hermes-web-ui 0.1.2 → 0.1.3
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/README.md +117 -408
- package/bin/hermes-web-ui.mjs +111 -97
- package/dist/assets/{ChatView-WnNeYrS7.js → ChatView-BBqtEbUW.js} +20 -20
- package/dist/assets/ChatView-DC6_7Uwg.css +1 -0
- package/dist/assets/JobsView-sQ8sqrxF.js +356 -0
- package/dist/assets/LogsView-BN_TkDPi.css +1 -0
- package/dist/assets/LogsView-DukKyFJt.js +1 -0
- package/dist/assets/Modal-oIDM0xXN.js +232 -0
- package/dist/assets/Spin-zWt--szS.js +476 -0
- package/dist/assets/Tooltip-BGvPCNBt.js +1 -0
- package/dist/assets/Warning-B9_T2nKK.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-V8xgnEJh.js +231 -0
- package/dist/assets/chat-CGF6ipPC.js +5 -0
- package/dist/assets/fade-in-scale-up.cssr-DQYNrBys.js +45 -0
- package/dist/assets/index-BsLYVWlc.js +307 -0
- package/dist/assets/index-DDAe8BhJ.css +1 -0
- package/dist/assets/{jobs-Cuol6Mqb.js → jobs-QHXENDTQ.js} +1 -1
- package/dist/assets/use-message-42wmA96q.js +117 -0
- package/dist/index.html +8 -6
- package/dist/server/config.d.ts +7 -0
- package/dist/server/config.js +12 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +154 -0
- package/dist/server/routes/logs.d.ts +2 -0
- package/dist/server/routes/logs.js +87 -0
- package/dist/server/routes/proxy-handler.d.ts +2 -0
- package/dist/server/routes/proxy-handler.js +82 -0
- package/dist/server/routes/proxy.d.ts +2 -0
- package/dist/server/routes/proxy.js +12 -0
- package/dist/server/routes/sessions.d.ts +2 -0
- package/dist/server/routes/sessions.js +69 -0
- package/dist/server/routes/upload.d.ts +2 -0
- package/dist/server/routes/upload.js +50 -0
- package/dist/server/routes/webhook.d.ts +2 -0
- package/dist/server/routes/webhook.js +33 -0
- package/dist/server/services/hermes-cli.d.ts +50 -0
- package/dist/server/services/hermes-cli.js +185 -0
- package/dist/server/services/hermes.d.ts +40 -0
- package/dist/server/services/hermes.js +118 -0
- package/package.json +19 -4
- package/dist/assets/ChatView-DrzZz5ex.css +0 -1
- package/dist/assets/JobsView-BF9wWdwU.js +0 -831
- package/dist/assets/Modal-CQVLL_Oc.js +0 -276
- package/dist/assets/_plugin-vue_export-helper-D5N3Hfca.js +0 -231
- package/dist/assets/chat-640V6r6N.js +0 -1
- package/dist/assets/index-4iFlrAYJ.js +0 -307
- package/dist/assets/index-CMJKLUKk.css +0 -1
- package/dist/assets/use-message-B8ClBznx.js +0 -117
- /package/dist/assets/{client-BxIiwrqC.js → client-ZYGCrm9m.js} +0 -0
|
@@ -1,831 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jobs-Cuol6Mqb.js","assets/ChatView-WnNeYrS7.js","assets/_plugin-vue_export-helper-D5N3Hfca.js","assets/chat-640V6r6N.js","assets/client-BxIiwrqC.js","assets/use-message-B8ClBznx.js","assets/ChatView-DrzZz5ex.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$n as e,$t as t,An as n,Bn as r,Bt as i,C as a,Cn as o,Ct as s,Dn as c,En as l,Fn as u,Ft as d,Gn as f,Gt as p,Ht as m,In as h,Jt as g,Kn as _,Kt as v,Mn as y,On as b,Pn as x,Pt as S,Rn as C,Rt as w,S as T,Sn as E,T as D,Tn as O,Tt as k,Un as A,Vn as j,Vt as ee,Wn as M,Wt as N,Xn as P,Xt as F,Zt as I,_t as L,a as te,at as ne,b as R,bn as z,bt as re,c as ie,cn as ae,ct as B,d as V,dt as H,en as U,er as W,et as G,f as oe,fn as se,g as ce,ht as K,i as le,jn as ue,kn as de,ln as fe,lt as pe,m as me,mn as he,nn as q,nr as ge,nt as _e,o as ve,p as ye,qt as be,rt as xe,s as Se,t as Ce,tn as J,tr as we,tt as Te,u as Ee,ut as De,v as Oe,vn as Y,vt as ke,w as Ae,wn as X,x as je,xn as Me,xt as Ne,y as Pe,yn as Z,zn as Fe,zt as Ie}from"./_plugin-vue_export-helper-D5N3Hfca.js";import{_ as Le,c as Re,l as ze,m as Be,p as Ve,t as He}from"./Modal-CQVLL_Oc.js";import{_ as Ue,a as We,c as Ge,d as Ke,f as qe,g as Je,h as Ye,l as Xe,m as Ze,n as Qe,o as $e,p as et,r as tt,s as nt,t as rt,u as it,v as at,y as ot}from"./use-message-B8ClBznx.js";import{a as st,c as ct,i as lt,n as ut,o as dt,s as ft,t as pt}from"./jobs-Cuol6Mqb.js";function mt(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function ht(e,t,n){let r=de(e,null);if(r===null)return;let i=c()?.proxy;A(n,a),a(n.value),x(()=>{a(void 0,n.value)});function a(e,n){if(!r)return;let i=r[t];n!==void 0&&o(i,n),e!==void 0&&s(i,e)}function o(e,t){e[t]||(e[t]=[]),e[t].splice(e[t].findIndex(e=>e===i),1)}function s(e,t){e[t]||(e[t]=[]),~e[t].findIndex(e=>e===i)||e[t].push(i)}}function gt(e){return e&-e}var _t=class{constructor(e,t){this.l=e,this.min=t;let n=Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,t){if(t===0)return;let{l:n,ft:r}=this;for(e+=1;e<=n;)r[e]+=t,e+=gt(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;let{ft:t,min:n,l:r}=this;if(e>r)throw Error("[FinweckTree.sum]: `i` is larger than length.");let i=e*n;for(;e>0;)i+=t[e],e-=gt(e);return i}getBound(e){let t=0,n=this.l;for(;n>t;){let r=Math.floor((t+n)/2),i=this.sum(r);if(i>e){n=r;continue}else if(i<e){if(t===r)return this.sum(t+1)<=e?t+1:r;t=r}else return r}return t}},vt;function yt(){return typeof document>`u`?!1:(vt===void 0&&(vt=`matchMedia`in window?window.matchMedia(`(pointer:coarse)`).matches:!1),vt)}var bt;function xt(){return typeof document>`u`?1:(bt===void 0&&(bt=`chrome`in window?window.devicePixelRatio:1),bt)}var St=`VVirtualListXScroll`;function Ct({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){let r=P(0),i=P(0),a=Y(()=>{let t=e.value;if(t.length===0)return null;let n=new _t(t.length,0);return t.forEach((e,t)=>{n.add(t,e.width)}),n});return Fe(St,{startIndexRef:w(()=>{let e=a.value;return e===null?0:Math.max(e.getBound(i.value)-1,0)}),endIndexRef:w(()=>{let t=a.value;return t===null?0:Math.min(t.getBound(i.value+r.value)+1,e.value.length-1)}),columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:e=>{let t=a.value;return t===null?0:t.sum(e)}}),{listWidthRef:r,scrollLeftRef:i}}var wt=l({name:`VirtualListRow`,props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){let{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:i,renderItemWithColsRef:a}=de(St);return{startIndex:e,endIndex:t,columns:n,renderCol:i,renderItemWithCols:a,getLeft:r}},render(){let{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:i,getLeft:a,item:o}=this;if(i!=null)return i({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:o,getLeft:a});if(r!=null){let i=[];for(let s=e;s<=t;++s){let e=n[s];i.push(r({column:e,left:a(s),item:o}))}return i}return null}}),Tt=it(`.v-vl`,{maxHeight:`inherit`,height:`100%`,overflow:`auto`,minWidth:`1px`},[it(`&:not(.v-vl--show-scrollbar)`,{scrollbarWidth:`none`},[it(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,{width:0,height:0,display:`none`})])]),Et=l({name:`VirtualList`,inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:`div`},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:`key`},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){let n=s();Tt.mount({id:`vueuc/virtual-list`,head:!0,anchorMetaName:Ke,ssr:n}),h(()=>{let{defaultScrollIndex:e,defaultScrollKey:n}=t;e==null?n!=null&&S({key:n}):S({index:e})});let r=!1,i=!1;y(()=>{if(r=!1,!i){i=!0;return}S({top:v.value,left:c.value})}),u(()=>{r=!0,i||=!0});let a=w(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let e=0;return t.columns.forEach(t=>{e+=t.width}),e}),o=Y(()=>{let e=new Map,{keyField:n}=t;return t.items.forEach((t,r)=>{e.set(t[n],r)}),e}),{scrollLeftRef:c,listWidthRef:l}=Ct({columnsRef:e(t,`columns`),renderColRef:e(t,`renderCol`),renderItemWithColsRef:e(t,`renderItemWithCols`)}),d=P(null),f=P(void 0),m=new Map,g=Y(()=>{let{items:e,itemSize:n,keyField:r}=t,i=new _t(e.length,n);return e.forEach((e,t)=>{let n=e[r],a=m.get(n);a!==void 0&&i.add(t,a)}),i}),_=P(0),v=P(0),b=w(()=>Math.max(g.value.getBound(v.value-p(t.paddingTop))-1,0)),x=Y(()=>{let{value:e}=f;if(e===void 0)return[];let{items:n,itemSize:r}=t,i=b.value,a=Math.min(i+Math.ceil(e/r+1),n.length-1),o=[];for(let e=i;e<=a;++e)o.push(n[e]);return o}),S=(e,t)=>{if(typeof e==`number`){D(e,t,`auto`);return}let{left:n,top:r,index:i,key:a,position:s,behavior:c,debounce:l=!0}=e;if(n!==void 0||r!==void 0)D(n,r,c);else if(i!==void 0)E(i,c,l);else if(a!==void 0){let e=o.value.get(a);e!==void 0&&E(e,c,l)}else s===`bottom`?D(0,2**53-1,c):s===`top`&&D(0,0,c)},C,T=null;function E(e,n,r){let{value:i}=g,a=i.sum(e)+p(t.paddingTop);if(!r)d.value.scrollTo({left:0,top:a,behavior:n});else{C=e,T!==null&&window.clearTimeout(T),T=window.setTimeout(()=>{C=void 0,T=null},16);let{scrollTop:t,offsetHeight:r}=d.value;if(a>t){let o=i.get(e);a+o<=t+r||d.value.scrollTo({left:0,top:a+o-r,behavior:n})}else d.value.scrollTo({left:0,top:a,behavior:n})}}function D(e,t,n){d.value.scrollTo({left:e,top:t,behavior:n})}function O(e,n){if(r||t.ignoreItemResize||F(n.target))return;let{value:i}=g,a=o.value.get(e),s=i.get(a),c=n.borderBoxSize?.[0]?.blockSize??n.contentRect.height;if(c===s)return;c-t.itemSize===0?m.delete(e):m.set(e,c-t.itemSize);let l=c-s;if(l===0)return;i.add(a,l);let u=d.value;if(u!=null){if(C===void 0){let e=i.sum(a);u.scrollTop>e&&u.scrollBy(0,l)}else (a<C||a===C&&c+i.sum(a)>u.scrollTop+u.offsetHeight)&&u.scrollBy(0,l);N()}_.value++}let k=!yt(),A=!1;function j(e){var n;(n=t.onScroll)==null||n.call(t,e),(!k||!A)&&N()}function ee(e){var n;if((n=t.onWheel)==null||n.call(t,e),k){let t=d.value;if(t!=null){if(e.deltaX===0&&(t.scrollTop===0&&e.deltaY<=0||t.scrollTop+t.offsetHeight>=t.scrollHeight&&e.deltaY>=0))return;e.preventDefault(),t.scrollTop+=e.deltaY/xt(),t.scrollLeft+=e.deltaX/xt(),N(),A=!0,ot(()=>{A=!1})}}}function M(e){if(r||F(e.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(e.contentRect.height===f.value)return}else if(e.contentRect.height===f.value&&e.contentRect.width===l.value)return;f.value=e.contentRect.height,l.value=e.contentRect.width;let{onResize:n}=t;n!==void 0&&n(e)}function N(){let{value:e}=d;e!=null&&(v.value=e.scrollTop,c.value=e.scrollLeft)}function F(e){let t=e;for(;t!==null;){if(t.style.display===`none`)return!0;t=t.parentElement}return!1}return{listHeight:f,listStyle:{overflow:`auto`},keyToIndex:o,itemsStyle:Y(()=>{let{itemResizable:e}=t,n=be(g.value.sum());return _.value,[t.itemsStyle,{boxSizing:`content-box`,width:be(a.value),height:e?``:n,minHeight:e?n:``,paddingTop:be(t.paddingTop),paddingBottom:be(t.paddingBottom)}]}),visibleItemsStyle:Y(()=>(_.value,{transform:`translateY(${be(g.value.sum(b.value))})`})),viewportItems:x,listElRef:d,itemsElRef:P(null),scrollTo:S,handleListResize:M,handleListScroll:j,handleListWheel:ee,handleItemResize:O}},render(){let{itemResizable:e,keyField:t,keyToIndex:r,visibleItemsTag:i}=this;return b(re,{onResize:this.handleListResize},{default:()=>{var a;return b(`div`,n(this.$attrs,{class:[`v-vl`,this.showScrollbar&&`v-vl--show-scrollbar`],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:`listElRef`}),[this.items.length===0?(a=this.$slots).empty?.call(a):b(`div`,{ref:`itemsElRef`,class:`v-vl-items`,style:this.itemsStyle},[b(i,Object.assign({class:`v-vl-visible-items`,style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{let{renderCol:n,renderItemWithCols:i}=this;return this.viewportItems.map(a=>{let o=a[t],s=r.get(o),c=n==null?void 0:b(wt,{index:s,item:a}),l=i==null?void 0:b(wt,{index:s,item:a}),u=this.$slots.default({item:a,renderedCols:c,renderedItemWithCols:l,index:s})[0];return e?b(re,{key:o,onResize:e=>this.handleItemResize(o,e)},{default:()=>u}):(u.key=o,u)})}})])])}})}}),Dt=`v-hidden`,Ot=it(`[v-hidden]`,{display:`none!important`}),kt=l({name:`Overflow`,props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){let n=P(null),r=P(null);function i(i){let{value:a}=n,{getCounter:o,getTail:s}=e,c;if(c=o===void 0?r.value:o(),!a||!c)return;c.hasAttribute(Dt)&&c.removeAttribute(Dt);let{children:l}=a;if(i.showAllItemsBeforeCalculate)for(let e of l)e.hasAttribute(Dt)&&e.removeAttribute(Dt);let u=a.offsetWidth,d=[],f=t.tail?s?.():null,p=f?f.offsetWidth:0,m=!1,h=a.children.length-+!!t.tail;for(let t=0;t<h-1;++t){if(t<0)continue;let n=l[t];if(m){n.hasAttribute(Dt)||n.setAttribute(Dt,``);continue}else n.hasAttribute(Dt)&&n.removeAttribute(Dt);let r=n.offsetWidth;if(p+=r,d[t]=r,p>u){let{updateCounter:n}=e;for(let r=t;r>=0;--r){let i=h-1-r;n===void 0?c.textContent=`${i}`:n(i);let a=c.offsetWidth;if(p-=d[r],p+a<=u||r===0){m=!0,t=r-1,f&&(t===-1?(f.style.maxWidth=`${u-a}px`,f.style.boxSizing=`border-box`):f.style.maxWidth=``);let{onUpdateCount:n}=e;n&&n(i);break}}}}let{onUpdateOverflow:g}=e;m?g!==void 0&&g(!0):(g!==void 0&&g(!1),c.setAttribute(Dt,``))}let a=s();return Ot.mount({id:`vueuc/overflow`,head:!0,anchorMetaName:Ke,ssr:a}),h(()=>i({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:i}},render(){let{$slots:e}=this;return ue(()=>this.sync({showAllItemsBeforeCalculate:!1})),b(`div`,{class:`v-overflow`,ref:`selfRef`},[j(e,`default`),e.counter?e.counter():b(`span`,{style:{display:`inline-block`},ref:`counterRef`}),e.tail?e.tail():null])}});function At(e,t){t&&(h(()=>{let{value:n}=e;n&&Ne.registerHandler(n,t)}),A(e,(e,t)=>{t&&Ne.unregisterHandler(t)},{deep:!1}),x(()=>{let{value:t}=e;t&&Ne.unregisterHandler(t)}))}function jt(e){switch(typeof e){case`string`:return e||void 0;case`number`:return String(e);default:return}}function Mt(e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?t[0]:t=>{e.forEach(e=>{e&&e(t)})}}var Nt=l({name:`Add`,render(){return b(`svg`,{width:`512`,height:`512`,viewBox:`0 0 512 512`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},b(`path`,{d:`M256 112V400M400 256H112`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linecap":`round`,"stroke-linejoin":`round`}))}}),Pt=l({name:`Checkmark`,render(){return b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`},b(`g`,{fill:`none`},b(`path`,{d:`M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z`,fill:`currentColor`})))}}),Ft=l({name:`ChevronDown`,render(){return b(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},b(`path`,{d:`M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z`,fill:`currentColor`}))}}),It=Oe(`clear`,()=>b(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},b(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},b(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},b(`path`,{d:`M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z`}))))),Lt=l({name:`Empty`,render(){return b(`svg`,{viewBox:`0 0 28 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},b(`path`,{d:`M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z`,fill:`currentColor`}),b(`path`,{d:`M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z`,fill:`currentColor`}))}}),Rt=l({name:`Eye`,render(){return b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},b(`path`,{d:`M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`}),b(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),zt=l({name:`EyeOff`,render(){return b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},b(`path`,{d:`M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z`,fill:`currentColor`}),b(`path`,{d:`M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z`,fill:`currentColor`}),b(`path`,{d:`M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z`,fill:`currentColor`}),b(`path`,{d:`M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z`,fill:`currentColor`}),b(`path`,{d:`M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z`,fill:`currentColor`}))}}),Bt=l({name:`Remove`,render(){return b(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},b(`line`,{x1:`400`,y1:`256`,x2:`112`,y2:`256`,style:`
|
|
3
|
-
fill: none;
|
|
4
|
-
stroke: currentColor;
|
|
5
|
-
stroke-linecap: round;
|
|
6
|
-
stroke-linejoin: round;
|
|
7
|
-
stroke-width: 32px;
|
|
8
|
-
`}))}}),Vt=I(`base-clear`,`
|
|
9
|
-
flex-shrink: 0;
|
|
10
|
-
height: 1em;
|
|
11
|
-
width: 1em;
|
|
12
|
-
position: relative;
|
|
13
|
-
`,[F(`>`,[t(`clear`,`
|
|
14
|
-
font-size: var(--n-clear-size);
|
|
15
|
-
height: 1em;
|
|
16
|
-
width: 1em;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
color: var(--n-clear-color);
|
|
19
|
-
transition: color .3s var(--n-bezier);
|
|
20
|
-
display: flex;
|
|
21
|
-
`,[F(`&:hover`,`
|
|
22
|
-
color: var(--n-clear-color-hover)!important;
|
|
23
|
-
`),F(`&:active`,`
|
|
24
|
-
color: var(--n-clear-color-pressed)!important;
|
|
25
|
-
`)]),t(`placeholder`,`
|
|
26
|
-
display: flex;
|
|
27
|
-
`),t(`clear, placeholder`,`
|
|
28
|
-
position: absolute;
|
|
29
|
-
left: 50%;
|
|
30
|
-
top: 50%;
|
|
31
|
-
transform: translateX(-50%) translateY(-50%);
|
|
32
|
-
`,[ce({originalTransform:`translateX(-50%) translateY(-50%)`,left:`50%`,top:`50%`})])])]),Ht=l({name:`BaseClear`,props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return a(`-base-clear`,Vt,e(t,`clsPrefix`)),{handleMouseDown(e){e.preventDefault()}}},render(){let{clsPrefix:e}=this;return b(`div`,{class:`${e}-base-clear`},b(Pe,null,{default:()=>{var t;return this.show?b(`div`,{key:`dismiss`,class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},B(this.$slots.icon,()=>[b(R,{clsPrefix:e},{default:()=>b(It,null)})])):b(`div`,{key:`icon`,class:`${e}-base-clear__placeholder`},(t=this.$slots).placeholder?.call(t))}}))}}),Ut=l({props:{onFocus:Function,onBlur:Function},setup(e){return()=>b(`div`,{style:`width: 0; height: 0`,tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}});function Wt(e){return Array.isArray(e)?e:[e]}var Gt={STOP:`STOP`};function Kt(e,t){let n=t(e);e.children!==void 0&&n!==Gt.STOP&&e.children.forEach(e=>Kt(e,t))}function qt(e,t={}){let{preserveGroup:n=!1}=t,r=[],i=n?e=>{e.isLeaf||(r.push(e.key),a(e.children))}:e=>{e.isLeaf||(e.isGroup||r.push(e.key),a(e.children))};function a(e){e.forEach(i)}return a(e),r}function Jt(e,t){let{isLeaf:n}=e;return n===void 0?!t(e):n}function Yt(e){return e.children}function Xt(e){return e.key}function Zt(){return!1}function Qt(e,t){let{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function $t(e){return e.disabled===!0}function en(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function tn(e){return e==null?[]:Array.isArray(e)?e:e.checkedKeys??[]}function nn(e){return e==null||Array.isArray(e)?[]:e.indeterminateKeys??[]}function rn(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function an(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function on(e){return e?.type===`group`}function sn(e){let t=new Map;return e.forEach((e,n)=>{t.set(e.key,n)}),e=>t.get(e)??null}var cn=class extends Error{constructor(){super(),this.message=`SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded.`}};function ln(e,t,n,r){return pn(t.concat(e),n,r,!1)}function un(e,t){let n=new Set;return e.forEach(e=>{let r=t.treeNodeMap.get(e);if(r!==void 0){let e=r.parent;for(;e!==null&&!(e.disabled||n.has(e.key));)n.add(e.key),e=e.parent}}),n}function dn(e,t,n,r){let i=pn(t,n,r,!1),a=pn(e,n,r,!0),o=un(e,n),s=[];return i.forEach(e=>{(a.has(e)||o.has(e))&&s.push(e)}),s.forEach(e=>i.delete(e)),i}function fn(e,t){let{checkedKeys:n,keysToCheck:r,keysToUncheck:i,indeterminateKeys:a,cascade:o,leafOnly:s,checkStrategy:c,allowNotLoaded:l}=e;if(!o)return r===void 0?i===void 0?{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)}:{checkedKeys:an(n,i),indeterminateKeys:Array.from(a)}:{checkedKeys:rn(n,r),indeterminateKeys:Array.from(a)};let{levelTreeNodeMap:u}=t,d;d=i===void 0?r===void 0?pn(n,t,l,!1):ln(r,n,t,l):dn(i,n,t,l);let f=c===`parent`,p=c===`child`||s,m=d,h=new Set,g=Math.max.apply(null,Array.from(u.keys()));for(let e=g;e>=0;--e){let t=e===0,n=u.get(e);for(let e of n){if(e.isLeaf)continue;let{key:n,shallowLoaded:r}=e;if(p&&r&&e.children.forEach(e=>{!e.disabled&&!e.isLeaf&&e.shallowLoaded&&m.has(e.key)&&m.delete(e.key)}),e.disabled||!r)continue;let i=!0,a=!1,o=!0;for(let t of e.children){let e=t.key;if(!t.disabled){if(o&&=!1,m.has(e))a=!0;else if(h.has(e)){a=!0,i=!1;break}else if(i=!1,a)break}}i&&!o?(f&&e.children.forEach(e=>{!e.disabled&&m.has(e.key)&&m.delete(e.key)}),m.add(n)):a&&h.add(n),t&&p&&m.has(n)&&m.delete(n)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(h)}}function pn(e,t,n,r){let{treeNodeMap:i,getChildren:a}=t,o=new Set,s=new Set(e);return e.forEach(e=>{let t=i.get(e);t!==void 0&&Kt(t,e=>{if(e.disabled)return Gt.STOP;let{key:t}=e;if(!o.has(t)&&(o.add(t),s.add(t),en(e.rawNode,a))){if(r)return Gt.STOP;if(!n)throw new cn}})}),s}function mn(e,{includeGroup:t=!1,includeSelf:n=!0},r){let i=r.treeNodeMap,a=e==null?null:i.get(e)??null,o={keyPath:[],treeNodePath:[],treeNode:a};if(a?.ignored)return o.treeNode=null,o;for(;a;)!a.ignored&&(t||!a.isGroup)&&o.treeNodePath.push(a),a=a.parent;return o.treeNodePath.reverse(),n||o.treeNodePath.pop(),o.keyPath=o.treeNodePath.map(e=>e.key),o}function hn(e){if(e.length===0)return null;let t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function gn(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i+1)%r]:i===n.length-1?null:n[i+1]}function _n(e,t,{loop:n=!1,includeDisabled:r=!1}={}){let i=t===`prev`?vn:gn,a={reverse:t===`prev`},o=!1,s=null;function c(t){if(t!==null){if(t===e){if(!o)o=!0;else if(!e.disabled&&!e.isGroup){s=e;return}}else if((!t.disabled||r)&&!t.ignored&&!t.isGroup){s=t;return}if(t.isGroup){let e=bn(t,a);e===null?c(i(t,n)):s=e}else{let e=i(t,!1);if(e!==null)c(e);else{let e=yn(t);e?.isGroup?c(i(e,n)):n&&c(i(t,!0))}}}}return c(e),s}function vn(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i-1+r)%r]:i===0?null:n[i-1]}function yn(e){return e.parent}function bn(e,t={}){let{reverse:n=!1}=t,{children:r}=e;if(r){let{length:e}=r,i=n?e-1:0,a=n?-1:e,o=n?-1:1;for(let e=i;e!==a;e+=o){let n=r[e];if(!n.disabled&&!n.ignored)if(n.isGroup){let e=bn(n,t);if(e!==null)return e}else return n}}return null}var xn={getChild(){return this.ignored?null:bn(this)},getParent(){let{parent:e}=this;return e?.isGroup?e.getParent():e},getNext(e={}){return _n(this,`next`,e)},getPrev(e={}){return _n(this,`prev`,e)}};function Sn(e,t){let n=t?new Set(t):void 0,r=[];function i(e){e.forEach(e=>{r.push(e),!(e.isLeaf||!e.children||e.ignored)&&(e.isGroup||n===void 0||n.has(e.key))&&i(e.children)})}return i(e),r}function Cn(e,t){let n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function wn(e,t,n,r,i,a=null,o=0){let s=[];return e.forEach((c,l)=>{var u;let d=Object.create(r);if(d.rawNode=c,d.siblings=s,d.level=o,d.index=l,d.isFirstChild=l===0,d.isLastChild=l+1===e.length,d.parent=a,!d.ignored){let e=i(c);Array.isArray(e)&&(d.children=wn(e,t,n,r,i,d,o+1))}s.push(d),t.set(d.key,d),n.has(o)||n.set(o,[]),(u=n.get(o))==null||u.push(d)}),s}function Tn(e,t={}){let n=new Map,r=new Map,{getDisabled:i=$t,getIgnored:a=Zt,getIsGroup:o=on,getKey:s=Xt}=t,c=t.getChildren??Yt,l=t.ignoreEmptyChildren?e=>{let t=c(e);return Array.isArray(t)?t.length?t:null:t}:c,u=wn(e,n,r,Object.assign({get key(){return s(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return o(this.rawNode)},get isLeaf(){return Jt(this.rawNode,l)},get shallowLoaded(){return Qt(this.rawNode,l)},get ignored(){return a(this.rawNode)},contains(e){return Cn(this,e)}},xn),l);function d(e){if(e==null)return null;let t=n.get(e);return t&&!t.isGroup&&!t.ignored?t:null}function f(e){if(e==null)return null;let t=n.get(e);return t&&!t.ignored?t:null}function p(e,t){let n=f(e);return n?n.getPrev(t):null}function m(e,t){let n=f(e);return n?n.getNext(t):null}function h(e){let t=f(e);return t?t.getParent():null}function g(e){let t=f(e);return t?t.getChild():null}let _={treeNodes:u,treeNodeMap:n,levelTreeNodeMap:r,maxLevel:Math.max(...r.keys()),getChildren:l,getFlattenedNodes(e){return Sn(u,e)},getNode:d,getPrev:p,getNext:m,getParent:h,getChild:g,getFirstAvailableNode(){return hn(u)},getPath(e,t={}){return mn(e,t,_)},getCheckedKeys(e,t={}){let{cascade:n=!0,leafOnly:r=!1,checkStrategy:i=`all`,allowNotLoaded:a=!1}=t;return fn({checkedKeys:tn(e),indeterminateKeys:nn(e),cascade:n,leafOnly:r,checkStrategy:i,allowNotLoaded:a},_)},check(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return fn({checkedKeys:tn(t),indeterminateKeys:nn(t),keysToCheck:e==null?[]:Wt(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},uncheck(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return fn({checkedKeys:tn(t),indeterminateKeys:nn(t),keysToUncheck:e==null?[]:Wt(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},getNonLeafKeys(e={}){return qt(u,e)}};return _}var En={iconSizeTiny:`28px`,iconSizeSmall:`34px`,iconSizeMedium:`40px`,iconSizeLarge:`46px`,iconSizeHuge:`52px`};function Dn(e){let{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c}=e;return Object.assign(Object.assign({},En),{fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}var On={name:`Empty`,common:V,self:Dn},kn=I(`empty`,`
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
align-items: center;
|
|
36
|
-
font-size: var(--n-font-size);
|
|
37
|
-
`,[t(`icon`,`
|
|
38
|
-
width: var(--n-icon-size);
|
|
39
|
-
height: var(--n-icon-size);
|
|
40
|
-
font-size: var(--n-icon-size);
|
|
41
|
-
line-height: var(--n-icon-size);
|
|
42
|
-
color: var(--n-icon-color);
|
|
43
|
-
transition:
|
|
44
|
-
color .3s var(--n-bezier);
|
|
45
|
-
`,[F(`+`,[t(`description`,`
|
|
46
|
-
margin-top: 8px;
|
|
47
|
-
`)])]),t(`description`,`
|
|
48
|
-
transition: color .3s var(--n-bezier);
|
|
49
|
-
color: var(--n-text-color);
|
|
50
|
-
`),t(`extra`,`
|
|
51
|
-
text-align: center;
|
|
52
|
-
transition: color .3s var(--n-bezier);
|
|
53
|
-
margin-top: 12px;
|
|
54
|
-
color: var(--n-extra-text-color);
|
|
55
|
-
`)]),An=l({name:`Empty`,props:Object.assign(Object.assign({},T.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:`medium`},renderIcon:Function}),slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=xe(e),i=T(`Empty`,`-empty`,kn,On,e,t),{localeRef:a}=$e(`Empty`),o=Y(()=>e.description??r?.value?.Empty?.description),s=Y(()=>r?.value?.Empty?.renderIcon||(()=>b(Lt,null))),c=Y(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{[q(`iconSize`,t)]:r,[q(`fontSize`,t)]:a,textColor:o,iconColor:s,extraTextColor:c}}=i.value;return{"--n-icon-size":r,"--n-font-size":a,"--n-bezier":n,"--n-text-color":o,"--n-icon-color":s,"--n-extra-text-color":c}}),l=n?_e(`empty`,Y(()=>{let t=``,{size:n}=e;return t+=n[0],t}),c,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:s,localizedDescription:Y(()=>o.value||a.value.description),cssVars:n?void 0:c,themeClass:l?.themeClass,onRender:l?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n?.(),b(`div`,{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?b(`div`,{class:`${t}-empty__icon`},e.icon?e.icon():b(R,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?b(`div`,{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?b(`div`,{class:`${t}-empty__extra`},e.extra()):null)}}),jn={height:`calc(var(--n-option-height) * 7.6)`,paddingTiny:`4px 0`,paddingSmall:`4px 0`,paddingMedium:`4px 0`,paddingLarge:`4px 0`,paddingHuge:`4px 0`,optionPaddingTiny:`0 12px`,optionPaddingSmall:`0 12px`,optionPaddingMedium:`0 12px`,optionPaddingLarge:`0 12px`,optionPaddingHuge:`0 12px`,loadingSize:`18px`};function Mn(e){let{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:i,textColor2:a,primaryColorPressed:o,textColorDisabled:s,primaryColor:c,opacityDisabled:l,hoverColor:u,fontSizeTiny:d,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:m,fontSizeHuge:h,heightTiny:g,heightSmall:_,heightMedium:v,heightLarge:y,heightHuge:b}=e;return Object.assign(Object.assign({},jn),{optionFontSizeTiny:d,optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:m,optionFontSizeHuge:h,optionHeightTiny:g,optionHeightSmall:_,optionHeightMedium:v,optionHeightLarge:y,optionHeightHuge:b,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:i,optionTextColor:a,optionTextColorPressed:o,optionTextColorDisabled:s,optionTextColorActive:c,optionOpacityDisabled:l,optionCheckColor:c,optionColorPending:u,optionColorActive:`rgba(0, 0, 0, 0)`,optionColorActivePending:u,actionTextColor:a,loadingColor:c})}var Nn=je({name:`InternalSelectMenu`,common:V,peers:{Scrollbar:Ee,Empty:On},self:Mn}),Pn=l({name:`NBaseSelectGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=de(Je);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){let{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:i}}=this,a=r?.(i),o=t?t(i,!1):Ve(i[this.labelField],i,!1),s=b(`div`,Object.assign({},a,{class:[`${e}-base-select-group-header`,a?.class]}),o);return i.render?i.render({node:s,option:i}):n?n({node:s,option:i,selected:!1}):s}});function Fn(e,t){return b(fe,{name:`fade-in-scale-up-transition`},{default:()=>e?b(R,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>b(Pt)}):null})}var In=l({name:`NBaseSelectOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){let{valueRef:t,pendingTmNodeRef:n,multipleRef:r,valueSetRef:i,renderLabelRef:a,renderOptionRef:o,labelFieldRef:s,valueFieldRef:c,showCheckmarkRef:l,nodePropsRef:u,handleOptionClick:d,handleOptionMouseEnter:f}=de(Je),p=w(()=>{let{value:t}=n;return t?e.tmNode.key===t.key:!1});function m(t){let{tmNode:n}=e;n.disabled||d(t,n)}function h(t){let{tmNode:n}=e;n.disabled||f(t,n)}function g(t){let{tmNode:n}=e,{value:r}=p;n.disabled||r||f(t,n)}return{multiple:r,isGrouped:w(()=>{let{tmNode:t}=e,{parent:n}=t;return n&&n.rawNode.type===`group`}),showCheckmark:l,nodeProps:u,isPending:p,isSelected:w(()=>{let{value:n}=t,{value:a}=r;if(n===null)return!1;let o=e.tmNode.rawNode[c.value];if(a){let{value:e}=i;return e.has(o)}else return n===o}),labelField:s,renderLabel:a,renderOption:o,handleMouseMove:g,handleMouseEnter:h,handleClick:m}},render(){let{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:i,showCheckmark:a,nodeProps:o,renderOption:s,renderLabel:c,handleClick:l,handleMouseEnter:u,handleMouseMove:d}=this,f=Fn(n,e),p=c?[c(t,n),a&&f]:[Ve(t[this.labelField],t,n),a&&f],m=o?.(t),h=b(`div`,Object.assign({},m,{class:[`${e}-base-select-option`,t.class,m?.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:i,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:a}],style:[m?.style||``,t.style||``],onClick:Mt([l,m?.onClick]),onMouseenter:Mt([u,m?.onMouseenter]),onMousemove:Mt([d,m?.onMousemove])}),b(`div`,{class:`${e}-base-select-option__content`},p));return t.render?t.render({node:h,option:t,selected:n}):s?s({node:h,option:t,selected:n}):h}}),Ln=I(`base-select-menu`,`
|
|
56
|
-
line-height: 1.5;
|
|
57
|
-
outline: none;
|
|
58
|
-
z-index: 0;
|
|
59
|
-
position: relative;
|
|
60
|
-
border-radius: var(--n-border-radius);
|
|
61
|
-
transition:
|
|
62
|
-
background-color .3s var(--n-bezier),
|
|
63
|
-
box-shadow .3s var(--n-bezier);
|
|
64
|
-
background-color: var(--n-color);
|
|
65
|
-
`,[I(`scrollbar`,`
|
|
66
|
-
max-height: var(--n-height);
|
|
67
|
-
`),I(`virtual-list`,`
|
|
68
|
-
max-height: var(--n-height);
|
|
69
|
-
`),I(`base-select-option`,`
|
|
70
|
-
min-height: var(--n-option-height);
|
|
71
|
-
font-size: var(--n-option-font-size);
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
`,[t(`content`,`
|
|
75
|
-
z-index: 1;
|
|
76
|
-
white-space: nowrap;
|
|
77
|
-
text-overflow: ellipsis;
|
|
78
|
-
overflow: hidden;
|
|
79
|
-
`)]),I(`base-select-group-header`,`
|
|
80
|
-
min-height: var(--n-option-height);
|
|
81
|
-
font-size: .93em;
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
`),I(`base-select-menu-option-wrapper`,`
|
|
85
|
-
position: relative;
|
|
86
|
-
width: 100%;
|
|
87
|
-
`),t(`loading, empty`,`
|
|
88
|
-
display: flex;
|
|
89
|
-
padding: 12px 32px;
|
|
90
|
-
flex: 1;
|
|
91
|
-
justify-content: center;
|
|
92
|
-
`),t(`loading`,`
|
|
93
|
-
color: var(--n-loading-color);
|
|
94
|
-
font-size: var(--n-loading-size);
|
|
95
|
-
`),t(`header`,`
|
|
96
|
-
padding: 8px var(--n-option-padding-left);
|
|
97
|
-
font-size: var(--n-option-font-size);
|
|
98
|
-
transition:
|
|
99
|
-
color .3s var(--n-bezier),
|
|
100
|
-
border-color .3s var(--n-bezier);
|
|
101
|
-
border-bottom: 1px solid var(--n-action-divider-color);
|
|
102
|
-
color: var(--n-action-text-color);
|
|
103
|
-
`),t(`action`,`
|
|
104
|
-
padding: 8px var(--n-option-padding-left);
|
|
105
|
-
font-size: var(--n-option-font-size);
|
|
106
|
-
transition:
|
|
107
|
-
color .3s var(--n-bezier),
|
|
108
|
-
border-color .3s var(--n-bezier);
|
|
109
|
-
border-top: 1px solid var(--n-action-divider-color);
|
|
110
|
-
color: var(--n-action-text-color);
|
|
111
|
-
`),I(`base-select-group-header`,`
|
|
112
|
-
position: relative;
|
|
113
|
-
cursor: default;
|
|
114
|
-
padding: var(--n-option-padding);
|
|
115
|
-
color: var(--n-group-header-text-color);
|
|
116
|
-
`),I(`base-select-option`,`
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
position: relative;
|
|
119
|
-
padding: var(--n-option-padding);
|
|
120
|
-
transition:
|
|
121
|
-
color .3s var(--n-bezier),
|
|
122
|
-
opacity .3s var(--n-bezier);
|
|
123
|
-
box-sizing: border-box;
|
|
124
|
-
color: var(--n-option-text-color);
|
|
125
|
-
opacity: 1;
|
|
126
|
-
`,[U(`show-checkmark`,`
|
|
127
|
-
padding-right: calc(var(--n-option-padding-right) + 20px);
|
|
128
|
-
`),F(`&::before`,`
|
|
129
|
-
content: "";
|
|
130
|
-
position: absolute;
|
|
131
|
-
left: 4px;
|
|
132
|
-
right: 4px;
|
|
133
|
-
top: 0;
|
|
134
|
-
bottom: 0;
|
|
135
|
-
border-radius: var(--n-border-radius);
|
|
136
|
-
transition: background-color .3s var(--n-bezier);
|
|
137
|
-
`),F(`&:active`,`
|
|
138
|
-
color: var(--n-option-text-color-pressed);
|
|
139
|
-
`),U(`grouped`,`
|
|
140
|
-
padding-left: calc(var(--n-option-padding-left) * 1.5);
|
|
141
|
-
`),U(`pending`,[F(`&::before`,`
|
|
142
|
-
background-color: var(--n-option-color-pending);
|
|
143
|
-
`)]),U(`selected`,`
|
|
144
|
-
color: var(--n-option-text-color-active);
|
|
145
|
-
`,[F(`&::before`,`
|
|
146
|
-
background-color: var(--n-option-color-active);
|
|
147
|
-
`),U(`pending`,[F(`&::before`,`
|
|
148
|
-
background-color: var(--n-option-color-active-pending);
|
|
149
|
-
`)])]),U(`disabled`,`
|
|
150
|
-
cursor: not-allowed;
|
|
151
|
-
`,[J(`selected`,`
|
|
152
|
-
color: var(--n-option-text-color-disabled);
|
|
153
|
-
`),U(`selected`,`
|
|
154
|
-
opacity: var(--n-option-opacity-disabled);
|
|
155
|
-
`)]),t(`check`,`
|
|
156
|
-
font-size: 16px;
|
|
157
|
-
position: absolute;
|
|
158
|
-
right: calc(var(--n-option-padding-right) - 4px);
|
|
159
|
-
top: calc(50% - 7px);
|
|
160
|
-
color: var(--n-option-check-color);
|
|
161
|
-
transition: color .3s var(--n-bezier);
|
|
162
|
-
`,[Re({enterScale:`0.5`})])])]),Rn=l({name:`InternalSelectMenu`,props:Object.assign(Object.assign({},T.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:`medium`},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,scrollbarProps:Object,onToggle:Function}),setup(t){let{mergedClsPrefixRef:n,mergedRtlRef:r,mergedComponentPropsRef:i}=xe(t),a=D(`InternalSelectMenu`,r,n),o=T(`InternalSelectMenu`,`-internal-select-menu`,Ln,Nn,t,e(t,`clsPrefix`)),s=P(null),c=P(null),l=P(null),u=Y(()=>t.treeMate.getFlattenedNodes()),d=Y(()=>sn(u.value)),f=P(null);function m(){let{treeMate:e}=t,n=null,{value:r}=t;r===null?n=e.getFirstAvailableNode():(n=t.multiple?e.getNode((r||[])[(r||[]).length-1]):e.getNode(r),(!n||n.disabled)&&(n=e.getFirstAvailableNode())),R(n||null)}function g(){let{value:e}=f;e&&!t.treeMate.getNode(e.key)&&(f.value=null)}let _;A(()=>t.show,e=>{e?_=A(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?m():g(),ue(z)):g()},{immediate:!0}):_?.()},{immediate:!0}),x(()=>{_?.()});let y=Y(()=>p(o.value.self[q(`optionHeight`,t.size)])),b=Y(()=>v(o.value.self[q(`padding`,t.size)])),S=Y(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),C=Y(()=>{let e=u.value;return e&&e.length===0}),w=Y(()=>i?.value?.Select?.renderEmpty);function E(e){let{onToggle:n}=t;n&&n(e)}function O(e){let{onScroll:n}=t;n&&n(e)}function k(e){var t;(t=l.value)==null||t.sync(),O(e)}function j(){var e;(e=l.value)==null||e.sync()}function ee(){let{value:e}=f;return e||null}function M(e,t){t.disabled||R(t,!1)}function N(e,t){t.disabled||E(t)}function F(e){var n;mt(e,`action`)||(n=t.onKeyup)==null||n.call(t,e)}function I(e){var n;mt(e,`action`)||(n=t.onKeydown)==null||n.call(t,e)}function L(e){var n;(n=t.onMousedown)==null||n.call(t,e),!t.focusable&&e.preventDefault()}function te(){let{value:e}=f;e&&R(e.getNext({loop:!0}),!0)}function ne(){let{value:e}=f;e&&R(e.getPrev({loop:!0}),!0)}function R(e,t=!1){f.value=e,t&&z()}function z(){var e,n;let r=f.value;if(!r)return;let i=d.value(r.key);i!==null&&(t.virtualScroll?(e=c.value)==null||e.scrollTo({index:i}):(n=l.value)==null||n.scrollTo({index:i,elSize:y.value}))}function re(e){var n;s.value?.contains(e.target)&&((n=t.onFocus)==null||n.call(t,e))}function ie(e){var n;s.value?.contains(e.relatedTarget)||(n=t.onBlur)==null||n.call(t,e)}Fe(Je,{handleOptionMouseEnter:M,handleOptionClick:N,valueSetRef:S,pendingTmNodeRef:f,nodePropsRef:e(t,`nodeProps`),showCheckmarkRef:e(t,`showCheckmark`),multipleRef:e(t,`multiple`),valueRef:e(t,`value`),renderLabelRef:e(t,`renderLabel`),renderOptionRef:e(t,`renderOption`),labelFieldRef:e(t,`labelField`),valueFieldRef:e(t,`valueField`)}),Fe(Ye,s),h(()=>{let{value:e}=l;e&&e.sync()});let ae=Y(()=>{let{size:e}=t,{common:{cubicBezierEaseInOut:n},self:{height:r,borderRadius:i,color:a,groupHeaderTextColor:s,actionDividerColor:c,optionTextColorPressed:l,optionTextColor:u,optionTextColorDisabled:d,optionTextColorActive:f,optionOpacityDisabled:p,optionCheckColor:m,actionTextColor:h,optionColorPending:g,optionColorActive:_,loadingColor:y,loadingSize:b,optionColorActivePending:x,[q(`optionFontSize`,e)]:S,[q(`optionHeight`,e)]:C,[q(`optionPadding`,e)]:w}}=o.value;return{"--n-height":r,"--n-action-divider-color":c,"--n-action-text-color":h,"--n-bezier":n,"--n-border-radius":i,"--n-color":a,"--n-option-font-size":S,"--n-group-header-text-color":s,"--n-option-check-color":m,"--n-option-color-pending":g,"--n-option-color-active":_,"--n-option-color-active-pending":x,"--n-option-height":C,"--n-option-opacity-disabled":p,"--n-option-text-color":u,"--n-option-text-color-active":f,"--n-option-text-color-disabled":d,"--n-option-text-color-pressed":l,"--n-option-padding":w,"--n-option-padding-left":v(w,`left`),"--n-option-padding-right":v(w,`right`),"--n-loading-color":y,"--n-loading-size":b}}),{inlineThemeDisabled:B}=t,V=B?_e(`internal-select-menu`,Y(()=>t.size[0]),ae,t):void 0,H={selfRef:s,next:te,prev:ne,getPendingTmNode:ee};return At(s,t.onResize),Object.assign({mergedTheme:o,mergedClsPrefix:n,rtlEnabled:a,virtualListRef:c,scrollbarRef:l,itemSize:y,padding:b,flattenedNodes:u,empty:C,mergedRenderEmpty:w,virtualListContainer(){let{value:e}=c;return e?.listElRef},virtualListContent(){let{value:e}=c;return e?.itemsElRef},doScroll:O,handleFocusin:re,handleFocusout:ie,handleKeyUp:F,handleKeyDown:I,handleMouseDown:L,handleVirtualListResize:j,handleVirtualListScroll:k,cssVars:B?void 0:ae,themeClass:V?.themeClass,onRender:V?.onRender},H)},render(){let{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:r,themeClass:i,onRender:a}=this;return a?.(),b(`div`,{ref:`selfRef`,tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,`${n}-base-select-menu--${this.size}-size`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,i,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},De(e.header,e=>e&&b(`div`,{class:`${n}-base-select-menu__header`,"data-header":!0,key:`header`},e)),this.loading?b(`div`,{class:`${n}-base-select-menu__loading`},b(ye,{clsPrefix:n,strokeWidth:20})):this.empty?b(`div`,{class:`${n}-base-select-menu__empty`,"data-empty":!0},B(e.empty,()=>[this.mergedRenderEmpty?.call(this)||b(An,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):b(ie,Object.assign({ref:`scrollbarRef`,theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},this.scrollbarProps),{default:()=>t?b(Et,{ref:`virtualListRef`,class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:e})=>e.isGroup?b(Pn,{key:e.key,clsPrefix:n,tmNode:e}):e.ignored?null:b(In,{clsPrefix:n,key:e.key,tmNode:e})}):b(`div`,{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(e=>e.isGroup?b(Pn,{key:e.key,clsPrefix:n,tmNode:e}):b(In,{clsPrefix:n,key:e.key,tmNode:e})))}),De(e.action,e=>e&&[b(`div`,{class:`${n}-base-select-menu__action`,"data-action":!0,key:`action`},e),b(Ut,{onFocus:this.onTabOut,key:`focus-detector`})]))}}),zn={closeIconSizeTiny:`12px`,closeIconSizeSmall:`12px`,closeIconSizeMedium:`14px`,closeIconSizeLarge:`14px`,closeSizeTiny:`16px`,closeSizeSmall:`16px`,closeSizeMedium:`18px`,closeSizeLarge:`18px`,padding:`0 7px`,closeMargin:`0 0 0 4px`};function Bn(e){let{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:i,infoColor:a,successColor:o,warningColor:s,errorColor:c,baseColor:l,borderColor:u,opacityDisabled:d,tagColor:f,closeIconColor:p,closeIconColorHover:h,closeIconColorPressed:g,borderRadiusSmall:_,fontSizeMini:v,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:x,heightMini:S,heightTiny:C,heightSmall:w,heightMedium:T,closeColorHover:E,closeColorPressed:D,buttonColor2Hover:O,buttonColor2Pressed:k,fontWeightStrong:A}=e;return Object.assign(Object.assign({},zn),{closeBorderRadius:_,heightTiny:S,heightSmall:C,heightMedium:w,heightLarge:T,borderRadius:_,opacityDisabled:d,fontSizeTiny:v,fontSizeSmall:y,fontSizeMedium:b,fontSizeLarge:x,fontWeightStrong:A,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:l,colorCheckable:`#0000`,colorHoverCheckable:O,colorPressedCheckable:k,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:t,color:f,colorBordered:`rgb(250, 250, 252)`,closeIconColor:p,closeIconColorHover:h,closeIconColorPressed:g,closeColorHover:E,closeColorPressed:D,borderPrimary:`1px solid ${m(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:m(i,{alpha:.12}),colorBorderedPrimary:m(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:m(i,{alpha:.12}),closeColorPressedPrimary:m(i,{alpha:.18}),borderInfo:`1px solid ${m(a,{alpha:.3})}`,textColorInfo:a,colorInfo:m(a,{alpha:.12}),colorBorderedInfo:m(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:m(a,{alpha:.12}),closeColorPressedInfo:m(a,{alpha:.18}),borderSuccess:`1px solid ${m(o,{alpha:.3})}`,textColorSuccess:o,colorSuccess:m(o,{alpha:.12}),colorBorderedSuccess:m(o,{alpha:.1}),closeIconColorSuccess:o,closeIconColorHoverSuccess:o,closeIconColorPressedSuccess:o,closeColorHoverSuccess:m(o,{alpha:.12}),closeColorPressedSuccess:m(o,{alpha:.18}),borderWarning:`1px solid ${m(s,{alpha:.35})}`,textColorWarning:s,colorWarning:m(s,{alpha:.15}),colorBorderedWarning:m(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:m(s,{alpha:.12}),closeColorPressedWarning:m(s,{alpha:.18}),borderError:`1px solid ${m(c,{alpha:.23})}`,textColorError:c,colorError:m(c,{alpha:.1}),colorBorderedError:m(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:m(c,{alpha:.12}),closeColorPressedError:m(c,{alpha:.18})})}var Vn={name:`Tag`,common:V,self:Bn},Hn={color:Object,type:{type:String,default:`default`},round:Boolean,size:String,closable:Boolean,disabled:{type:Boolean,default:void 0}},Un=I(`tag`,`
|
|
163
|
-
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
|
|
164
|
-
white-space: nowrap;
|
|
165
|
-
position: relative;
|
|
166
|
-
box-sizing: border-box;
|
|
167
|
-
cursor: default;
|
|
168
|
-
display: inline-flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
flex-wrap: nowrap;
|
|
171
|
-
padding: var(--n-padding);
|
|
172
|
-
border-radius: var(--n-border-radius);
|
|
173
|
-
color: var(--n-text-color);
|
|
174
|
-
background-color: var(--n-color);
|
|
175
|
-
transition:
|
|
176
|
-
border-color .3s var(--n-bezier),
|
|
177
|
-
background-color .3s var(--n-bezier),
|
|
178
|
-
color .3s var(--n-bezier),
|
|
179
|
-
box-shadow .3s var(--n-bezier),
|
|
180
|
-
opacity .3s var(--n-bezier);
|
|
181
|
-
line-height: 1;
|
|
182
|
-
height: var(--n-height);
|
|
183
|
-
font-size: var(--n-font-size);
|
|
184
|
-
`,[U(`strong`,`
|
|
185
|
-
font-weight: var(--n-font-weight-strong);
|
|
186
|
-
`),t(`border`,`
|
|
187
|
-
pointer-events: none;
|
|
188
|
-
position: absolute;
|
|
189
|
-
left: 0;
|
|
190
|
-
right: 0;
|
|
191
|
-
top: 0;
|
|
192
|
-
bottom: 0;
|
|
193
|
-
border-radius: inherit;
|
|
194
|
-
border: var(--n-border);
|
|
195
|
-
transition: border-color .3s var(--n-bezier);
|
|
196
|
-
`),t(`icon`,`
|
|
197
|
-
display: flex;
|
|
198
|
-
margin: 0 4px 0 0;
|
|
199
|
-
color: var(--n-text-color);
|
|
200
|
-
transition: color .3s var(--n-bezier);
|
|
201
|
-
font-size: var(--n-avatar-size-override);
|
|
202
|
-
`),t(`avatar`,`
|
|
203
|
-
display: flex;
|
|
204
|
-
margin: 0 6px 0 0;
|
|
205
|
-
`),t(`close`,`
|
|
206
|
-
margin: var(--n-close-margin);
|
|
207
|
-
transition:
|
|
208
|
-
background-color .3s var(--n-bezier),
|
|
209
|
-
color .3s var(--n-bezier);
|
|
210
|
-
`),U(`round`,`
|
|
211
|
-
padding: 0 calc(var(--n-height) / 3);
|
|
212
|
-
border-radius: calc(var(--n-height) / 2);
|
|
213
|
-
`,[t(`icon`,`
|
|
214
|
-
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
|
|
215
|
-
`),t(`avatar`,`
|
|
216
|
-
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
|
|
217
|
-
`),U(`closable`,`
|
|
218
|
-
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
|
|
219
|
-
`)]),U(`icon, avatar`,[U(`round`,`
|
|
220
|
-
padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
|
|
221
|
-
`)]),U(`disabled`,`
|
|
222
|
-
cursor: not-allowed !important;
|
|
223
|
-
opacity: var(--n-opacity-disabled);
|
|
224
|
-
`),U(`checkable`,`
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
box-shadow: none;
|
|
227
|
-
color: var(--n-text-color-checkable);
|
|
228
|
-
background-color: var(--n-color-checkable);
|
|
229
|
-
`,[J(`disabled`,[F(`&:hover`,`background-color: var(--n-color-hover-checkable);`,[J(`checked`,`color: var(--n-text-color-hover-checkable);`)]),F(`&:active`,`background-color: var(--n-color-pressed-checkable);`,[J(`checked`,`color: var(--n-text-color-pressed-checkable);`)])]),U(`checked`,`
|
|
230
|
-
color: var(--n-text-color-checked);
|
|
231
|
-
background-color: var(--n-color-checked);
|
|
232
|
-
`,[J(`disabled`,[F(`&:hover`,`background-color: var(--n-color-checked-hover);`),F(`&:active`,`background-color: var(--n-color-checked-pressed);`)])])])]),Wn=Object.assign(Object.assign(Object.assign({},T.props),Hn),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),Gn=S(`n-tag`),Kn=l({name:`Tag`,props:Wn,slots:Object,setup(t){let n=P(null),{mergedBorderedRef:r,mergedClsPrefixRef:i,inlineThemeDisabled:a,mergedRtlRef:o,mergedComponentPropsRef:s}=xe(t),c=Y(()=>t.size||s?.value?.Tag?.size||`medium`),l=T(`Tag`,`-tag`,Un,Vn,t,i);Fe(Gn,{roundRef:e(t,`round`)});function u(){if(!t.disabled&&t.checkable){let{checked:e,onCheckedChange:n,onUpdateChecked:r,"onUpdate:checked":i}=t;r&&r(!e),i&&i(!e),n&&n(!e)}}function d(e){if(t.triggerClickOnClose||e.stopPropagation(),!t.disabled){let{onClose:n}=t;n&&K(n,e)}}let f={setTextContent(e){let{value:t}=n;t&&(t.textContent=e)}},p=D(`Tag`,o,i),m=Y(()=>{let{type:e,color:{color:n,textColor:i}={}}=t,a=c.value,{common:{cubicBezierEaseInOut:o},self:{padding:s,closeMargin:u,borderRadius:d,opacityDisabled:f,textColorCheckable:p,textColorHoverCheckable:m,textColorPressedCheckable:h,textColorChecked:g,colorCheckable:_,colorHoverCheckable:y,colorPressedCheckable:b,colorChecked:x,colorCheckedHover:S,colorCheckedPressed:C,closeBorderRadius:w,fontWeightStrong:T,[q(`colorBordered`,e)]:E,[q(`closeSize`,a)]:D,[q(`closeIconSize`,a)]:O,[q(`fontSize`,a)]:k,[q(`height`,a)]:A,[q(`color`,e)]:j,[q(`textColor`,e)]:ee,[q(`border`,e)]:M,[q(`closeIconColor`,e)]:N,[q(`closeIconColorHover`,e)]:P,[q(`closeIconColorPressed`,e)]:F,[q(`closeColorHover`,e)]:I,[q(`closeColorPressed`,e)]:L}}=l.value,te=v(u);return{"--n-font-weight-strong":T,"--n-avatar-size-override":`calc(${A} - 8px)`,"--n-bezier":o,"--n-border-radius":d,"--n-border":M,"--n-close-icon-size":O,"--n-close-color-pressed":L,"--n-close-color-hover":I,"--n-close-border-radius":w,"--n-close-icon-color":N,"--n-close-icon-color-hover":P,"--n-close-icon-color-pressed":F,"--n-close-icon-color-disabled":N,"--n-close-margin-top":te.top,"--n-close-margin-right":te.right,"--n-close-margin-bottom":te.bottom,"--n-close-margin-left":te.left,"--n-close-size":D,"--n-color":n||(r.value?E:j),"--n-color-checkable":_,"--n-color-checked":x,"--n-color-checked-hover":S,"--n-color-checked-pressed":C,"--n-color-hover-checkable":y,"--n-color-pressed-checkable":b,"--n-font-size":k,"--n-height":A,"--n-opacity-disabled":f,"--n-padding":s,"--n-text-color":i||ee,"--n-text-color-checkable":p,"--n-text-color-checked":g,"--n-text-color-hover-checkable":m,"--n-text-color-pressed-checkable":h}}),h=a?_e(`tag`,Y(()=>{let e=``,{type:n,color:{color:i,textColor:a}={}}=t;return e+=n[0],e+=c.value[0],i&&(e+=`a${ke(i)}`),a&&(e+=`b${ke(a)}`),r.value&&(e+=`c`),e}),m,t):void 0;return Object.assign(Object.assign({},f),{rtlEnabled:p,mergedClsPrefix:i,contentRef:n,mergedBordered:r,handleClick:u,handleCloseClick:d,cssVars:a?void 0:m,themeClass:h?.themeClass,onRender:h?.onRender})},render(){var e;let{mergedClsPrefix:t,rtlEnabled:n,closable:r,color:{borderColor:i}={},round:a,onRender:o,$slots:s}=this;o?.();let c=De(s.avatar,e=>e&&b(`div`,{class:`${t}-tag__avatar`},e)),l=De(s.icon,e=>e&&b(`div`,{class:`${t}-tag__icon`},e));return b(`div`,{class:[`${t}-tag`,this.themeClass,{[`${t}-tag--rtl`]:n,[`${t}-tag--strong`]:this.strong,[`${t}-tag--disabled`]:this.disabled,[`${t}-tag--checkable`]:this.checkable,[`${t}-tag--checked`]:this.checkable&&this.checked,[`${t}-tag--round`]:a,[`${t}-tag--avatar`]:c,[`${t}-tag--icon`]:l,[`${t}-tag--closable`]:r}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},l||c,b(`span`,{class:`${t}-tag__content`,ref:`contentRef`},(e=this.$slots).default?.call(e)),!this.checkable&&r?b(ze,{clsPrefix:t,class:`${t}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?b(`div`,{class:`${t}-tag__border`,style:{borderColor:i}}):null)}}),qn=l({name:`InternalSelectionSuffix`,props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{let{clsPrefix:n}=e;return b(ye,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?b(Ht,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>b(R,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>B(t.default,()=>[b(Ft,null)])})}):null})}}}),Jn={paddingSingle:`0 26px 0 12px`,paddingMultiple:`3px 26px 0 12px`,clearSize:`16px`,arrowSize:`16px`};function Yn(e){let{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:i,inputColorDisabled:a,primaryColor:o,primaryColorHover:s,warningColor:c,warningColorHover:l,errorColor:u,errorColorHover:d,borderColor:f,iconColor:p,iconColorDisabled:h,clearColor:g,clearColorHover:_,clearColorPressed:v,placeholderColor:y,placeholderColorDisabled:b,fontSizeTiny:x,fontSizeSmall:S,fontSizeMedium:C,fontSizeLarge:w,heightTiny:T,heightSmall:E,heightMedium:D,heightLarge:O,fontWeight:k}=e;return Object.assign(Object.assign({},Jn),{fontSizeTiny:x,fontSizeSmall:S,fontSizeMedium:C,fontSizeLarge:w,heightTiny:T,heightSmall:E,heightMedium:D,heightLarge:O,borderRadius:t,fontWeight:k,textColor:n,textColorDisabled:r,placeholderColor:y,placeholderColorDisabled:b,color:i,colorDisabled:a,colorActive:i,border:`1px solid ${f}`,borderHover:`1px solid ${s}`,borderActive:`1px solid ${o}`,borderFocus:`1px solid ${s}`,boxShadowHover:`none`,boxShadowActive:`0 0 0 2px ${m(o,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${m(o,{alpha:.2})}`,caretColor:o,arrowColor:p,arrowColorDisabled:h,loadingColor:o,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${l}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${l}`,boxShadowHoverWarning:`none`,boxShadowActiveWarning:`0 0 0 2px ${m(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${m(c,{alpha:.2})}`,colorActiveWarning:i,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${d}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${d}`,boxShadowHoverError:`none`,boxShadowActiveError:`0 0 0 2px ${m(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${m(u,{alpha:.2})}`,colorActiveError:i,caretColorError:u,clearColor:g,clearColorHover:_,clearColorPressed:v})}var Xn=je({name:`InternalSelection`,common:V,peers:{Popover:We},self:Yn}),Zn=F([I(`base-selection`,`
|
|
233
|
-
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
|
|
234
|
-
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
|
|
235
|
-
position: relative;
|
|
236
|
-
z-index: auto;
|
|
237
|
-
box-shadow: none;
|
|
238
|
-
width: 100%;
|
|
239
|
-
max-width: 100%;
|
|
240
|
-
display: inline-block;
|
|
241
|
-
vertical-align: bottom;
|
|
242
|
-
border-radius: var(--n-border-radius);
|
|
243
|
-
min-height: var(--n-height);
|
|
244
|
-
line-height: 1.5;
|
|
245
|
-
font-size: var(--n-font-size);
|
|
246
|
-
`,[I(`base-loading`,`
|
|
247
|
-
color: var(--n-loading-color);
|
|
248
|
-
`),I(`base-selection-tags`,`min-height: var(--n-height);`),t(`border, state-border`,`
|
|
249
|
-
position: absolute;
|
|
250
|
-
left: 0;
|
|
251
|
-
right: 0;
|
|
252
|
-
top: 0;
|
|
253
|
-
bottom: 0;
|
|
254
|
-
pointer-events: none;
|
|
255
|
-
border: var(--n-border);
|
|
256
|
-
border-radius: inherit;
|
|
257
|
-
transition:
|
|
258
|
-
box-shadow .3s var(--n-bezier),
|
|
259
|
-
border-color .3s var(--n-bezier);
|
|
260
|
-
`),t(`state-border`,`
|
|
261
|
-
z-index: 1;
|
|
262
|
-
border-color: #0000;
|
|
263
|
-
`),I(`base-suffix`,`
|
|
264
|
-
cursor: pointer;
|
|
265
|
-
position: absolute;
|
|
266
|
-
top: 50%;
|
|
267
|
-
transform: translateY(-50%);
|
|
268
|
-
right: 10px;
|
|
269
|
-
`,[t(`arrow`,`
|
|
270
|
-
font-size: var(--n-arrow-size);
|
|
271
|
-
color: var(--n-arrow-color);
|
|
272
|
-
transition: color .3s var(--n-bezier);
|
|
273
|
-
`)]),I(`base-selection-overlay`,`
|
|
274
|
-
display: flex;
|
|
275
|
-
align-items: center;
|
|
276
|
-
white-space: nowrap;
|
|
277
|
-
pointer-events: none;
|
|
278
|
-
position: absolute;
|
|
279
|
-
top: 0;
|
|
280
|
-
right: 0;
|
|
281
|
-
bottom: 0;
|
|
282
|
-
left: 0;
|
|
283
|
-
padding: var(--n-padding-single);
|
|
284
|
-
transition: color .3s var(--n-bezier);
|
|
285
|
-
`,[t(`wrapper`,`
|
|
286
|
-
flex-basis: 0;
|
|
287
|
-
flex-grow: 1;
|
|
288
|
-
overflow: hidden;
|
|
289
|
-
text-overflow: ellipsis;
|
|
290
|
-
`)]),I(`base-selection-placeholder`,`
|
|
291
|
-
color: var(--n-placeholder-color);
|
|
292
|
-
`,[t(`inner`,`
|
|
293
|
-
max-width: 100%;
|
|
294
|
-
overflow: hidden;
|
|
295
|
-
`)]),I(`base-selection-tags`,`
|
|
296
|
-
cursor: pointer;
|
|
297
|
-
outline: none;
|
|
298
|
-
box-sizing: border-box;
|
|
299
|
-
position: relative;
|
|
300
|
-
z-index: auto;
|
|
301
|
-
display: flex;
|
|
302
|
-
padding: var(--n-padding-multiple);
|
|
303
|
-
flex-wrap: wrap;
|
|
304
|
-
align-items: center;
|
|
305
|
-
width: 100%;
|
|
306
|
-
vertical-align: bottom;
|
|
307
|
-
background-color: var(--n-color);
|
|
308
|
-
border-radius: inherit;
|
|
309
|
-
transition:
|
|
310
|
-
color .3s var(--n-bezier),
|
|
311
|
-
box-shadow .3s var(--n-bezier),
|
|
312
|
-
background-color .3s var(--n-bezier);
|
|
313
|
-
`),I(`base-selection-label`,`
|
|
314
|
-
height: var(--n-height);
|
|
315
|
-
display: inline-flex;
|
|
316
|
-
width: 100%;
|
|
317
|
-
vertical-align: bottom;
|
|
318
|
-
cursor: pointer;
|
|
319
|
-
outline: none;
|
|
320
|
-
z-index: auto;
|
|
321
|
-
box-sizing: border-box;
|
|
322
|
-
position: relative;
|
|
323
|
-
transition:
|
|
324
|
-
color .3s var(--n-bezier),
|
|
325
|
-
box-shadow .3s var(--n-bezier),
|
|
326
|
-
background-color .3s var(--n-bezier);
|
|
327
|
-
border-radius: inherit;
|
|
328
|
-
background-color: var(--n-color);
|
|
329
|
-
align-items: center;
|
|
330
|
-
`,[I(`base-selection-input`,`
|
|
331
|
-
font-size: inherit;
|
|
332
|
-
line-height: inherit;
|
|
333
|
-
outline: none;
|
|
334
|
-
cursor: pointer;
|
|
335
|
-
box-sizing: border-box;
|
|
336
|
-
border:none;
|
|
337
|
-
width: 100%;
|
|
338
|
-
padding: var(--n-padding-single);
|
|
339
|
-
background-color: #0000;
|
|
340
|
-
color: var(--n-text-color);
|
|
341
|
-
transition: color .3s var(--n-bezier);
|
|
342
|
-
caret-color: var(--n-caret-color);
|
|
343
|
-
`,[t(`content`,`
|
|
344
|
-
text-overflow: ellipsis;
|
|
345
|
-
overflow: hidden;
|
|
346
|
-
white-space: nowrap;
|
|
347
|
-
`)]),t(`render-label`,`
|
|
348
|
-
color: var(--n-text-color);
|
|
349
|
-
`)]),J(`disabled`,[F(`&:hover`,[t(`state-border`,`
|
|
350
|
-
box-shadow: var(--n-box-shadow-hover);
|
|
351
|
-
border: var(--n-border-hover);
|
|
352
|
-
`)]),U(`focus`,[t(`state-border`,`
|
|
353
|
-
box-shadow: var(--n-box-shadow-focus);
|
|
354
|
-
border: var(--n-border-focus);
|
|
355
|
-
`)]),U(`active`,[t(`state-border`,`
|
|
356
|
-
box-shadow: var(--n-box-shadow-active);
|
|
357
|
-
border: var(--n-border-active);
|
|
358
|
-
`),I(`base-selection-label`,`background-color: var(--n-color-active);`),I(`base-selection-tags`,`background-color: var(--n-color-active);`)])]),U(`disabled`,`cursor: not-allowed;`,[t(`arrow`,`
|
|
359
|
-
color: var(--n-arrow-color-disabled);
|
|
360
|
-
`),I(`base-selection-label`,`
|
|
361
|
-
cursor: not-allowed;
|
|
362
|
-
background-color: var(--n-color-disabled);
|
|
363
|
-
`,[I(`base-selection-input`,`
|
|
364
|
-
cursor: not-allowed;
|
|
365
|
-
color: var(--n-text-color-disabled);
|
|
366
|
-
`),t(`render-label`,`
|
|
367
|
-
color: var(--n-text-color-disabled);
|
|
368
|
-
`)]),I(`base-selection-tags`,`
|
|
369
|
-
cursor: not-allowed;
|
|
370
|
-
background-color: var(--n-color-disabled);
|
|
371
|
-
`),I(`base-selection-placeholder`,`
|
|
372
|
-
cursor: not-allowed;
|
|
373
|
-
color: var(--n-placeholder-color-disabled);
|
|
374
|
-
`)]),I(`base-selection-input-tag`,`
|
|
375
|
-
height: calc(var(--n-height) - 6px);
|
|
376
|
-
line-height: calc(var(--n-height) - 6px);
|
|
377
|
-
outline: none;
|
|
378
|
-
display: none;
|
|
379
|
-
position: relative;
|
|
380
|
-
margin-bottom: 3px;
|
|
381
|
-
max-width: 100%;
|
|
382
|
-
vertical-align: bottom;
|
|
383
|
-
`,[t(`input`,`
|
|
384
|
-
font-size: inherit;
|
|
385
|
-
font-family: inherit;
|
|
386
|
-
min-width: 1px;
|
|
387
|
-
padding: 0;
|
|
388
|
-
background-color: #0000;
|
|
389
|
-
outline: none;
|
|
390
|
-
border: none;
|
|
391
|
-
max-width: 100%;
|
|
392
|
-
overflow: hidden;
|
|
393
|
-
width: 1em;
|
|
394
|
-
line-height: inherit;
|
|
395
|
-
cursor: pointer;
|
|
396
|
-
color: var(--n-text-color);
|
|
397
|
-
caret-color: var(--n-caret-color);
|
|
398
|
-
`),t(`mirror`,`
|
|
399
|
-
position: absolute;
|
|
400
|
-
left: 0;
|
|
401
|
-
top: 0;
|
|
402
|
-
white-space: pre;
|
|
403
|
-
visibility: hidden;
|
|
404
|
-
user-select: none;
|
|
405
|
-
-webkit-user-select: none;
|
|
406
|
-
opacity: 0;
|
|
407
|
-
`)]),[`warning`,`error`].map(e=>U(`${e}-status`,[t(`state-border`,`border: var(--n-border-${e});`),J(`disabled`,[F(`&:hover`,[t(`state-border`,`
|
|
408
|
-
box-shadow: var(--n-box-shadow-hover-${e});
|
|
409
|
-
border: var(--n-border-hover-${e});
|
|
410
|
-
`)]),U(`active`,[t(`state-border`,`
|
|
411
|
-
box-shadow: var(--n-box-shadow-active-${e});
|
|
412
|
-
border: var(--n-border-active-${e});
|
|
413
|
-
`),I(`base-selection-label`,`background-color: var(--n-color-active-${e});`),I(`base-selection-tags`,`background-color: var(--n-color-active-${e});`)]),U(`focus`,[t(`state-border`,`
|
|
414
|
-
box-shadow: var(--n-box-shadow-focus-${e});
|
|
415
|
-
border: var(--n-border-focus-${e});
|
|
416
|
-
`)])])]))]),I(`base-selection-popover`,`
|
|
417
|
-
margin-bottom: -3px;
|
|
418
|
-
display: flex;
|
|
419
|
-
flex-wrap: wrap;
|
|
420
|
-
margin-right: -8px;
|
|
421
|
-
`),I(`base-selection-tag-wrapper`,`
|
|
422
|
-
max-width: 100%;
|
|
423
|
-
display: inline-flex;
|
|
424
|
-
padding: 0 7px 3px 0;
|
|
425
|
-
`,[F(`&:last-child`,`padding-right: 0;`),I(`tag`,`
|
|
426
|
-
font-size: 14px;
|
|
427
|
-
max-width: 100%;
|
|
428
|
-
`,[t(`content`,`
|
|
429
|
-
line-height: 1.25;
|
|
430
|
-
text-overflow: ellipsis;
|
|
431
|
-
overflow: hidden;
|
|
432
|
-
`)])])]),Qn=l({name:`InternalSelection`,props:Object.assign(Object.assign({},T.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:``},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:`medium`},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){let{mergedClsPrefixRef:n,mergedRtlRef:r}=xe(t),i=D(`InternalSelection`,r,n),a=P(null),o=P(null),s=P(null),c=P(null),l=P(null),u=P(null),d=P(null),f=P(null),p=P(null),m=P(null),g=P(!1),_=P(!1),y=P(!1),b=T(`InternalSelection`,`-internal-selection`,Zn,Xn,t,e(t,`clsPrefix`)),x=Y(()=>t.clearable&&!t.disabled&&(y.value||t.active)),S=Y(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Ve(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),C=Y(()=>{let e=t.selectedOption;if(e)return e[t.labelField]}),w=Y(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function E(){var e;let{value:n}=a;if(n){let{value:r}=o;r&&(r.style.width=`${n.offsetWidth}px`,t.maxTagCount!==`responsive`&&((e=p.value)==null||e.sync({showAllItemsBeforeCalculate:!1})))}}function O(){let{value:e}=m;e&&(e.style.display=`none`)}function k(){let{value:e}=m;e&&(e.style.display=`inline-block`)}A(e(t,`active`),e=>{e||O()}),A(e(t,`pattern`),()=>{t.multiple&&ue(E)});function j(e){let{onFocus:n}=t;n&&n(e)}function ee(e){let{onBlur:n}=t;n&&n(e)}function N(e){let{onDeleteOption:n}=t;n&&n(e)}function F(e){let{onClear:n}=t;n&&n(e)}function I(e){let{onPatternInput:n}=t;n&&n(e)}function L(e){(!e.relatedTarget||!s.value?.contains(e.relatedTarget))&&j(e)}function te(e){s.value?.contains(e.relatedTarget)||ee(e)}function ne(e){F(e)}function R(){y.value=!0}function z(){y.value=!1}function re(e){!t.active||!t.filterable||e.target!==o.value&&e.preventDefault()}function ie(e){N(e)}let ae=P(!1);function B(e){if(e.key===`Backspace`&&!ae.value&&!t.pattern.length){let{selectedOptions:e}=t;e?.length&&ie(e[e.length-1])}}let V=null;function H(e){let{value:n}=a;n&&(n.textContent=e.target.value,E()),t.ignoreComposition&&ae.value?V=e:I(e)}function U(){ae.value=!0}function W(){ae.value=!1,t.ignoreComposition&&I(V),V=null}function G(e){var n;_.value=!0,(n=t.onPatternFocus)==null||n.call(t,e)}function oe(e){var n;_.value=!1,(n=t.onPatternBlur)==null||n.call(t,e)}function se(){var e,n;if(t.filterable)_.value=!1,(e=u.value)==null||e.blur(),(n=o.value)==null||n.blur();else if(t.multiple){let{value:e}=c;e?.blur()}else{let{value:e}=l;e?.blur()}}function ce(){var e,n,r;t.filterable?(_.value=!1,(e=u.value)==null||e.focus()):t.multiple?(n=c.value)==null||n.focus():(r=l.value)==null||r.focus()}function K(){let{value:e}=o;e&&(k(),e.focus())}function le(){let{value:e}=o;e&&e.blur()}function de(e){let{value:t}=d;t&&t.setTextContent(`+${e}`)}function fe(){let{value:e}=f;return e}function pe(){return o.value}let me=null;function he(){me!==null&&window.clearTimeout(me)}function ge(){t.active||(he(),me=window.setTimeout(()=>{w.value&&(g.value=!0)},100))}function ve(){he()}function ye(e){e||(he(),g.value=!1)}A(w,e=>{e||(g.value=!1)}),h(()=>{M(()=>{let e=u.value;e&&(t.disabled?e.removeAttribute(`tabindex`):e.tabIndex=_.value?-1:0)})}),At(s,t.onResize);let{inlineThemeDisabled:be}=t,Se=Y(()=>{let{size:e}=t,{common:{cubicBezierEaseInOut:n},self:{fontWeight:r,borderRadius:i,color:a,placeholderColor:o,textColor:s,paddingSingle:c,paddingMultiple:l,caretColor:u,colorDisabled:d,textColorDisabled:f,placeholderColorDisabled:p,colorActive:m,boxShadowFocus:h,boxShadowActive:g,boxShadowHover:_,border:y,borderFocus:x,borderHover:S,borderActive:C,arrowColor:w,arrowColorDisabled:T,loadingColor:E,colorActiveWarning:D,boxShadowFocusWarning:O,boxShadowActiveWarning:k,boxShadowHoverWarning:A,borderWarning:j,borderFocusWarning:ee,borderHoverWarning:M,borderActiveWarning:N,colorActiveError:P,boxShadowFocusError:F,boxShadowActiveError:I,boxShadowHoverError:L,borderError:te,borderFocusError:ne,borderHoverError:R,borderActiveError:z,clearColor:re,clearColorHover:ie,clearColorPressed:ae,clearSize:B,arrowSize:V,[q(`height`,e)]:H,[q(`fontSize`,e)]:U}}=b.value,W=v(c),G=v(l);return{"--n-bezier":n,"--n-border":y,"--n-border-active":C,"--n-border-focus":x,"--n-border-hover":S,"--n-border-radius":i,"--n-box-shadow-active":g,"--n-box-shadow-focus":h,"--n-box-shadow-hover":_,"--n-caret-color":u,"--n-color":a,"--n-color-active":m,"--n-color-disabled":d,"--n-font-size":U,"--n-height":H,"--n-padding-single-top":W.top,"--n-padding-multiple-top":G.top,"--n-padding-single-right":W.right,"--n-padding-multiple-right":G.right,"--n-padding-single-left":W.left,"--n-padding-multiple-left":G.left,"--n-padding-single-bottom":W.bottom,"--n-padding-multiple-bottom":G.bottom,"--n-placeholder-color":o,"--n-placeholder-color-disabled":p,"--n-text-color":s,"--n-text-color-disabled":f,"--n-arrow-color":w,"--n-arrow-color-disabled":T,"--n-loading-color":E,"--n-color-active-warning":D,"--n-box-shadow-focus-warning":O,"--n-box-shadow-active-warning":k,"--n-box-shadow-hover-warning":A,"--n-border-warning":j,"--n-border-focus-warning":ee,"--n-border-hover-warning":M,"--n-border-active-warning":N,"--n-color-active-error":P,"--n-box-shadow-focus-error":F,"--n-box-shadow-active-error":I,"--n-box-shadow-hover-error":L,"--n-border-error":te,"--n-border-focus-error":ne,"--n-border-hover-error":R,"--n-border-active-error":z,"--n-clear-size":B,"--n-clear-color":re,"--n-clear-color-hover":ie,"--n-clear-color-pressed":ae,"--n-arrow-size":V,"--n-font-weight":r}}),Ce=be?_e(`internal-selection`,Y(()=>t.size[0]),Se,t):void 0;return{mergedTheme:b,mergedClearable:x,mergedClsPrefix:n,rtlEnabled:i,patternInputFocused:_,filterablePlaceholder:S,label:C,selected:w,showTagsPanel:g,isComposing:ae,counterRef:d,counterWrapperRef:f,patternInputMirrorRef:a,patternInputRef:o,selfRef:s,multipleElRef:c,singleElRef:l,patternInputWrapperRef:u,overflowRef:p,inputTagElRef:m,handleMouseDown:re,handleFocusin:L,handleClear:ne,handleMouseEnter:R,handleMouseLeave:z,handleDeleteOption:ie,handlePatternKeyDown:B,handlePatternInputInput:H,handlePatternInputBlur:oe,handlePatternInputFocus:G,handleMouseEnterCounter:ge,handleMouseLeaveCounter:ve,handleFocusout:te,handleCompositionEnd:W,handleCompositionStart:U,onPopoverUpdateShow:ye,focus:ce,focusInput:K,blur:se,blurInput:le,updateCounter:de,getCounter:fe,getTail:pe,renderLabel:t.renderLabel,cssVars:be?void 0:Se,themeClass:Ce?.themeClass,onRender:Ce?.onRender}},render(){let{status:e,multiple:t,size:n,disabled:r,filterable:i,maxTagCount:a,bordered:o,clsPrefix:s,ellipsisTagPopoverProps:c,onRender:l,renderTag:u,renderLabel:d}=this;l?.();let f=a===`responsive`,p=typeof a==`number`,m=f||p,h=b(ne,null,{default:()=>b(qn,{clsPrefix:s,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var e;return(e=this.$slots).arrow?.call(e)}})}),g;if(t){let{labelField:e}=this,t=t=>b(`div`,{class:`${s}-base-selection-tag-wrapper`,key:t.value},u?u({option:t,handleClose:()=>{this.handleDeleteOption(t)}}):b(Kn,{size:n,closable:!t.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(t)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>d?d(t,!0):Ve(t[e],t,!0)})),o=()=>(p?this.selectedOptions.slice(0,a):this.selectedOptions).map(t),l=i?b(`div`,{class:`${s}-base-selection-input-tag`,ref:`inputTagElRef`,key:`__input-tag__`},b(`input`,Object.assign({},this.inputProps,{ref:`patternInputRef`,tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${s}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),b(`span`,{ref:`patternInputMirrorRef`,class:`${s}-base-selection-input-tag__mirror`},this.pattern)):null,_=f?()=>b(`div`,{class:`${s}-base-selection-tag-wrapper`,ref:`counterWrapperRef`},b(Kn,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0,v;if(p){let e=this.selectedOptions.length-a;e>0&&(v=b(`div`,{class:`${s}-base-selection-tag-wrapper`,key:`__counter__`},b(Kn,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${e}`})))}let y=f?i?b(kt,{ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:o,counter:_,tail:()=>l}):b(kt,{ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:o,counter:_}):p&&v?o().concat(v):o(),x=m?()=>b(`div`,{class:`${s}-base-selection-popover`},f?o():this.selectedOptions.map(t)):void 0,S=m?Object.assign({show:this.showTagsPanel,trigger:`hover`,overlap:!0,placement:`top`,width:`trigger`,onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,C=!this.selected&&(!this.active||!this.pattern&&!this.isComposing)?b(`div`,{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`},b(`div`,{class:`${s}-base-selection-placeholder__inner`},this.placeholder)):null,w=i?b(`div`,{ref:`patternInputWrapperRef`,class:`${s}-base-selection-tags`},y,f?null:l,h):b(`div`,{ref:`multipleElRef`,class:`${s}-base-selection-tags`,tabindex:r?void 0:0},y,h);g=b(he,null,m?b(tt,Object.assign({},S,{scrollable:!0,style:`max-height: calc(var(--v-target-height) * 6.6);`}),{trigger:()=>w,default:x}):w,C)}else if(i){let e=this.pattern||this.isComposing,t=this.active?!e:!this.selected,n=this.active?!1:this.selected;g=b(`div`,{ref:`patternInputWrapperRef`,class:`${s}-base-selection-label`,title:this.patternInputFocused?void 0:jt(this.label)},b(`input`,Object.assign({},this.inputProps,{ref:`patternInputRef`,class:`${s}-base-selection-input`,value:this.active?this.pattern:``,placeholder:``,readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),n?b(`div`,{class:`${s}-base-selection-label__render-label ${s}-base-selection-overlay`,key:`input`},b(`div`,{class:`${s}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):d?d(this.selectedOption,!0):Ve(this.label,this.selectedOption,!0))):null,t?b(`div`,{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:`placeholder`},b(`div`,{class:`${s}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,h)}else g=b(`div`,{ref:`singleElRef`,class:`${s}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label===void 0?b(`div`,{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:`placeholder`},b(`div`,{class:`${s}-base-selection-placeholder__inner`},this.placeholder)):b(`div`,{class:`${s}-base-selection-input`,title:jt(this.label),key:`input`},b(`div`,{class:`${s}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):d?d(this.selectedOption,!0):Ve(this.label,this.selectedOption,!0))),h);return b(`div`,{ref:`selfRef`,class:[`${s}-base-selection`,this.rtlEnabled&&`${s}-base-selection--rtl`,this.themeClass,e&&`${s}-base-selection--${e}-status`,{[`${s}-base-selection--active`]:this.active,[`${s}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${s}-base-selection--disabled`]:this.disabled,[`${s}-base-selection--multiple`]:this.multiple,[`${s}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},g,o?b(`div`,{class:`${s}-base-selection__border`}):null,o?b(`div`,{class:`${s}-base-selection__state-border`}):null)}}),$n={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`};function er(e){let{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:i,primaryColorHover:a,inputColor:o,inputColorDisabled:s,borderColor:c,warningColor:l,warningColorHover:u,errorColor:d,errorColorHover:f,borderRadius:p,lineHeight:h,fontSizeTiny:g,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:y,heightTiny:b,heightSmall:x,heightMedium:S,heightLarge:C,actionColor:w,clearColor:T,clearColorHover:E,clearColorPressed:D,placeholderColor:O,placeholderColorDisabled:k,iconColor:A,iconColorDisabled:j,iconColorHover:ee,iconColorPressed:M,fontWeight:N}=e;return Object.assign(Object.assign({},$n),{fontWeight:N,countTextColorDisabled:r,countTextColor:n,heightTiny:b,heightSmall:x,heightMedium:S,heightLarge:C,fontSizeTiny:g,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:y,lineHeight:h,lineHeightTextarea:h,borderRadius:p,iconSize:`16px`,groupLabelColor:w,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:O,placeholderColorDisabled:k,color:o,colorDisabled:s,colorFocus:o,groupLabelBorder:`1px solid ${c}`,border:`1px solid ${c}`,borderHover:`1px solid ${a}`,borderDisabled:`1px solid ${c}`,borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 0 2px ${m(i,{alpha:.2})}`,loadingColor:i,loadingColorWarning:l,borderWarning:`1px solid ${l}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:o,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${m(l,{alpha:.2})}`,caretColorWarning:l,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${f}`,colorFocusError:o,borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 0 2px ${m(d,{alpha:.2})}`,caretColorError:d,clearColor:T,clearColorHover:E,clearColorPressed:D,iconColor:A,iconColorDisabled:j,iconColorHover:ee,iconColorPressed:M,suffixTextColor:t})}var tr=je({name:`Input`,common:V,peers:{Scrollbar:Ee},self:er}),nr=S(`n-input`),rr=I(`input`,`
|
|
433
|
-
max-width: 100%;
|
|
434
|
-
cursor: text;
|
|
435
|
-
line-height: 1.5;
|
|
436
|
-
z-index: auto;
|
|
437
|
-
outline: none;
|
|
438
|
-
box-sizing: border-box;
|
|
439
|
-
position: relative;
|
|
440
|
-
display: inline-flex;
|
|
441
|
-
border-radius: var(--n-border-radius);
|
|
442
|
-
background-color: var(--n-color);
|
|
443
|
-
transition: background-color .3s var(--n-bezier);
|
|
444
|
-
font-size: var(--n-font-size);
|
|
445
|
-
font-weight: var(--n-font-weight);
|
|
446
|
-
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
|
|
447
|
-
`,[t(`input, textarea`,`
|
|
448
|
-
overflow: hidden;
|
|
449
|
-
flex-grow: 1;
|
|
450
|
-
position: relative;
|
|
451
|
-
`),t(`input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder`,`
|
|
452
|
-
box-sizing: border-box;
|
|
453
|
-
font-size: inherit;
|
|
454
|
-
line-height: 1.5;
|
|
455
|
-
font-family: inherit;
|
|
456
|
-
border: none;
|
|
457
|
-
outline: none;
|
|
458
|
-
background-color: #0000;
|
|
459
|
-
text-align: inherit;
|
|
460
|
-
transition:
|
|
461
|
-
-webkit-text-fill-color .3s var(--n-bezier),
|
|
462
|
-
caret-color .3s var(--n-bezier),
|
|
463
|
-
color .3s var(--n-bezier),
|
|
464
|
-
text-decoration-color .3s var(--n-bezier);
|
|
465
|
-
`),t(`input-el, textarea-el`,`
|
|
466
|
-
-webkit-appearance: none;
|
|
467
|
-
scrollbar-width: none;
|
|
468
|
-
width: 100%;
|
|
469
|
-
min-width: 0;
|
|
470
|
-
text-decoration-color: var(--n-text-decoration-color);
|
|
471
|
-
color: var(--n-text-color);
|
|
472
|
-
caret-color: var(--n-caret-color);
|
|
473
|
-
background-color: transparent;
|
|
474
|
-
`,[F(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
475
|
-
width: 0;
|
|
476
|
-
height: 0;
|
|
477
|
-
display: none;
|
|
478
|
-
`),F(`&::placeholder`,`
|
|
479
|
-
color: #0000;
|
|
480
|
-
-webkit-text-fill-color: transparent !important;
|
|
481
|
-
`),F(`&:-webkit-autofill ~`,[t(`placeholder`,`display: none;`)])]),U(`round`,[J(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),t(`placeholder`,`
|
|
482
|
-
pointer-events: none;
|
|
483
|
-
position: absolute;
|
|
484
|
-
left: 0;
|
|
485
|
-
right: 0;
|
|
486
|
-
top: 0;
|
|
487
|
-
bottom: 0;
|
|
488
|
-
overflow: hidden;
|
|
489
|
-
color: var(--n-placeholder-color);
|
|
490
|
-
`,[F(`span`,`
|
|
491
|
-
width: 100%;
|
|
492
|
-
display: inline-block;
|
|
493
|
-
`)]),U(`textarea`,[t(`placeholder`,`overflow: visible;`)]),J(`autosize`,`width: 100%;`),U(`autosize`,[t(`textarea-el, input-el`,`
|
|
494
|
-
position: absolute;
|
|
495
|
-
top: 0;
|
|
496
|
-
left: 0;
|
|
497
|
-
height: 100%;
|
|
498
|
-
`)]),I(`input-wrapper`,`
|
|
499
|
-
overflow: hidden;
|
|
500
|
-
display: inline-flex;
|
|
501
|
-
flex-grow: 1;
|
|
502
|
-
position: relative;
|
|
503
|
-
padding-left: var(--n-padding-left);
|
|
504
|
-
padding-right: var(--n-padding-right);
|
|
505
|
-
`),t(`input-mirror`,`
|
|
506
|
-
padding: 0;
|
|
507
|
-
height: var(--n-height);
|
|
508
|
-
line-height: var(--n-height);
|
|
509
|
-
overflow: hidden;
|
|
510
|
-
visibility: hidden;
|
|
511
|
-
position: static;
|
|
512
|
-
white-space: pre;
|
|
513
|
-
pointer-events: none;
|
|
514
|
-
`),t(`input-el`,`
|
|
515
|
-
padding: 0;
|
|
516
|
-
height: var(--n-height);
|
|
517
|
-
line-height: var(--n-height);
|
|
518
|
-
`,[F(`&[type=password]::-ms-reveal`,`display: none;`),F(`+`,[t(`placeholder`,`
|
|
519
|
-
display: flex;
|
|
520
|
-
align-items: center;
|
|
521
|
-
`)])]),J(`textarea`,[t(`placeholder`,`white-space: nowrap;`)]),t(`eye`,`
|
|
522
|
-
display: flex;
|
|
523
|
-
align-items: center;
|
|
524
|
-
justify-content: center;
|
|
525
|
-
transition: color .3s var(--n-bezier);
|
|
526
|
-
`),U(`textarea`,`width: 100%;`,[I(`input-word-count`,`
|
|
527
|
-
position: absolute;
|
|
528
|
-
right: var(--n-padding-right);
|
|
529
|
-
bottom: var(--n-padding-vertical);
|
|
530
|
-
`),U(`resizable`,[I(`input-wrapper`,`
|
|
531
|
-
resize: vertical;
|
|
532
|
-
min-height: var(--n-height);
|
|
533
|
-
`)]),t(`textarea-el, textarea-mirror, placeholder`,`
|
|
534
|
-
height: 100%;
|
|
535
|
-
padding-left: 0;
|
|
536
|
-
padding-right: 0;
|
|
537
|
-
padding-top: var(--n-padding-vertical);
|
|
538
|
-
padding-bottom: var(--n-padding-vertical);
|
|
539
|
-
word-break: break-word;
|
|
540
|
-
display: inline-block;
|
|
541
|
-
vertical-align: bottom;
|
|
542
|
-
box-sizing: border-box;
|
|
543
|
-
line-height: var(--n-line-height-textarea);
|
|
544
|
-
margin: 0;
|
|
545
|
-
resize: none;
|
|
546
|
-
white-space: pre-wrap;
|
|
547
|
-
scroll-padding-block-end: var(--n-padding-vertical);
|
|
548
|
-
`),t(`textarea-mirror`,`
|
|
549
|
-
width: 100%;
|
|
550
|
-
pointer-events: none;
|
|
551
|
-
overflow: hidden;
|
|
552
|
-
visibility: hidden;
|
|
553
|
-
position: static;
|
|
554
|
-
white-space: pre-wrap;
|
|
555
|
-
overflow-wrap: break-word;
|
|
556
|
-
`)]),U(`pair`,[t(`input-el, placeholder`,`text-align: center;`),t(`separator`,`
|
|
557
|
-
display: flex;
|
|
558
|
-
align-items: center;
|
|
559
|
-
transition: color .3s var(--n-bezier);
|
|
560
|
-
color: var(--n-text-color);
|
|
561
|
-
white-space: nowrap;
|
|
562
|
-
`,[I(`icon`,`
|
|
563
|
-
color: var(--n-icon-color);
|
|
564
|
-
`),I(`base-icon`,`
|
|
565
|
-
color: var(--n-icon-color);
|
|
566
|
-
`)])]),U(`disabled`,`
|
|
567
|
-
cursor: not-allowed;
|
|
568
|
-
background-color: var(--n-color-disabled);
|
|
569
|
-
`,[t(`border`,`border: var(--n-border-disabled);`),t(`input-el, textarea-el`,`
|
|
570
|
-
cursor: not-allowed;
|
|
571
|
-
color: var(--n-text-color-disabled);
|
|
572
|
-
text-decoration-color: var(--n-text-color-disabled);
|
|
573
|
-
`),t(`placeholder`,`color: var(--n-placeholder-color-disabled);`),t(`separator`,`color: var(--n-text-color-disabled);`,[I(`icon`,`
|
|
574
|
-
color: var(--n-icon-color-disabled);
|
|
575
|
-
`),I(`base-icon`,`
|
|
576
|
-
color: var(--n-icon-color-disabled);
|
|
577
|
-
`)]),I(`input-word-count`,`
|
|
578
|
-
color: var(--n-count-text-color-disabled);
|
|
579
|
-
`),t(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[I(`icon`,`
|
|
580
|
-
color: var(--n-icon-color-disabled);
|
|
581
|
-
`),I(`internal-icon`,`
|
|
582
|
-
color: var(--n-icon-color-disabled);
|
|
583
|
-
`)])]),J(`disabled`,[t(`eye`,`
|
|
584
|
-
color: var(--n-icon-color);
|
|
585
|
-
cursor: pointer;
|
|
586
|
-
`,[F(`&:hover`,`
|
|
587
|
-
color: var(--n-icon-color-hover);
|
|
588
|
-
`),F(`&:active`,`
|
|
589
|
-
color: var(--n-icon-color-pressed);
|
|
590
|
-
`)]),F(`&:hover`,[t(`state-border`,`border: var(--n-border-hover);`)]),U(`focus`,`background-color: var(--n-color-focus);`,[t(`state-border`,`
|
|
591
|
-
border: var(--n-border-focus);
|
|
592
|
-
box-shadow: var(--n-box-shadow-focus);
|
|
593
|
-
`)])]),t(`border, state-border`,`
|
|
594
|
-
box-sizing: border-box;
|
|
595
|
-
position: absolute;
|
|
596
|
-
left: 0;
|
|
597
|
-
right: 0;
|
|
598
|
-
top: 0;
|
|
599
|
-
bottom: 0;
|
|
600
|
-
pointer-events: none;
|
|
601
|
-
border-radius: inherit;
|
|
602
|
-
border: var(--n-border);
|
|
603
|
-
transition:
|
|
604
|
-
box-shadow .3s var(--n-bezier),
|
|
605
|
-
border-color .3s var(--n-bezier);
|
|
606
|
-
`),t(`state-border`,`
|
|
607
|
-
border-color: #0000;
|
|
608
|
-
z-index: 1;
|
|
609
|
-
`),t(`prefix`,`margin-right: 4px;`),t(`suffix`,`
|
|
610
|
-
margin-left: 4px;
|
|
611
|
-
`),t(`suffix, prefix`,`
|
|
612
|
-
transition: color .3s var(--n-bezier);
|
|
613
|
-
flex-wrap: nowrap;
|
|
614
|
-
flex-shrink: 0;
|
|
615
|
-
line-height: var(--n-height);
|
|
616
|
-
white-space: nowrap;
|
|
617
|
-
display: inline-flex;
|
|
618
|
-
align-items: center;
|
|
619
|
-
justify-content: center;
|
|
620
|
-
color: var(--n-suffix-text-color);
|
|
621
|
-
`,[I(`base-loading`,`
|
|
622
|
-
font-size: var(--n-icon-size);
|
|
623
|
-
margin: 0 2px;
|
|
624
|
-
color: var(--n-loading-color);
|
|
625
|
-
`),I(`base-clear`,`
|
|
626
|
-
font-size: var(--n-icon-size);
|
|
627
|
-
`,[t(`placeholder`,[I(`base-icon`,`
|
|
628
|
-
transition: color .3s var(--n-bezier);
|
|
629
|
-
color: var(--n-icon-color);
|
|
630
|
-
font-size: var(--n-icon-size);
|
|
631
|
-
`)])]),F(`>`,[I(`icon`,`
|
|
632
|
-
transition: color .3s var(--n-bezier);
|
|
633
|
-
color: var(--n-icon-color);
|
|
634
|
-
font-size: var(--n-icon-size);
|
|
635
|
-
`)]),I(`base-icon`,`
|
|
636
|
-
font-size: var(--n-icon-size);
|
|
637
|
-
`)]),I(`input-word-count`,`
|
|
638
|
-
pointer-events: none;
|
|
639
|
-
line-height: 1.5;
|
|
640
|
-
font-size: .85em;
|
|
641
|
-
color: var(--n-count-text-color);
|
|
642
|
-
transition: color .3s var(--n-bezier);
|
|
643
|
-
margin-left: 4px;
|
|
644
|
-
font-variant: tabular-nums;
|
|
645
|
-
`),[`warning`,`error`].map(e=>U(`${e}-status`,[J(`disabled`,[I(`base-loading`,`
|
|
646
|
-
color: var(--n-loading-color-${e})
|
|
647
|
-
`),t(`input-el, textarea-el`,`
|
|
648
|
-
caret-color: var(--n-caret-color-${e});
|
|
649
|
-
`),t(`state-border`,`
|
|
650
|
-
border: var(--n-border-${e});
|
|
651
|
-
`),F(`&:hover`,[t(`state-border`,`
|
|
652
|
-
border: var(--n-border-hover-${e});
|
|
653
|
-
`)]),F(`&:focus`,`
|
|
654
|
-
background-color: var(--n-color-focus-${e});
|
|
655
|
-
`,[t(`state-border`,`
|
|
656
|
-
box-shadow: var(--n-box-shadow-focus-${e});
|
|
657
|
-
border: var(--n-border-focus-${e});
|
|
658
|
-
`)]),U(`focus`,`
|
|
659
|
-
background-color: var(--n-color-focus-${e});
|
|
660
|
-
`,[t(`state-border`,`
|
|
661
|
-
box-shadow: var(--n-box-shadow-focus-${e});
|
|
662
|
-
border: var(--n-border-focus-${e});
|
|
663
|
-
`)])])]))]),ir=I(`input`,[U(`disabled`,[t(`input-el, textarea-el`,`
|
|
664
|
-
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|
665
|
-
`)])]);function ar(e){let t=0;for(let n of e)t++;return t}function or(e){return e===``||e==null}function sr(e){let t=P(null);function n(){let{value:n}=e;if(!n?.focus){i();return}let{selectionStart:r,selectionEnd:a,value:o}=n;if(r==null||a==null){i();return}t.value={start:r,end:a,beforeText:o.slice(0,r),afterText:o.slice(a)}}function r(){var n;let{value:r}=t,{value:i}=e;if(!r||!i)return;let{value:a}=i,{start:o,beforeText:s,afterText:c}=r,l=a.length;if(a.endsWith(c))l=a.length-c.length;else if(a.startsWith(s))l=s.length;else{let e=s[o-1],t=a.indexOf(e,o-1);t!==-1&&(l=t+1)}(n=i.setSelectionRange)==null||n.call(i,l,l)}function i(){t.value=null}return A(e,i),{recordCursor:n,restoreCursor:r}}var cr=l({name:`InputWordCount`,setup(e,{slots:t}){let{mergedValueRef:n,maxlengthRef:r,mergedClsPrefixRef:i,countGraphemesRef:a}=de(nr),o=Y(()=>{let{value:e}=n;return e===null||Array.isArray(e)?0:(a.value||ar)(e)});return()=>{let{value:e}=r,{value:a}=n;return b(`span`,{class:`${i.value}-input-word-count`},pe(t.default,{value:a===null||Array.isArray(a)?``:a},()=>[e===void 0?o.value:`${o.value} / ${e}`]))}}}),lr=l({name:`Input`,props:Object.assign(Object.assign({},T.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:`text`},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),slots:Object,setup(t){let{mergedClsPrefixRef:n,mergedBorderedRef:r,inlineThemeDisabled:o,mergedRtlRef:s,mergedComponentPropsRef:l}=xe(t),u=T(`Input`,`-input`,rr,tr,t,n);Se&&a(`-input-safari`,ir,n);let d=P(null),f=P(null),p=P(null),m=P(null),g=P(null),_=P(null),y=P(null),b=sr(y),x=P(null),{localeRef:S}=$e(`Input`),C=P(t.defaultValue),E=at(e(t,`value`),C),O=Te(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:l?.value?.Input?.size||`medium`}}),{mergedSizeRef:k,mergedDisabledRef:j,mergedStatusRef:ee}=O,N=P(!1),F=P(!1),I=P(!1),L=P(!1),te=null,ne=Y(()=>{let{placeholder:e,pair:n}=t;return n?Array.isArray(e)?e:e===void 0?[``,``]:[e,e]:e===void 0?[S.value.placeholder]:[e]}),R=Y(()=>{let{value:e}=I,{value:t}=E,{value:n}=ne;return!e&&(or(t)||Array.isArray(t)&&or(t[0]))&&n[0]}),z=Y(()=>{let{value:e}=I,{value:t}=E,{value:n}=ne;return!e&&n[1]&&(or(t)||Array.isArray(t)&&or(t[1]))}),re=w(()=>t.internalForceFocus||N.value),ie=w(()=>{if(j.value||t.readonly||!t.clearable||!re.value&&!F.value)return!1;let{value:e}=E,{value:n}=re;return t.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(F.value||n):!!e&&(F.value||n)}),ae=Y(()=>{let{showPasswordOn:e}=t;if(e)return e;if(t.showPasswordToggle)return`click`}),B=P(!1),V=Y(()=>{let{textDecoration:e}=t;return e?Array.isArray(e)?e.map(e=>({textDecoration:e})):[{textDecoration:e}]:[``,``]}),H=P(void 0),U=()=>{if(t.type===`textarea`){let{autosize:e}=t;if(e&&(H.value=x.value?.$el?.offsetWidth),!f.value||typeof e==`boolean`)return;let{paddingTop:n,paddingBottom:r,lineHeight:i}=window.getComputedStyle(f.value),a=Number(n.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:c}=p;if(!c)return;if(e.minRows){let t=Math.max(e.minRows,1),n=`${a+o+s*t}px`;c.style.minHeight=n}if(e.maxRows){let t=`${a+o+s*e.maxRows}px`;c.style.maxHeight=t}}},W=Y(()=>{let{maxlength:e}=t;return e===void 0?void 0:Number(e)});h(()=>{let{value:e}=E;Array.isArray(e)||Xe(e)});let G=c().proxy;function oe(e,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=t,{nTriggerFormInput:o}=O;r&&K(r,e,n),i&&K(i,e,n),a&&K(a,e,n),C.value=e,o()}function se(e,n){let{onChange:r}=t,{nTriggerFormChange:i}=O;r&&K(r,e,n),C.value=e,i()}function ce(e){let{onBlur:n}=t,{nTriggerFormBlur:r}=O;n&&K(n,e),r()}function le(e){let{onFocus:n}=t,{nTriggerFormFocus:r}=O;n&&K(n,e),r()}function de(e){let{onClear:n}=t;n&&K(n,e)}function fe(e){let{onInputBlur:n}=t;n&&K(n,e)}function pe(e){let{onInputFocus:n}=t;n&&K(n,e)}function me(){let{onDeactivate:e}=t;e&&K(e)}function he(){let{onActivate:e}=t;e&&K(e)}function ge(e){let{onClick:n}=t;n&&K(n,e)}function ve(e){let{onWrapperFocus:n}=t;n&&K(n,e)}function ye(e){let{onWrapperBlur:n}=t;n&&K(n,e)}function be(){I.value=!0}function Ce(e){I.value=!1,e.target===_.value?J(e,1):J(e,0)}function J(e,n=0,r=`input`){let i=e.target.value;if(Xe(i),e instanceof InputEvent&&!e.isComposing&&(I.value=!1),t.type===`textarea`){let{value:e}=x;e&&e.syncUnifiedContainer()}if(te=i,I.value)return;b.recordCursor();let a=we(i);if(a)if(!t.pair)r===`input`?oe(i,{source:n}):se(i,{source:n});else{let{value:e}=E;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[n]=i,r===`input`?oe(e,{source:n}):se(e,{source:n})}G.$forceUpdate(),a||ue(b.restoreCursor)}function we(e){let{countGraphemes:n,maxlength:r,minlength:i}=t;if(n){let t;if(r!==void 0&&(t===void 0&&(t=n(e)),t>Number(r))||i!==void 0&&(t===void 0&&(t=n(e)),t<Number(r)))return!1}let{allowInput:a}=t;return typeof a==`function`?a(e):!0}function Ee(e){fe(e),e.relatedTarget===d.value&&me(),e.relatedTarget!==null&&(e.relatedTarget===g.value||e.relatedTarget===_.value||e.relatedTarget===f.value)||(L.value=!1),Ae(e,`blur`),y.value=null}function De(e,t){pe(e),N.value=!0,L.value=!0,he(),Ae(e,`focus`),t===0?y.value=g.value:t===1?y.value=_.value:t===2&&(y.value=f.value)}function Oe(e){t.passivelyActivated&&(ye(e),Ae(e,`blur`))}function ke(e){t.passivelyActivated&&(N.value=!0,ve(e),Ae(e,`focus`))}function Ae(e,t){e.relatedTarget!==null&&(e.relatedTarget===g.value||e.relatedTarget===_.value||e.relatedTarget===f.value||e.relatedTarget===d.value)||(t===`focus`?(le(e),N.value=!0):t===`blur`&&(ce(e),N.value=!1))}function X(e,t){J(e,t,`change`)}function je(e){ge(e)}function Me(e){de(e),Ne()}function Ne(){t.pair?(oe([``,``],{source:`clear`}),se([``,``],{source:`clear`})):(oe(``,{source:`clear`}),se(``,{source:`clear`}))}function Pe(e){let{onMousedown:n}=t;n&&n(e);let{tagName:r}=e.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(t.resizable){let{value:t}=d;if(t){let{left:n,top:r,width:i,height:a}=t.getBoundingClientRect();if(n+i-14<e.clientX&&e.clientX<n+i&&r+a-14<e.clientY&&e.clientY<r+a)return}}e.preventDefault(),N.value||We()}}function Z(){var e;F.value=!0,t.type===`textarea`&&((e=x.value)==null||e.handleMouseEnterWrapper())}function Le(){var e;F.value=!1,t.type===`textarea`&&((e=x.value)==null||e.handleMouseLeaveWrapper())}function Re(){j.value||ae.value===`click`&&(B.value=!B.value)}function ze(e){if(j.value)return;e.preventDefault();let t=e=>{e.preventDefault(),Ie(`mouseup`,document,t)};if(i(`mouseup`,document,t),ae.value!==`mousedown`)return;B.value=!0;let n=()=>{B.value=!1,Ie(`mouseup`,document,n)};i(`mouseup`,document,n)}function Be(e){t.onKeyup&&K(t.onKeyup,e)}function Ve(e){switch(t.onKeydown&&K(t.onKeydown,e),e.key){case`Escape`:Ue();break;case`Enter`:He(e);break}}function He(e){var n,r;if(t.passivelyActivated){let{value:i}=L;if(i){t.internalDeactivateOnEnter&&Ue();return}e.preventDefault(),t.type===`textarea`?(n=f.value)==null||n.focus():(r=g.value)==null||r.focus()}}function Ue(){t.passivelyActivated&&(L.value=!1,ue(()=>{var e;(e=d.value)==null||e.focus()}))}function We(){var e,n,r;j.value||(t.passivelyActivated?(e=d.value)==null||e.focus():((n=f.value)==null||n.focus(),(r=g.value)==null||r.focus()))}function Ge(){d.value?.contains(document.activeElement)&&document.activeElement.blur()}function Ke(){var e,t;(e=f.value)==null||e.select(),(t=g.value)==null||t.select()}function qe(){j.value||(f.value?f.value.focus():g.value&&g.value.focus())}function Je(){let{value:e}=d;e?.contains(document.activeElement)&&e!==document.activeElement&&Ue()}function Ye(e){if(t.type===`textarea`){let{value:t}=f;t?.scrollTo(e)}else{let{value:t}=g;t?.scrollTo(e)}}function Xe(e){let{type:n,pair:r,autosize:i}=t;if(!r&&i)if(n===`textarea`){let{value:t}=p;t&&(t.textContent=`${e??``}\r\n`)}else{let{value:t}=m;t&&(e?t.textContent=e:t.innerHTML=` `)}}function Ze(){U()}let Qe=P({top:`0`});function et(e){var t;let{scrollTop:n}=e.target;Qe.value.top=`${-n}px`,(t=x.value)==null||t.syncUnifiedContainer()}let tt=null;M(()=>{let{autosize:e,type:n}=t;e&&n===`textarea`?tt=A(E,e=>{!Array.isArray(e)&&e!==te&&Xe(e)}):tt?.()});let nt=null;M(()=>{t.type===`textarea`?nt=A(E,e=>{var t;!Array.isArray(e)&&e!==te&&((t=x.value)==null||t.syncUnifiedContainer())}):nt?.()}),Fe(nr,{mergedValueRef:E,maxlengthRef:W,mergedClsPrefixRef:n,countGraphemesRef:e(t,`countGraphemes`)});let rt={wrapperElRef:d,inputElRef:g,textareaElRef:f,isCompositing:I,clear:Ne,focus:We,blur:Ge,select:Ke,deactivate:Je,activate:qe,scrollTo:Ye},it=D(`Input`,s,n),ot=Y(()=>{let{value:e}=k,{common:{cubicBezierEaseInOut:t},self:{color:n,borderRadius:r,textColor:i,caretColor:a,caretColorError:o,caretColorWarning:s,textDecorationColor:c,border:l,borderDisabled:d,borderHover:f,borderFocus:p,placeholderColor:m,placeholderColorDisabled:h,lineHeightTextarea:g,colorDisabled:_,colorFocus:y,textColorDisabled:b,boxShadowFocus:x,iconSize:S,colorFocusWarning:C,boxShadowFocusWarning:w,borderWarning:T,borderFocusWarning:E,borderHoverWarning:D,colorFocusError:O,boxShadowFocusError:A,borderError:j,borderFocusError:ee,borderHoverError:M,clearSize:N,clearColor:P,clearColorHover:F,clearColorPressed:I,iconColor:L,iconColorDisabled:te,suffixTextColor:ne,countTextColor:R,countTextColorDisabled:z,iconColorHover:re,iconColorPressed:ie,loadingColor:ae,loadingColorError:B,loadingColorWarning:V,fontWeight:H,[q(`padding`,e)]:U,[q(`fontSize`,e)]:W,[q(`height`,e)]:G}}=u.value,{left:oe,right:se}=v(U);return{"--n-bezier":t,"--n-count-text-color":R,"--n-count-text-color-disabled":z,"--n-color":n,"--n-font-size":W,"--n-font-weight":H,"--n-border-radius":r,"--n-height":G,"--n-padding-left":oe,"--n-padding-right":se,"--n-text-color":i,"--n-caret-color":a,"--n-text-decoration-color":c,"--n-border":l,"--n-border-disabled":d,"--n-border-hover":f,"--n-border-focus":p,"--n-placeholder-color":m,"--n-placeholder-color-disabled":h,"--n-icon-size":S,"--n-line-height-textarea":g,"--n-color-disabled":_,"--n-color-focus":y,"--n-text-color-disabled":b,"--n-box-shadow-focus":x,"--n-loading-color":ae,"--n-caret-color-warning":s,"--n-color-focus-warning":C,"--n-box-shadow-focus-warning":w,"--n-border-warning":T,"--n-border-focus-warning":E,"--n-border-hover-warning":D,"--n-loading-color-warning":V,"--n-caret-color-error":o,"--n-color-focus-error":O,"--n-box-shadow-focus-error":A,"--n-border-error":j,"--n-border-focus-error":ee,"--n-border-hover-error":M,"--n-loading-color-error":B,"--n-clear-color":P,"--n-clear-size":N,"--n-clear-color-hover":F,"--n-clear-color-pressed":I,"--n-icon-color":L,"--n-icon-color-hover":re,"--n-icon-color-pressed":ie,"--n-icon-color-disabled":te,"--n-suffix-text-color":ne}}),st=o?_e(`input`,Y(()=>{let{value:e}=k;return e[0]}),ot,t):void 0;return Object.assign(Object.assign({},rt),{wrapperElRef:d,inputElRef:g,inputMirrorElRef:m,inputEl2Ref:_,textareaElRef:f,textareaMirrorElRef:p,textareaScrollbarInstRef:x,rtlEnabled:it,uncontrolledValue:C,mergedValue:E,passwordVisible:B,mergedPlaceholder:ne,showPlaceholder1:R,showPlaceholder2:z,mergedFocus:re,isComposing:I,activated:L,showClearButton:ie,mergedSize:k,mergedDisabled:j,textDecorationStyle:V,mergedClsPrefix:n,mergedBordered:r,mergedShowPasswordOn:ae,placeholderStyle:Qe,mergedStatus:ee,textAreaScrollContainerWidth:H,handleTextAreaScroll:et,handleCompositionStart:be,handleCompositionEnd:Ce,handleInput:J,handleInputBlur:Ee,handleInputFocus:De,handleWrapperBlur:Oe,handleWrapperFocus:ke,handleMouseEnter:Z,handleMouseLeave:Le,handleMouseDown:Pe,handleChange:X,handleClick:je,handleClear:Me,handlePasswordToggleClick:Re,handlePasswordToggleMousedown:ze,handleWrapperKeydown:Ve,handleWrapperKeyup:Be,handleTextAreaMirrorResize:Ze,getTextareaScrollContainer:()=>f.value,mergedTheme:u,cssVars:o?void 0:ot,themeClass:st?.themeClass,onRender:st?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:r,countGraphemes:i,onRender:a}=this,o=this.$slots;return a?.(),b(`div`,{ref:`wrapperElRef`,class:[`${e}-input`,`${e}-input--${this.mergedSize}-size`,n,t&&`${e}-input--${t}-status`,{[`${e}-input--rtl`]:this.rtlEnabled,[`${e}-input--disabled`]:this.mergedDisabled,[`${e}-input--textarea`]:r===`textarea`,[`${e}-input--resizable`]:this.resizable&&!this.autosize,[`${e}-input--autosize`]:this.autosize,[`${e}-input--round`]:this.round&&r!==`textarea`,[`${e}-input--pair`]:this.pair,[`${e}-input--focus`]:this.mergedFocus,[`${e}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},b(`div`,{class:`${e}-input-wrapper`},De(o.prefix,t=>t&&b(`div`,{class:`${e}-input__prefix`},t)),r===`textarea`?b(ie,{ref:`textareaScrollbarInstRef`,class:`${e}-input__textarea`,container:this.getTextareaScrollContainer,theme:this.theme?.peers?.Scrollbar,themeOverrides:this.themeOverrides?.peers?.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{let{textAreaScrollContainerWidth:t}=this,n={width:this.autosize&&t&&`${t}px`};return b(he,null,b(`textarea`,Object.assign({},this.inputProps,{ref:`textareaElRef`,class:[`${e}-input__textarea-el`,this.inputProps?.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],this.inputProps?.style,n],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?b(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?b(re,{onResize:this.handleTextAreaMirrorResize},{default:()=>b(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):b(`div`,{class:`${e}-input__input`},b(`input`,Object.assign({type:r===`password`&&this.mergedShowPasswordOn&&this.passwordVisible?`text`:r},this.inputProps,{ref:`inputElRef`,class:[`${e}-input__input-el`,this.inputProps?.class],style:[this.textDecorationStyle[0],this.inputProps?.style],tabindex:this.passivelyActivated&&!this.activated?-1:this.inputProps?.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?b(`div`,{class:`${e}-input__placeholder`},b(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?b(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&De(o.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?b(`div`,{class:`${e}-input__suffix`},[De(o[`clear-icon-placeholder`],t=>(this.clearable||t)&&b(Ht,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>{var e;return(e=this.$slots)[`clear-icon`]?.call(e)}})),this.internalLoadingBeforeSuffix?null:t,this.loading===void 0?null:b(qn,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?b(cr,null,{default:e=>{let{renderCount:t}=this;return t?t(e):o.count?.call(o,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?b(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?B(o[`password-visible-icon`],()=>[b(R,{clsPrefix:e},{default:()=>b(Rt,null)})]):B(o[`password-invisible-icon`],()=>[b(R,{clsPrefix:e},{default:()=>b(zt,null)})])):null]):null)),this.pair?b(`span`,{class:`${e}-input__separator`},B(o.separator,()=>[this.separator])):null,this.pair?b(`div`,{class:`${e}-input-wrapper`},b(`div`,{class:`${e}-input__input`},b(`input`,{ref:`inputEl2Ref`,type:this.type,class:`${e}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?b(`div`,{class:`${e}-input__placeholder`},b(`span`,null,this.mergedPlaceholder[1])):null),De(o.suffix,t=>(this.clearable||t)&&b(`div`,{class:`${e}-input__suffix`},[this.clearable&&b(Ht,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>o[`clear-icon`]?.call(o),placeholder:()=>o[`clear-icon-placeholder`]?.call(o)}),t]))):null,this.mergedBordered?b(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?b(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&r===`textarea`?b(cr,null,{default:e=>{let{renderCount:t}=this;return t?t(e):o.count?.call(o,e)}}):null)}});function ur(e){return e.type===`group`}function dr(e){return e.type===`ignored`}function fr(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function pr(e,t){return{getIsGroup:ur,getIgnored:dr,getKey(t){return ur(t)?t.name||t.key||`key-required`:t[e]},getChildren(e){return e[t]}}}function mr(e,t,n,r){if(!t)return e;function i(e){if(!Array.isArray(e))return[];let a=[];for(let o of e)if(ur(o)){let e=i(o[r]);e.length&&a.push(Object.assign({},o,{[r]:e}))}else if(dr(o))continue;else t(n,o)&&a.push(o);return a}return i(e)}function hr(e,t,n){let r=new Map;return e.forEach(e=>{ur(e)?e[n].forEach(e=>{r.set(e[t],e)}):r.set(e[t],e)}),r}function gr(e){let{boxShadow2:t}=e;return{menuBoxShadow:t}}var _r=je({name:`Select`,common:V,peers:{InternalSelection:Xn,InternalSelectMenu:Nn},self:gr}),vr=F([I(`select`,`
|
|
666
|
-
z-index: auto;
|
|
667
|
-
outline: none;
|
|
668
|
-
width: 100%;
|
|
669
|
-
position: relative;
|
|
670
|
-
font-weight: var(--n-font-weight);
|
|
671
|
-
`),I(`select-menu`,`
|
|
672
|
-
margin: 4px 0;
|
|
673
|
-
box-shadow: var(--n-menu-box-shadow);
|
|
674
|
-
`,[Re({originalTransition:`background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)`})])]),yr=l({name:`Select`,props:Object.assign(Object.assign({},T.props),{to:Ze.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearCreatedOptionsOnClear:{type:Boolean,default:!0},clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:`bottom-start`},widthMode:{type:String,default:`trigger`},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},childrenField:{type:String,default:`children`},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:`show`},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},scrollbarProps:Object,onChange:[Function,Array],items:Array}),slots:Object,setup(t){let{mergedClsPrefixRef:n,mergedBorderedRef:r,namespaceRef:i,inlineThemeDisabled:a,mergedComponentPropsRef:o}=xe(t),s=T(`Select`,`-select`,vr,_r,t,n),c=P(t.defaultValue),l=at(e(t,`value`),c),u=P(!1),f=P(``),p=Ue(t,[`items`,`options`]),m=P([]),h=P([]),_=Y(()=>h.value.concat(m.value).concat(p.value)),v=Y(()=>{let{filter:e}=t;if(e)return e;let{labelField:n,valueField:r}=t;return(e,t)=>{if(!t)return!1;let i=t[n];if(typeof i==`string`)return fr(e,i);let a=t[r];return typeof a==`string`?fr(e,a):typeof a==`number`?fr(e,String(a)):!1}}),y=Y(()=>{if(t.remote)return p.value;{let{value:e}=_,{value:n}=f;return!n.length||!t.filterable?e:mr(e,v.value,n,t.childrenField)}}),b=Y(()=>{let{valueField:e,childrenField:n}=t,r=pr(e,n);return Tn(y.value,r)}),x=Y(()=>hr(_.value,t.valueField,t.childrenField)),S=P(!1),C=at(e(t,`show`),S),w=P(null),E=P(null),D=P(null),{localeRef:O}=$e(`Select`),k=Y(()=>t.placeholder??O.value.placeholder),j=[],ee=P(new Map),M=Y(()=>{let{fallbackOption:e}=t;if(e===void 0){let{labelField:e,valueField:n}=t;return t=>({[e]:String(t),[n]:t})}return e===!1?!1:t=>Object.assign(e(t),{value:t})});function N(e){let n=t.remote,{value:r}=ee,{value:i}=x,{value:a}=M,o=[];return e.forEach(e=>{if(i.has(e))o.push(i.get(e));else if(n&&r.has(e))o.push(r.get(e));else if(a){let t=a(e);t&&o.push(t)}}),o}let F=Y(()=>{if(t.multiple){let{value:e}=l;return Array.isArray(e)?N(e):[]}return null}),I=Y(()=>{let{value:e}=l;return!t.multiple&&!Array.isArray(e)?e===null?null:N([e])[0]||null:null}),L=Te(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:o?.value?.Select?.size||`medium`}}),{mergedSizeRef:te,mergedDisabledRef:ne,mergedStatusRef:R}=L;function z(e,n){let{onChange:r,"onUpdate:value":i,onUpdateValue:a}=t,{nTriggerFormChange:o,nTriggerFormInput:s}=L;r&&K(r,e,n),a&&K(a,e,n),i&&K(i,e,n),c.value=e,o(),s()}function re(e){let{onBlur:n}=t,{nTriggerFormBlur:r}=L;n&&K(n,e),r()}function ie(){let{onClear:e}=t;e&&K(e)}function ae(e){let{onFocus:n,showOnFocus:r}=t,{nTriggerFormFocus:i}=L;n&&K(n,e),i(),r&&W()}function B(e){let{onSearch:n}=t;n&&K(n,e)}function V(e){let{onScroll:n}=t;n&&K(n,e)}function H(){var e;let{remote:n,multiple:r}=t;if(n){let{value:n}=ee;if(r){let{valueField:r}=t;(e=F.value)==null||e.forEach(e=>{n.set(e[r],e)})}else{let e=I.value;e&&n.set(e[t.valueField],e)}}}function U(e){let{onUpdateShow:n,"onUpdate:show":r}=t;n&&K(n,e),r&&K(r,e),S.value=e}function W(){ne.value||(U(!0),S.value=!0,t.filterable&&Oe())}function G(){U(!1)}function oe(){f.value=``,h.value=j}let se=P(!1);function ce(){t.filterable&&(se.value=!0)}function le(){t.filterable&&(se.value=!1,C.value||oe())}function ue(){ne.value||(C.value?t.filterable?Oe():G():W())}function de(e){(D.value?.selfRef)?.contains(e.relatedTarget)||(u.value=!1,re(e),G())}function fe(e){ae(e),u.value=!0}function pe(){u.value=!0}function me(e){w.value?.$el.contains(e.relatedTarget)||(u.value=!1,re(e),G())}function he(){var e;(e=w.value)==null||e.focus(),G()}function q(e){C.value&&(w.value?.$el.contains(g(e))||G())}function ge(e){if(!Array.isArray(e))return[];if(M.value)return Array.from(e);{let{remote:n}=t,{value:r}=x;if(n){let{value:t}=ee;return e.filter(e=>r.has(e)||t.has(e))}else return e.filter(e=>r.has(e))}}function ve(e){ye(e.rawNode)}function ye(e){if(ne.value)return;let{tag:n,remote:r,clearFilterAfterSelect:i,valueField:a}=t;if(n&&!r){let{value:e}=h,t=e[0]||null;if(t){let e=m.value;e.length?e.push(t):m.value=[t],h.value=j}}if(r&&ee.value.set(e[a],e),t.multiple){let t=ge(l.value),o=t.findIndex(t=>t===e[a]);if(~o){if(t.splice(o,1),n&&!r){let t=be(e[a]);~t&&(m.value.splice(t,1),i&&(f.value=``))}}else t.push(e[a]),i&&(f.value=``);z(t,N(t))}else{if(n&&!r){let t=be(e[a]);~t?m.value=[m.value[t]]:m.value=j}De(),G(),z(e[a],e)}}function be(e){return m.value.findIndex(n=>n[t.valueField]===e)}function Se(e){C.value||W();let{value:n}=e.target;f.value=n;let{tag:r,remote:i}=t;if(B(n),r&&!i){if(!n){h.value=j;return}let{onCreate:e}=t,r=e?e(n):{[t.labelField]:n,[t.valueField]:n},{valueField:i,labelField:a}=t;p.value.some(e=>e[i]===r[i]||e[a]===r[a])||m.value.some(e=>e[i]===r[i]||e[a]===r[a])?h.value=j:h.value=[r]}}function Ce(e){e.stopPropagation();let{multiple:n,tag:r,remote:i,clearCreatedOptionsOnClear:a}=t;!n&&t.filterable&&G(),r&&!i&&a&&(m.value=j),ie(),n?z([],[]):z(null,null)}function J(e){!mt(e,`action`)&&!mt(e,`empty`)&&!mt(e,`header`)&&e.preventDefault()}function we(e){V(e)}function Ee(e){var n,r,i;if(!t.keyboard){e.preventDefault();return}switch(e.key){case` `:if(t.filterable)break;e.preventDefault();case`Enter`:if(!w.value?.isComposing){if(C.value){let e=D.value?.getPendingTmNode();e?ve(e):t.filterable||(G(),De())}else if(W(),t.tag&&se.value){let e=h.value[0];if(e){let n=e[t.valueField],{value:r}=l;t.multiple&&Array.isArray(r)&&r.includes(n)||ye(e)}}}e.preventDefault();break;case`ArrowUp`:if(e.preventDefault(),t.loading)return;C.value&&((n=D.value)==null||n.prev());break;case`ArrowDown`:if(e.preventDefault(),t.loading)return;C.value?(r=D.value)==null||r.next():W();break;case`Escape`:C.value&&(Be(e),G()),(i=w.value)==null||i.focus();break}}function De(){var e;(e=w.value)==null||e.focus()}function Oe(){var e;(e=w.value)==null||e.focusInput()}function ke(){var e;C.value&&((e=E.value)==null||e.syncPosition())}H(),A(e(t,`options`),H);let Ae={focus:()=>{var e;(e=w.value)==null||e.focus()},focusInput:()=>{var e;(e=w.value)==null||e.focusInput()},blur:()=>{var e;(e=w.value)==null||e.blur()},blurInput:()=>{var e;(e=w.value)==null||e.blurInput()}},X=Y(()=>{let{self:{menuBoxShadow:e}}=s.value;return{"--n-menu-box-shadow":e}}),je=a?_e(`select`,void 0,X,t):void 0;return Object.assign(Object.assign({},Ae),{mergedStatus:R,mergedClsPrefix:n,mergedBordered:r,namespace:i,treeMate:b,isMounted:d(),triggerRef:w,menuRef:D,pattern:f,uncontrolledShow:S,mergedShow:C,adjustedTo:Ze(t),uncontrolledValue:c,mergedValue:l,followerRef:E,localizedPlaceholder:k,selectedOption:I,selectedOptions:F,mergedSize:te,mergedDisabled:ne,focused:u,activeWithoutMenuOpen:se,inlineThemeDisabled:a,onTriggerInputFocus:ce,onTriggerInputBlur:le,handleTriggerOrMenuResize:ke,handleMenuFocus:pe,handleMenuBlur:me,handleMenuTabOut:he,handleTriggerClick:ue,handleToggle:ve,handleDeleteOption:ye,handlePatternInput:Se,handleClear:Ce,handleTriggerBlur:de,handleTriggerFocus:fe,handleKeydown:Ee,handleMenuAfterLeave:oe,handleMenuClickOutside:q,handleMenuScroll:we,handleMenuKeydown:Ee,handleMenuMousedown:J,mergedTheme:s,cssVars:a?void 0:X,themeClass:je?.themeClass,onRender:je?.onRender})},render(){return b(`div`,{class:`${this.mergedClsPrefix}-select`},b(et,null,{default:()=>[b(qe,null,{default:()=>b(Qn,{ref:`triggerRef`,inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e;return[(e=this.$slots).arrow?.call(e)]}})}),b(Xe,{ref:`followerRef`,show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Ze.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?`target`:void 0,minWidth:`target`,placement:this.placement},{default:()=>b(fe,{name:`fade-in-scale-up-transition`,appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e;return this.mergedShow||this.displayDirective===`show`?((e=this.onRender)==null||e.call(this),_(b(Rn,Object.assign({},this.menuProps,{ref:`menuRef`,onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,this.menuProps?.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[this.menuProps?.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange,scrollbarProps:this.scrollbarProps}),{empty:()=>{var e;return[(e=this.$slots).empty?.call(e)]},header:()=>{var e;return[(e=this.$slots).header?.call(e)]},action:()=>{var e;return[(e=this.$slots).action?.call(e)]}}),this.displayDirective===`show`?[[se,this.mergedShow],[k,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[k,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),br={feedbackPadding:`4px 0 0 2px`,feedbackHeightSmall:`24px`,feedbackHeightMedium:`24px`,feedbackHeightLarge:`26px`,feedbackFontSizeSmall:`13px`,feedbackFontSizeMedium:`14px`,feedbackFontSizeLarge:`14px`,labelFontSizeLeftSmall:`14px`,labelFontSizeLeftMedium:`14px`,labelFontSizeLeftLarge:`15px`,labelFontSizeTopSmall:`13px`,labelFontSizeTopMedium:`14px`,labelFontSizeTopLarge:`14px`,labelHeightSmall:`24px`,labelHeightMedium:`26px`,labelHeightLarge:`28px`,labelPaddingVertical:`0 0 6px 2px`,labelPaddingHorizontal:`0 12px 0 0`,labelTextAlignVertical:`left`,labelTextAlignHorizontal:`right`,labelFontWeight:`400`};function xr(e){let{heightSmall:t,heightMedium:n,heightLarge:r,textColor1:i,errorColor:a,warningColor:o,lineHeight:s,textColor3:c}=e;return Object.assign(Object.assign({},br),{blankHeightSmall:t,blankHeightMedium:n,blankHeightLarge:r,lineHeight:s,labelTextColor:i,asteriskColor:a,feedbackTextColorError:a,feedbackTextColorWarning:o,feedbackTextColor:c})}var Sr={name:`Form`,common:V,self:xr};function Cr(e){let{textColorDisabled:t}=e;return{iconColorDisabled:t}}var wr=je({name:`InputNumber`,common:V,peers:{Button:ve,Input:tr},self:Cr});function Tr(e){let{opacityDisabled:t,heightTiny:n,heightSmall:r,heightMedium:i,heightLarge:a,heightHuge:o,primaryColor:s,fontSize:c}=e;return{fontSize:c,textColor:s,sizeTiny:n,sizeSmall:r,sizeMedium:i,sizeLarge:a,sizeHuge:o,color:s,opacitySpinning:t}}var Er={name:`Spin`,common:V,self:Tr},Dr=S(`n-form`),Or=S(`n-form-item-insts`),kr=I(`form`,[U(`inline`,`
|
|
675
|
-
width: 100%;
|
|
676
|
-
display: inline-flex;
|
|
677
|
-
align-items: flex-start;
|
|
678
|
-
align-content: space-around;
|
|
679
|
-
`,[I(`form-item`,{width:`auto`,marginRight:`18px`},[F(`&:last-child`,{marginRight:0})])])]),Ar=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},jr=l({name:`Form`,props:Object.assign(Object.assign({},T.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:`top`},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),setup(e){let{mergedClsPrefixRef:t}=xe(e);T(`Form`,`-form`,kr,Sr,e,t);let n={},r=P(void 0),i=e=>{let t=r.value;(t===void 0||e>=t)&&(r.value=e)};function a(){var e;for(let t of H(n)){let r=n[t];for(let t of r)(e=t.invalidateLabelWidth)==null||e.call(t)}}function o(e){return Ar(this,arguments,void 0,function*(e,t=()=>!0){return yield new Promise((r,i)=>{let a=[];for(let e of H(n)){let r=n[e];for(let e of r)e.path&&a.push(e.internalValidate(null,t))}Promise.all(a).then(t=>{let n=t.some(e=>!e.valid),a=[],o=[];t.forEach(e=>{e.errors?.length&&a.push(e.errors),e.warnings?.length&&o.push(e.warnings)}),e&&e(a.length?a:void 0,{warnings:o.length?o:void 0}),n?i(a.length?a:void 0):r({warnings:o.length?o:void 0})})})})}function s(){for(let e of H(n)){let t=n[e];for(let e of t)e.restoreValidation()}}return Fe(Dr,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:i}),Fe(Or,{formItems:n}),Object.assign({validate:o,restoreValidation:s,invalidateLabelWidth:a},{mergedClsPrefix:t})},render(){let{mergedClsPrefix:e}=this;return b(`form`,{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Mr(){return Mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function Nr(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fr(e,t)}function Pr(e){return Pr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Pr(e)}function Fr(e,t){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fr(e,t)}function Ir(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lr(e,t,n){return Lr=Ir()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Fr(i,n.prototype),i},Lr.apply(null,arguments)}function Rr(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function zr(e){var t=typeof Map==`function`?new Map:void 0;return zr=function(e){if(e===null||!Rr(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Lr(e,arguments,Pr(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fr(n,e)},zr(e)}var Br=/%[sdj%]/g,Vr=function(){};function Hr(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function Ur(e){var t=[...arguments].slice(1),n=0,r=t.length;return typeof e==`function`?e.apply(null,t):typeof e==`string`?e.replace(Br,function(e){if(e===`%%`)return`%`;if(n>=r)return e;switch(e){case`%s`:return String(t[n++]);case`%d`:return Number(t[n++]);case`%j`:try{return JSON.stringify(t[n++])}catch{return`[Circular]`}break;default:return e}}):e}function Wr(e){return e===`string`||e===`url`||e===`hex`||e===`email`||e===`date`||e===`pattern`}function Q(e,t){return!!(e==null||t===`array`&&Array.isArray(e)&&!e.length||Wr(t)&&typeof e==`string`&&!e)}function Gr(e,t,n){var r=[],i=0,a=e.length;function o(e){r.push.apply(r,e||[]),i++,i===a&&n(r)}e.forEach(function(e){t(e,o)})}function Kr(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var s=r;r+=1,s<i?t(e[s],a):n([])}a([])}function qr(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n]||[])}),t}var Jr=function(e){Nr(t,e);function t(t,n){var r=e.call(this,`Async Validation Error`)||this;return r.errors=t,r.fields=n,r}return t}(zr(Error));function Yr(e,t,n,r,i){if(t.first){var a=new Promise(function(t,a){Kr(qr(e),n,function(e){return r(e),e.length?a(new Jr(e,Hr(e))):t(i)})});return a.catch(function(e){return e}),a}var o=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),c=s.length,l=0,u=[],d=new Promise(function(t,a){var d=function(e){if(u.push.apply(u,e),l++,l===c)return r(u),u.length?a(new Jr(u,Hr(u))):t(i)};s.length||(r(u),t(i)),s.forEach(function(t){var r=e[t];o.indexOf(t)===-1?Gr(r,n,d):Kr(r,n,d)})});return d.catch(function(e){return e}),d}function Xr(e){return!!(e&&e.message!==void 0)}function Zr(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function Qr(e,t){return function(n){var r=e.fullFields?Zr(t,e.fullFields):t[n.field||e.fullField];return Xr(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n==`function`?n():n,fieldValue:r,field:n.field||e.fullField}}}function $r(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];typeof r==`object`&&typeof e[n]==`object`?e[n]=Mr({},e[n],r):e[n]=r}}return e}var ei=function(e,t,n,r,i,a){e.required&&(!n.hasOwnProperty(e.field)||Q(t,a||e.type))&&r.push(Ur(i.messages.required,e.fullField))},ti=function(e,t,n,r,i){(/^\s+$/.test(t)||t===``)&&r.push(Ur(i.messages.whitespace,e.fullField))},ni,ri=(function(){if(ni)return ni;var e=`[a-fA-F\\d:]`,t=function(t){return t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=`+e+`)|(?<=`+e+`)(?=\\s|$))`:``},n=`(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}`,r=`[a-fA-F\\d]{1,4}`,i=(`
|
|
680
|
-
(?:
|
|
681
|
-
(?:`+r+`:){7}(?:`+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
682
|
-
(?:`+r+`:){6}(?:`+n+`|:`+r+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
683
|
-
(?:`+r+`:){5}(?::`+n+`|(?::`+r+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|
684
|
-
(?:`+r+`:){4}(?:(?::`+r+`){0,1}:`+n+`|(?::`+r+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|
685
|
-
(?:`+r+`:){3}(?:(?::`+r+`){0,2}:`+n+`|(?::`+r+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|
686
|
-
(?:`+r+`:){2}(?:(?::`+r+`){0,3}:`+n+`|(?::`+r+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|
687
|
-
(?:`+r+`:){1}(?:(?::`+r+`){0,4}:`+n+`|(?::`+r+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
688
|
-
(?::(?:(?::`+r+`){0,5}:`+n+`|(?::`+r+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
689
|
-
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
690
|
-
`).replace(/\s*\/\/.*$/gm,``).replace(/\n/g,``).trim(),a=RegExp(`(?:^`+n+`$)|(?:^`+i+`$)`),o=RegExp(`^`+n+`$`),s=RegExp(`^`+i+`$`),c=function(e){return e&&e.exact?a:RegExp(`(?:`+t(e)+n+t(e)+`)|(?:`+t(e)+i+t(e)+`)`,`g`)};c.v4=function(e){return e&&e.exact?o:RegExp(``+t(e)+n+t(e),`g`)},c.v6=function(e){return e&&e.exact?s:RegExp(``+t(e)+i+t(e),`g`)};var l=`(?:(?:[a-z]+:)?//)`,u=`(?:\\S+(?::\\S*)?@)?`,d=c.v4().source,f=c.v6().source,p=`(?:`+l+`|www\\.)`+u+`(?:localhost|`+d+`|`+f+`|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return ni=RegExp(`(?:^`+p+`$)`,`i`),ni}),ii={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},ai={integer:function(e){return ai.number(e)&&parseInt(e,10)===e},float:function(e){return ai.number(e)&&!ai.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime==`function`&&typeof e.getMonth==`function`&&typeof e.getYear==`function`&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e==`number`},object:function(e){return typeof e==`object`&&!ai.array(e)},method:function(e){return typeof e==`function`},email:function(e){return typeof e==`string`&&e.length<=320&&!!e.match(ii.email)},url:function(e){return typeof e==`string`&&e.length<=2048&&!!e.match(ri())},hex:function(e){return typeof e==`string`&&!!e.match(ii.hex)}},oi=function(e,t,n,r,i){if(e.required&&t===void 0){ei(e,t,n,r,i);return}var a=[`integer`,`float`,`array`,`regexp`,`object`,`method`,`email`,`number`,`date`,`url`,`hex`],o=e.type;a.indexOf(o)>-1?ai[o](t)||r.push(Ur(i.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(Ur(i.messages.types[o],e.fullField,e.type))},si=function(e,t,n,r,i){var a=typeof e.len==`number`,o=typeof e.min==`number`,s=typeof e.max==`number`,c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=t,u=null,d=typeof t==`number`,f=typeof t==`string`,p=Array.isArray(t);if(d?u=`number`:f?u=`string`:p&&(u=`array`),!u)return!1;p&&(l=t.length),f&&(l=t.replace(c,`_`).length),a?l!==e.len&&r.push(Ur(i.messages[u].len,e.fullField,e.len)):o&&!s&&l<e.min?r.push(Ur(i.messages[u].min,e.fullField,e.min)):s&&!o&&l>e.max?r.push(Ur(i.messages[u].max,e.fullField,e.max)):o&&s&&(l<e.min||l>e.max)&&r.push(Ur(i.messages[u].range,e.fullField,e.min,e.max))},ci=`enum`,$={required:ei,whitespace:ti,type:oi,range:si,enum:function(e,t,n,r,i){e[ci]=Array.isArray(e[ci])?e[ci]:[],e[ci].indexOf(t)===-1&&r.push(Ur(i.messages[ci],e.fullField,e[ci].join(`, `)))},pattern:function(e,t,n,r,i){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Ur(i.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern==`string`&&(new RegExp(e.pattern).test(t)||r.push(Ur(i.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},li=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t,`string`)&&!e.required)return n();$.required(e,t,r,a,i,`string`),Q(t,`string`)||($.type(e,t,r,a,i),$.range(e,t,r,a,i),$.pattern(e,t,r,a,i),e.whitespace===!0&&$.whitespace(e,t,r,a,i))}n(a)},ui=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&$.type(e,t,r,a,i)}n(a)},di=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===``&&(t=void 0),Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&($.type(e,t,r,a,i),$.range(e,t,r,a,i))}n(a)},fi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&$.type(e,t,r,a,i)}n(a)},pi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),Q(t)||$.type(e,t,r,a,i)}n(a)},mi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&($.type(e,t,r,a,i),$.range(e,t,r,a,i))}n(a)},hi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&($.type(e,t,r,a,i),$.range(e,t,r,a,i))}n(a)},gi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();$.required(e,t,r,a,i,`array`),t!=null&&($.type(e,t,r,a,i),$.range(e,t,r,a,i))}n(a)},_i=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&$.type(e,t,r,a,i)}n(a)},vi=`enum`,yi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i),t!==void 0&&$[vi](e,t,r,a,i)}n(a)},bi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t,`string`)&&!e.required)return n();$.required(e,t,r,a,i),Q(t,`string`)||$.pattern(e,t,r,a,i)}n(a)},xi=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t,`date`)&&!e.required)return n();if($.required(e,t,r,a,i),!Q(t,`date`)){var o=t instanceof Date?t:new Date(t);$.type(e,o,r,a,i),o&&$.range(e,o.getTime(),r,a,i)}}n(a)},Si=function(e,t,n,r,i){var a=[],o=Array.isArray(t)?`array`:typeof t;$.required(e,t,r,a,i,o),n(a)},Ci=function(e,t,n,r,i){var a=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t,a)&&!e.required)return n();$.required(e,t,r,o,i,a),Q(t,a)||$.type(e,t,r,o,i)}n(o)},wi={string:li,method:ui,number:di,boolean:fi,regexp:pi,integer:mi,float:hi,array:gi,object:_i,enum:yi,pattern:bi,date:xi,url:Ci,hex:Ci,email:Ci,required:Si,any:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Q(t)&&!e.required)return n();$.required(e,t,r,a,i)}n(a)}};function Ti(){return{default:`Validation error on field %s`,required:`%s is required`,enum:`%s must be one of %s`,whitespace:`%s cannot be empty`,date:{format:`%s date %s is invalid for format %s`,parse:`%s date could not be parsed, %s is invalid `,invalid:`%s date %s is invalid`},types:{string:`%s is not a %s`,method:`%s is not a %s (function)`,array:`%s is not an %s`,object:`%s is not an %s`,number:`%s is not a %s`,date:`%s is not a %s`,boolean:`%s is not a %s`,integer:`%s is not an %s`,float:`%s is not a %s`,regexp:`%s is not a valid %s`,email:`%s is not a valid %s`,url:`%s is not a valid %s`,hex:`%s is not a valid %s`},string:{len:`%s must be exactly %s characters`,min:`%s must be at least %s characters`,max:`%s cannot be longer than %s characters`,range:`%s must be between %s and %s characters`},number:{len:`%s must equal %s`,min:`%s cannot be less than %s`,max:`%s cannot be greater than %s`,range:`%s must be between %s and %s`},array:{len:`%s must be exactly %s in length`,min:`%s cannot be less than %s in length`,max:`%s cannot be greater than %s in length`,range:`%s must be between %s and %s in length`},pattern:{mismatch:`%s value %s does not match pattern %s`},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Ei=Ti(),Di=function(){function e(e){this.rules=null,this._messages=Ei,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw Error(`Cannot configure a schema with no rules`);if(typeof e!=`object`||Array.isArray(e))throw Error(`Rules must be an object`);this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})},t.messages=function(e){return e&&(this._messages=$r(Ti(),e)),this._messages},t.validate=function(t,n,r){var i=this;n===void 0&&(n={}),r===void 0&&(r=function(){});var a=t,o=n,s=r;if(typeof o==`function`&&(s=o,o={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(null,a),Promise.resolve(a);function c(e){var t=[],n={};function r(e){if(Array.isArray(e)){var n;t=(n=t).concat.apply(n,e)}else t.push(e)}for(var i=0;i<e.length;i++)r(e[i]);t.length?(n=Hr(t),s(t,n)):s(null,a)}if(o.messages){var l=this.messages();l===Ei&&(l=Ti()),$r(l,o.messages),o.messages=l}else o.messages=this.messages();var u={};(o.keys||Object.keys(this.rules)).forEach(function(e){var n=i.rules[e],r=a[e];n.forEach(function(n){var o=n;typeof o.transform==`function`&&(a===t&&(a=Mr({},a)),r=a[e]=o.transform(r)),o=typeof o==`function`?{validator:o}:Mr({},o),o.validator=i.getValidationMethod(o),o.validator&&(o.field=e,o.fullField=o.fullField||e,o.type=i.getType(o),u[e]=u[e]||[],u[e].push({rule:o,value:r,source:a,field:e}))})});var d={};return Yr(u,o,function(t,n){var r=t.rule,i=(r.type===`object`||r.type===`array`)&&(typeof r.fields==`object`||typeof r.defaultField==`object`);i&&=r.required||!r.required&&t.value,r.field=t.field;function s(e,t){return Mr({},t,{fullField:r.fullField+`.`+e,fullFields:r.fullFields?[].concat(r.fullFields,[e]):[e]})}function c(c){c===void 0&&(c=[]);var l=Array.isArray(c)?c:[c];!o.suppressWarning&&l.length&&e.warning(`async-validator:`,l),l.length&&r.message!==void 0&&(l=[].concat(r.message));var u=l.map(Qr(r,a));if(o.first&&u.length)return d[r.field]=1,n(u);if(!i)n(u);else{if(r.required&&!t.value)return r.message===void 0?o.error&&(u=[o.error(r,Ur(o.messages.required,r.field))]):u=[].concat(r.message).map(Qr(r,a)),n(u);var f={};r.defaultField&&Object.keys(t.value).map(function(e){f[e]=r.defaultField}),f=Mr({},f,t.rule.fields);var p={};Object.keys(f).forEach(function(e){var t=f[e];p[e]=(Array.isArray(t)?t:[t]).map(s.bind(null,e))});var m=new e(p);m.messages(o.messages),t.rule.options&&(t.rule.options.messages=o.messages,t.rule.options.error=o.error),m.validate(t.value,t.rule.options||o,function(e){var t=[];u&&u.length&&t.push.apply(t,u),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)})}}var l;if(r.asyncValidator)l=r.asyncValidator(r,t.value,c,t.source,o);else if(r.validator){try{l=r.validator(r,t.value,c,t.source,o)}catch(e){console.error==null||console.error(e),o.suppressValidatorError||setTimeout(function(){throw e},0),c(e.message)}l===!0?c():l===!1?c(typeof r.message==`function`?r.message(r.fullField||r.field):r.message||(r.fullField||r.field)+` fails`):l instanceof Array?c(l):l instanceof Error&&c(l.message)}l&&l.then&&l.then(function(){return c()},function(e){return c(e)})},function(e){c(e)},a)},t.getType=function(e){if(e.type===void 0&&e.pattern instanceof RegExp&&(e.type=`pattern`),typeof e.validator!=`function`&&e.type&&!wi.hasOwnProperty(e.type))throw Error(Ur(`Unknown rule type %s`,e.type));return e.type||`string`},t.getValidationMethod=function(e){if(typeof e.validator==`function`)return e.validator;var t=Object.keys(e),n=t.indexOf(`message`);return n!==-1&&t.splice(n,1),t.length===1&&t[0]===`required`?wi.required:wi[this.getType(e)]||void 0},e}();Di.register=function(e,t){if(typeof t!=`function`)throw Error(`Cannot register a validator by type, validator is not a function`);wi[e]=t},Di.warning=Vr,Di.messages=Ei,Di.validators=wi;var{cubicBezierEaseInOut:Oi}=Ae;function ki({name:e=`fade-down`,fromOffset:t=`-4px`,enterDuration:n=`.3s`,leaveDuration:r=`.3s`,enterCubicBezier:i=Oi,leaveCubicBezier:a=Oi}={}){return[F(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${t})`}),F(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:`translateY(0)`}),F(`&.${e}-transition-leave-active`,{transition:`opacity ${r} ${a}, transform ${r} ${a}`}),F(`&.${e}-transition-enter-active`,{transition:`opacity ${n} ${i}, transform ${n} ${i}`})]}var Ai=I(`form-item`,`
|
|
691
|
-
display: grid;
|
|
692
|
-
line-height: var(--n-line-height);
|
|
693
|
-
`,[I(`form-item-label`,`
|
|
694
|
-
grid-area: label;
|
|
695
|
-
align-items: center;
|
|
696
|
-
line-height: 1.25;
|
|
697
|
-
text-align: var(--n-label-text-align);
|
|
698
|
-
font-size: var(--n-label-font-size);
|
|
699
|
-
min-height: var(--n-label-height);
|
|
700
|
-
padding: var(--n-label-padding);
|
|
701
|
-
color: var(--n-label-text-color);
|
|
702
|
-
transition: color .3s var(--n-bezier);
|
|
703
|
-
box-sizing: border-box;
|
|
704
|
-
font-weight: var(--n-label-font-weight);
|
|
705
|
-
`,[t(`asterisk`,`
|
|
706
|
-
white-space: nowrap;
|
|
707
|
-
user-select: none;
|
|
708
|
-
-webkit-user-select: none;
|
|
709
|
-
color: var(--n-asterisk-color);
|
|
710
|
-
transition: color .3s var(--n-bezier);
|
|
711
|
-
`),t(`asterisk-placeholder`,`
|
|
712
|
-
grid-area: mark;
|
|
713
|
-
user-select: none;
|
|
714
|
-
-webkit-user-select: none;
|
|
715
|
-
visibility: hidden;
|
|
716
|
-
`)]),I(`form-item-blank`,`
|
|
717
|
-
grid-area: blank;
|
|
718
|
-
min-height: var(--n-blank-height);
|
|
719
|
-
`),U(`auto-label-width`,[I(`form-item-label`,`white-space: nowrap;`)]),U(`left-labelled`,`
|
|
720
|
-
grid-template-areas:
|
|
721
|
-
"label blank"
|
|
722
|
-
"label feedback";
|
|
723
|
-
grid-template-columns: auto minmax(0, 1fr);
|
|
724
|
-
grid-template-rows: auto 1fr;
|
|
725
|
-
align-items: flex-start;
|
|
726
|
-
`,[I(`form-item-label`,`
|
|
727
|
-
display: grid;
|
|
728
|
-
grid-template-columns: 1fr auto;
|
|
729
|
-
min-height: var(--n-blank-height);
|
|
730
|
-
height: auto;
|
|
731
|
-
box-sizing: border-box;
|
|
732
|
-
flex-shrink: 0;
|
|
733
|
-
flex-grow: 0;
|
|
734
|
-
`,[U(`reverse-columns-space`,`
|
|
735
|
-
grid-template-columns: auto 1fr;
|
|
736
|
-
`),U(`left-mark`,`
|
|
737
|
-
grid-template-areas:
|
|
738
|
-
"mark text"
|
|
739
|
-
". text";
|
|
740
|
-
`),U(`right-mark`,`
|
|
741
|
-
grid-template-areas:
|
|
742
|
-
"text mark"
|
|
743
|
-
"text .";
|
|
744
|
-
`),U(`right-hanging-mark`,`
|
|
745
|
-
grid-template-areas:
|
|
746
|
-
"text mark"
|
|
747
|
-
"text .";
|
|
748
|
-
`),t(`text`,`
|
|
749
|
-
grid-area: text;
|
|
750
|
-
`),t(`asterisk`,`
|
|
751
|
-
grid-area: mark;
|
|
752
|
-
align-self: end;
|
|
753
|
-
`)])]),U(`top-labelled`,`
|
|
754
|
-
grid-template-areas:
|
|
755
|
-
"label"
|
|
756
|
-
"blank"
|
|
757
|
-
"feedback";
|
|
758
|
-
grid-template-rows: minmax(var(--n-label-height), auto) 1fr;
|
|
759
|
-
grid-template-columns: minmax(0, 100%);
|
|
760
|
-
`,[U(`no-label`,`
|
|
761
|
-
grid-template-areas:
|
|
762
|
-
"blank"
|
|
763
|
-
"feedback";
|
|
764
|
-
grid-template-rows: 1fr;
|
|
765
|
-
`),I(`form-item-label`,`
|
|
766
|
-
display: flex;
|
|
767
|
-
align-items: flex-start;
|
|
768
|
-
justify-content: var(--n-label-text-align);
|
|
769
|
-
`)]),I(`form-item-blank`,`
|
|
770
|
-
box-sizing: border-box;
|
|
771
|
-
display: flex;
|
|
772
|
-
align-items: center;
|
|
773
|
-
position: relative;
|
|
774
|
-
`),I(`form-item-feedback-wrapper`,`
|
|
775
|
-
grid-area: feedback;
|
|
776
|
-
box-sizing: border-box;
|
|
777
|
-
min-height: var(--n-feedback-height);
|
|
778
|
-
font-size: var(--n-feedback-font-size);
|
|
779
|
-
line-height: 1.25;
|
|
780
|
-
transform-origin: top left;
|
|
781
|
-
`,[F(`&:not(:empty)`,`
|
|
782
|
-
padding: var(--n-feedback-padding);
|
|
783
|
-
`),I(`form-item-feedback`,{transition:`color .3s var(--n-bezier)`,color:`var(--n-feedback-text-color)`},[U(`warning`,{color:`var(--n-feedback-text-color-warning)`}),U(`error`,{color:`var(--n-feedback-text-color-error)`}),ki({fromOffset:`-3px`,enterDuration:`.3s`,leaveDuration:`.2s`})])])]);function ji(e){let t=de(Dr,null),{mergedComponentPropsRef:n}=xe(e);return{mergedSize:Y(()=>e.size===void 0?t?.props.size===void 0?n?.value?.Form?.size||`medium`:t.props.size:e.size)}}function Mi(e){let t=de(Dr,null),n=Y(()=>{let{labelPlacement:n}=e;return n===void 0?t?.props.labelPlacement?t.props.labelPlacement:`top`:n}),r=Y(()=>n.value===`left`&&(e.labelWidth===`auto`||t?.props.labelWidth===`auto`)),i=Y(()=>{if(n.value===`top`)return;let{labelWidth:i}=e;if(i!==void 0&&i!==`auto`)return Ge(i);if(r.value){let e=t?.maxChildLabelWidthRef.value;return e===void 0?void 0:Ge(e)}if(t?.props.labelWidth!==void 0)return Ge(t.props.labelWidth)}),a=Y(()=>{let{labelAlign:n}=e;if(n)return n;if(t?.props.labelAlign)return t.props.labelAlign}),o=Y(()=>[e.labelProps?.style,e.labelStyle,{width:i.value}]),s=Y(()=>{let{showRequireMark:n}=e;return n===void 0?t?.props.showRequireMark:n}),c=Y(()=>{let{requireMarkPlacement:n}=e;return n===void 0?t?.props.requireMarkPlacement||`right`:n}),l=P(!1),u=P(!1);return{validationErrored:l,validationWarned:u,mergedLabelStyle:o,mergedLabelPlacement:n,mergedLabelAlign:a,mergedShowRequireMark:s,mergedRequireMarkPlacement:c,mergedValidationStatus:Y(()=>{let{validationStatus:t}=e;if(t!==void 0)return t;if(l.value)return`error`;if(u.value)return`warning`}),mergedShowFeedback:Y(()=>{let{showFeedback:n}=e;return n===void 0?t?.props.showFeedback===void 0?!0:t.props.showFeedback:n}),mergedShowLabel:Y(()=>{let{showLabel:n}=e;return n===void 0?t?.props.showLabel===void 0?!0:t.props.showLabel:n}),isAutoLabelWidth:r}}function Ni(e){let t=de(Dr,null),n=Y(()=>{let{rulePath:t}=e;if(t!==void 0)return t;let{path:n}=e;if(n!==void 0)return n}),r=Y(()=>{let r=[],{rule:i}=e;if(i!==void 0&&(Array.isArray(i)?r.push(...i):r.push(i)),t){let{rules:e}=t.props,{value:i}=n;if(e!==void 0&&i!==void 0){let t=nt(e,i);t!==void 0&&(Array.isArray(t)?r.push(...t):r.push(t))}}return r}),i=Y(()=>r.value.some(e=>e.required));return{mergedRules:r,mergedRequired:Y(()=>i.value||e.required)}}var Pi=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},Fi=Object.assign(Object.assign({},T.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object,contentClass:String,contentStyle:[String,Object]});H(Fi);function Ii(e,t){return(...n)=>{try{let r=e(...n);return!t&&(typeof r==`boolean`||r instanceof Error||Array.isArray(r))||r?.then?r:(r===void 0||L(`form-item/validate`,`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(e){L(`form-item/validate`,"An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(e);return}}}var Li=l({name:`FormItem`,props:Fi,slots:Object,setup(t){ht(Or,`formItems`,e(t,`path`));let{mergedClsPrefixRef:n,inlineThemeDisabled:r}=xe(t),i=de(Dr,null),a=ji(t),o=Mi(t),{validationErrored:s,validationWarned:c}=o,{mergedRequired:l,mergedRules:u}=Ni(t),{mergedSize:d}=a,{mergedLabelPlacement:f,mergedLabelAlign:p,mergedRequireMarkPlacement:m}=o,g=P([]),_=P(ee()),v=P(null),y=i?e(i.props,`disabled`):P(!1),b=T(`Form`,`-form-item`,Ai,Sr,t,n);A(e(t,`path`),()=>{t.ignorePathChange||S()});function x(){if(!o.isAutoLabelWidth.value)return;let e=v.value;if(e!==null){let t=e.style.whiteSpace;e.style.whiteSpace=`nowrap`,e.style.width=``,i?.deriveMaxChildLabelWidth(Number(getComputedStyle(e).width.slice(0,-2))),e.style.whiteSpace=t}}function S(){g.value=[],s.value=!1,c.value=!1,t.feedback&&(_.value=ee())}let C=(...e)=>Pi(this,[...e],void 0,function*(e=null,n=()=>!0,r={suppressWarning:!0}){let{path:a}=t;r?r.first||=t.first:r={};let{value:o}=u,l=i?nt(i.props.model,a||``):void 0,d={},f={},p=(e?o.filter(t=>Array.isArray(t.trigger)?t.trigger.includes(e):t.trigger===e):o).filter(n).map((e,t)=>{let n=Object.assign({},e);if(n.validator&&=Ii(n.validator,!1),n.asyncValidator&&=Ii(n.asyncValidator,!0),n.renderMessage){let e=`__renderMessage__${t}`;f[e]=n.message,n.message=e,d[e]=n.renderMessage}return n}),m=p.filter(e=>e.level!==`warning`),h=p.filter(e=>e.level===`warning`),_={valid:!0,errors:void 0,warnings:void 0};if(!p.length)return _;let v=a??`__n_no_path__`,y=new Di({[v]:m}),b=new Di({[v]:h}),{validateMessages:x}=i?.props||{};x&&(y.messages(x),b.messages(x));let C=e=>{g.value=e.map(e=>{let t=e?.message||``;return{key:t,render:()=>t.startsWith(`__renderMessage__`)?d[t]():t}}),e.forEach(e=>{e.message?.startsWith(`__renderMessage__`)&&(e.message=f[e.message])})};if(m.length){let e=yield new Promise(e=>{y.validate({[v]:l},r,e)});e?.length&&(_.valid=!1,_.errors=e,C(e))}if(h.length&&!_.errors){let e=yield new Promise(e=>{b.validate({[v]:l},r,e)});e?.length&&(C(e),_.warnings=e)}return!_.errors&&!_.warnings?S():(s.value=!!_.errors,c.value=!!_.warnings),_});function w(){C(`blur`)}function E(){C(`change`)}function D(){C(`focus`)}function O(){C(`input`)}function k(e,t){return Pi(this,void 0,void 0,function*(){let n,r,i,a;return typeof e==`string`?(n=e,r=t):typeof e==`object`&&e&&(n=e.trigger,r=e.callback,i=e.shouldRuleBeApplied,a=e.options),yield new Promise((e,t)=>{C(n,i,a).then(({valid:n,errors:i,warnings:a})=>{n?(r&&r(void 0,{warnings:a}),e({warnings:a})):(r&&r(i,{warnings:a}),t(i))})})})}Fe(G,{path:e(t,`path`),disabled:y,mergedSize:a.mergedSize,mergedValidationStatus:o.mergedValidationStatus,restoreValidation:S,handleContentBlur:w,handleContentChange:E,handleContentFocus:D,handleContentInput:O});let j={validate:k,restoreValidation:S,internalValidate:C,invalidateLabelWidth:x};h(x);let M=Y(()=>{let{value:e}=d,{value:t}=f,n=t===`top`?`vertical`:`horizontal`,{common:{cubicBezierEaseInOut:r},self:{labelTextColor:i,asteriskColor:a,lineHeight:o,feedbackTextColor:s,feedbackTextColorWarning:c,feedbackTextColorError:l,feedbackPadding:u,labelFontWeight:m,[q(`labelHeight`,e)]:h,[q(`blankHeight`,e)]:g,[q(`feedbackFontSize`,e)]:_,[q(`feedbackHeight`,e)]:v,[q(`labelPadding`,n)]:y,[q(`labelTextAlign`,n)]:x,[q(q(`labelFontSize`,t),e)]:S}}=b.value,C=p.value??x;return t===`top`&&(C=C===`right`?`flex-end`:`flex-start`),{"--n-bezier":r,"--n-line-height":o,"--n-blank-height":g,"--n-label-font-size":S,"--n-label-text-align":C,"--n-label-height":h,"--n-label-padding":y,"--n-label-font-weight":m,"--n-asterisk-color":a,"--n-label-text-color":i,"--n-feedback-padding":u,"--n-feedback-font-size":_,"--n-feedback-height":v,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":c,"--n-feedback-text-color-error":l}}),N=r?_e(`form-item`,Y(()=>`${d.value[0]}${f.value[0]}${p.value?.[0]||``}`),M,t):void 0,F=Y(()=>f.value===`left`&&m.value===`left`&&p.value===`left`);return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:v,mergedClsPrefix:n,mergedRequired:l,feedbackId:_,renderExplains:g,reverseColSpace:F},o),a),j),{cssVars:r?void 0:M,themeClass:N?.themeClass,onRender:N?.onRender})},render(){let{$slots:e,mergedClsPrefix:t,mergedShowLabel:n,mergedShowRequireMark:r,mergedRequireMarkPlacement:i,onRender:a}=this,o=r===void 0?this.mergedRequired:r;return a?.(),b(`div`,{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!n&&`${t}-form-item--no-label`],style:this.cssVars},n&&(()=>{let e=this.$slots.label?this.$slots.label():this.label;if(!e)return null;let n=b(`span`,{class:`${t}-form-item-label__text`},e),r=o?b(`span`,{class:`${t}-form-item-label__asterisk`},i===`left`?`*\xA0`:`\xA0*`):i===`right-hanging`&&b(`span`,{class:`${t}-form-item-label__asterisk-placeholder`},`\xA0*`),{labelProps:a}=this;return b(`label`,Object.assign({},a,{class:[a?.class,`${t}-form-item-label`,`${t}-form-item-label--${i}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:`labelElementRef`}),i===`left`?[r,n]:[n,r])})(),b(`div`,{class:[`${t}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`],style:this.contentStyle},e),this.mergedShowFeedback?b(`div`,{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},b(fe,{name:`fade-down-transition`,mode:`out-in`},{default:()=>{let{mergedValidationStatus:n}=this;return De(e.feedback,e=>{let{feedback:r}=this,i=e||r?b(`div`,{key:`__feedback__`,class:`${t}-form-item-feedback__line`},e||r):this.renderExplains.length?this.renderExplains?.map(({key:e,render:n})=>b(`div`,{key:e,class:`${t}-form-item-feedback__line`},n())):null;return i?n===`warning`?b(`div`,{key:`controlled-warning`,class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},i):n===`error`?b(`div`,{key:`controlled-error`,class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},i):n===`success`?b(`div`,{key:`controlled-success`,class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},i):b(`div`,{key:`controlled-default`,class:`${t}-form-item-feedback`},i):null})}})):null)}}),Ri=F([I(`input-number-suffix`,`
|
|
784
|
-
display: inline-block;
|
|
785
|
-
margin-right: 10px;
|
|
786
|
-
`),I(`input-number-prefix`,`
|
|
787
|
-
display: inline-block;
|
|
788
|
-
margin-left: 10px;
|
|
789
|
-
`)]);function zi(e){return e==null||typeof e==`string`&&e.trim()===``?null:Number(e)}function Bi(e){return e.includes(`.`)&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e===`-`||e===`-0`}function Vi(e){return e==null?!0:!Number.isNaN(e)}function Hi(e,t){return typeof e==`number`?t===void 0?String(e):e.toFixed(t):``}function Ui(e){if(e===null)return null;if(typeof e==`number`)return e;{let t=Number(e);return Number.isNaN(t)?null:t}}var Wi=800,Gi=100,Ki=l({name:`InputNumber`,props:Object.assign(Object.assign({},T.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:`right`},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),slots:Object,setup(t){let{mergedBorderedRef:n,mergedClsPrefixRef:r,mergedRtlRef:a,mergedComponentPropsRef:o}=xe(t),s=T(`InputNumber`,`-input-number`,Ri,wr,t,r),{localeRef:c}=$e(`InputNumber`),l=Te(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:o?.value?.InputNumber?.size||`medium`}}),{mergedSizeRef:u,mergedDisabledRef:d,mergedStatusRef:f}=l,p=P(null),m=P(null),h=P(null),g=P(t.defaultValue),_=at(e(t,`value`),g),v=P(``),y=e=>{let t=String(e).split(`.`)[1];return t?t.length:0},b=e=>{let n=[t.min,t.max,t.step,e].map(e=>e===void 0?0:y(e));return Math.max(...n)},x=w(()=>{let{placeholder:e}=t;return e===void 0?c.value.placeholder:e}),S=w(()=>{let e=Ui(t.step);return e===null||e===0?1:Math.abs(e)}),C=w(()=>{let e=Ui(t.min);return e===null?null:e}),E=w(()=>{let e=Ui(t.max);return e===null?null:e}),O=()=>{let{value:e}=_;if(Vi(e)){let{format:n,precision:r}=t;n?v.value=n(e):e===null||r===void 0||y(e)>r?v.value=Hi(e,void 0):v.value=Hi(e,r)}else v.value=String(e)};O();let k=e=>{let{value:n}=_;if(e===n){O();return}let{"onUpdate:value":r,onUpdateValue:i,onChange:a}=t,{nTriggerFormInput:o,nTriggerFormChange:s}=l;a&&K(a,e),i&&K(i,e),r&&K(r,e),g.value=e,o(),s()},j=({offset:e,doUpdateIfValid:n,fixPrecision:r,isInputing:i})=>{let{value:a}=v;if(i&&Bi(a))return!1;let o=(t.parse||zi)(a);if(o===null)return n&&k(null),null;if(Vi(o)){let a=y(o),{precision:s}=t;if(s!==void 0&&s<a&&!r)return!1;let c=Number.parseFloat((o+e).toFixed(s??b(o)));if(Vi(c)){let{value:e}=E,{value:r}=C;if(e!==null&&c>e){if(!n||i)return!1;c=e}if(r!==null&&c<r){if(!n||i)return!1;c=r}return t.validator&&!t.validator(c)?!1:(n&&k(c),c)}}return!1},ee=w(()=>j({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),M=w(()=>{let{value:e}=_;if(t.validator&&e===null)return!1;let{value:n}=S;return j({offset:-n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),F=w(()=>{let{value:e}=_;if(t.validator&&e===null)return!1;let{value:n}=S;return j({offset:+n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function I(e){let{onFocus:n}=t,{nTriggerFormFocus:r}=l;n&&K(n,e),r()}function L(e){if(e.target===p.value?.wrapperElRef)return;let n=j({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(n!==!1){let e=p.value?.inputElRef;e&&(e.value=String(n||``)),_.value===n&&O()}else O();let{onBlur:r}=t,{nTriggerFormBlur:i}=l;r&&K(r,e),i(),ue(()=>{O()})}function te(e){let{onClear:n}=t;n&&K(n,e)}function ne(){let{value:e}=F;if(!e){oe();return}let{value:n}=_;if(n===null)t.validator||k(ie());else{let{value:e}=S;j({offset:e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function R(){let{value:e}=M;if(!e){W();return}let{value:n}=_;if(n===null)t.validator||k(ie());else{let{value:e}=S;j({offset:-e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}let z=I,re=L;function ie(){if(t.validator)return null;let{value:e}=C,{value:n}=E;return e===null?n===null?0:Math.min(0,n):Math.max(0,e)}function ae(e){te(e),k(null)}function B(e){var t;h.value?.$el.contains(e.target)&&e.preventDefault(),m.value?.$el.contains(e.target)&&e.preventDefault(),(t=p.value)==null||t.activate()}let V=null,H=null,U=null;function W(){U&&=(window.clearTimeout(U),null),V&&=(window.clearInterval(V),null)}let G=null;function oe(){G&&=(window.clearTimeout(G),null),H&&=(window.clearInterval(H),null)}function se(){W(),U=window.setTimeout(()=>{V=window.setInterval(()=>{R()},Gi)},Wi),i(`mouseup`,document,W,{once:!0})}function ce(){oe(),G=window.setTimeout(()=>{H=window.setInterval(()=>{ne()},Gi)},Wi),i(`mouseup`,document,oe,{once:!0})}let le=()=>{H||ne()},de=()=>{V||R()};function fe(e){var n;if(e.key===`Enter`){if(e.target===p.value?.wrapperElRef)return;j({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((n=p.value)==null||n.deactivate())}else if(e.key===`ArrowUp`){if(!F.value||t.keyboard.ArrowUp===!1)return;e.preventDefault(),j({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&ne()}else if(e.key===`ArrowDown`){if(!M.value||t.keyboard.ArrowDown===!1)return;e.preventDefault(),j({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&R()}}function pe(e){v.value=e,t.updateValueOnInput&&!t.format&&!t.parse&&t.precision===void 0&&j({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}A(_,()=>{O()});let me={focus:()=>p.value?.focus(),blur:()=>p.value?.blur(),select:()=>p.value?.select()},he=D(`InputNumber`,a,r);return Object.assign(Object.assign({},me),{rtlEnabled:he,inputInstRef:p,minusButtonInstRef:m,addButtonInstRef:h,mergedClsPrefix:r,mergedBordered:n,uncontrolledValue:g,mergedValue:_,mergedPlaceholder:x,displayedValueInvalid:ee,mergedSize:u,mergedDisabled:d,displayedValue:v,addable:F,minusable:M,mergedStatus:f,handleFocus:z,handleBlur:re,handleClear:ae,handleMouseDown:B,handleAddClick:le,handleMinusClick:de,handleAddMousedown:ce,handleMinusMousedown:se,handleKeyDown:fe,handleUpdateDisplayedValue:pe,mergedTheme:s,inputThemeOverrides:{paddingSmall:`0 8px 0 10px`,paddingMedium:`0 8px 0 12px`,paddingLarge:`0 8px 0 14px`},buttonThemeOverrides:Y(()=>{let{self:{iconColorDisabled:e}}=s.value,[t,n,r,i]=N(e);return{textColorTextDisabled:`rgb(${t}, ${n}, ${r})`,opacityDisabled:`${i}`}})})},render(){let{mergedClsPrefix:e,$slots:t}=this,n=()=>b(te,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:`minusButtonInstRef`},{icon:()=>B(t[`minus-icon`],()=>[b(R,{clsPrefix:e},{default:()=>b(Bt,null)})])}),r=()=>b(te,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:`addButtonInstRef`},{icon:()=>B(t[`add-icon`],()=>[b(R,{clsPrefix:e},{default:()=>b(Nt,null)})])});return b(`div`,{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},b(lr,{ref:`inputInstRef`,autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?`line-through`:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>this.showButton&&this.buttonPlacement===`both`?[n(),De(t.prefix,t=>t?b(`span`,{class:`${e}-input-number-prefix`},t):null)]:t.prefix?.call(t),suffix:()=>this.showButton?[De(t.suffix,t=>t?b(`span`,{class:`${e}-input-number-suffix`},t):null),this.buttonPlacement===`right`?n():null,r()]:t.suffix?.call(t)}))}}),qi=F([F(`@keyframes spin-rotate`,`
|
|
790
|
-
from {
|
|
791
|
-
transform: rotate(0);
|
|
792
|
-
}
|
|
793
|
-
to {
|
|
794
|
-
transform: rotate(360deg);
|
|
795
|
-
}
|
|
796
|
-
`),I(`spin-container`,`
|
|
797
|
-
position: relative;
|
|
798
|
-
`,[I(`spin-body`,`
|
|
799
|
-
position: absolute;
|
|
800
|
-
top: 50%;
|
|
801
|
-
left: 50%;
|
|
802
|
-
transform: translateX(-50%) translateY(-50%);
|
|
803
|
-
`,[oe()])]),I(`spin-body`,`
|
|
804
|
-
display: inline-flex;
|
|
805
|
-
align-items: center;
|
|
806
|
-
justify-content: center;
|
|
807
|
-
flex-direction: column;
|
|
808
|
-
`),I(`spin`,`
|
|
809
|
-
display: inline-flex;
|
|
810
|
-
height: var(--n-size);
|
|
811
|
-
width: var(--n-size);
|
|
812
|
-
font-size: var(--n-size);
|
|
813
|
-
color: var(--n-color);
|
|
814
|
-
`,[U(`rotate`,`
|
|
815
|
-
animation: spin-rotate 2s linear infinite;
|
|
816
|
-
`)]),I(`spin-description`,`
|
|
817
|
-
display: inline-block;
|
|
818
|
-
font-size: var(--n-font-size);
|
|
819
|
-
color: var(--n-text-color);
|
|
820
|
-
transition: color .3s var(--n-bezier);
|
|
821
|
-
margin-top: 8px;
|
|
822
|
-
`),I(`spin-content`,`
|
|
823
|
-
opacity: 1;
|
|
824
|
-
transition: opacity .3s var(--n-bezier);
|
|
825
|
-
pointer-events: all;
|
|
826
|
-
`,[U(`spinning`,`
|
|
827
|
-
user-select: none;
|
|
828
|
-
-webkit-user-select: none;
|
|
829
|
-
pointer-events: none;
|
|
830
|
-
opacity: var(--n-opacity-spinning);
|
|
831
|
-
`)])]),Ji={small:20,medium:18,large:16},Yi=l({name:`Spin`,props:Object.assign(Object.assign(Object.assign({},T.props),{contentClass:String,contentStyle:[Object,String],description:String,size:{type:[String,Number],default:`medium`},show:{type:Boolean,default:!0},rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),me),slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=xe(e),r=T(`Spin`,`-spin`,qi,Er,e,t),i=Y(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:i}=r.value,{opacitySpinning:a,color:o,textColor:s}=i;return{"--n-bezier":n,"--n-opacity-spinning":a,"--n-size":typeof t==`number`?be(t):i[q(`size`,t)],"--n-color":o,"--n-text-color":s}}),a=n?_e(`spin`,Y(()=>{let{size:t}=e;return typeof t==`number`?String(t):t[0]}),i,e):void 0,o=Ue(e,[`spinning`,`show`]),s=P(!1);return M(t=>{let n;if(o.value){let{delay:r}=e;if(r){n=window.setTimeout(()=>{s.value=!0},r),t(()=>{clearTimeout(n)});return}}s.value=o.value}),{mergedClsPrefix:t,active:s,mergedStrokeWidth:Y(()=>{let{strokeWidth:t}=e;if(t!==void 0)return t;let{size:n}=e;return Ji[typeof n==`number`?`medium`:n]}),cssVars:n?void 0:i,themeClass:a?.themeClass,onRender:a?.onRender}},render(){var e;let{$slots:t,mergedClsPrefix:n,description:r}=this,i=t.icon&&this.rotate,a=(r||t.description)&&b(`div`,{class:`${n}-spin-description`},r||t.description?.call(t)),o=t.icon?b(`div`,{class:[`${n}-spin-body`,this.themeClass]},b(`div`,{class:[`${n}-spin`,i&&`${n}-spin--rotate`],style:t.default?``:this.cssVars},t.icon()),a):b(`div`,{class:[`${n}-spin-body`,this.themeClass]},b(ye,{clsPrefix:n,style:t.default?``:this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,radius:this.radius,scale:this.scale,class:`${n}-spin`}),a);return(e=this.onRender)==null||e.call(this),t.default?b(`div`,{class:[`${n}-spin-container`,this.themeClass],style:this.cssVars},b(`div`,{class:[`${n}-spin-content`,this.active&&`${n}-spin-content--spinning`,this.contentClass],style:this.contentStyle},t),b(fe,{name:`fade-in-transition`},{default:()=>this.active?o:null})):o}});function Xi(e,t){return e.job_id===t||e.id===t}var Zi=ae(`jobs`,()=>{let e=P([]),t=P(!1);async function n(){t.value=!0;try{e.value=await lt()}catch(e){console.error(`Failed to fetch jobs:`,e)}finally{t.value=!1}}async function r(t){let n=await pt(t);return e.value.unshift(n),n}async function i(t,n){let r=await ct(t,n),i=e.value.findIndex(e=>Xi(e,t));return i!==-1&&(e.value[i]=r),r}async function a(t){await ut(t),e.value=e.value.filter(e=>!Xi(e,t))}async function o(t){let n=await st(t),r=e.value.findIndex(e=>Xi(e,t));r!==-1&&(e.value[r]=n)}async function s(t){let n=await dt(t),r=e.value.findIndex(e=>Xi(e,t));r!==-1&&(e.value[r]=n)}async function c(t){let n=await ft(t),r=e.value.findIndex(e=>Xi(e,t));r!==-1&&(e.value[r]=n)}return{jobs:e,loading:t,fetchJobs:n,createJob:r,updateJob:i,deleteJob:a,pauseJob:o,resumeJob:s,runJob:c}}),Qi={class:`job-card`},$i={class:`card-header`},ea={class:`job-name`},ta={class:`card-body`},na={class:`info-row`},ra={class:`info-value mono`},ia={class:`info-row`},aa={class:`info-value`},oa={class:`info-row`},sa={class:`info-value`},ca={class:`info-row`},la={class:`info-value`},ua={key:0,class:`info-row`},da={class:`info-value`},fa={class:`card-actions`},pa=Ce(l({__name:`JobCard`,props:{job:{}},emits:[`edit`],setup(e,{emit:t}){let n=e,r=t,i=Zi(),a=rt(),o=Y(()=>n.job.job_id||n.job.id),s=Y(()=>n.job.state===`running`?`Running`:n.job.state===`paused`?`Paused`:n.job.enabled?`Scheduled`:`Disabled`),c=Y(()=>n.job.state===`running`?`info`:n.job.state===`paused`?`warning`:n.job.enabled?`success`:`error`),l=Y(()=>{let e=n.job.schedule;return typeof e==`string`?e:e?.expr||n.job.schedule_display||`—`}),u=e=>e?new Date(e).toLocaleString():`—`;async function d(){try{await i.pauseJob(o.value),a.success(`Job paused`)}catch(e){a.error(e.message)}}async function p(){try{await i.resumeJob(o.value),a.success(`Job resumed`)}catch(e){a.error(e.message)}}async function m(){try{await i.runJob(o.value),a.info(`Job triggered`)}catch(e){a.error(e.message)}}async function h(){try{await i.deleteJob(o.value),a.success(`Job deleted`)}catch(e){a.error(e.message)}}return(t,n)=>(C(),E(`div`,Qi,[Z(`div`,$i,[Z(`h3`,ea,ge(e.job.name),1),Z(`span`,{class:we([`status-badge`,c.value])},ge(s.value),3)]),Z(`div`,ta,[Z(`div`,na,[n[1]||=Z(`span`,{class:`info-label`},`Schedule`,-1),Z(`code`,ra,ge(l.value),1)]),Z(`div`,ia,[n[2]||=Z(`span`,{class:`info-label`},`Last Run`,-1),Z(`span`,aa,[X(ge(u(e.job.last_run_at))+` `,1),e.job.last_status?(C(),E(`span`,{key:0,class:we([`run-status`,{ok:e.job.last_status===`ok`,err:e.job.last_status!==`ok`}])},ge(e.job.last_status===`ok`?`OK`:e.job.last_status),3)):Me(``,!0)])]),Z(`div`,oa,[n[3]||=Z(`span`,{class:`info-label`},`Next Run`,-1),Z(`span`,sa,ge(u(e.job.next_run_at)),1)]),Z(`div`,ca,[n[4]||=Z(`span`,{class:`info-label`},`Deliver`,-1),Z(`span`,la,[X(ge(e.job.deliver),1),e.job.origin?(C(),E(he,{key:0},[X(` (`+ge(e.job.origin.platform)+`)`,1)],64)):Me(``,!0)])]),e.job.repeat?(C(),E(`div`,ua,[n[5]||=Z(`span`,{class:`info-label`},`Repeat`,-1),Z(`span`,da,[typeof e.job.repeat==`string`?(C(),E(he,{key:0},[X(ge(e.job.repeat),1)],64)):(C(),E(he,{key:1},[X(ge(e.job.repeat.completed)+` / `+ge(e.job.repeat.times??`∞`),1)],64))])])):Me(``,!0)]),Z(`div`,fa,[e.job.state!==`paused`&&e.job.enabled?(C(),z(W(Qe),{key:0},{trigger:f(()=>[O(W(le),{size:`tiny`,quaternary:``,onClick:d},{default:f(()=>[...n[6]||=[X(`Pause`,-1)]]),_:1})]),default:f(()=>[n[7]||=X(` Pause job `,-1)]),_:1})):e.job.state===`paused`?(C(),z(W(Qe),{key:1},{trigger:f(()=>[O(W(le),{size:`tiny`,quaternary:``,onClick:p},{default:f(()=>[...n[8]||=[X(`Resume`,-1)]]),_:1})]),default:f(()=>[n[9]||=X(` Resume job `,-1)]),_:1})):Me(``,!0),O(W(Qe),null,{trigger:f(()=>[O(W(le),{size:`tiny`,quaternary:``,onClick:m},{default:f(()=>[...n[10]||=[X(`Run Now`,-1)]]),_:1})]),default:f(()=>[n[11]||=X(` Trigger immediately `,-1)]),_:1}),O(W(le),{size:`tiny`,quaternary:``,onClick:n[0]||=e=>r(`edit`,o.value)},{default:f(()=>[...n[12]||=[X(`Edit`,-1)]]),_:1}),O(W(le),{size:`tiny`,quaternary:``,type:`error`,onClick:h},{default:f(()=>[...n[13]||=[X(`Delete`,-1)]]),_:1})])]))}}),[[`__scopeId`,`data-v-63daa2cf`]]),ma={key:0,class:`empty-state`},ha={key:1,class:`jobs-grid`},ga=Ce(l({__name:`JobsPanel`,emits:[`edit`],setup(e,{emit:t}){let n=t,i=Zi();return(e,t)=>W(i).jobs.length===0?(C(),E(`div`,ma,[...t[0]||=[o(`<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" class="empty-icon" data-v-27255c6b><rect x="3" y="4" width="18" height="18" rx="2" ry="2" data-v-27255c6b></rect><line x1="16" y1="2" x2="16" y2="6" data-v-27255c6b></line><line x1="8" y1="2" x2="8" y2="6" data-v-27255c6b></line><line x1="3" y1="10" x2="21" y2="10" data-v-27255c6b></line></svg><p data-v-27255c6b>No scheduled jobs yet. Create one to get started.</p>`,2)]])):(C(),E(`div`,ha,[(C(!0),E(he,null,r(W(i).jobs,e=>(C(),z(pa,{key:e.id,job:e,onEdit:t=>n(`edit`,e.id)},null,8,[`job`,`onEdit`]))),128))]))}}),[[`__scopeId`,`data-v-27255c6b`]]),_a={class:`modal-footer`},va=Ce(l({__name:`JobFormModal`,props:{jobId:{}},emits:[`close`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Zi(),a=rt(),o=P(!0),s=P(!1),c=P({name:``,schedule:``,prompt:``,deliver:`origin`,repeat_times:null}),l=P(null),u=Y(()=>!!n.jobId),d=[{label:`Every minute`,value:`* * * * *`},{label:`Every 5 minutes`,value:`*/5 * * * *`},{label:`Every hour`,value:`0 * * * *`},{label:`Every day at 00:00`,value:`0 0 * * *`},{label:`Every day at 09:00`,value:`0 9 * * *`},{label:`Every Monday at 09:00`,value:`0 9 * * 1`},{label:`Every month 1st at 09:00`,value:`0 9 1 * *`}],p=[{label:`Origin`,value:`origin`},{label:`Local`,value:`local`}];h(async()=>{if(n.jobId)try{let{getJob:e}=await Le(async()=>{let{getJob:e}=await import(`./jobs-Cuol6Mqb.js`).then(e=>e.r);return{getJob:e}},__vite__mapDeps([0,1,2,3,4,5,6])),t=await e(n.jobId);c.value={name:t.name,schedule:typeof t.schedule==`string`?t.schedule:t.schedule?.expr||t.schedule_display||``,prompt:t.prompt,deliver:t.deliver||`origin`,repeat_times:typeof t.repeat==`number`?t.repeat:typeof t.repeat==`object`?t.repeat.times:null}}catch(e){a.error(`Failed to load job: `+e.message)}});async function m(){if(!c.value.name.trim()){a.warning(`Name is required`);return}if(!c.value.schedule.trim()){a.warning(`Schedule is required`);return}s.value=!0;try{let e={name:c.value.name,schedule:c.value.schedule,prompt:c.value.prompt,deliver:c.value.deliver,repeat:c.value.repeat_times??void 0};u.value?(await i.updateJob(n.jobId,e),a.success(`Job updated`)):(await i.createJob(e),a.success(`Job created`)),r(`saved`)}catch(e){a.error(e.message)}finally{s.value=!1}}function g(){o.value=!1,setTimeout(()=>r(`close`),200)}return(e,t)=>(C(),z(W(He),{show:o.value,"onUpdate:show":t[7]||=e=>o.value=e,preset:`card`,title:u.value?`Edit Job`:`Create Job`,style:{width:`520px`},"mask-closable":!s.value,onAfterLeave:t[8]||=e=>r(`close`)},{footer:f(()=>[Z(`div`,_a,[O(W(le),{onClick:g},{default:f(()=>[...t[9]||=[X(`Cancel`,-1)]]),_:1}),O(W(le),{type:`primary`,loading:s.value,onClick:m},{default:f(()=>[X(ge(u.value?`Update`:`Create`),1)]),_:1},8,[`loading`])])]),default:f(()=>[O(W(jr),{"label-placement":`top`},{default:f(()=>[O(W(Li),{label:`Name`,required:``},{default:f(()=>[O(W(lr),{value:c.value.name,"onUpdate:value":t[0]||=e=>c.value.name=e,placeholder:`Job name`,maxlength:`200`,"show-count":``},null,8,[`value`])]),_:1}),O(W(Li),{label:`Schedule (Cron Expression)`,required:``},{default:f(()=>[O(W(lr),{value:c.value.schedule,"onUpdate:value":t[1]||=e=>c.value.schedule=e,placeholder:`e.g. 0 9 * * *`},null,8,[`value`])]),_:1}),O(W(Li),{label:`Quick Presets`},{default:f(()=>[O(W(yr),{value:l.value,"onUpdate:value":[t[2]||=e=>l.value=e,t[3]||=e=>c.value.schedule=e],options:d,placeholder:`Select a preset...`},null,8,[`value`])]),_:1}),O(W(Li),{label:`Prompt`,required:``},{default:f(()=>[O(W(lr),{value:c.value.prompt,"onUpdate:value":t[4]||=e=>c.value.prompt=e,type:`textarea`,placeholder:`The prompt to execute`,rows:4,maxlength:`5000`,"show-count":``},null,8,[`value`])]),_:1}),O(W(Li),{label:`Deliver Target`},{default:f(()=>[O(W(yr),{value:c.value.deliver,"onUpdate:value":t[5]||=e=>c.value.deliver=e,options:p},null,8,[`value`])]),_:1}),O(W(Li),{label:`Repeat Count (optional)`},{default:f(()=>[O(W(Ki),{value:c.value.repeat_times,"onUpdate:value":t[6]||=e=>c.value.repeat_times=e,min:1,placeholder:`Leave empty for infinite`,clearable:``,style:{width:`100%`}},null,8,[`value`])]),_:1})]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-0ca2301e`]]),ya={class:`jobs-view`},ba={class:`jobs-header`},xa={class:`jobs-content`},Sa=Ce(l({__name:`JobsView`,setup(e){let t=Zi(),n=P(!1),r=P(null);h(()=>{t.fetchJobs()});function i(){r.value=null,n.value=!0}function a(e){r.value=e,n.value=!0}function o(){n.value=!1,r.value=null}async function s(){await t.fetchJobs(),o()}return(e,c)=>(C(),E(`div`,ya,[Z(`header`,ba,[c[2]||=Z(`h2`,{class:`header-title`},`Scheduled Jobs`,-1),O(W(le),{type:`primary`,onClick:i},{icon:f(()=>[...c[0]||=[Z(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[Z(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),Z(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:f(()=>[c[1]||=X(` Create Job `,-1)]),_:1})]),Z(`div`,xa,[O(W(Yi),{show:W(t).loading&&W(t).jobs.length===0},{default:f(()=>[O(ga,{onEdit:a})]),_:1},8,[`show`])]),n.value?(C(),z(va,{key:0,"job-id":r.value,onClose:o,onSaved:s},null,8,[`job-id`])):Me(``,!0)]))}}),[[`__scopeId`,`data-v-627362aa`]]);export{Sa as default};
|