|
|
import{r as ur,s as to,c as Re,g as rr,d as ko,a as yo,h as at,b as J,e as tt,f as ld,p as Do,i as Xi,j as Ft,k as Zi}from"./seemly-hKSMrbh9.js";import{A as un,F as so,C as wn,B as ad,D as Go,d as Z,i as ze,g as Tr,E as Xe,G as So,H as M,b as po,o as fr,I as sd,J as Qi,p as De,c as $,K as Ji,L as oo,h as i,T as io,M as Sn,N as ae,O as To,n as lo,P as Ho,Q as nr,R as dd,m as Jn,S as el,U as qr,V as Yr,W as cd,s as ud,X as ol}from"./@vue-M2CzPUka.js";import{r as ei,V as st,a as fd,b as Or,F as zn,c as Fr,d as _r,e as fn,L as $n,f as hd}from"./vueuc-5-iSHcg-.js";import{u as Ve,i as zt,a as pd,b as co,c as Ct,d as vd,e as tl,f as rl,g as gd,o as md}from"./vooks-RlHpQsWY.js";import{m as Ht,u as bd,a as xd,r as Cd,g as nl,k as yd,t as Xr}from"./lodash-es-KEIJqYRD.js";import{m as kr}from"./@emotion-vV6BesBt.js";import{c as wd,a as bt}from"./treemate-hmrDCADh.js";import{c as At,m as Sd,z as Mr}from"./vdirs-gz97tqc5.js";import{S as oi}from"./async-validator-BHjhHa7C.js";import{o as Lo,a as Io}from"./evtd-9ZCiDXyn.js";import{p as zd,u as Dr}from"./@css-render-nQ5vzMKz.js";import{d as $d}from"./date-fns-E8ESfRGG.js";import{C as Rd,e as Pd}from"./css-render-Adblu2bf.js";function Rn(e,o="default",t=[]){const n=e.$slots[o];return n===void 0?t:n()}function mo(e,o=[],t){const r={};return o.forEach(n=>{r[n]=e[n]}),Object.assign(r,t)}function Wt(e,o=[],t){const r={};return Object.getOwnPropertyNames(e).forEach(l=>{o.includes(l)||(r[l]=e[l])}),Object.assign(r,t)}function ot(e,o=!0,t=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&t.push(un(String(r)));return}if(Array.isArray(r)){ot(r,o,t);return}if(r.type===so){if(r.children===null)return;Array.isArray(r.children)&&ot(r.children,o,t)}else{if(r.type===wn&&o)return;t.push(r)}}}),t}function ce(e,...o){if(Array.isArray(e))e.forEach(t=>ce(t,...o));else return e(...o)}function wo(e){return Object.keys(e)}const Qe=(e,...o)=>typeof e=="function"?e(...o):typeof e=="string"?un(e):typeof e=="number"?un(String(e)):null;function qo(e,o){console.error(`[naive/${e}]: ${o}`)}function Wo(e,o){throw new Error(`[naive/${e}]: ${o}`)}function ti(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw Error(`${e} has no smaller size.`)}function il(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function hn(e,o="default",t=void 0){const r=e[o];if(!r)return qo("getFirstSlotVNode",`slot[${o}] is empty`),null;const n=ot(r(t));return n.length===1?n[0]:(qo("getFirstSlotVNode",`slot[${o}] should have exactly one child`),null)}function ll(e){return o=>{o?e.value=o.$el:e.value=null}}function hr(e){return e.some(o=>ad(o)?!(o.type===wn||o.type===so&&!hr(o.children)):!0)?e:null}function ao(e,o){return e&&hr(e())||o()}function pn(e,o,t){return e&&hr(e(o))||t(o)}function je(e,o){const t=e&&hr(e());return o(t||null)}function xt(e){return!(e&&hr(e()))}function tr(e){const o=e.filter(t=>t!==void 0);if(o.length!==0)return o.length===1?o[0]:t=>{e.forEach(r=>{r&&r(t)})}}function kd(e){var o;const t=(o=e.dirs)===null||o===void 0?void 0:o.find(({dir:r})=>r===Go);return!!(t&&t.value===!1)}const vn=Z({render(){var e,o;return(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)}}),Id=/^(\d|\.)+$/,ri=/(\d|\.)+/;function ro(e,{c:o=1,offset:t=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+t)*o;return n===0?"0":`${n}px`}else if(typeof e=="string")if(Id.test(e)){const n=(Number(e)+t)*o;return r?n===0?"0":`${n}px`:`${n}`}else{const n=ri.exec(e);return n?e.replace(ri,String((Number(n[0])+t)*o)):e}return e}function Et(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Bd="n",ir=`.${Bd}-`,Td="__",Od="--",al=Rd(),sl=zd({blockPrefix:ir,elementPrefix:Td,modifierPrefix:Od});al.use(sl);const{c:y,find:P1}=al,{cB:g,cE:w,cM:P,cNotM:Ne}=sl;function Lr(e){return y(({props:{bPrefix:o}})=>`${o||ir}modal, ${o||ir}drawer`,[e])}function Pn(e){return y(({props:{bPrefix:o}})=>`${o||ir}popover`,[e])}function dl(e){return y(({props:{bPrefix:o}})=>`&${o||ir}modal`,e)}const Fd=(...e)=>y(">",[g(...e)]);function N(e,o){return e+(o==="default"?"":o.replace(/^[a-z]/,t=>t.toUpperCase()))}let Zr;function _d(){return Zr===void 0&&(Zr=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Zr}const No=typeof document<"u"&&typeof window<"u",cl=new WeakSet;function Md(e){cl.add(e)}function ul(e){return!cl.has(e)}function Dd(e,o,t){var r;const n=ze(e,null);if(n===null)return;const l=(r=Tr())===null||r===void 0?void 0:r.proxy;Xe(t,a),a(t.value),So(()=>{a(void 0,t.value)});function a(c,u){if(!n)return;const f=n[o];u!==void 0&&s(f,u),c!==void 0&&d(f,c)}function s(c,u){c[u]||(c[u]=[]),c[u].splice(c[u].findIndex(f=>f===l),1)}function d(c,u){c[u]||(c[u]=[]),~c[u].findIndex(f=>f===l)||c[u].push(l)}}function Ld(e,o,t){if(!o)return e;const r=M(e.value);let n=null;return Xe(e,l=>{n!==null&&window.clearTimeout(n),l===!0?t&&!t.value?r.value=!0:n=window.setTimeout(()=>{r.value=!0},o):r.value=!1}),r}const kn="n-internal-select-menu",fl="n-internal-select-menu-body",pr="n-modal-body",hl="n-modal",vr="n-drawer-body",In="n-drawer",Nt="n-popover-body",pl="__disabled__";function Oo(e){const o=ze(pr,null),t=ze(vr,null),r=ze(Nt,null),n=ze(fl,null),l=M();if(typeof document<"u"){l.value=document.fullscreenElement;const a=()=>{l.value=document.fullscreenElement};po(()=>{Lo("fullscreenchange",document,a)}),So(()=>{Io("fullscreenchange",document,a)})}return Ve(()=>{var a;const{to:s}=e;return s!==void 0?s===!1?pl:s===!0?l.value||"body":s:o!=null&&o.value?(a=o.value.$el)!==null&&a!==void 0?a:o.value:t!=null&&t.value?t.value:r!=null&&r.value?r.value:n!=null&&n.value?n.value:s??(l.value||"body")})}Oo.tdkey=pl;Oo.propTo={type:[String,Object,Boolean],default:void 0};let ni=!1;function vl(){if(No&&window.CSS&&!ni&&(ni=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}function gl(e,o){o&&(po(()=>{const{value:t}=e;t&&ei.registerHandler(t,o)}),So(()=>{const{value:t}=e;t&&ei.unregisterHandler(t)}))}let _t=0,ii="",li="",ai="",si="";const di=M("0px");function ml(e){if(typeof document>"u")return;const o=document.documentElement;let t,r=!1;const n=()=>{o.style.marginRight=ii,o.style.overflow=li,o.style.overflowX=ai,o.style.overflowY=si,di.value="0px"};po(()=>{t=Xe(e,l=>{if(l){if(!_t){const a=window.innerWidth-o.offsetWidth;a>0&&(ii=o.style.marginRight,o.style.marginRight=`${a}px`,di.value=`${a}px`),li=o.style.overflow,ai=o.style.overflowX,si=o.style.overflowY,o.style.overflow="hidden",o.style.overflowX="hidden",o.style.overflowY="hidden"}r=!0,_t++}else _t--,_t||n(),r=!1},{immediate:!0})}),So(()=>{t==null||t(),r&&(_t--,_t||n(),r=!1)})}const Bn=M(!1),ci=()=>{Bn.value=!0},ui=()=>{Bn.value=!1};let er=0;const bl=()=>(No&&(fr(()=>{er||(window.addEventListener("compositionstart",ci),window.addEventListener("compositionend",ui)),er++}),So(()=>{er<=1?(window.removeEventListener("compositionstart",ci),window.removeEventListener("compositionend",ui),er=0):er--})),Bn);function Hd(e){const o={isDeactivated:!1};let t=!1;return sd(()=>{if(o.isDeactivated=!1,!t){t=!0;return}e()}),Qi(()=>{o.isDeactivated=!0,t||(t=!0)}),o}const xl=(e,o)=>{if(!e)return;const t=document.createElement("a");t.href=e,o!==void 0&&(t.download=o),document.body.appendChild(t),t.click(),document.body.removeChild(t)},Ir="n-form-item";function rt(e,{defaultSize:o="medium",mergedSize:t,mergedDisabled:r}={}){const n=ze(Ir,null);De(Ir,null);const l=$(t?()=>t(n):()=>{const{size:d}=e;if(d)return d;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return o}),a=$(r?()=>r(n):()=>{const{disabled:d}=e;return d!==void 0?d:n?n.disabled.value:!1}),s=$(()=>{const{status:d}=e;return d||(n==null?void 0:n.mergedValidationStatus.value)});return So(()=>{n&&n.restoreValidation()}),{mergedSizeRef:l,mergedDisabledRef:a,mergedStatusRef:s,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const zo={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Ad,fontFamily:Ed,lineHeight:jd}=zo,Cl=y("body",`
|
|
|
margin: 0;
|
|
|
font-size: ${Ad};
|
|
|
font-family: ${Ed};
|
|
|
line-height: ${jd};
|
|
|
-webkit-text-size-adjust: 100%;
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
`,[y("input",`
|
|
|
font-family: inherit;
|
|
|
font-size: inherit;
|
|
|
`)]),jo="n-config-provider",lr="naive-ui-style";function se(e,o,t,r,n,l){const a=Dr(),s=ze(jo,null);if(t){const c=()=>{const u=l==null?void 0:l.value;t.mount({id:u===void 0?o:u+o,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:lr,ssr:a}),s!=null&&s.preflightStyleDisabled||Cl.mount({id:"n-global",head:!0,anchorMetaName:lr,ssr:a})};a?c():fr(c)}return $(()=>{var c;const{theme:{common:u,self:f,peers:p={}}={},themeOverrides:v={},builtinThemeOverrides:h={}}=n,{common:m,peers:x}=v,{common:C=void 0,[e]:{common:b=void 0,self:_=void 0,peers:k={}}={}}=(s==null?void 0:s.mergedThemeRef.value)||{},{common:z=void 0,[e]:R={}}=(s==null?void 0:s.mergedThemeOverridesRef.value)||{},{common:S,peers:L={}}=R,I=Ht({},u||b||C||r.common,z,S,m),D=Ht((c=f||_||r.self)===null||c===void 0?void 0:c(I),h,R,v);return{common:I,self:D,peers:Ht({},r.peers,k,p),peerOverrides:Ht({},h.peers,L,x)}})}se.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const ar="n";function Ie(e={},o={defaultBordered:!0}){const t=ze(jo,null);return{inlineThemeDisabled:t==null?void 0:t.inlineThemeDisabled,mergedRtlRef:t==null?void 0:t.mergedRtlRef,mergedComponentPropsRef:t==null?void 0:t.mergedComponentPropsRef,mergedBreakpointsRef:t==null?void 0:t.mergedBreakpointsRef,mergedBorderedRef:$(()=>{var r,n;const{bordered:l}=e;return l!==void 0?l:(n=(r=t==null?void 0:t.mergedBorderedRef.value)!==null&&r!==void 0?r:o.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:t?t.mergedClsPrefixRef:Ji(ar),namespaceRef:$(()=>t==null?void 0:t.mergedNamespaceRef.value)}}function Wd(){const e=ze(jo,null);return e?e.mergedClsPrefixRef:Ji(ar)}const Nd={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"yyyy-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},Vd=Nd,Ud={name:"en-US",locale:$d},Kd=Ud;function Yo(e){const{mergedLocaleRef:o,mergedDateLocaleRef:t}=ze(jo,null)||{},r=$(()=>{var l,a;return(a=(l=o==null?void 0:o.value)===null||l===void 0?void 0:l[e])!==null&&a!==void 0?a:Vd[e]});return{dateLocaleRef:$(()=>{var l;return(l=t==null?void 0:t.value)!==null&&l!==void 0?l:Kd}),localeRef:r}}function Xo(e,o,t){if(!o)return;const r=Dr(),n=ze(jo,null),l=()=>{const a=t.value;o.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:lr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r}),n!=null&&n.preflightStyleDisabled||Cl.mount({id:"n-global",head:!0,anchorMetaName:lr,ssr:r})};r?l():fr(l)}function We(e,o,t,r){var n;t||Wo("useThemeClass","cssVarsRef is not passed");const l=(n=ze(jo,null))===null||n===void 0?void 0:n.mergedThemeHashRef,a=M(""),s=Dr();let d;const c=`__${e}`,u=()=>{let f=c;const p=o?o.value:void 0,v=l==null?void 0:l.value;v&&(f+="-"+v),p&&(f+="-"+p);const{themeOverrides:h,builtinThemeOverrides:m}=r;h&&(f+="-"+kr(JSON.stringify(h))),m&&(f+="-"+kr(JSON.stringify(m))),a.value=f,d=()=>{const x=t.value;let C="";for(const b in x)C+=`${b}: ${x[b]};`;y(`.${f}`,C).mount({id:f,ssr:s}),d=void 0}};return oo(()=>{u()}),{themeClass:a,onRender:()=>{d==null||d()}}}function eo(e,o,t){if(!o)return;const r=Dr(),n=$(()=>{const{value:a}=o;if(!a)return;const s=a[e];if(s)return s}),l=()=>{oo(()=>{const{value:a}=t,s=`${a}${e}Rtl`;if(Pd(s,r))return;const{value:d}=n;d&&d.style.mount({id:s,head:!0,anchorMetaName:lr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r})})};return r?l():fr(l),n}const sr=Z({name:"Add",render(){return i("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))}}),Gd=Z({name:"ArrowDown",render(){return i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z"}))))}}),qd=Z({name:"ArrowUp",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},i("g",{fill:"none"},i("path",{d:"M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z",fill:"currentColor"})))}});function bo(e,o){return Z({name:bd(e),setup(){var t;const r=(t=ze(jo,null))===null||t===void 0?void 0:t.mergedIconsRef;return()=>{var n;const l=(n=r==null?void 0:r.value)===null||n===void 0?void 0:n[e];return l?l():o}}})}const Yd=bo("attach",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M3.25735931,8.70710678 L7.85355339,4.1109127 C8.82986412,3.13460197 10.4127766,3.13460197 11.3890873,4.1109127 C12.365398,5.08722343 12.365398,6.67013588 11.3890873,7.64644661 L6.08578644,12.9497475 C5.69526215,13.3402718 5.06209717,13.3402718 4.67157288,12.9497475 C4.28104858,12.5592232 4.28104858,11.9260582 4.67157288,11.5355339 L9.97487373,6.23223305 C10.1701359,6.0369709 10.1701359,5.72038841 9.97487373,5.52512627 C9.77961159,5.32986412 9.4630291,5.32986412 9.26776695,5.52512627 L3.96446609,10.8284271 C3.18341751,11.6094757 3.18341751,12.8758057 3.96446609,13.6568542 C4.74551468,14.4379028 6.01184464,14.4379028 6.79289322,13.6568542 L12.0961941,8.35355339 C13.4630291,6.98671837 13.4630291,4.77064094 12.0961941,3.40380592 C10.7293591,2.0369709 8.51328163,2.0369709 7.14644661,3.40380592 L2.55025253,8 C2.35499039,8.19526215 2.35499039,8.51184464 2.55025253,8.70710678 C2.74551468,8.90236893 3.06209717,8.90236893 3.25735931,8.70710678 Z"}))))),fi=Z({name:"Backward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z",fill:"currentColor"}))}}),Xd=Z({name:"Checkmark",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i("g",{fill:"none"},i("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"})))}}),Zd=Z({name:"ChevronRight",render(){return i("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z",fill:"currentColor"}))}}),Qd=bo("close",i("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),yl=Z({name:"Eye",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("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"}),i("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),Jd=Z({name:"EyeOff",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("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"}),i("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"}),i("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"}),i("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"}),i("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"}))}}),ec=bo("trash",i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("path",{d:"M432,144,403.33,419.74A32,32,0,0,1,371.55,448H140.46a32,32,0,0,1-31.78-28.26L80,144",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),i("rect",{x:"32",y:"64",width:"448",height:"80",rx:"16",ry:"16",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),i("line",{x1:"312",y1:"240",x2:"200",y2:"352",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}),i("line",{x1:"312",y1:"352",x2:"200",y2:"240",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),oc=bo("download",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M3.5,13 L12.5,13 C12.7761424,13 13,13.2238576 13,13.5 C13,13.7454599 12.8231248,13.9496084 12.5898756,13.9919443 L12.5,14 L3.5,14 C3.22385763,14 3,13.7761424 3,13.5 C3,13.2545401 3.17687516,13.0503916 3.41012437,13.0080557 L3.5,13 L12.5,13 L3.5,13 Z M7.91012437,1.00805567 L8,1 C8.24545989,1 8.44960837,1.17687516 8.49194433,1.41012437 L8.5,1.5 L8.5,10.292 L11.1819805,7.6109127 C11.3555469,7.43734635 11.6249713,7.4180612 11.8198394,7.55305725 L11.8890873,7.6109127 C12.0626536,7.78447906 12.0819388,8.05390346 11.9469427,8.2487716 L11.8890873,8.31801948 L8.35355339,11.8535534 C8.17998704,12.0271197 7.91056264,12.0464049 7.7156945,11.9114088 L7.64644661,11.8535534 L4.1109127,8.31801948 C3.91565056,8.12275734 3.91565056,7.80617485 4.1109127,7.6109127 C4.28447906,7.43734635 4.55390346,7.4180612 4.7487716,7.55305725 L4.81801948,7.6109127 L7.5,10.292 L7.5,1.5 C7.5,1.25454011 7.67687516,1.05039163 7.91012437,1.00805567 L8,1 L7.91012437,1.00805567 Z"}))))),tc=Z({name:"Empty",render(){return i("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("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"}),i("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"}))}}),Vt=bo("error",i("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),hi=Z({name:"FastBackward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),pi=Z({name:"FastForward",render(){return i("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),vi=Z({name:"Forward",render(){return i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),yt=bo("info",i("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),gi=Z({name:"More",render(){return i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),wl=Z({name:"Remove",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:`
|
|
|
fill: none;
|
|
|
stroke: currentColor;
|
|
|
stroke-linecap: round;
|
|
|
stroke-linejoin: round;
|
|
|
stroke-width: 32px;
|
|
|
`}))}}),Ut=bo("success",i("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),$t=bo("warning",i("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},i("g",{"fill-rule":"nonzero"},i("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),rc=bo("cancel",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("path",{d:"M2.58859116,2.7156945 L2.64644661,2.64644661 C2.82001296,2.47288026 3.08943736,2.45359511 3.2843055,2.58859116 L3.35355339,2.64644661 L8,7.293 L12.6464466,2.64644661 C12.8417088,2.45118446 13.1582912,2.45118446 13.3535534,2.64644661 C13.5488155,2.84170876 13.5488155,3.15829124 13.3535534,3.35355339 L8.707,8 L13.3535534,12.6464466 C13.5271197,12.820013 13.5464049,13.0894374 13.4114088,13.2843055 L13.3535534,13.3535534 C13.179987,13.5271197 12.9105626,13.5464049 12.7156945,13.4114088 L12.6464466,13.3535534 L8,8.707 L3.35355339,13.3535534 C3.15829124,13.5488155 2.84170876,13.5488155 2.64644661,13.3535534 C2.45118446,13.1582912 2.45118446,12.8417088 2.64644661,12.6464466 L7.293,8 L2.64644661,3.35355339 C2.47288026,3.17998704 2.45359511,2.91056264 2.58859116,2.7156945 L2.64644661,2.64644661 L2.58859116,2.7156945 Z"}))))),nc=Z({name:"ChevronDown",render(){return i("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("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"}))}}),ic=bo("clear",i("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i("g",{fill:"currentColor","fill-rule":"nonzero"},i("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"}))))),lc=Z({name:"ChevronDownFilled",render(){return i("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M3.20041 5.73966C3.48226 5.43613 3.95681 5.41856 4.26034 5.70041L8 9.22652L11.7397 5.70041C12.0432 5.41856 12.5177 5.43613 12.7996 5.73966C13.0815 6.0432 13.0639 6.51775 12.7603 6.7996L8.51034 10.7996C8.22258 11.0668 7.77743 11.0668 7.48967 10.7996L3.23966 6.7996C2.93613 6.51775 2.91856 6.0432 3.20041 5.73966Z",fill:"currentColor"}))}}),ac=bo("retry",i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},i("path",{d:"M320,146s24.36-12-64-12A160,160,0,1,0,416,294",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-miterlimit: 10; stroke-width: 32px;"}),i("polyline",{points:"256 58 336 138 256 218",style:"fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 32px;"}))),sc=bo("rotateClockwise",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 12.7916 15.3658 15.2026 13 16.3265V14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5V17.5C12 17.7761 12.2239 18 12.5 18H15.5C15.7761 18 16 17.7761 16 17.5C16 17.2239 15.7761 17 15.5 17H13.8758C16.3346 15.6357 18 13.0128 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 10.2761 2.22386 10.5 2.5 10.5C2.77614 10.5 3 10.2761 3 10Z",fill:"currentColor"}),i("path",{d:"M10 12C11.1046 12 12 11.1046 12 10C12 8.89543 11.1046 8 10 8C8.89543 8 8 8.89543 8 10C8 11.1046 8.89543 12 10 12ZM10 11C9.44772 11 9 10.5523 9 10C9 9.44772 9.44772 9 10 9C10.5523 9 11 9.44772 11 10C11 10.5523 10.5523 11 10 11Z",fill:"currentColor"}))),dc=bo("rotateClockwise",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M17 10C17 6.13401 13.866 3 10 3C6.13401 3 3 6.13401 3 10C3 12.7916 4.63419 15.2026 7 16.3265V14.5C7 14.2239 7.22386 14 7.5 14C7.77614 14 8 14.2239 8 14.5V17.5C8 17.7761 7.77614 18 7.5 18H4.5C4.22386 18 4 17.7761 4 17.5C4 17.2239 4.22386 17 4.5 17H6.12422C3.66539 15.6357 2 13.0128 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10C18 10.2761 17.7761 10.5 17.5 10.5C17.2239 10.5 17 10.2761 17 10Z",fill:"currentColor"}),i("path",{d:"M10 12C8.89543 12 8 11.1046 8 10C8 8.89543 8.89543 8 10 8C11.1046 8 12 8.89543 12 10C12 11.1046 11.1046 12 10 12ZM10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10C9 10.5523 9.44772 11 10 11Z",fill:"currentColor"}))),cc=bo("zoomIn",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5Z",fill:"currentColor"}),i("path",{d:"M8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z",fill:"currentColor"}))),uc=bo("zoomOut",i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11Z",fill:"currentColor"}),i("path",{d:"M14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z",fill:"currentColor"}))),fc=Z({name:"ResizeSmall",render(){return i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},i("g",{fill:"none"},i("path",{d:"M5.5 4A1.5 1.5 0 0 0 4 5.5v1a.5.5 0 0 1-1 0v-1A2.5 2.5 0 0 1 5.5 3h1a.5.5 0 0 1 0 1h-1zM16 5.5A1.5 1.5 0 0 0 14.5 4h-1a.5.5 0 0 1 0-1h1A2.5 2.5 0 0 1 17 5.5v1a.5.5 0 0 1-1 0v-1zm0 9a1.5 1.5 0 0 1-1.5 1.5h-1a.5.5 0 0 0 0 1h1a2.5 2.5 0 0 0 2.5-2.5v-1a.5.5 0 0 0-1 0v1zm-12 0A1.5 1.5 0 0 0 5.5 16h1.25a.5.5 0 0 1 0 1H5.5A2.5 2.5 0 0 1 3 14.5v-1.25a.5.5 0 0 1 1 0v1.25zM8.5 7A1.5 1.5 0 0 0 7 8.5v3A1.5 1.5 0 0 0 8.5 13h3a1.5 1.5 0 0 0 1.5-1.5v-3A1.5 1.5 0 0 0 11.5 7h-3zM8 8.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v3a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-3z",fill:"currentColor"})))}}),Kt=Z({name:"BaseIconSwitchTransition",setup(e,{slots:o}){const t=zt();return()=>i(io,{name:"icon-switch-transition",appear:t.value},o)}}),Rt=Z({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:o}){function t(s){e.width?s.style.maxWidth=`${s.offsetWidth}px`:s.style.maxHeight=`${s.offsetHeight}px`,s.offsetWidth}function r(s){e.width?s.style.maxWidth="0":s.style.maxHeight="0",s.offsetWidth;const{onLeave:d}=e;d&&d()}function n(s){e.width?s.style.maxWidth="":s.style.maxHeight="";const{onAfterLeave:d}=e;d&&d()}function l(s){if(s.style.transition="none",e.width){const d=s.offsetWidth;s.style.maxWidth="0",s.offsetWidth,s.style.transition="",s.style.maxWidth=`${d}px`}else if(e.reverse)s.style.maxHeight=`${s.offsetHeight}px`,s.offsetHeight,s.style.transition="",s.style.maxHeight="0";else{const d=s.offsetHeight;s.style.maxHeight="0",s.offsetWidth,s.style.transition="",s.style.maxHeight=`${d}px`}s.offsetWidth}function a(s){var d;e.width?s.style.maxWidth="":e.reverse||(s.style.maxHeight=""),(d=e.onAfterEnter)===null||d===void 0||d.call(e)}return()=>{const{group:s,width:d,appear:c,mode:u}=e,f=s?Sn:io,p={name:d?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:c,onEnter:l,onAfterEnter:a,onBeforeLeave:t,onLeave:r,onAfterLeave:n};return s||(p.mode=u),i(f,p,o)}}}),hc=g("base-icon",`
|
|
|
height: 1em;
|
|
|
width: 1em;
|
|
|
line-height: 1em;
|
|
|
text-align: center;
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
fill: currentColor;
|
|
|
transform: translateZ(0);
|
|
|
`,[y("svg",`
|
|
|
height: 1em;
|
|
|
width: 1em;
|
|
|
`)]),He=Z({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Xo("-base-icon",hc,ae(e,"clsPrefix"))},render(){return i("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),pc=g("base-close",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
cursor: pointer;
|
|
|
background-color: transparent;
|
|
|
color: var(--n-close-icon-color);
|
|
|
border-radius: var(--n-close-border-radius);
|
|
|
height: var(--n-close-size);
|
|
|
width: var(--n-close-size);
|
|
|
font-size: var(--n-close-icon-size);
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
position: relative;
|
|
|
padding: 0;
|
|
|
`,[P("absolute",`
|
|
|
height: var(--n-close-icon-size);
|
|
|
width: var(--n-close-icon-size);
|
|
|
`),y("&::before",`
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
width: var(--n-close-size);
|
|
|
height: var(--n-close-size);
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%) translateX(-50%);
|
|
|
transition: inherit;
|
|
|
border-radius: inherit;
|
|
|
`),Ne("disabled",[y("&:hover",`
|
|
|
color: var(--n-close-icon-color-hover);
|
|
|
`),y("&:hover::before",`
|
|
|
background-color: var(--n-close-color-hover);
|
|
|
`),y("&:focus::before",`
|
|
|
background-color: var(--n-close-color-hover);
|
|
|
`),y("&:active",`
|
|
|
color: var(--n-close-icon-color-pressed);
|
|
|
`),y("&:active::before",`
|
|
|
background-color: var(--n-close-color-pressed);
|
|
|
`)]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
color: var(--n-close-icon-color-disabled);
|
|
|
background-color: transparent;
|
|
|
`),P("round",[y("&::before",`
|
|
|
border-radius: 50%;
|
|
|
`)])]),Pt=Z({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Xo("-base-close",pc,ae(e,"clsPrefix")),()=>{const{clsPrefix:o,disabled:t,absolute:r,round:n,isButtonTag:l}=e;return i(l?"button":"div",{type:l?"button":void 0,tabindex:t||!e.focusable?-1:0,"aria-disabled":t,"aria-label":"close",role:l?void 0:"button",disabled:t,class:[`${o}-base-close`,r&&`${o}-base-close--absolute`,t&&`${o}-base-close--disabled`,n&&`${o}-base-close--round`],onMousedown:s=>{e.focusable||s.preventDefault()},onClick:e.onClick},i(He,{clsPrefix:o},{default:()=>i(Qd,null)}))}}}),vc=Z({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),{cubicBezierEaseInOut:gc}=zo;function dt({originalTransform:e="",left:o=0,top:t=0,transition:r=`all .3s ${gc} !important`}={}){return[y("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:e+" scale(0.75)",left:o,top:t,opacity:0}),y("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:o,top:t,opacity:1}),y("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:o,top:t,transition:r})]}const mc=y([y("@keyframes rotator",`
|
|
|
0% {
|
|
|
-webkit-transform: rotate(0deg);
|
|
|
transform: rotate(0deg);
|
|
|
}
|
|
|
100% {
|
|
|
-webkit-transform: rotate(360deg);
|
|
|
transform: rotate(360deg);
|
|
|
}`),g("base-loading",`
|
|
|
position: relative;
|
|
|
line-height: 0;
|
|
|
width: 1em;
|
|
|
height: 1em;
|
|
|
`,[w("transition-wrapper",`
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
`,[dt()]),w("placeholder",`
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
`,[dt({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),w("container",`
|
|
|
animation: rotator 3s linear infinite both;
|
|
|
`,[w("icon",`
|
|
|
height: 1em;
|
|
|
width: 1em;
|
|
|
`)])])]),Qr="1.6s",bc={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},Gt=Z({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},bc),setup(e){Xo("-base-loading",mc,ae(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:o,strokeWidth:t,stroke:r,scale:n}=this,l=o/n;return i("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},i(Kt,null,{default:()=>this.show?i("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i("div",{class:`${e}-base-loading__container`},i("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*l} ${2*l}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i("g",null,i("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${l} ${l};270 ${l} ${l}`,begin:"0s",dur:Qr,fill:"freeze",repeatCount:"indefinite"}),i("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":t,"stroke-linecap":"round",cx:l,cy:l,r:o-t/2,"stroke-dasharray":5.67*o,"stroke-dashoffset":18.48*o},i("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${l} ${l};135 ${l} ${l};450 ${l} ${l}`,begin:"0s",dur:Qr,fill:"freeze",repeatCount:"indefinite"}),i("animate",{attributeName:"stroke-dashoffset",values:`${5.67*o};${1.42*o};${5.67*o}`,begin:"0s",dur:Qr,fill:"freeze",repeatCount:"indefinite"})))))):i("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),we={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},xc=ur(we.neutralBase),Sl=ur(we.neutralInvertBase),Cc="rgba("+Sl.slice(0,3).join(", ")+", ";function Ke(e){return Cc+String(e)+")"}function yc(e){const o=Array.from(Sl);return o[3]=Number(e),Re(xc,o)}const wc=Object.assign(Object.assign({name:"common"},zo),{baseColor:we.neutralBase,primaryColor:we.primaryDefault,primaryColorHover:we.primaryHover,primaryColorPressed:we.primaryActive,primaryColorSuppl:we.primarySuppl,infoColor:we.infoDefault,infoColorHover:we.infoHover,infoColorPressed:we.infoActive,infoColorSuppl:we.infoSuppl,successColor:we.successDefault,successColorHover:we.successHover,successColorPressed:we.successActive,successColorSuppl:we.successSuppl,warningColor:we.warningDefault,warningColorHover:we.warningHover,warningColorPressed:we.warningActive,warningColorSuppl:we.warningSuppl,errorColor:we.errorDefault,errorColorHover:we.errorHover,errorColorPressed:we.errorActive,errorColorSuppl:we.errorSuppl,textColorBase:we.neutralTextBase,textColor1:Ke(we.alpha1),textColor2:Ke(we.alpha2),textColor3:Ke(we.alpha3),textColorDisabled:Ke(we.alpha4),placeholderColor:Ke(we.alpha4),placeholderColorDisabled:Ke(we.alpha5),iconColor:Ke(we.alpha4),iconColorDisabled:Ke(we.alpha5),iconColorHover:Ke(Number(we.alpha4)*1.25),iconColorPressed:Ke(Number(we.alpha4)*.8),opacity1:we.alpha1,opacity2:we.alpha2,opacity3:we.alpha3,opacity4:we.alpha4,opacity5:we.alpha5,dividerColor:Ke(we.alphaDivider),borderColor:Ke(we.alphaBorder),closeIconColorHover:Ke(Number(we.alphaClose)),closeIconColor:Ke(Number(we.alphaClose)),closeIconColorPressed:Ke(Number(we.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Ke(we.alpha4),clearColorHover:to(Ke(we.alpha4),{alpha:1.25}),clearColorPressed:to(Ke(we.alpha4),{alpha:.8}),scrollbarColor:Ke(we.alphaScrollbar),scrollbarColorHover:Ke(we.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Ke(we.alphaProgressRail),railColor:Ke(we.alphaRail),popoverColor:we.neutralPopover,tableColor:we.neutralCard,cardColor:we.neutralCard,modalColor:we.neutralModal,bodyColor:we.neutralBody,tagColor:yc(we.alphaTag),avatarColor:Ke(we.alphaAvatar),invertedColor:we.neutralBase,inputColor:Ke(we.alphaInput),codeColor:Ke(we.alphaCode),tabColor:Ke(we.alphaTab),actionColor:Ke(we.alphaAction),tableHeaderColor:Ke(we.alphaAction),hoverColor:Ke(we.alphaPending),tableColorHover:Ke(we.alphaTablePending),tableColorStriped:Ke(we.alphaTableStriped),pressedColor:Ke(we.alphaPressed),opacityDisabled:we.alphaDisabled,inputColorDisabled:Ke(we.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),fe=wc,Oe={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaDisabledInput:"0.02",alphaPending:"0.05",alphaTablePending:"0.02",alphaPressed:"0.07",alphaAvatar:"0.2",alphaRail:"0.14",alphaProgressRail:".08",alphaBorder:"0.12",alphaDivider:"0.06",alphaInput:"0",alphaAction:"0.02",alphaTab:"0.04",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",alphaCode:"0.05",alphaTag:"0.02",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Sc=ur(Oe.neutralBase),zl=ur(Oe.neutralInvertBase),zc="rgba("+zl.slice(0,3).join(", ")+", ";function mi(e){return zc+String(e)+")"}function ho(e){const o=Array.from(zl);return o[3]=Number(e),Re(Sc,o)}const $c=Object.assign(Object.assign({name:"common"},zo),{baseColor:Oe.neutralBase,primaryColor:Oe.primaryDefault,primaryColorHover:Oe.primaryHover,primaryColorPressed:Oe.primaryActive,primaryColorSuppl:Oe.primarySuppl,infoColor:Oe.infoDefault,infoColorHover:Oe.infoHover,infoColorPressed:Oe.infoActive,infoColorSuppl:Oe.infoSuppl,successColor:Oe.successDefault,successColorHover:Oe.successHover,successColorPressed:Oe.successActive,successColorSuppl:Oe.successSuppl,warningColor:Oe.warningDefault,warningColorHover:Oe.warningHover,warningColorPressed:Oe.warningActive,warningColorSuppl:Oe.warningSuppl,errorColor:Oe.errorDefault,errorColorHover:Oe.errorHover,errorColorPressed:Oe.errorActive,errorColorSuppl:Oe.errorSuppl,textColorBase:Oe.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ho(Oe.alpha4),placeholderColor:ho(Oe.alpha4),placeholderColorDisabled:ho(Oe.alpha5),iconColor:ho(Oe.alpha4),iconColorHover:to(ho(Oe.alpha4),{lightness:.75}),iconColorPressed:to(ho(Oe.alpha4),{lightness:.9}),iconColorDisabled:ho(Oe.alpha5),opacity1:Oe.alpha1,opacity2:Oe.alpha2,opacity3:Oe.alpha3,opacity4:Oe.alpha4,opacity5:Oe.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ho(Number(Oe.alphaClose)),closeIconColorHover:ho(Number(Oe.alphaClose)),closeIconColorPressed:ho(Number(Oe.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ho(Oe.alpha4),clearColorHover:to(ho(Oe.alpha4),{lightness:.75}),clearColorPressed:to(ho(Oe.alpha4),{lightness:.9}),scrollbarColor:mi(Oe.alphaScrollbar),scrollbarColorHover:mi(Oe.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ho(Oe.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:Oe.neutralPopover,tableColor:Oe.neutralCard,cardColor:Oe.neutralCard,modalColor:Oe.neutralModal,bodyColor:Oe.neutralBody,tagColor:"#eee",avatarColor:ho(Oe.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ho(Oe.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:Oe.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Ae=$c,Rc={iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"},$l=e=>{const{textColorDisabled:o,iconColor:t,textColor2:r,fontSizeSmall:n,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:s}=e;return Object.assign(Object.assign({},Rc),{fontSizeSmall:n,fontSizeMedium:l,fontSizeLarge:a,fontSizeHuge:s,textColor:o,iconColor:t,extraTextColor:r})},Pc={name:"Empty",common:Ae,self:$l},Tn=Pc,kc={name:"Empty",common:fe,self:$l},kt=kc,Ic=g("empty",`
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
font-size: var(--n-font-size);
|
|
|
`,[w("icon",`
|
|
|
width: var(--n-icon-size);
|
|
|
height: var(--n-icon-size);
|
|
|
font-size: var(--n-icon-size);
|
|
|
line-height: var(--n-icon-size);
|
|
|
color: var(--n-icon-color);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier);
|
|
|
`,[y("+",[w("description",`
|
|
|
margin-top: 8px;
|
|
|
`)])]),w("description",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-text-color);
|
|
|
`),w("extra",`
|
|
|
text-align: center;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
margin-top: 12px;
|
|
|
color: var(--n-extra-text-color);
|
|
|
`)]),Bc=Object.assign(Object.assign({},se.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Tc=Z({name:"Empty",props:Bc,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Empty","-empty",Ic,Tn,e,o),{localeRef:n}=Yo("Empty"),l=ze(jo,null),a=$(()=>{var u,f,p;return(u=e.description)!==null&&u!==void 0?u:(p=(f=l==null?void 0:l.mergedComponentPropsRef.value)===null||f===void 0?void 0:f.Empty)===null||p===void 0?void 0:p.description}),s=$(()=>{var u,f;return((f=(u=l==null?void 0:l.mergedComponentPropsRef.value)===null||u===void 0?void 0:u.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i(tc,null))}),d=$(()=>{const{size:u}=e,{common:{cubicBezierEaseInOut:f},self:{[N("iconSize",u)]:p,[N("fontSize",u)]:v,textColor:h,iconColor:m,extraTextColor:x}}=r.value;return{"--n-icon-size":p,"--n-font-size":v,"--n-bezier":f,"--n-text-color":h,"--n-icon-color":m,"--n-extra-text-color":x}}),c=t?We("empty",$(()=>{let u="";const{size:f}=e;return u+=f[0],u}),d,e):void 0;return{mergedClsPrefix:o,mergedRenderIcon:s,localizedDescription:$(()=>a.value||n.value.description),cssVars:t?void 0:d,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:o,onRender:t}=this;return t==null||t(),i("div",{class:[`${o}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i("div",{class:`${o}-empty__icon`},e.icon?e.icon():i(He,{clsPrefix:o},{default:this.mergedRenderIcon})):null,this.showDescription?i("div",{class:`${o}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i("div",{class:`${o}-empty__extra`},e.extra()):null)}}),Rl=e=>{const{scrollbarColor:o,scrollbarColorHover:t}=e;return{color:o,colorHover:t}},Oc={name:"Scrollbar",common:Ae,self:Rl},Hr=Oc,Fc={name:"Scrollbar",common:fe,self:Rl},$o=Fc,{cubicBezierEaseInOut:bi}=zo;function jt({name:e="fade-in",enterDuration:o="0.2s",leaveDuration:t="0.2s",enterCubicBezier:r=bi,leaveCubicBezier:n=bi}={}){return[y(`&.${e}-transition-enter-active`,{transition:`all ${o} ${r}!important`}),y(`&.${e}-transition-leave-active`,{transition:`all ${t} ${n}!important`}),y(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),y(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const _c=g("scrollbar",`
|
|
|
overflow: hidden;
|
|
|
position: relative;
|
|
|
z-index: auto;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
`,[y(">",[g("scrollbar-container",`
|
|
|
width: 100%;
|
|
|
overflow: scroll;
|
|
|
height: 100%;
|
|
|
min-height: inherit;
|
|
|
max-height: inherit;
|
|
|
scrollbar-width: none;
|
|
|
`,[y("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
display: none;
|
|
|
`),y(">",[g("scrollbar-content",`
|
|
|
box-sizing: border-box;
|
|
|
min-width: 100%;
|
|
|
`)])])]),y(">, +",[g("scrollbar-rail",`
|
|
|
position: absolute;
|
|
|
pointer-events: none;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
`,[P("horizontal",`
|
|
|
left: 2px;
|
|
|
right: 2px;
|
|
|
bottom: 4px;
|
|
|
height: var(--n-scrollbar-height);
|
|
|
`,[y(">",[w("scrollbar",`
|
|
|
height: var(--n-scrollbar-height);
|
|
|
border-radius: var(--n-scrollbar-border-radius);
|
|
|
right: 0;
|
|
|
`)])]),P("vertical",`
|
|
|
right: 4px;
|
|
|
top: 2px;
|
|
|
bottom: 2px;
|
|
|
width: var(--n-scrollbar-width);
|
|
|
`,[y(">",[w("scrollbar",`
|
|
|
width: var(--n-scrollbar-width);
|
|
|
border-radius: var(--n-scrollbar-border-radius);
|
|
|
bottom: 0;
|
|
|
`)])]),P("disabled",[y(">",[w("scrollbar","pointer-events: none;")])]),y(">",[w("scrollbar",`
|
|
|
z-index: 1;
|
|
|
position: absolute;
|
|
|
cursor: pointer;
|
|
|
pointer-events: all;
|
|
|
background-color: var(--n-scrollbar-color);
|
|
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
|
|
`,[jt(),y("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Mc=Object.assign(Object.assign({},se.props),{size:{type:Number,default:5},duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean}),Pl=Z({name:"Scrollbar",props:Mc,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:r}=Ie(e),n=eo("Scrollbar",r,o),l=M(null),a=M(null),s=M(null),d=M(null),c=M(null),u=M(null),f=M(null),p=M(null),v=M(null),h=M(null),m=M(null),x=M(0),C=M(0),b=M(!1),_=M(!1);let k=!1,z=!1,R,S,L=0,I=0,D=0,W=0;const H=pd(),j=$(()=>{const{value:O}=p,{value:X}=u,{value:ue}=h;return O===null||X===null||ue===null?0:Math.min(O,ue*O/X+e.size*1.5)}),V=$(()=>`${j.value}px`),E=$(()=>{const{value:O}=v,{value:X}=f,{value:ue}=m;return O===null||X===null||ue===null?0:ue*O/X+e.size*1.5}),Y=$(()=>`${E.value}px`),K=$(()=>{const{value:O}=p,{value:X}=x,{value:ue}=u,{value:$e}=h;if(O===null||ue===null||$e===null)return 0;{const Pe=ue-O;return Pe?X/Pe*($e-j.value):0}}),te=$(()=>`${K.value}px`),xe=$(()=>{const{value:O}=v,{value:X}=C,{value:ue}=f,{value:$e}=m;if(O===null||ue===null||$e===null)return 0;{const Pe=ue-O;return Pe?X/Pe*($e-E.value):0}}),de=$(()=>`${xe.value}px`),ie=$(()=>{const{value:O}=p,{value:X}=u;return O!==null&&X!==null&&X>O}),F=$(()=>{const{value:O}=v,{value:X}=f;return O!==null&&X!==null&&X>O}),B=$(()=>{const{trigger:O}=e;return O==="none"||b.value}),q=$(()=>{const{trigger:O}=e;return O==="none"||_.value}),ee=$(()=>{const{container:O}=e;return O?O():a.value}),be=$(()=>{const{content:O}=e;return O?O():s.value}),me=Hd(()=>{e.container||ve({top:x.value,left:C.value})}),Be=()=>{me.isDeactivated||oe()},T=O=>{if(me.isDeactivated)return;const{onResize:X}=e;X&&X(O),oe()},ve=(O,X)=>{if(!e.scrollable)return;if(typeof O=="number"){Fe(X??0,O,0,!1,"auto");return}const{left:ue,top:$e,index:Pe,elSize:ke,position:Me,behavior:Le,el:qe,debounce:go=!0}=O;(ue!==void 0||$e!==void 0)&&Fe(ue??0,$e??0,0,!1,Le),qe!==void 0?Fe(0,qe.offsetTop,qe.offsetHeight,go,Le):Pe!==void 0&&ke!==void 0?Fe(0,Pe*ke,ke,go,Le):Me==="bottom"?Fe(0,Number.MAX_SAFE_INTEGER,0,!1,Le):Me==="top"&&Fe(0,0,0,!1,Le)},Se=(O,X)=>{if(!e.scrollable)return;const{value:ue}=ee;ue&&(typeof O=="object"?ue.scrollBy(O):ue.scrollBy(O,X||0))};function Fe(O,X,ue,$e,Pe){const{value:ke}=ee;if(ke){if($e){const{scrollTop:Me,offsetHeight:Le}=ke;if(X>Me){X+ue<=Me+Le||ke.scrollTo({left:O,top:X+ue-Le,behavior:Pe});return}}ke.scrollTo({left:O,top:X,behavior:Pe})}}function ne(){he(),G(),oe()}function Ce(){ge()}function ge(){Ee(),Q()}function Ee(){S!==void 0&&window.clearTimeout(S),S=window.setTimeout(()=>{_.value=!1},e.duration)}function Q(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{b.value=!1},e.duration)}function he(){R!==void 0&&window.clearTimeout(R),b.value=!0}function G(){S!==void 0&&window.clearTimeout(S),_.value=!0}function U(O){const{onScroll:X}=e;X&&X(O),le()}function le(){const{value:O}=ee;O&&(x.value=O.scrollTop,C.value=O.scrollLeft*(n!=null&&n.value?-1:1))}function ye(){const{value:O}=be;O&&(u.value=O.offsetHeight,f.value=O.offsetWidth);const{value:X}=ee;X&&(p.value=X.offsetHeight,v.value=X.offsetWidth);const{value:ue}=c,{value:$e}=d;ue&&(m.value=ue.offsetWidth),$e&&(h.value=$e.offsetHeight)}function _e(){const{value:O}=ee;O&&(x.value=O.scrollTop,C.value=O.scrollLeft*(n!=null&&n.value?-1:1),p.value=O.offsetHeight,v.value=O.offsetWidth,u.value=O.scrollHeight,f.value=O.scrollWidth);const{value:X}=c,{value:ue}=d;X&&(m.value=X.offsetWidth),ue&&(h.value=ue.offsetHeight)}function oe(){e.scrollable&&(e.useUnifiedContainer?_e():(ye(),le()))}function pe(O){var X;return!(!((X=l.value)===null||X===void 0)&&X.contains(rr(O)))}function Ue(O){O.preventDefault(),O.stopPropagation(),z=!0,Lo("mousemove",window,fo,!0),Lo("mouseup",window,Po,!0),I=C.value,D=n!=null&&n.value?window.innerWidth-O.clientX:O.clientX}function fo(O){if(!z)return;R!==void 0&&window.clearTimeout(R),S!==void 0&&window.clearTimeout(S);const{value:X}=v,{value:ue}=f,{value:$e}=E;if(X===null||ue===null)return;const ke=(n!=null&&n.value?window.innerWidth-O.clientX-D:O.clientX-D)*(ue-X)/(X-$e),Me=ue-X;let Le=I+ke;Le=Math.min(Me,Le),Le=Math.max(Le,0);const{value:qe}=ee;if(qe){qe.scrollLeft=Le*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:go}=e;go&&go(Le)}}function Po(O){O.preventDefault(),O.stopPropagation(),Io("mousemove",window,fo,!0),Io("mouseup",window,Po,!0),z=!1,oe(),pe(O)&&ge()}function Fo(O){O.preventDefault(),O.stopPropagation(),k=!0,Lo("mousemove",window,xo,!0),Lo("mouseup",window,Co,!0),L=x.value,W=O.clientY}function xo(O){if(!k)return;R!==void 0&&window.clearTimeout(R),S!==void 0&&window.clearTimeout(S);const{value:X}=p,{value:ue}=u,{value:$e}=j;if(X===null||ue===null)return;const ke=(O.clientY-W)*(ue-X)/(X-$e),Me=ue-X;let Le=L+ke;Le=Math.min(Me,Le),Le=Math.max(Le,0);const{value:qe}=ee;qe&&(qe.scrollTop=Le)}function Co(O){O.preventDefault(),O.stopPropagation(),Io("mousemove",window,xo,!0),Io("mouseup",window,Co,!0),k=!1,oe(),pe(O)&&ge()}oo(()=>{const{value:O}=F,{value:X}=ie,{value:ue}=o,{value:$e}=c,{value:Pe}=d;$e&&(O?$e.classList.remove(`${ue}-scrollbar-rail--disabled`):$e.classList.add(`${ue}-scrollbar-rail--disabled`)),Pe&&(X?Pe.classList.remove(`${ue}-scrollbar-rail--disabled`):Pe.classList.add(`${ue}-scrollbar-rail--disabled`))}),po(()=>{e.container||oe()}),So(()=>{R!==void 0&&window.clearTimeout(R),S!==void 0&&window.clearTimeout(S),Io("mousemove",window,xo,!0),Io("mouseup",window,Co,!0)});const Eo=se("Scrollbar","-scrollbar",_c,Hr,e,o),_o=$(()=>{const{common:{cubicBezierEaseInOut:O,scrollbarBorderRadius:X,scrollbarHeight:ue,scrollbarWidth:$e},self:{color:Pe,colorHover:ke}}=Eo.value;return{"--n-scrollbar-bezier":O,"--n-scrollbar-color":Pe,"--n-scrollbar-color-hover":ke,"--n-scrollbar-border-radius":X,"--n-scrollbar-width":$e,"--n-scrollbar-height":ue}}),uo=t?We("scrollbar",void 0,_o,e):void 0;return Object.assign(Object.assign({},{scrollTo:ve,scrollBy:Se,sync:oe,syncUnifiedContainer:_e,handleMouseEnterWrapper:ne,handleMouseLeaveWrapper:Ce}),{mergedClsPrefix:o,rtlEnabled:n,containerScrollTop:x,wrapperRef:l,containerRef:a,contentRef:s,yRailRef:d,xRailRef:c,needYBar:ie,needXBar:F,yBarSizePx:V,xBarSizePx:Y,yBarTopPx:te,xBarLeftPx:de,isShowXBar:B,isShowYBar:q,isIos:H,handleScroll:U,handleContentResize:Be,handleContainerResize:T,handleYScrollMouseDown:Fo,handleXScrollMouseDown:Ue,cssVars:t?void 0:_o,themeClass:uo==null?void 0:uo.themeClass,onRender:uo==null?void 0:uo.onRender})},render(){var e;const{$slots:o,mergedClsPrefix:t,triggerDisplayManually:r,rtlEnabled:n,internalHoistYRail:l}=this;if(!this.scrollable)return(e=o.default)===null||e===void 0?void 0:e.call(o);const a=this.trigger==="none",s=(u,f)=>i("div",{ref:"yRailRef",class:[`${t}-scrollbar-rail`,`${t}-scrollbar-rail--vertical`,u],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hiddens":!0},i(a?vn:io,a?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i("div",{class:`${t}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),d=()=>{var u,f;return(u=this.onRender)===null||u===void 0||u.call(this),i("div",To(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${t}-scrollbar`,this.themeClass,n&&`${t}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=o.default)===null||f===void 0?void 0:f.call(o):i("div",{role:"none",ref:"containerRef",class:[`${t}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i(st,{onResize:this.handleContentResize},{default:()=>i("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${t}-scrollbar-content`,this.contentClass]},o)})),l?null:s(void 0,void 0),this.xScrollable&&i("div",{ref:"xRailRef",class:[`${t}-scrollbar-rail`,`${t}-scrollbar-rail--horizontal`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i(a?vn:io,a?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i("div",{class:`${t}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},c=this.container?d():i(st,{onResize:this.handleContainerResize},{default:d});return l?i(so,null,c,s(this.themeClass,this.cssVars)):c}}),gr=Pl,kl=Pl,Dc={height:"calc(var(--n-option-height) * 7.6)",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"},Il=e=>{const{borderRadius:o,popoverColor:t,textColor3:r,dividerColor:n,textColor2:l,primaryColorPressed:a,textColorDisabled:s,primaryColor:d,opacityDisabled:c,hoverColor:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:v,fontSizeHuge:h,heightSmall:m,heightMedium:x,heightLarge:C,heightHuge:b}=e;return Object.assign(Object.assign({},Dc),{optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:v,optionFontSizeHuge:h,optionHeightSmall:m,optionHeightMedium:x,optionHeightLarge:C,optionHeightHuge:b,borderRadius:o,color:t,groupHeaderTextColor:r,actionDividerColor:n,optionTextColor:l,optionTextColorPressed:a,optionTextColorDisabled:s,optionTextColorActive:d,optionOpacityDisabled:c,optionCheckColor:d,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:l,loadingColor:d})},Lc={name:"InternalSelectMenu",common:Ae,peers:{Scrollbar:Hr,Empty:Tn},self:Il},Ar=Lc,Hc={name:"InternalSelectMenu",common:fe,peers:{Scrollbar:$o,Empty:kt},self:Il},mr=Hc;function Ac(e,o){return i(io,{name:"fade-in-scale-up-transition"},{default:()=>e?i(He,{clsPrefix:o,class:`${o}-base-select-option__check`},{default:()=>i(Xd)}):null})}const xi=Z({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:o,pendingTmNodeRef:t,multipleRef:r,valueSetRef:n,renderLabelRef:l,renderOptionRef:a,labelFieldRef:s,valueFieldRef:d,showCheckmarkRef:c,nodePropsRef:u,handleOptionClick:f,handleOptionMouseEnter:p}=ze(kn),v=Ve(()=>{const{value:C}=t;return C?e.tmNode.key===C.key:!1});function h(C){const{tmNode:b}=e;b.disabled||f(C,b)}function m(C){const{tmNode:b}=e;b.disabled||p(C,b)}function x(C){const{tmNode:b}=e,{value:_}=v;b.disabled||_||p(C,b)}return{multiple:r,isGrouped:Ve(()=>{const{tmNode:C}=e,{parent:b}=C;return b&&b.rawNode.type==="group"}),showCheckmark:c,nodeProps:u,isPending:v,isSelected:Ve(()=>{const{value:C}=o,{value:b}=r;if(C===null)return!1;const _=e.tmNode.rawNode[d.value];if(b){const{value:k}=n;return k.has(_)}else return C===_}),labelField:s,renderLabel:l,renderOption:a,handleMouseMove:x,handleMouseEnter:m,handleClick:h}},render(){const{clsPrefix:e,tmNode:{rawNode:o},isSelected:t,isPending:r,isGrouped:n,showCheckmark:l,nodeProps:a,renderOption:s,renderLabel:d,handleClick:c,handleMouseEnter:u,handleMouseMove:f}=this,p=Ac(t,e),v=d?[d(o,t),l&&p]:[Qe(o[this.labelField],o,t),l&&p],h=a==null?void 0:a(o),m=i("div",Object.assign({},h,{class:[`${e}-base-select-option`,o.class,h==null?void 0:h.class,{[`${e}-base-select-option--disabled`]:o.disabled,[`${e}-base-select-option--selected`]:t,[`${e}-base-select-option--grouped`]:n,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:l}],style:[(h==null?void 0:h.style)||"",o.style||""],onClick:tr([c,h==null?void 0:h.onClick]),onMouseenter:tr([u,h==null?void 0:h.onMouseenter]),onMousemove:tr([f,h==null?void 0:h.onMousemove])}),i("div",{class:`${e}-base-select-option__content`},v));return o.render?o.render({node:m,option:o,selected:t}):s?s({node:m,option:o,selected:t}):m}}),Ci=Z({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:o,labelFieldRef:t,nodePropsRef:r}=ze(kn);return{labelField:t,nodeProps:r,renderLabel:e,renderOption:o}},render(){const{clsPrefix:e,renderLabel:o,renderOption:t,nodeProps:r,tmNode:{rawNode:n}}=this,l=r==null?void 0:r(n),a=o?o(n,!1):Qe(n[this.labelField],n,!1),s=i("div",Object.assign({},l,{class:[`${e}-base-select-group-header`,l==null?void 0:l.class]}),a);return n.render?n.render({node:s,option:n}):t?t({node:s,option:n,selected:!1}):s}}),{cubicBezierEaseIn:yi,cubicBezierEaseOut:wi}=zo;function ct({transformOrigin:e="inherit",duration:o=".2s",enterScale:t=".9",originalTransform:r="",originalTransition:n=""}={}){return[y("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${o} ${yi}, transform ${o} ${yi} ${n&&","+n}`}),y("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${o} ${wi}, transform ${o} ${wi} ${n&&","+n}`}),y("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${t})`}),y("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Ec=g("base-select-menu",`
|
|
|
line-height: 1.5;
|
|
|
outline: none;
|
|
|
z-index: 0;
|
|
|
position: relative;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier);
|
|
|
background-color: var(--n-color);
|
|
|
`,[g("scrollbar",`
|
|
|
max-height: var(--n-height);
|
|
|
`),g("virtual-list",`
|
|
|
max-height: var(--n-height);
|
|
|
`),g("base-select-option",`
|
|
|
min-height: var(--n-option-height);
|
|
|
font-size: var(--n-option-font-size);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[w("content",`
|
|
|
z-index: 1;
|
|
|
white-space: nowrap;
|
|
|
text-overflow: ellipsis;
|
|
|
overflow: hidden;
|
|
|
`)]),g("base-select-group-header",`
|
|
|
min-height: var(--n-option-height);
|
|
|
font-size: .93em;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`),g("base-select-menu-option-wrapper",`
|
|
|
position: relative;
|
|
|
width: 100%;
|
|
|
`),w("loading, empty",`
|
|
|
display: flex;
|
|
|
padding: 12px 32px;
|
|
|
flex: 1;
|
|
|
justify-content: center;
|
|
|
`),w("loading",`
|
|
|
color: var(--n-loading-color);
|
|
|
font-size: var(--n-loading-size);
|
|
|
`),w("header",`
|
|
|
padding: 8px var(--n-option-padding-left);
|
|
|
font-size: var(--n-option-font-size);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
border-bottom: 1px solid var(--n-action-divider-color);
|
|
|
color: var(--n-action-text-color);
|
|
|
`),w("action",`
|
|
|
padding: 8px var(--n-option-padding-left);
|
|
|
font-size: var(--n-option-font-size);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
border-top: 1px solid var(--n-action-divider-color);
|
|
|
color: var(--n-action-text-color);
|
|
|
`),g("base-select-group-header",`
|
|
|
position: relative;
|
|
|
cursor: default;
|
|
|
padding: var(--n-option-padding);
|
|
|
color: var(--n-group-header-text-color);
|
|
|
`),g("base-select-option",`
|
|
|
cursor: pointer;
|
|
|
position: relative;
|
|
|
padding: var(--n-option-padding);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier);
|
|
|
box-sizing: border-box;
|
|
|
color: var(--n-option-text-color);
|
|
|
opacity: 1;
|
|
|
`,[P("show-checkmark",`
|
|
|
padding-right: calc(var(--n-option-padding-right) + 20px);
|
|
|
`),y("&::before",`
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
left: 4px;
|
|
|
right: 4px;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
`),y("&:active",`
|
|
|
color: var(--n-option-text-color-pressed);
|
|
|
`),P("grouped",`
|
|
|
padding-left: calc(var(--n-option-padding-left) * 1.5);
|
|
|
`),P("pending",[y("&::before",`
|
|
|
background-color: var(--n-option-color-pending);
|
|
|
`)]),P("selected",`
|
|
|
color: var(--n-option-text-color-active);
|
|
|
`,[y("&::before",`
|
|
|
background-color: var(--n-option-color-active);
|
|
|
`),P("pending",[y("&::before",`
|
|
|
background-color: var(--n-option-color-active-pending);
|
|
|
`)])]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
`,[Ne("selected",`
|
|
|
color: var(--n-option-text-color-disabled);
|
|
|
`),P("selected",`
|
|
|
opacity: var(--n-option-opacity-disabled);
|
|
|
`)]),w("check",`
|
|
|
font-size: 16px;
|
|
|
position: absolute;
|
|
|
right: calc(var(--n-option-padding-right) - 4px);
|
|
|
top: calc(50% - 7px);
|
|
|
color: var(--n-option-check-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`,[ct({enterScale:"0.5"})])])]),On=Z({name:"InternalSelectMenu",props:Object.assign(Object.assign({},se.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,onToggle:Function}),setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=Ie(e),r=eo("InternalSelectMenu",t,o),n=se("InternalSelectMenu","-internal-select-menu",Ec,Ar,e,ae(e,"clsPrefix")),l=M(null),a=M(null),s=M(null),d=$(()=>e.treeMate.getFlattenedNodes()),c=$(()=>wd(d.value)),u=M(null);function f(){const{treeMate:F}=e;let B=null;const{value:q}=e;q===null?B=F.getFirstAvailableNode():(e.multiple?B=F.getNode((q||[])[(q||[]).length-1]):B=F.getNode(q),(!B||B.disabled)&&(B=F.getFirstAvailableNode())),V(B||null)}function p(){const{value:F}=u;F&&!e.treeMate.getNode(F.key)&&(u.value=null)}let v;Xe(()=>e.show,F=>{F?v=Xe(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():p(),lo(E)):p()},{immediate:!0}):v==null||v()},{immediate:!0}),So(()=>{v==null||v()});const h=$(()=>ko(n.value.self[N("optionHeight",e.size)])),m=$(()=>yo(n.value.self[N("padding",e.size)])),x=$(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),C=$(()=>{const F=d.value;return F&&F.length===0});function b(F){const{onToggle:B}=e;B&&B(F)}function _(F){const{onScroll:B}=e;B&&B(F)}function k(F){var B;(B=s.value)===null||B===void 0||B.sync(),_(F)}function z(){var F;(F=s.value)===null||F===void 0||F.sync()}function R(){const{value:F}=u;return F||null}function S(F,B){B.disabled||V(B,!1)}function L(F,B){B.disabled||b(B)}function I(F){var B;at(F,"action")||(B=e.onKeyup)===null||B===void 0||B.call(e,F)}function D(F){var B;at(F,"action")||(B=e.onKeydown)===null||B===void 0||B.call(e,F)}function W(F){var B;(B=e.onMousedown)===null||B===void 0||B.call(e,F),!e.focusable&&F.preventDefault()}function H(){const{value:F}=u;F&&V(F.getNext({loop:!0}),!0)}function j(){const{value:F}=u;F&&V(F.getPrev({loop:!0}),!0)}function V(F,B=!1){u.value=F,B&&E()}function E(){var F,B;const q=u.value;if(!q)return;const ee=c.value(q.key);ee!==null&&(e.virtualScroll?(F=a.value)===null||F===void 0||F.scrollTo({index:ee}):(B=s.value)===null||B===void 0||B.scrollTo({index:ee,elSize:h.value}))}function Y(F){var B,q;!((B=l.value)===null||B===void 0)&&B.contains(F.target)&&((q=e.onFocus)===null||q===void 0||q.call(e,F))}function K(F){var B,q;!((B=l.value)===null||B===void 0)&&B.contains(F.relatedTarget)||(q=e.onBlur)===null||q===void 0||q.call(e,F)}De(kn,{handleOptionMouseEnter:S,handleOptionClick:L,valueSetRef:x,pendingTmNodeRef:u,nodePropsRef:ae(e,"nodeProps"),showCheckmarkRef:ae(e,"showCheckmark"),multipleRef:ae(e,"multiple"),valueRef:ae(e,"value"),renderLabelRef:ae(e,"renderLabel"),renderOptionRef:ae(e,"renderOption"),labelFieldRef:ae(e,"labelField"),valueFieldRef:ae(e,"valueField")}),De(fl,l),po(()=>{const{value:F}=s;F&&F.sync()});const te=$(()=>{const{size:F}=e,{common:{cubicBezierEaseInOut:B},self:{height:q,borderRadius:ee,color:be,groupHeaderTextColor:me,actionDividerColor:Be,optionTextColorPressed:T,optionTextColor:ve,optionTextColorDisabled:Se,optionTextColorActive:Fe,optionOpacityDisabled:ne,optionCheckColor:Ce,actionTextColor:ge,optionColorPending:Ee,optionColorActive:Q,loadingColor:he,loadingSize:G,optionColorActivePending:U,[N("optionFontSize",F)]:le,[N("optionHeight",F)]:ye,[N("optionPadding",F)]:_e}}=n.value;return{"--n-height":q,"--n-action-divider-color":Be,"--n-action-text-color":ge,"--n-bezier":B,"--n-border-radius":ee,"--n-color":be,"--n-option-font-size":le,"--n-group-header-text-color":me,"--n-option-check-color":Ce,"--n-option-color-pending":Ee,"--n-option-color-active":Q,"--n-option-color-active-pending":U,"--n-option-height":ye,"--n-option-opacity-disabled":ne,"--n-option-text-color":ve,"--n-option-text-color-active":Fe,"--n-option-text-color-disabled":Se,"--n-option-text-color-pressed":T,"--n-option-padding":_e,"--n-option-padding-left":yo(_e,"left"),"--n-option-padding-right":yo(_e,"right"),"--n-loading-color":he,"--n-loading-size":G}}),{inlineThemeDisabled:xe}=e,de=xe?We("internal-select-menu",$(()=>e.size[0]),te,e):void 0,ie={selfRef:l,next:H,prev:j,getPendingTmNode:R};return gl(l,e.onResize),Object.assign({mergedTheme:n,mergedClsPrefix:o,rtlEnabled:r,virtualListRef:a,scrollbarRef:s,itemSize:h,padding:m,flattenedNodes:d,empty:C,virtualListContainer(){const{value:F}=a;return F==null?void 0:F.listElRef},virtualListContent(){const{value:F}=a;return F==null?void 0:F.itemsElRef},doScroll:_,handleFocusin:Y,handleFocusout:K,handleKeyUp:I,handleKeyDown:D,handleMouseDown:W,handleVirtualListResize:z,handleVirtualListScroll:k,cssVars:xe?void 0:te,themeClass:de==null?void 0:de.themeClass,onRender:de==null?void 0:de.onRender},ie)},render(){const{$slots:e,virtualScroll:o,clsPrefix:t,mergedTheme:r,themeClass:n,onRender:l}=this;return l==null||l(),i("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${t}-base-select-menu`,this.rtlEnabled&&`${t}-base-select-menu--rtl`,n,this.multiple&&`${t}-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},je(e.header,a=>a&&i("div",{class:`${t}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i("div",{class:`${t}-base-select-menu__loading`},i(Gt,{clsPrefix:t,strokeWidth:20})):this.empty?i("div",{class:`${t}-base-select-menu__empty`,"data-empty":!0},ao(e.empty,()=>[i(Tc,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty})])):i(gr,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:o?this.virtualListContainer:void 0,content:o?this.virtualListContent:void 0,onScroll:o?void 0:this.doScroll},{default:()=>o?i(fd,{ref:"virtualListRef",class:`${t}-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:a})=>a.isGroup?i(Ci,{key:a.key,clsPrefix:t,tmNode:a}):a.ignored?null:i(xi,{clsPrefix:t,key:a.key,tmNode:a})}):i("div",{class:`${t}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i(Ci,{key:a.key,clsPrefix:t,tmNode:a}):i(xi,{clsPrefix:t,key:a.key,tmNode:a})))}),je(e.action,a=>a&&[i("div",{class:`${t}-base-select-menu__action`,"data-action":!0,key:"action"},a),i(vc,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),jc=g("base-wave",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
border-radius: inherit;
|
|
|
`),Bl=Z({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){Xo("-base-wave",jc,ae(e,"clsPrefix"));const o=M(null),t=M(!1);let r=null;return So(()=>{r!==null&&window.clearTimeout(r)}),{active:t,selfRef:o,play(){r!==null&&(window.clearTimeout(r),t.value=!1,r=null),lo(()=>{var n;(n=o.value)===null||n===void 0||n.offsetHeight,t.value=!0,r=window.setTimeout(()=>{t.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return i("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),Wc={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"},Tl=e=>{const{boxShadow2:o,popoverColor:t,textColor2:r,borderRadius:n,fontSize:l,dividerColor:a}=e;return Object.assign(Object.assign({},Wc),{fontSize:l,borderRadius:n,color:t,dividerColor:a,textColor:r,boxShadow:o})},Nc={name:"Popover",common:Ae,self:Tl},qt=Nc,Vc={name:"Popover",common:fe,self:Tl},It=Vc,Jr={top:"bottom",bottom:"top",left:"right",right:"left"},no="var(--n-arrow-height) * 1.414",Uc=y([g("popover",`
|
|
|
transition:
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
position: relative;
|
|
|
font-size: var(--n-font-size);
|
|
|
color: var(--n-text-color);
|
|
|
box-shadow: var(--n-box-shadow);
|
|
|
word-break: break-word;
|
|
|
`,[y(">",[g("scrollbar",`
|
|
|
height: inherit;
|
|
|
max-height: inherit;
|
|
|
`)]),Ne("raw",`
|
|
|
background-color: var(--n-color);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
`,[Ne("scrollable",[Ne("show-header-or-footer","padding: var(--n-padding);")])]),w("header",`
|
|
|
padding: var(--n-padding);
|
|
|
border-bottom: 1px solid var(--n-divider-color);
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),w("footer",`
|
|
|
padding: var(--n-padding);
|
|
|
border-top: 1px solid var(--n-divider-color);
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),P("scrollable, show-header-or-footer",[w("content",`
|
|
|
padding: var(--n-padding);
|
|
|
`)])]),g("popover-shared",`
|
|
|
transform-origin: inherit;
|
|
|
`,[g("popover-arrow-wrapper",`
|
|
|
position: absolute;
|
|
|
overflow: hidden;
|
|
|
pointer-events: none;
|
|
|
`,[g("popover-arrow",`
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
position: absolute;
|
|
|
display: block;
|
|
|
width: calc(${no});
|
|
|
height: calc(${no});
|
|
|
box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
|
|
|
transform: rotate(45deg);
|
|
|
background-color: var(--n-color);
|
|
|
pointer-events: all;
|
|
|
`)]),y("&.popover-transition-enter-from, &.popover-transition-leave-to",`
|
|
|
opacity: 0;
|
|
|
transform: scale(.85);
|
|
|
`),y("&.popover-transition-enter-to, &.popover-transition-leave-from",`
|
|
|
transform: scale(1);
|
|
|
opacity: 1;
|
|
|
`),y("&.popover-transition-enter-active",`
|
|
|
transition:
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
opacity .15s var(--n-bezier-ease-out),
|
|
|
transform .15s var(--n-bezier-ease-out);
|
|
|
`),y("&.popover-transition-leave-active",`
|
|
|
transition:
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
opacity .15s var(--n-bezier-ease-in),
|
|
|
transform .15s var(--n-bezier-ease-in);
|
|
|
`)]),Mo("top-start",`
|
|
|
top: calc(${no} / -2);
|
|
|
left: calc(${et("top-start")} - var(--v-offset-left));
|
|
|
`),Mo("top",`
|
|
|
top: calc(${no} / -2);
|
|
|
transform: translateX(calc(${no} / -2)) rotate(45deg);
|
|
|
left: 50%;
|
|
|
`),Mo("top-end",`
|
|
|
top: calc(${no} / -2);
|
|
|
right: calc(${et("top-end")} + var(--v-offset-left));
|
|
|
`),Mo("bottom-start",`
|
|
|
bottom: calc(${no} / -2);
|
|
|
left: calc(${et("bottom-start")} - var(--v-offset-left));
|
|
|
`),Mo("bottom",`
|
|
|
bottom: calc(${no} / -2);
|
|
|
transform: translateX(calc(${no} / -2)) rotate(45deg);
|
|
|
left: 50%;
|
|
|
`),Mo("bottom-end",`
|
|
|
bottom: calc(${no} / -2);
|
|
|
right: calc(${et("bottom-end")} + var(--v-offset-left));
|
|
|
`),Mo("left-start",`
|
|
|
left: calc(${no} / -2);
|
|
|
top: calc(${et("left-start")} - var(--v-offset-top));
|
|
|
`),Mo("left",`
|
|
|
left: calc(${no} / -2);
|
|
|
transform: translateY(calc(${no} / -2)) rotate(45deg);
|
|
|
top: 50%;
|
|
|
`),Mo("left-end",`
|
|
|
left: calc(${no} / -2);
|
|
|
bottom: calc(${et("left-end")} + var(--v-offset-top));
|
|
|
`),Mo("right-start",`
|
|
|
right: calc(${no} / -2);
|
|
|
top: calc(${et("right-start")} - var(--v-offset-top));
|
|
|
`),Mo("right",`
|
|
|
right: calc(${no} / -2);
|
|
|
transform: translateY(calc(${no} / -2)) rotate(45deg);
|
|
|
top: 50%;
|
|
|
`),Mo("right-end",`
|
|
|
right: calc(${no} / -2);
|
|
|
bottom: calc(${et("right-end")} + var(--v-offset-top));
|
|
|
`),...xd({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,o)=>{const t=["right","left"].includes(o),r=t?"width":"height";return e.map(n=>{const l=n.split("-")[1]==="end",s=`calc((${`var(--v-target-${r}, 0px)`} - ${no}) / 2)`,d=et(n);return y(`[v-placement="${n}"] >`,[g("popover-shared",[P("center-arrow",[g("popover-arrow",`${o}: calc(max(${s}, ${d}) ${l?"+":"-"} var(--v-offset-${t?"left":"top"}));`)])])])})})]);function et(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Mo(e,o){const t=e.split("-")[0],r=["top","bottom"].includes(t)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return y(`[v-placement="${e}"] >`,[g("popover-shared",`
|
|
|
margin-${Jr[t]}: var(--n-space);
|
|
|
`,[P("show-arrow",`
|
|
|
margin-${Jr[t]}: var(--n-space-arrow);
|
|
|
`),P("overlap",`
|
|
|
margin: 0;
|
|
|
`),Fd("popover-arrow-wrapper",`
|
|
|
right: 0;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
${t}: 100%;
|
|
|
${Jr[t]}: auto;
|
|
|
${r}
|
|
|
`,[g("popover-arrow",o)])])])}const Ol=Object.assign(Object.assign({},se.props),{to:Oo.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number}),Fl=({arrowClass:e,arrowStyle:o,arrowWrapperClass:t,arrowWrapperStyle:r,clsPrefix:n})=>i("div",{key:"__popover-arrow__",style:r,class:[`${n}-popover-arrow-wrapper`,t]},i("div",{class:[`${n}-popover-arrow`,e],style:o})),Kc=Z({name:"PopoverBody",inheritAttrs:!1,props:Ol,setup(e,{slots:o,attrs:t}){const{namespaceRef:r,mergedClsPrefixRef:n,inlineThemeDisabled:l}=Ie(e),a=se("Popover","-popover",Uc,qt,e,n),s=M(null),d=ze("NPopover"),c=M(null),u=M(e.show),f=M(!1);oo(()=>{const{show:S}=e;S&&!_d()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=$(()=>{const{trigger:S,onClickoutside:L}=e,I=[],{positionManuallyRef:{value:D}}=d;return D||(S==="click"&&!L&&I.push([At,k,void 0,{capture:!0}]),S==="hover"&&I.push([Sd,_])),L&&I.push([At,k,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&I.push([Go,e.show]),I}),v=$(()=>{const S=e.width==="trigger"?void 0:ro(e.width),L=[];S&&L.push({width:S});const{maxWidth:I,minWidth:D}=e;return I&&L.push({maxWidth:ro(I)}),D&&L.push({maxWidth:ro(D)}),l||L.push(h.value),L}),h=$(()=>{const{common:{cubicBezierEaseInOut:S,cubicBezierEaseIn:L,cubicBezierEaseOut:I},self:{space:D,spaceArrow:W,padding:H,fontSize:j,textColor:V,dividerColor:E,color:Y,boxShadow:K,borderRadius:te,arrowHeight:xe,arrowOffset:de,arrowOffsetVertical:ie}}=a.value;return{"--n-box-shadow":K,"--n-bezier":S,"--n-bezier-ease-in":L,"--n-bezier-ease-out":I,"--n-font-size":j,"--n-text-color":V,"--n-color":Y,"--n-divider-color":E,"--n-border-radius":te,"--n-arrow-height":xe,"--n-arrow-offset":de,"--n-arrow-offset-vertical":ie,"--n-padding":H,"--n-space":D,"--n-space-arrow":W}}),m=l?We("popover",void 0,h,e):void 0;d.setBodyInstance({syncPosition:x}),So(()=>{d.setBodyInstance(null)}),Xe(ae(e,"show"),S=>{e.animated||(S?u.value=!0:u.value=!1)});function x(){var S;(S=s.value)===null||S===void 0||S.syncPosition()}function C(S){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(S)}function b(S){e.trigger==="hover"&&e.keepAliveOnHover&&d.handleMouseLeave(S)}function _(S){e.trigger==="hover"&&!z().contains(rr(S))&&d.handleMouseMoveOutside(S)}function k(S){(e.trigger==="click"&&!z().contains(rr(S))||e.onClickoutside)&&d.handleClickOutside(S)}function z(){return d.getTriggerElement()}De(Nt,c),De(vr,null),De(pr,null);function R(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let L;const I=d.internalRenderBodyRef.value,{value:D}=n;if(I)L=I([`${D}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${D}-popover-shared--overlap`,e.showArrow&&`${D}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${D}-popover-shared--center-arrow`],c,v.value,C,b);else{const{value:W}=d.extraClassRef,{internalTrapFocus:H}=e,j=!xt(o.header)||!xt(o.footer),V=()=>{var E,Y;const K=j?i(so,null,je(o.header,de=>de?i("div",{class:[`${D}-popover__header`,e.headerClass],style:e.headerStyle},de):null),je(o.default,de=>de?i("div",{class:[`${D}-popover__content`,e.contentClass],style:e.contentStyle},o):null),je(o.footer,de=>de?i("div",{class:[`${D}-popover__footer`,e.footerClass],style:e.footerStyle},de):null)):e.scrollable?(E=o.default)===null||E===void 0?void 0:E.call(o):i("div",{class:[`${D}-popover__content`,e.contentClass],style:e.contentStyle},o),te=e.scrollable?i(kl,{contentClass:j?void 0:`${D}-popover__content ${(Y=e.contentClass)!==null&&Y!==void 0?Y:""}`,contentStyle:j?void 0:e.contentStyle},{default:()=>K}):K,xe=e.showArrow?Fl({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:D}):null;return[te,xe]};L=i("div",To({class:[`${D}-popover`,`${D}-popover-shared`,m==null?void 0:m.themeClass.value,W.map(E=>`${D}-${E}`),{[`${D}-popover--scrollable`]:e.scrollable,[`${D}-popover--show-header-or-footer`]:j,[`${D}-popover--raw`]:e.raw,[`${D}-popover-shared--overlap`]:e.overlap,[`${D}-popover-shared--show-arrow`]:e.showArrow,[`${D}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:v.value,onKeydown:d.handleKeydown,onMouseenter:C,onMouseleave:b},t),H?i(zn,{active:e.show,autoFocus:!0},{default:V}):V())}return Ho(L,p.value)}return{displayed:f,namespace:r,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:s,adjustedTo:Oo(e),followerEnabled:u,renderContentNode:R}},render(){return i(Or,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Oo.tdkey},{default:()=>this.animated?i(io,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),Gc=Object.keys(Ol),qc={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Yc(e,o,t){qc[o].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const n=e.props[r],l=t[r];n?e.props[r]=(...a)=>{n(...a),l(...a)}:e.props[r]=l})}const wt={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Oo.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Xc=Object.assign(Object.assign(Object.assign({},se.props),wt),{internalOnAfterLeave:Function,internalRenderBody:Function}),br=Z({name:"Popover",inheritAttrs:!1,props:Xc,__popover__:!0,setup(e){const o=zt(),t=M(null),r=$(()=>e.show),n=M(e.defaultShow),l=co(r,n),a=Ve(()=>e.disabled?!1:l.value),s=()=>{if(e.disabled)return!0;const{getDisabled:E}=e;return!!(E!=null&&E())},d=()=>s()?!1:l.value,c=Ct(e,["arrow","showArrow"]),u=$(()=>e.overlap?!1:c.value);let f=null;const p=M(null),v=M(null),h=Ve(()=>e.x!==void 0&&e.y!==void 0);function m(E){const{"onUpdate:show":Y,onUpdateShow:K,onShow:te,onHide:xe}=e;n.value=E,Y&&ce(Y,E),K&&ce(K,E),E&&te&&ce(te,!0),E&&xe&&ce(xe,!1)}function x(){f&&f.syncPosition()}function C(){const{value:E}=p;E&&(window.clearTimeout(E),p.value=null)}function b(){const{value:E}=v;E&&(window.clearTimeout(E),v.value=null)}function _(){const E=s();if(e.trigger==="focus"&&!E){if(d())return;m(!0)}}function k(){const E=s();if(e.trigger==="focus"&&!E){if(!d())return;m(!1)}}function z(){const E=s();if(e.trigger==="hover"&&!E){if(b(),p.value!==null||d())return;const Y=()=>{m(!0),p.value=null},{delay:K}=e;K===0?Y():p.value=window.setTimeout(Y,K)}}function R(){const E=s();if(e.trigger==="hover"&&!E){if(C(),v.value!==null||!d())return;const Y=()=>{m(!1),v.value=null},{duration:K}=e;K===0?Y():v.value=window.setTimeout(Y,K)}}function S(){R()}function L(E){var Y;d()&&(e.trigger==="click"&&(C(),b(),m(!1)),(Y=e.onClickoutside)===null||Y===void 0||Y.call(e,E))}function I(){if(e.trigger==="click"&&!s()){C(),b();const E=!d();m(E)}}function D(E){e.internalTrapFocus&&E.key==="Escape"&&(C(),b(),m(!1))}function W(E){n.value=E}function H(){var E;return(E=t.value)===null||E===void 0?void 0:E.targetRef}function j(E){f=E}return De("NPopover",{getTriggerElement:H,handleKeydown:D,handleMouseEnter:z,handleMouseLeave:R,handleClickOutside:L,handleMouseMoveOutside:S,setBodyInstance:j,positionManuallyRef:h,isMountedRef:o,zIndexRef:ae(e,"zIndex"),extraClassRef:ae(e,"internalExtraClass"),internalRenderBodyRef:ae(e,"internalRenderBody")}),oo(()=>{l.value&&s()&&m(!1)}),{binderInstRef:t,positionManually:h,mergedShowConsideringDisabledProp:a,uncontrolledShow:n,mergedShowArrow:u,getMergedShow:d,setShow:W,handleClick:I,handleMouseEnter:z,handleMouseLeave:R,handleFocus:_,handleBlur:k,syncPosition:x}},render(){var e;const{positionManually:o,$slots:t}=this;let r,n=!1;if(!o&&(t.activator?r=hn(t,"activator"):r=hn(t,"trigger"),r)){r=nr(r),r=r.type===dd?i("span",[r]):r;const l={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)n=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[l,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[l];else{const{internalInheritedEventHandlers:a}=this,s=[l,...a],d={onBlur:c=>{s.forEach(u=>{u.onBlur(c)})},onFocus:c=>{s.forEach(u=>{u.onFocus(c)})},onClick:c=>{s.forEach(u=>{u.onClick(c)})},onMouseenter:c=>{s.forEach(u=>{u.onMouseenter(c)})},onMouseleave:c=>{s.forEach(u=>{u.onMouseleave(c)})}};Yc(r,a?"nested":o?"manual":this.trigger,d)}}return i(_r,{ref:"binderInstRef",syncTarget:!n,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const l=this.getMergedShow();return[this.internalTrapFocus&&l?Ho(i("div",{style:{position:"fixed",inset:0}}),[[Mr,{enabled:l,zIndex:this.zIndex}]]):null,o?null:i(Fr,null,{default:()=>r}),i(Kc,mo(this.$props,Gc,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:l})),{default:()=>{var a,s;return(s=(a=this.$slots).default)===null||s===void 0?void 0:s.call(a)},header:()=>{var a,s;return(s=(a=this.$slots).header)===null||s===void 0?void 0:s.call(a)},footer:()=>{var a,s;return(s=(a=this.$slots).footer)===null||s===void 0?void 0:s.call(a)}})]}})}}),_l={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"},Zc={name:"Tag",common:fe,self(e){const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,tagColor:f,opacityDisabled:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:x,closeColorPressed:C,borderRadiusSmall:b,fontSizeMini:_,fontSizeTiny:k,fontSizeSmall:z,fontSizeMedium:R,heightMini:S,heightTiny:L,heightSmall:I,heightMedium:D,buttonColor2Hover:W,buttonColor2Pressed:H,fontWeightStrong:j}=e;return Object.assign(Object.assign({},_l),{closeBorderRadius:b,heightTiny:S,heightSmall:L,heightMedium:I,heightLarge:D,borderRadius:b,opacityDisabled:p,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:z,fontSizeLarge:R,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:W,colorPressedCheckable:H,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:f,colorBordered:"#0000",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:x,closeColorPressed:C,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:to(n,{lightness:.7}),closeIconColorHoverPrimary:to(n,{lightness:.7}),closeIconColorPressedPrimary:to(n,{lightness:.7}),closeColorHoverPrimary:J(n,{alpha:.16}),closeColorPressedPrimary:J(n,{alpha:.12}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:to(l,{alpha:.7}),closeIconColorHoverInfo:to(l,{alpha:.7}),closeIconColorPressedInfo:to(l,{alpha:.7}),closeColorHoverInfo:J(l,{alpha:.16}),closeColorPressedInfo:J(l,{alpha:.12}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:to(a,{alpha:.7}),closeIconColorHoverSuccess:to(a,{alpha:.7}),closeIconColorPressedSuccess:to(a,{alpha:.7}),closeColorHoverSuccess:J(a,{alpha:.16}),closeColorPressedSuccess:J(a,{alpha:.12}),borderWarning:`1px solid ${J(s,{alpha:.3})}`,textColorWarning:s,colorWarning:J(s,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:to(s,{alpha:.7}),closeIconColorHoverWarning:to(s,{alpha:.7}),closeIconColorPressedWarning:to(s,{alpha:.7}),closeColorHoverWarning:J(s,{alpha:.16}),closeColorPressedWarning:J(s,{alpha:.11}),borderError:`1px solid ${J(d,{alpha:.3})}`,textColorError:d,colorError:J(d,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:to(d,{alpha:.7}),closeIconColorHoverError:to(d,{alpha:.7}),closeIconColorPressedError:to(d,{alpha:.7}),closeColorHoverError:J(d,{alpha:.16}),closeColorPressedError:J(d,{alpha:.12})})}},Ml=Zc,Qc=e=>{const{textColor2:o,primaryColorHover:t,primaryColorPressed:r,primaryColor:n,infoColor:l,successColor:a,warningColor:s,errorColor:d,baseColor:c,borderColor:u,opacityDisabled:f,tagColor:p,closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,borderRadiusSmall:x,fontSizeMini:C,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:k,heightMini:z,heightTiny:R,heightSmall:S,heightMedium:L,closeColorHover:I,closeColorPressed:D,buttonColor2Hover:W,buttonColor2Pressed:H,fontWeightStrong:j}=e;return Object.assign(Object.assign({},_l),{closeBorderRadius:x,heightTiny:z,heightSmall:R,heightMedium:S,heightLarge:L,borderRadius:x,opacityDisabled:f,fontSizeTiny:C,fontSizeSmall:b,fontSizeMedium:_,fontSizeLarge:k,fontWeightStrong:j,textColorCheckable:o,textColorHoverCheckable:o,textColorPressedCheckable:o,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:W,colorPressedCheckable:H,colorChecked:n,colorCheckedHover:t,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:o,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:v,closeIconColorHover:h,closeIconColorPressed:m,closeColorHover:I,closeColorPressed:D,borderPrimary:`1px solid ${J(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:J(n,{alpha:.12}),colorBorderedPrimary:J(n,{alpha:.1}),closeIconColorPrimary:n,closeIconColorHoverPrimary:n,closeIconColorPressedPrimary:n,closeColorHoverPrimary:J(n,{alpha:.12}),closeColorPressedPrimary:J(n,{alpha:.18}),borderInfo:`1px solid ${J(l,{alpha:.3})}`,textColorInfo:l,colorInfo:J(l,{alpha:.12}),colorBorderedInfo:J(l,{alpha:.1}),closeIconColorInfo:l,closeIconColorHoverInfo:l,closeIconColorPressedInfo:l,closeColorHoverInfo:J(l,{alpha:.12}),closeColorPressedInfo:J(l,{alpha:.18}),borderSuccess:`1px solid ${J(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:J(a,{alpha:.12}),colorBorderedSuccess:J(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:J(a,{alpha:.12}),closeColorPressedSuccess:J(a,{alpha:.18}),borderWarning:`1px solid ${J(s,{alpha:.35})}`,textColorWarning:s,colorWarning:J(s,{alpha:.15}),colorBorderedWarning:J(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:J(s,{alpha:.12}),closeColorPressedWarning:J(s,{alpha:.18}),borderError:`1px solid ${J(d,{alpha:.23})}`,textColorError:d,colorError:J(d,{alpha:.1}),colorBorderedError:J(d,{alpha:.08}),closeIconColorError:d,closeIconColorHoverError:d,closeIconColorPressedError:d,closeColorHoverError:J(d,{alpha:.12}),closeColorPressedError:J(d,{alpha:.18})})},Jc={name:"Tag",common:Ae,self:Qc},eu=Jc,ou={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},tu=g("tag",`
|
|
|
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
|
|
|
white-space: nowrap;
|
|
|
position: relative;
|
|
|
box-sizing: border-box;
|
|
|
cursor: default;
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: nowrap;
|
|
|
padding: var(--n-padding);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
color: var(--n-text-color);
|
|
|
background-color: var(--n-color);
|
|
|
transition:
|
|
|
border-color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier);
|
|
|
line-height: 1;
|
|
|
height: var(--n-height);
|
|
|
font-size: var(--n-font-size);
|
|
|
`,[P("strong",`
|
|
|
font-weight: var(--n-font-weight-strong);
|
|
|
`),w("border",`
|
|
|
pointer-events: none;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
border-radius: inherit;
|
|
|
border: var(--n-border);
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),w("icon",`
|
|
|
display: flex;
|
|
|
margin: 0 4px 0 0;
|
|
|
color: var(--n-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
font-size: var(--n-avatar-size-override);
|
|
|
`),w("avatar",`
|
|
|
display: flex;
|
|
|
margin: 0 6px 0 0;
|
|
|
`),w("close",`
|
|
|
margin: var(--n-close-margin);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`),P("round",`
|
|
|
padding: 0 calc(var(--n-height) / 3);
|
|
|
border-radius: calc(var(--n-height) / 2);
|
|
|
`,[w("icon",`
|
|
|
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
|
|
|
`),w("avatar",`
|
|
|
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
|
|
|
`),P("closable",`
|
|
|
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
|
|
|
`)]),P("icon, avatar",[P("round",`
|
|
|
padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
|
|
|
`)]),P("disabled",`
|
|
|
cursor: not-allowed !important;
|
|
|
opacity: var(--n-opacity-disabled);
|
|
|
`),P("checkable",`
|
|
|
cursor: pointer;
|
|
|
box-shadow: none;
|
|
|
color: var(--n-text-color-checkable);
|
|
|
background-color: var(--n-color-checkable);
|
|
|
`,[Ne("disabled",[y("&:hover","background-color: var(--n-color-hover-checkable);",[Ne("checked","color: var(--n-text-color-hover-checkable);")]),y("&:active","background-color: var(--n-color-pressed-checkable);",[Ne("checked","color: var(--n-text-color-pressed-checkable);")])]),P("checked",`
|
|
|
color: var(--n-text-color-checked);
|
|
|
background-color: var(--n-color-checked);
|
|
|
`,[Ne("disabled",[y("&:hover","background-color: var(--n-color-checked-hover);"),y("&:active","background-color: var(--n-color-checked-pressed);")])])])]),ru=Object.assign(Object.assign(Object.assign({},se.props),ou),{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}),Dl="n-tag",en=Z({name:"Tag",props:ru,setup(e){const o=M(null),{mergedBorderedRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:n,mergedRtlRef:l}=Ie(e),a=se("Tag","-tag",tu,eu,e,r);De(Dl,{roundRef:ae(e,"round")});function s(v){if(!e.disabled&&e.checkable){const{checked:h,onCheckedChange:m,onUpdateChecked:x,"onUpdate:checked":C}=e;x&&x(!h),C&&C(!h),m&&m(!h)}}function d(v){if(e.triggerClickOnClose||v.stopPropagation(),!e.disabled){const{onClose:h}=e;h&&ce(h,v)}}const c={setTextContent(v){const{value:h}=o;h&&(h.textContent=v)}},u=eo("Tag",l,r),f=$(()=>{const{type:v,size:h,color:{color:m,textColor:x}={}}=e,{common:{cubicBezierEaseInOut:C},self:{padding:b,closeMargin:_,borderRadius:k,opacityDisabled:z,textColorCheckable:R,textColorHoverCheckable:S,textColorPressedCheckable:L,textColorChecked:I,colorCheckable:D,colorHoverCheckable:W,colorPressedCheckable:H,colorChecked:j,colorCheckedHover:V,colorCheckedPressed:E,closeBorderRadius:Y,fontWeightStrong:K,[N("colorBordered",v)]:te,[N("closeSize",h)]:xe,[N("closeIconSize",h)]:de,[N("fontSize",h)]:ie,[N("height",h)]:F,[N("color",v)]:B,[N("textColor",v)]:q,[N("border",v)]:ee,[N("closeIconColor",v)]:be,[N("closeIconColorHover",v)]:me,[N("closeIconColorPressed",v)]:Be,[N("closeColorHover",v)]:T,[N("closeColorPressed",v)]:ve}}=a.value,Se=yo(_);return{"--n-font-weight-strong":K,"--n-avatar-size-override":`calc(${F} - 8px)`,"--n-bezier":C,"--n-border-radius":k,"--n-border":ee,"--n-close-icon-size":de,"--n-close-color-pressed":ve,"--n-close-color-hover":T,"--n-close-border-radius":Y,"--n-close-icon-color":be,"--n-close-icon-color-hover":me,"--n-close-icon-color-pressed":Be,"--n-close-icon-color-disabled":be,"--n-close-margin-top":Se.top,"--n-close-margin-right":Se.right,"--n-close-margin-bottom":Se.bottom,"--n-close-margin-left":Se.left,"--n-close-size":xe,"--n-color":m||(t.value?te:B),"--n-color-checkable":D,"--n-color-checked":j,"--n-color-checked-hover":V,"--n-color-checked-pressed":E,"--n-color-hover-checkable":W,"--n-color-pressed-checkable":H,"--n-font-size":ie,"--n-height":F,"--n-opacity-disabled":z,"--n-padding":b,"--n-text-color":x||q,"--n-text-color-checkable":R,"--n-text-color-checked":I,"--n-text-color-hover-checkable":S,"--n-text-color-pressed-checkable":L}}),p=n?We("tag",$(()=>{let v="";const{type:h,size:m,color:{color:x,textColor:C}={}}=e;return v+=h[0],v+=m[0],x&&(v+=`a${Et(x)}`),C&&(v+=`b${Et(C)}`),t.value&&(v+="c"),v}),f,e):void 0;return Object.assign(Object.assign({},c),{rtlEnabled:u,mergedClsPrefix:r,contentRef:o,mergedBordered:t,handleClick:s,handleCloseClick:d,cssVars:n?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,o;const{mergedClsPrefix:t,rtlEnabled:r,closable:n,color:{borderColor:l}={},round:a,onRender:s,$slots:d}=this;s==null||s();const c=je(d.avatar,f=>f&&i("div",{class:`${t}-tag__avatar`},f)),u=je(d.icon,f=>f&&i("div",{class:`${t}-tag__icon`},f));return i("div",{class:[`${t}-tag`,this.themeClass,{[`${t}-tag--rtl`]:r,[`${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`]:u,[`${t}-tag--closable`]:n}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||c,i("span",{class:`${t}-tag__content`,ref:"contentRef"},(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)),!this.checkable&&n?i(Pt,{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?i("div",{class:`${t}-tag__border`,style:{borderColor:l}}):null)}}),nu=g("base-clear",`
|
|
|
flex-shrink: 0;
|
|
|
height: 1em;
|
|
|
width: 1em;
|
|
|
position: relative;
|
|
|
`,[y(">",[w("clear",`
|
|
|
font-size: var(--n-clear-size);
|
|
|
height: 1em;
|
|
|
width: 1em;
|
|
|
cursor: pointer;
|
|
|
color: var(--n-clear-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
display: flex;
|
|
|
`,[y("&:hover",`
|
|
|
color: var(--n-clear-color-hover)!important;
|
|
|
`),y("&:active",`
|
|
|
color: var(--n-clear-color-pressed)!important;
|
|
|
`)]),w("placeholder",`
|
|
|
display: flex;
|
|
|
`),w("clear, placeholder",`
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
`,[dt({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),gn=Z({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Xo("-base-clear",nu,ae(e,"clsPrefix")),{handleMouseDown(o){o.preventDefault()}}},render(){const{clsPrefix:e}=this;return i("div",{class:`${e}-base-clear`},i(Kt,null,{default:()=>{var o,t;return this.show?i("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},ao(this.$slots.icon,()=>[i(He,{clsPrefix:e},{default:()=>i(ic,null)})])):i("div",{key:"icon",class:`${e}-base-clear__placeholder`},(t=(o=this.$slots).placeholder)===null||t===void 0?void 0:t.call(o))}}))}}),Ll=Z({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:o}){return()=>{const{clsPrefix:t}=e;return i(Gt,{clsPrefix:t,class:`${t}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i(gn,{clsPrefix:t,show:e.showClear,onClear:e.onClear},{placeholder:()=>i(He,{clsPrefix:t,class:`${t}-base-suffix__arrow`},{default:()=>ao(o.default,()=>[i(nc,null)])})}):null})}}}),Hl={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},iu=e=>{const{borderRadius:o,textColor2:t,textColorDisabled:r,inputColor:n,inputColorDisabled:l,primaryColor:a,primaryColorHover:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,borderColor:p,iconColor:v,iconColorDisabled:h,clearColor:m,clearColorHover:x,clearColorPressed:C,placeholderColor:b,placeholderColorDisabled:_,fontSizeTiny:k,fontSizeSmall:z,fontSizeMedium:R,fontSizeLarge:S,heightTiny:L,heightSmall:I,heightMedium:D,heightLarge:W}=e;return Object.assign(Object.assign({},Hl),{fontSizeTiny:k,fontSizeSmall:z,fontSizeMedium:R,fontSizeLarge:S,heightTiny:L,heightSmall:I,heightMedium:D,heightLarge:W,borderRadius:o,textColor:t,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:_,color:n,colorDisabled:l,colorActive:n,border:`1px solid ${p}`,borderHover:`1px solid ${s}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${s}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${J(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${J(a,{alpha:.2})}`,caretColor:a,arrowColor:v,arrowColorDisabled:h,loadingColor:a,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${d}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${J(d,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${J(d,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:d,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${J(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${J(u,{alpha:.2})}`,colorActiveError:n,caretColorError:u,clearColor:m,clearColorHover:x,clearColorPressed:C})},lu={name:"InternalSelection",common:Ae,peers:{Popover:qt},self:iu},Al=lu,au={name:"InternalSelection",common:fe,peers:{Popover:It},self(e){const{borderRadius:o,textColor2:t,textColorDisabled:r,inputColor:n,inputColorDisabled:l,primaryColor:a,primaryColorHover:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,iconColor:p,iconColorDisabled:v,clearColor:h,clearColorHover:m,clearColorPressed:x,placeholderColor:C,placeholderColorDisabled:b,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:z,fontSizeLarge:R,heightTiny:S,heightSmall:L,heightMedium:I,heightLarge:D}=e;return Object.assign(Object.assign({},Hl),{fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:z,fontSizeLarge:R,heightTiny:S,heightSmall:L,heightMedium:I,heightLarge:D,borderRadius:o,textColor:t,textColorDisabled:r,placeholderColor:C,placeholderColorDisabled:b,color:n,colorDisabled:l,colorActive:J(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${s}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${s}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${J(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${J(a,{alpha:.4})}`,caretColor:a,arrowColor:p,arrowColorDisabled:v,loadingColor:a,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${d}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${J(d,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${J(d,{alpha:.4})}`,colorActiveWarning:J(d,{alpha:.1}),caretColorWarning:d,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${J(u,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${J(u,{alpha:.4})}`,colorActiveError:J(u,{alpha:.1}),caretColorError:u,clearColor:h,clearColorHover:m,clearColorPressed:x})}},Fn=au,su=y([g("base-selection",`
|
|
|
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
|
|
|
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
|
|
|
position: relative;
|
|
|
z-index: auto;
|
|
|
box-shadow: none;
|
|
|
width: 100%;
|
|
|
max-width: 100%;
|
|
|
display: inline-block;
|
|
|
vertical-align: bottom;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
min-height: var(--n-height);
|
|
|
line-height: 1.5;
|
|
|
font-size: var(--n-font-size);
|
|
|
`,[g("base-loading",`
|
|
|
color: var(--n-loading-color);
|
|
|
`),g("base-selection-tags","min-height: var(--n-height);"),w("border, state-border",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
pointer-events: none;
|
|
|
border: var(--n-border);
|
|
|
border-radius: inherit;
|
|
|
transition:
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`),w("state-border",`
|
|
|
z-index: 1;
|
|
|
border-color: #0000;
|
|
|
`),g("base-suffix",`
|
|
|
cursor: pointer;
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
right: 10px;
|
|
|
`,[w("arrow",`
|
|
|
font-size: var(--n-arrow-size);
|
|
|
color: var(--n-arrow-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)]),g("base-selection-overlay",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
white-space: nowrap;
|
|
|
pointer-events: none;
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
padding: var(--n-padding-single);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`,[w("wrapper",`
|
|
|
flex-basis: 0;
|
|
|
flex-grow: 1;
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
`)]),g("base-selection-placeholder",`
|
|
|
color: var(--n-placeholder-color);
|
|
|
`,[w("inner",`
|
|
|
max-width: 100%;
|
|
|
overflow: hidden;
|
|
|
`)]),g("base-selection-tags",`
|
|
|
cursor: pointer;
|
|
|
outline: none;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
z-index: auto;
|
|
|
display: flex;
|
|
|
padding: var(--n-padding-multiple);
|
|
|
flex-wrap: wrap;
|
|
|
align-items: center;
|
|
|
width: 100%;
|
|
|
vertical-align: bottom;
|
|
|
background-color: var(--n-color);
|
|
|
border-radius: inherit;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
`),g("base-selection-label",`
|
|
|
height: var(--n-height);
|
|
|
display: inline-flex;
|
|
|
width: 100%;
|
|
|
vertical-align: bottom;
|
|
|
cursor: pointer;
|
|
|
outline: none;
|
|
|
z-index: auto;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
border-radius: inherit;
|
|
|
background-color: var(--n-color);
|
|
|
align-items: center;
|
|
|
`,[g("base-selection-input",`
|
|
|
font-size: inherit;
|
|
|
line-height: inherit;
|
|
|
outline: none;
|
|
|
cursor: pointer;
|
|
|
box-sizing: border-box;
|
|
|
border:none;
|
|
|
width: 100%;
|
|
|
padding: var(--n-padding-single);
|
|
|
background-color: #0000;
|
|
|
color: var(--n-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
caret-color: var(--n-caret-color);
|
|
|
`,[w("content",`
|
|
|
text-overflow: ellipsis;
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
`)]),w("render-label",`
|
|
|
color: var(--n-text-color);
|
|
|
`)]),Ne("disabled",[y("&:hover",[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-hover);
|
|
|
border: var(--n-border-hover);
|
|
|
`)]),P("focus",[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-focus);
|
|
|
border: var(--n-border-focus);
|
|
|
`)]),P("active",[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-active);
|
|
|
border: var(--n-border-active);
|
|
|
`),g("base-selection-label","background-color: var(--n-color-active);"),g("base-selection-tags","background-color: var(--n-color-active);")])]),P("disabled","cursor: not-allowed;",[w("arrow",`
|
|
|
color: var(--n-arrow-color-disabled);
|
|
|
`),g("base-selection-label",`
|
|
|
cursor: not-allowed;
|
|
|
background-color: var(--n-color-disabled);
|
|
|
`,[g("base-selection-input",`
|
|
|
cursor: not-allowed;
|
|
|
color: var(--n-text-color-disabled);
|
|
|
`),w("render-label",`
|
|
|
color: var(--n-text-color-disabled);
|
|
|
`)]),g("base-selection-tags",`
|
|
|
cursor: not-allowed;
|
|
|
background-color: var(--n-color-disabled);
|
|
|
`),g("base-selection-placeholder",`
|
|
|
cursor: not-allowed;
|
|
|
color: var(--n-placeholder-color-disabled);
|
|
|
`)]),g("base-selection-input-tag",`
|
|
|
height: calc(var(--n-height) - 6px);
|
|
|
line-height: calc(var(--n-height) - 6px);
|
|
|
outline: none;
|
|
|
display: none;
|
|
|
position: relative;
|
|
|
margin-bottom: 3px;
|
|
|
max-width: 100%;
|
|
|
vertical-align: bottom;
|
|
|
`,[w("input",`
|
|
|
font-size: inherit;
|
|
|
font-family: inherit;
|
|
|
min-width: 1px;
|
|
|
padding: 0;
|
|
|
background-color: #0000;
|
|
|
outline: none;
|
|
|
border: none;
|
|
|
max-width: 100%;
|
|
|
overflow: hidden;
|
|
|
width: 1em;
|
|
|
line-height: inherit;
|
|
|
cursor: pointer;
|
|
|
color: var(--n-text-color);
|
|
|
caret-color: var(--n-caret-color);
|
|
|
`),w("mirror",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
white-space: pre;
|
|
|
visibility: hidden;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
opacity: 0;
|
|
|
`)]),["warning","error"].map(e=>P(`${e}-status`,[w("state-border",`border: var(--n-border-${e});`),Ne("disabled",[y("&:hover",[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-hover-${e});
|
|
|
border: var(--n-border-hover-${e});
|
|
|
`)]),P("active",[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-active-${e});
|
|
|
border: var(--n-border-active-${e});
|
|
|
`),g("base-selection-label",`background-color: var(--n-color-active-${e});`),g("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),P("focus",[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|
|
border: var(--n-border-focus-${e});
|
|
|
`)])])]))]),g("base-selection-popover",`
|
|
|
margin-bottom: -3px;
|
|
|
display: flex;
|
|
|
flex-wrap: wrap;
|
|
|
margin-right: -8px;
|
|
|
`),g("base-selection-tag-wrapper",`
|
|
|
max-width: 100%;
|
|
|
display: inline-flex;
|
|
|
padding: 0 7px 3px 0;
|
|
|
`,[y("&:last-child","padding-right: 0;"),g("tag",`
|
|
|
font-size: 14px;
|
|
|
max-width: 100%;
|
|
|
`,[w("content",`
|
|
|
line-height: 1.25;
|
|
|
text-overflow: ellipsis;
|
|
|
overflow: hidden;
|
|
|
`)])])]),du=Z({name:"InternalSelection",props:Object.assign(Object.assign({},se.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(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=Ie(e),r=eo("InternalSelection",t,o),n=M(null),l=M(null),a=M(null),s=M(null),d=M(null),c=M(null),u=M(null),f=M(null),p=M(null),v=M(null),h=M(!1),m=M(!1),x=M(!1),C=se("InternalSelection","-internal-selection",su,Al,e,ae(e,"clsPrefix")),b=$(()=>e.clearable&&!e.disabled&&(x.value||e.active)),_=$(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Qe(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),k=$(()=>{const oe=e.selectedOption;if(oe)return oe[e.labelField]}),z=$(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function R(){var oe;const{value:pe}=n;if(pe){const{value:Ue}=l;Ue&&(Ue.style.width=`${pe.offsetWidth}px`,e.maxTagCount!=="responsive"&&((oe=p.value)===null||oe===void 0||oe.sync({showAllItemsBeforeCalculate:!1})))}}function S(){const{value:oe}=v;oe&&(oe.style.display="none")}function L(){const{value:oe}=v;oe&&(oe.style.display="inline-block")}Xe(ae(e,"active"),oe=>{oe||S()}),Xe(ae(e,"pattern"),()=>{e.multiple&&lo(R)});function I(oe){const{onFocus:pe}=e;pe&&pe(oe)}function D(oe){const{onBlur:pe}=e;pe&&pe(oe)}function W(oe){const{onDeleteOption:pe}=e;pe&&pe(oe)}function H(oe){const{onClear:pe}=e;pe&&pe(oe)}function j(oe){const{onPatternInput:pe}=e;pe&&pe(oe)}function V(oe){var pe;(!oe.relatedTarget||!(!((pe=a.value)===null||pe===void 0)&&pe.contains(oe.relatedTarget)))&&I(oe)}function E(oe){var pe;!((pe=a.value)===null||pe===void 0)&&pe.contains(oe.relatedTarget)||D(oe)}function Y(oe){H(oe)}function K(){x.value=!0}function te(){x.value=!1}function xe(oe){!e.active||!e.filterable||oe.target!==l.value&&oe.preventDefault()}function de(oe){W(oe)}function ie(oe){if(oe.key==="Backspace"&&!F.value&&!e.pattern.length){const{selectedOptions:pe}=e;pe!=null&&pe.length&&de(pe[pe.length-1])}}const F=M(!1);let B=null;function q(oe){const{value:pe}=n;if(pe){const Ue=oe.target.value;pe.textContent=Ue,R()}e.ignoreComposition&&F.value?B=oe:j(oe)}function ee(){F.value=!0}function be(){F.value=!1,e.ignoreComposition&&j(B),B=null}function me(oe){var pe;m.value=!0,(pe=e.onPatternFocus)===null||pe===void 0||pe.call(e,oe)}function Be(oe){var pe;m.value=!1,(pe=e.onPatternBlur)===null||pe===void 0||pe.call(e,oe)}function T(){var oe,pe;if(e.filterable)m.value=!1,(oe=c.value)===null||oe===void 0||oe.blur(),(pe=l.value)===null||pe===void 0||pe.blur();else if(e.multiple){const{value:Ue}=s;Ue==null||Ue.blur()}else{const{value:Ue}=d;Ue==null||Ue.blur()}}function ve(){var oe,pe,Ue;e.filterable?(m.value=!1,(oe=c.value)===null||oe===void 0||oe.focus()):e.multiple?(pe=s.value)===null||pe===void 0||pe.focus():(Ue=d.value)===null||Ue===void 0||Ue.focus()}function Se(){const{value:oe}=l;oe&&(L(),oe.focus())}function Fe(){const{value:oe}=l;oe&&oe.blur()}function ne(oe){const{value:pe}=u;pe&&pe.setTextContent(`+${oe}`)}function Ce(){const{value:oe}=f;return oe}function ge(){return l.value}let Ee=null;function Q(){Ee!==null&&window.clearTimeout(Ee)}function he(){e.active||(Q(),Ee=window.setTimeout(()=>{z.value&&(h.value=!0)},100))}function G(){Q()}function U(oe){oe||(Q(),h.value=!1)}Xe(z,oe=>{oe||(h.value=!1)}),po(()=>{oo(()=>{const oe=c.value;oe&&(e.disabled?oe.removeAttribute("tabindex"):oe.tabIndex=m.value?-1:0)})}),gl(a,e.onResize);const{inlineThemeDisabled:le}=e,ye=$(()=>{const{size:oe}=e,{common:{cubicBezierEaseInOut:pe},self:{borderRadius:Ue,color:fo,placeholderColor:Po,textColor:Fo,paddingSingle:xo,paddingMultiple:Co,caretColor:Eo,colorDisabled:_o,textColorDisabled:uo,placeholderColorDisabled:vo,colorActive:O,boxShadowFocus:X,boxShadowActive:ue,boxShadowHover:$e,border:Pe,borderFocus:ke,borderHover:Me,borderActive:Le,arrowColor:qe,arrowColorDisabled:go,loadingColor:nt,colorActiveWarning:ut,boxShadowFocusWarning:Vo,boxShadowActiveWarning:Uo,boxShadowHoverWarning:ft,borderWarning:ht,borderFocusWarning:Bt,borderHoverWarning:it,borderActiveWarning:A,colorActiveError:re,boxShadowFocusError:Te,boxShadowActiveError:Ye,boxShadowHoverError:Ze,borderError:Ge,borderFocusError:Zo,borderHoverError:Qo,borderActiveError:Jo,clearColor:pt,clearColorHover:vt,clearColorPressed:Jt,clearSize:Vr,arrowSize:Ur,[N("height",oe)]:Kr,[N("fontSize",oe)]:Gr}}=C.value,Tt=yo(xo),Ot=yo(Co);return{"--n-bezier":pe,"--n-border":Pe,"--n-border-active":Le,"--n-border-focus":ke,"--n-border-hover":Me,"--n-border-radius":Ue,"--n-box-shadow-active":ue,"--n-box-shadow-focus":X,"--n-box-shadow-hover":$e,"--n-caret-color":Eo,"--n-color":fo,"--n-color-active":O,"--n-color-disabled":_o,"--n-font-size":Gr,"--n-height":Kr,"--n-padding-single-top":Tt.top,"--n-padding-multiple-top":Ot.top,"--n-padding-single-right":Tt.right,"--n-padding-multiple-right":Ot.right,"--n-padding-single-left":Tt.left,"--n-padding-multiple-left":Ot.left,"--n-padding-single-bottom":Tt.bottom,"--n-padding-multiple-bottom":Ot.bottom,"--n-placeholder-color":Po,"--n-placeholder-color-disabled":vo,"--n-text-color":Fo,"--n-text-color-disabled":uo,"--n-arrow-color":qe,"--n-arrow-color-disabled":go,"--n-loading-color":nt,"--n-color-active-warning":ut,"--n-box-shadow-focus-warning":Vo,"--n-box-shadow-active-warning":Uo,"--n-box-shadow-hover-warning":ft,"--n-border-warning":ht,"--n-border-focus-warning":Bt,"--n-border-hover-warning":it,"--n-border-active-warning":A,"--n-color-active-error":re,"--n-box-shadow-focus-error":Te,"--n-box-shadow-active-error":Ye,"--n-box-shadow-hover-error":Ze,"--n-border-error":Ge,"--n-border-focus-error":Zo,"--n-border-hover-error":Qo,"--n-border-active-error":Jo,"--n-clear-size":Vr,"--n-clear-color":pt,"--n-clear-color-hover":vt,"--n-clear-color-pressed":Jt,"--n-arrow-size":Ur}}),_e=le?We("internal-selection",$(()=>e.size[0]),ye,e):void 0;return{mergedTheme:C,mergedClearable:b,mergedClsPrefix:o,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:_,label:k,selected:z,showTagsPanel:h,isComposing:F,counterRef:u,counterWrapperRef:f,patternInputMirrorRef:n,patternInputRef:l,selfRef:a,multipleElRef:s,singleElRef:d,patternInputWrapperRef:c,overflowRef:p,inputTagElRef:v,handleMouseDown:xe,handleFocusin:V,handleClear:Y,handleMouseEnter:K,handleMouseLeave:te,handleDeleteOption:de,handlePatternKeyDown:ie,handlePatternInputInput:q,handlePatternInputBlur:Be,handlePatternInputFocus:me,handleMouseEnterCounter:he,handleMouseLeaveCounter:G,handleFocusout:E,handleCompositionEnd:be,handleCompositionStart:ee,onPopoverUpdateShow:U,focus:ve,focusInput:Se,blur:T,blurInput:Fe,updateCounter:ne,getCounter:Ce,getTail:ge,renderLabel:e.renderLabel,cssVars:le?void 0:ye,themeClass:_e==null?void 0:_e.themeClass,onRender:_e==null?void 0:_e.onRender}},render(){const{status:e,multiple:o,size:t,disabled:r,filterable:n,maxTagCount:l,bordered:a,clsPrefix:s,ellipsisTagPopoverProps:d,onRender:c,renderTag:u,renderLabel:f}=this;c==null||c();const p=l==="responsive",v=typeof l=="number",h=p||v,m=i(vn,null,{default:()=>i(Ll,{clsPrefix:s,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var C,b;return(b=(C=this.$slots).arrow)===null||b===void 0?void 0:b.call(C)}})});let x;if(o){const{labelField:C}=this,b=j=>i("div",{class:`${s}-base-selection-tag-wrapper`,key:j.value},u?u({option:j,handleClose:()=>{this.handleDeleteOption(j)}}):i(en,{size:t,closable:!j.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(j)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(j,!0):Qe(j[C],j,!0)})),_=()=>(v?this.selectedOptions.slice(0,l):this.selectedOptions).map(b),k=n?i("div",{class:`${s}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i("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})),i("span",{ref:"patternInputMirrorRef",class:`${s}-base-selection-input-tag__mirror`},this.pattern)):null,z=p?()=>i("div",{class:`${s}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i(en,{size:t,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(v){const j=this.selectedOptions.length-l;j>0&&(R=i("div",{class:`${s}-base-selection-tag-wrapper`,key:"__counter__"},i(en,{size:t,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${j}`})))}const S=p?n?i(fn,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:_,counter:z,tail:()=>k}):i(fn,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:_,counter:z}):v&&R?_().concat(R):_(),L=h?()=>i("div",{class:`${s}-base-selection-popover`},p?_():this.selectedOptions.map(b)):void 0,I=h?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},d):null,W=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`},i("div",{class:`${s}-base-selection-placeholder__inner`},this.placeholder)):null,H=n?i("div",{ref:"patternInputWrapperRef",class:`${s}-base-selection-tags`},S,p?null:k,m):i("div",{ref:"multipleElRef",class:`${s}-base-selection-tags`,tabindex:r?void 0:0},S,m);x=i(so,null,h?i(br,Object.assign({},I,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>H,default:L}):H,W)}else if(n){const C=this.pattern||this.isComposing,b=this.active?!C:!this.selected,_=this.active?!1:this.selected;x=i("div",{ref:"patternInputWrapperRef",class:`${s}-base-selection-label`},i("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})),_?i("div",{class:`${s}-base-selection-label__render-label ${s}-base-selection-overlay`,key:"input"},i("div",{class:`${s}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Qe(this.label,this.selectedOption,!0))):null,b?i("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:"placeholder"},i("div",{class:`${s}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else x=i("div",{ref:"singleElRef",class:`${s}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i("div",{class:`${s}-base-selection-input`,title:il(this.label),key:"input"},i("div",{class:`${s}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Qe(this.label,this.selectedOption,!0))):i("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:"placeholder"},i("div",{class:`${s}-base-selection-placeholder__inner`},this.placeholder)),m);return i("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},x,a?i("div",{class:`${s}-base-selection__border`}):null,a?i("div",{class:`${s}-base-selection__state-border`}):null)}}),Si=Z({name:"SlotMachineNumber",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],required:!0},oldOriginalNumber:{type:Number,default:void 0},newOriginalNumber:{type:Number,default:void 0}},setup(e){const o=M(null),t=M(e.value),r=M(e.value),n=M("up"),l=M(!1),a=$(()=>l.value?`${e.clsPrefix}-base-slot-machine-current-number--${n.value}-scroll`:null),s=$(()=>l.value?`${e.clsPrefix}-base-slot-machine-old-number--${n.value}-scroll`:null);Xe(ae(e,"value"),(u,f)=>{t.value=f,r.value=u,lo(d)});function d(){const u=e.newOriginalNumber,f=e.oldOriginalNumber;f===void 0||u===void 0||(u>f?c("up"):f>u&&c("down"))}function c(u){n.value=u,l.value=!1,lo(()=>{var f;(f=o.value)===null||f===void 0||f.offsetWidth,l.value=!0})}return()=>{const{clsPrefix:u}=e;return i("span",{ref:o,class:`${u}-base-slot-machine-number`},t.value!==null?i("span",{class:[`${u}-base-slot-machine-old-number ${u}-base-slot-machine-old-number--top`,s.value]},t.value):null,i("span",{class:[`${u}-base-slot-machine-current-number`,a.value]},i("span",{ref:"numberWrapper",class:[`${u}-base-slot-machine-current-number__inner`,typeof e.value!="number"&&`${u}-base-slot-machine-current-number__inner--not-number`]},r.value)),t.value!==null?i("span",{class:[`${u}-base-slot-machine-old-number ${u}-base-slot-machine-old-number--bottom`,s.value]},t.value):null)}}}),{cubicBezierEaseInOut:lt}=zo;function El({duration:e=".2s",delay:o=".1s"}={}){return[y("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),y("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",`
|
|
|
opacity: 0!important;
|
|
|
margin-left: 0!important;
|
|
|
margin-right: 0!important;
|
|
|
`),y("&.fade-in-width-expand-transition-leave-active",`
|
|
|
overflow: hidden;
|
|
|
transition:
|
|
|
opacity ${e} ${lt},
|
|
|
max-width ${e} ${lt} ${o},
|
|
|
margin-left ${e} ${lt} ${o},
|
|
|
margin-right ${e} ${lt} ${o};
|
|
|
`),y("&.fade-in-width-expand-transition-enter-active",`
|
|
|
overflow: hidden;
|
|
|
transition:
|
|
|
opacity ${e} ${lt} ${o},
|
|
|
max-width ${e} ${lt},
|
|
|
margin-left ${e} ${lt},
|
|
|
margin-right ${e} ${lt};
|
|
|
`)]}const{cubicBezierEaseOut:Mt}=zo;function cu({duration:e=".2s"}={}){return[y("&.fade-up-width-expand-transition-leave-active",{transition:`
|
|
|
opacity ${e} ${Mt},
|
|
|
max-width ${e} ${Mt},
|
|
|
transform ${e} ${Mt}
|
|
|
`}),y("&.fade-up-width-expand-transition-enter-active",{transition:`
|
|
|
opacity ${e} ${Mt},
|
|
|
max-width ${e} ${Mt},
|
|
|
transform ${e} ${Mt}
|
|
|
`}),y("&.fade-up-width-expand-transition-enter-to",{opacity:1,transform:"translateX(0) translateY(0)"}),y("&.fade-up-width-expand-transition-enter-from",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"}),y("&.fade-up-width-expand-transition-leave-from",{opacity:1,transform:"translateY(0)"}),y("&.fade-up-width-expand-transition-leave-to",{maxWidth:"0 !important",opacity:0,transform:"translateY(60%)"})]}const uu=y([y("@keyframes n-base-slot-machine-fade-up-in",`
|
|
|
from {
|
|
|
transform: translateY(60%);
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
transform: translateY(0);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`),y("@keyframes n-base-slot-machine-fade-down-in",`
|
|
|
from {
|
|
|
transform: translateY(-60%);
|
|
|
opacity: 0;
|
|
|
}
|
|
|
to {
|
|
|
transform: translateY(0);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
`),y("@keyframes n-base-slot-machine-fade-up-out",`
|
|
|
from {
|
|
|
transform: translateY(0%);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
transform: translateY(-60%);
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`),y("@keyframes n-base-slot-machine-fade-down-out",`
|
|
|
from {
|
|
|
transform: translateY(0%);
|
|
|
opacity: 1;
|
|
|
}
|
|
|
to {
|
|
|
transform: translateY(60%);
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`),g("base-slot-machine",`
|
|
|
overflow: hidden;
|
|
|
white-space: nowrap;
|
|
|
display: inline-block;
|
|
|
height: 18px;
|
|
|
line-height: 18px;
|
|
|
`,[g("base-slot-machine-number",`
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
height: 18px;
|
|
|
width: .6em;
|
|
|
max-width: .6em;
|
|
|
`,[cu({duration:".2s"}),El({duration:".2s",delay:"0s"}),g("base-slot-machine-old-number",`
|
|
|
display: inline-block;
|
|
|
opacity: 0;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
`,[P("top",{transform:"translateY(-100%)"}),P("bottom",{transform:"translateY(100%)"}),P("down-scroll",{animation:"n-base-slot-machine-fade-down-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),P("up-scroll",{animation:"n-base-slot-machine-fade-up-out .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1})]),g("base-slot-machine-current-number",`
|
|
|
display: inline-block;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
opacity: 1;
|
|
|
transform: translateY(0);
|
|
|
width: .6em;
|
|
|
`,[P("down-scroll",{animation:"n-base-slot-machine-fade-down-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),P("up-scroll",{animation:"n-base-slot-machine-fade-up-in .2s cubic-bezier(0, 0, .2, 1)",animationIterationCount:1}),w("inner",`
|
|
|
display: inline-block;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
width: .6em;
|
|
|
`,[P("not-number",`
|
|
|
right: unset;
|
|
|
left: 0;
|
|
|
`)])])])])]),fu=Z({name:"BaseSlotMachine",props:{clsPrefix:{type:String,required:!0},value:{type:[Number,String],default:0},max:{type:Number,default:void 0},appeared:{type:Boolean,required:!0}},setup(e){Xo("-base-slot-machine",uu,ae(e,"clsPrefix"));const o=M(),t=M(),r=$(()=>{if(typeof e.value=="string")return[];if(e.value<1)return[0];const n=[];let l=e.value;for(e.max!==void 0&&(l=Math.min(e.max,l));l>=1;)n.push(l%10),l/=10,l=Math.floor(l);return n.reverse(),n});return Xe(ae(e,"value"),(n,l)=>{typeof n=="string"?(t.value=void 0,o.value=void 0):typeof l=="string"?(t.value=n,o.value=void 0):(t.value=n,o.value=l)}),()=>{const{value:n,clsPrefix:l}=e;return typeof n=="number"?i("span",{class:`${l}-base-slot-machine`},i(Sn,{name:"fade-up-width-expand-transition",tag:"span"},{default:()=>r.value.map((a,s)=>i(Si,{clsPrefix:l,key:r.value.length-s-1,oldOriginalNumber:o.value,newOriginalNumber:t.value,value:a}))}),i(Rt,{key:"+",width:!0},{default:()=>e.max!==void 0&&e.max<n?i(Si,{clsPrefix:l,value:"+"}):null})):i("span",{class:`${l}-base-slot-machine`},n)}}}),jl={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},hu={name:"Alert",common:fe,self(e){const{lineHeight:o,borderRadius:t,fontWeightStrong:r,dividerColor:n,inputColor:l,textColor1:a,textColor2:s,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,infoColorSuppl:v,successColorSuppl:h,warningColorSuppl:m,errorColorSuppl:x,fontSize:C}=e;return Object.assign(Object.assign({},jl),{fontSize:C,lineHeight:o,titleFontWeight:r,borderRadius:t,border:`1px solid ${n}`,color:l,titleTextColor:a,iconColor:s,contentTextColor:s,closeBorderRadius:t,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,borderInfo:`1px solid ${J(v,{alpha:.35})}`,colorInfo:J(v,{alpha:.25}),titleTextColorInfo:a,iconColorInfo:v,contentTextColorInfo:s,closeColorHoverInfo:d,closeColorPressedInfo:c,closeIconColorInfo:u,closeIconColorHoverInfo:f,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${J(h,{alpha:.35})}`,colorSuccess:J(h,{alpha:.25}),titleTextColorSuccess:a,iconColorSuccess:h,contentTextColorSuccess:s,closeColorHoverSuccess:d,closeColorPressedSuccess:c,closeIconColorSuccess:u,closeIconColorHoverSuccess:f,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${J(m,{alpha:.35})}`,colorWarning:J(m,{alpha:.25}),titleTextColorWarning:a,iconColorWarning:m,contentTextColorWarning:s,closeColorHoverWarning:d,closeColorPressedWarning:c,closeIconColorWarning:u,closeIconColorHoverWarning:f,closeIconColorPressedWarning:p,borderError:`1px solid ${J(x,{alpha:.35})}`,colorError:J(x,{alpha:.25}),titleTextColorError:a,iconColorError:x,contentTextColorError:s,closeColorHoverError:d,closeColorPressedError:c,closeIconColorError:u,closeIconColorHoverError:f,closeIconColorPressedError:p})}},pu=hu,vu=e=>{const{lineHeight:o,borderRadius:t,fontWeightStrong:r,baseColor:n,dividerColor:l,actionColor:a,textColor1:s,textColor2:d,closeColorHover:c,closeColorPressed:u,closeIconColor:f,closeIconColorHover:p,closeIconColorPressed:v,infoColor:h,successColor:m,warningColor:x,errorColor:C,fontSize:b}=e;return Object.assign(Object.assign({},jl),{fontSize:b,lineHeight:o,titleFontWeight:r,borderRadius:t,border:`1px solid ${l}`,color:a,titleTextColor:s,iconColor:d,contentTextColor:d,closeBorderRadius:t,closeColorHover:c,closeColorPressed:u,closeIconColor:f,closeIconColorHover:p,closeIconColorPressed:v,borderInfo:`1px solid ${Re(n,J(h,{alpha:.25}))}`,colorInfo:Re(n,J(h,{alpha:.08})),titleTextColorInfo:s,iconColorInfo:h,contentTextColorInfo:d,closeColorHoverInfo:c,closeColorPressedInfo:u,closeIconColorInfo:f,closeIconColorHoverInfo:p,closeIconColorPressedInfo:v,borderSuccess:`1px solid ${Re(n,J(m,{alpha:.25}))}`,colorSuccess:Re(n,J(m,{alpha:.08})),titleTextColorSuccess:s,iconColorSuccess:m,contentTextColorSuccess:d,closeColorHoverSuccess:c,closeColorPressedSuccess:u,closeIconColorSuccess:f,closeIconColorHoverSuccess:p,closeIconColorPressedSuccess:v,borderWarning:`1px solid ${Re(n,J(x,{alpha:.33}))}`,colorWarning:Re(n,J(x,{alpha:.08})),titleTextColorWarning:s,iconColorWarning:x,contentTextColorWarning:d,closeColorHoverWarning:c,closeColorPressedWarning:u,closeIconColorWarning:f,closeIconColorHoverWarning:p,closeIconColorPressedWarning:v,borderError:`1px solid ${Re(n,J(C,{alpha:.25}))}`,colorError:Re(n,J(C,{alpha:.08})),titleTextColorError:s,iconColorError:C,contentTextColorError:d,closeColorHoverError:c,closeColorPressedError:u,closeIconColorError:f,closeIconColorHoverError:p,closeIconColorPressedError:v})},gu={name:"Alert",common:Ae,self:vu},mu=gu,{cubicBezierEaseInOut:Ko,cubicBezierEaseOut:bu,cubicBezierEaseIn:xu}=zo;function dr({overflow:e="hidden",duration:o=".3s",originalTransition:t="",leavingDelay:r="0s",foldPadding:n=!1,enterToProps:l=void 0,leaveToProps:a=void 0,reverse:s=!1}={}){const d=s?"leave":"enter",c=s?"enter":"leave";return[y(`&.fade-in-height-expand-transition-${c}-from,
|
|
|
&.fade-in-height-expand-transition-${d}-to`,Object.assign(Object.assign({},l),{opacity:1})),y(`&.fade-in-height-expand-transition-${c}-to,
|
|
|
&.fade-in-height-expand-transition-${d}-from`,Object.assign(Object.assign({},a),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:n?"0 !important":void 0,paddingBottom:n?"0 !important":void 0})),y(`&.fade-in-height-expand-transition-${c}-active`,`
|
|
|
overflow: ${e};
|
|
|
transition:
|
|
|
max-height ${o} ${Ko} ${r},
|
|
|
opacity ${o} ${bu} ${r},
|
|
|
margin-top ${o} ${Ko} ${r},
|
|
|
margin-bottom ${o} ${Ko} ${r},
|
|
|
padding-top ${o} ${Ko} ${r},
|
|
|
padding-bottom ${o} ${Ko} ${r}
|
|
|
${t?","+t:""}
|
|
|
`),y(`&.fade-in-height-expand-transition-${d}-active`,`
|
|
|
overflow: ${e};
|
|
|
transition:
|
|
|
max-height ${o} ${Ko},
|
|
|
opacity ${o} ${xu},
|
|
|
margin-top ${o} ${Ko},
|
|
|
margin-bottom ${o} ${Ko},
|
|
|
padding-top ${o} ${Ko},
|
|
|
padding-bottom ${o} ${Ko}
|
|
|
${t?","+t:""}
|
|
|
`)]}const Cu=g("alert",`
|
|
|
line-height: var(--n-line-height);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
position: relative;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
background-color: var(--n-color);
|
|
|
text-align: start;
|
|
|
word-break: break-word;
|
|
|
`,[w("border",`
|
|
|
border-radius: inherit;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
border: var(--n-border);
|
|
|
pointer-events: none;
|
|
|
`),P("closable",[g("alert-body",[w("title",`
|
|
|
padding-right: 24px;
|
|
|
`)])]),w("icon",{color:"var(--n-icon-color)"}),g("alert-body",{padding:"var(--n-padding)"},[w("title",{color:"var(--n-title-text-color)"}),w("content",{color:"var(--n-content-text-color)"})]),dr({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),w("icon",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
display: flex;
|
|
|
width: var(--n-icon-size);
|
|
|
height: var(--n-icon-size);
|
|
|
font-size: var(--n-icon-size);
|
|
|
margin: var(--n-icon-margin);
|
|
|
`),w("close",`
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
margin: var(--n-close-margin);
|
|
|
`),P("show-icon",[g("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),P("right-adjust",[g("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),g("alert-body",`
|
|
|
border-radius: var(--n-border-radius);
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`,[w("title",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
font-size: 16px;
|
|
|
line-height: 19px;
|
|
|
font-weight: var(--n-title-font-weight);
|
|
|
`,[y("& +",[w("content",{marginTop:"9px"})])]),w("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),w("icon",{transition:"color .3s var(--n-bezier)"})]),yu=Object.assign(Object.assign({},se.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),k1=Z({name:"Alert",inheritAttrs:!1,props:yu,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),l=se("Alert","-alert",Cu,mu,e,o),a=eo("Alert",n,o),s=$(()=>{const{common:{cubicBezierEaseInOut:v},self:h}=l.value,{fontSize:m,borderRadius:x,titleFontWeight:C,lineHeight:b,iconSize:_,iconMargin:k,iconMarginRtl:z,closeIconSize:R,closeBorderRadius:S,closeSize:L,closeMargin:I,closeMarginRtl:D,padding:W}=h,{type:H}=e,{left:j,right:V}=yo(k);return{"--n-bezier":v,"--n-color":h[N("color",H)],"--n-close-icon-size":R,"--n-close-border-radius":S,"--n-close-color-hover":h[N("closeColorHover",H)],"--n-close-color-pressed":h[N("closeColorPressed",H)],"--n-close-icon-color":h[N("closeIconColor",H)],"--n-close-icon-color-hover":h[N("closeIconColorHover",H)],"--n-close-icon-color-pressed":h[N("closeIconColorPressed",H)],"--n-icon-color":h[N("iconColor",H)],"--n-border":h[N("border",H)],"--n-title-text-color":h[N("titleTextColor",H)],"--n-content-text-color":h[N("contentTextColor",H)],"--n-line-height":b,"--n-border-radius":x,"--n-font-size":m,"--n-title-font-weight":C,"--n-icon-size":_,"--n-icon-margin":k,"--n-icon-margin-rtl":z,"--n-close-size":L,"--n-close-margin":I,"--n-close-margin-rtl":D,"--n-padding":W,"--n-icon-margin-left":j,"--n-icon-margin-right":V}}),d=r?We("alert",$(()=>e.type[0]),s,e):void 0,c=M(!0),u=()=>{const{onAfterLeave:v,onAfterHide:h}=e;v&&v(),h&&h()};return{rtlEnabled:a,mergedClsPrefix:o,mergedBordered:t,visible:c,handleCloseClick:()=>{var v;Promise.resolve((v=e.onClose)===null||v===void 0?void 0:v.call(e)).then(h=>{h!==!1&&(c.value=!1)})},handleAfterLeave:()=>{u()},mergedTheme:l,cssVars:r?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),i(Rt,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:o,$slots:t}=this,r={class:[`${o}-alert`,this.themeClass,this.closable&&`${o}-alert--closable`,this.showIcon&&`${o}-alert--show-icon`,!this.title&&this.closable&&`${o}-alert--right-adjust`,this.rtlEnabled&&`${o}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?i("div",Object.assign({},To(this.$attrs,r)),this.closable&&i(Pt,{clsPrefix:o,class:`${o}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&i("div",{class:`${o}-alert__border`}),this.showIcon&&i("div",{class:`${o}-alert__icon`,"aria-hidden":"true"},ao(t.icon,()=>[i(He,{clsPrefix:o},{default:()=>{switch(this.type){case"success":return i(Ut,null);case"info":return i(yt,null);case"warning":return i($t,null);case"error":return i(Vt,null);default:return null}}})])),i("div",{class:[`${o}-alert-body`,this.mergedBordered&&`${o}-alert-body--bordered`]},je(t.header,n=>{const l=n||this.title;return l?i("div",{class:`${o}-alert-body__title`},l):null}),t.default&&i("div",{class:`${o}-alert-body__content`},t))):null}})}}),wu={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"},Su=e=>{const{borderRadius:o,railColor:t,primaryColor:r,primaryColorHover:n,primaryColorPressed:l,textColor2:a}=e;return Object.assign(Object.assign({},wu),{borderRadius:o,railColor:t,railColorActive:r,linkColor:J(r,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:l,linkTextColorActive:r})},zu={name:"Anchor",common:fe,self:Su},$u=zu;function Br(e){return e.type==="group"}function Wl(e){return e.type==="ignored"}function on(e,o){try{return!!(1+o.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Nl(e,o){return{getIsGroup:Br,getIgnored:Wl,getKey(r){return Br(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[o]}}}function Ru(e,o,t,r){if(!o)return e;function n(l){if(!Array.isArray(l))return[];const a=[];for(const s of l)if(Br(s)){const d=n(s[r]);d.length&&a.push(Object.assign({},s,{[r]:d}))}else{if(Wl(s))continue;o(t,s)&&a.push(s)}return a}return n(e)}function Pu(e,o,t){const r=new Map;return e.forEach(n=>{Br(n)?n[t].forEach(l=>{r.set(l[o],l)}):r.set(n[o],n)}),r}const ku=No&&"chrome"in window;No&&navigator.userAgent.includes("Firefox");const Vl=No&&navigator.userAgent.includes("Safari")&&!ku,Ul={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},Iu={name:"Input",common:fe,self(e){const{textColor2:o,textColor3:t,textColorDisabled:r,primaryColor:n,primaryColorHover:l,inputColor:a,inputColorDisabled:s,warningColor:d,warningColorHover:c,errorColor:u,errorColorHover:f,borderRadius:p,lineHeight:v,fontSizeTiny:h,fontSizeSmall:m,fontSizeMedium:x,fontSizeLarge:C,heightTiny:b,heightSmall:_,heightMedium:k,heightLarge:z,clearColor:R,clearColorHover:S,clearColorPressed:L,placeholderColor:I,placeholderColorDisabled:D,iconColor:W,iconColorDisabled:H,iconColorHover:j,iconColorPressed:V}=e;return Object.assign(Object.assign({},Ul),{countTextColorDisabled:r,countTextColor:t,heightTiny:b,heightSmall:_,heightMedium:k,heightLarge:z,fontSizeTiny:h,fontSizeSmall:m,fontSizeMedium:x,fontSizeLarge:C,lineHeight:v,lineHeightTextarea:v,borderRadius:p,iconSize:"16px",groupLabelColor:a,textColor:o,textColorDisabled:r,textDecorationColor:o,groupLabelTextColor:o,caretColor:n,placeholderColor:I,placeholderColorDisabled:D,color:a,colorDisabled:s,colorFocus:J(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${l}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${l}`,boxShadowFocus:`0 0 8px 0 ${J(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:d,borderWarning:`1px solid ${d}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:J(d,{alpha:.1}),borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 8px 0 ${J(d,{alpha:.3})}`,caretColorWarning:d,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${f}`,colorFocusError:J(u,{alpha:.1}),borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 8px 0 ${J(u,{alpha:.3})}`,caretColorError:u,clearColor:R,clearColorHover:S,clearColorPressed:L,iconColor:W,iconColorDisabled:H,iconColorHover:j,iconColorPressed:V,suffixTextColor:o})}},Ao=Iu,Bu=e=>{const{textColor2:o,textColor3:t,textColorDisabled:r,primaryColor:n,primaryColorHover:l,inputColor:a,inputColorDisabled:s,borderColor:d,warningColor:c,warningColorHover:u,errorColor:f,errorColorHover:p,borderRadius:v,lineHeight:h,fontSizeTiny:m,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:b,heightTiny:_,heightSmall:k,heightMedium:z,heightLarge:R,actionColor:S,clearColor:L,clearColorHover:I,clearColorPressed:D,placeholderColor:W,placeholderColorDisabled:H,iconColor:j,iconColorDisabled:V,iconColorHover:E,iconColorPressed:Y}=e;return Object.assign(Object.assign({},Ul),{countTextColorDisabled:r,countTextColor:t,heightTiny:_,heightSmall:k,heightMedium:z,heightLarge:R,fontSizeTiny:m,fontSizeSmall:x,fontSizeMedium:C,fontSizeLarge:b,lineHeight:h,lineHeightTextarea:h,borderRadius:v,iconSize:"16px",groupLabelColor:S,groupLabelTextColor:o,textColor:o,textColorDisabled:r,textDecorationColor:o,caretColor:n,placeholderColor:W,placeholderColorDisabled:H,color:a,colorDisabled:s,colorFocus:a,groupLabelBorder:`1px solid ${d}`,border:`1px solid ${d}`,borderHover:`1px solid ${l}`,borderDisabled:`1px solid ${d}`,borderFocus:`1px solid ${l}`,boxShadowFocus:`0 0 0 2px ${J(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:c,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${J(c,{alpha:.2})}`,caretColorWarning:c,loadingColorError:f,borderError:`1px solid ${f}`,borderHoverError:`1px solid ${p}`,colorFocusError:a,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${J(f,{alpha:.2})}`,caretColorError:f,clearColor:L,clearColorHover:I,clearColorPressed:D,iconColor:j,iconColorDisabled:V,iconColorHover:E,iconColorPressed:Y,suffixTextColor:o})},Tu={name:"Input",common:Ae,self:Bu},xr=Tu,Kl="n-input";function Ou(e){let o=0;for(const t of e)o++;return o}function wr(e){return e===""||e==null}function Fu(e){const o=M(null);function t(){const{value:l}=e;if(!(l!=null&&l.focus)){n();return}const{selectionStart:a,selectionEnd:s,value:d}=l;if(a==null||s==null){n();return}o.value={start:a,end:s,beforeText:d.slice(0,a),afterText:d.slice(s)}}function r(){var l;const{value:a}=o,{value:s}=e;if(!a||!s)return;const{value:d}=s,{start:c,beforeText:u,afterText:f}=a;let p=d.length;if(d.endsWith(f))p=d.length-f.length;else if(d.startsWith(u))p=u.length;else{const v=u[c-1],h=d.indexOf(v,c-1);h!==-1&&(p=h+1)}(l=s.setSelectionRange)===null||l===void 0||l.call(s,p,p)}function n(){o.value=null}return Xe(e,n),{recordCursor:t,restoreCursor:r}}const zi=Z({name:"InputWordCount",setup(e,{slots:o}){const{mergedValueRef:t,maxlengthRef:r,mergedClsPrefixRef:n,countGraphemesRef:l}=ze(Kl),a=$(()=>{const{value:s}=t;return s===null||Array.isArray(s)?0:(l.value||Ou)(s)});return()=>{const{value:s}=r,{value:d}=t;return i("span",{class:`${n.value}-input-word-count`},pn(o.default,{value:d===null||Array.isArray(d)?"":d},()=>[s===void 0?a.value:`${a.value} / ${s}`]))}}}),_u=g("input",`
|
|
|
max-width: 100%;
|
|
|
cursor: text;
|
|
|
line-height: 1.5;
|
|
|
z-index: auto;
|
|
|
outline: none;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
display: inline-flex;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
background-color: var(--n-color);
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
font-size: var(--n-font-size);
|
|
|
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
|
|
|
`,[w("input, textarea",`
|
|
|
overflow: hidden;
|
|
|
flex-grow: 1;
|
|
|
position: relative;
|
|
|
`),w("input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder",`
|
|
|
box-sizing: border-box;
|
|
|
font-size: inherit;
|
|
|
line-height: 1.5;
|
|
|
font-family: inherit;
|
|
|
border: none;
|
|
|
outline: none;
|
|
|
background-color: #0000;
|
|
|
text-align: inherit;
|
|
|
transition:
|
|
|
-webkit-text-fill-color .3s var(--n-bezier),
|
|
|
caret-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
text-decoration-color .3s var(--n-bezier);
|
|
|
`),w("input-el, textarea-el",`
|
|
|
-webkit-appearance: none;
|
|
|
scrollbar-width: none;
|
|
|
width: 100%;
|
|
|
min-width: 0;
|
|
|
text-decoration-color: var(--n-text-decoration-color);
|
|
|
color: var(--n-text-color);
|
|
|
caret-color: var(--n-caret-color);
|
|
|
background-color: transparent;
|
|
|
`,[y("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
display: none;
|
|
|
`),y("&::placeholder",`
|
|
|
color: #0000;
|
|
|
-webkit-text-fill-color: transparent !important;
|
|
|
`),y("&:-webkit-autofill ~",[w("placeholder","display: none;")])]),P("round",[Ne("textarea","border-radius: calc(var(--n-height) / 2);")]),w("placeholder",`
|
|
|
pointer-events: none;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
overflow: hidden;
|
|
|
color: var(--n-placeholder-color);
|
|
|
`,[y("span",`
|
|
|
width: 100%;
|
|
|
display: inline-block;
|
|
|
`)]),P("textarea",[w("placeholder","overflow: visible;")]),Ne("autosize","width: 100%;"),P("autosize",[w("textarea-el, input-el",`
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
height: 100%;
|
|
|
`)]),g("input-wrapper",`
|
|
|
overflow: hidden;
|
|
|
display: inline-flex;
|
|
|
flex-grow: 1;
|
|
|
position: relative;
|
|
|
padding-left: var(--n-padding-left);
|
|
|
padding-right: var(--n-padding-right);
|
|
|
`),w("input-mirror",`
|
|
|
padding: 0;
|
|
|
height: var(--n-height);
|
|
|
line-height: var(--n-height);
|
|
|
overflow: hidden;
|
|
|
visibility: hidden;
|
|
|
position: static;
|
|
|
white-space: pre;
|
|
|
pointer-events: none;
|
|
|
`),w("input-el",`
|
|
|
padding: 0;
|
|
|
height: var(--n-height);
|
|
|
line-height: var(--n-height);
|
|
|
`,[y("&[type=password]::-ms-reveal","display: none;"),y("+",[w("placeholder",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`)])]),Ne("textarea",[w("placeholder","white-space: nowrap;")]),w("eye",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`),P("textarea","width: 100%;",[g("input-word-count",`
|
|
|
position: absolute;
|
|
|
right: var(--n-padding-right);
|
|
|
bottom: var(--n-padding-vertical);
|
|
|
`),P("resizable",[g("input-wrapper",`
|
|
|
resize: vertical;
|
|
|
min-height: var(--n-height);
|
|
|
`)]),w("textarea-el, textarea-mirror, placeholder",`
|
|
|
height: 100%;
|
|
|
padding-left: 0;
|
|
|
padding-right: 0;
|
|
|
padding-top: var(--n-padding-vertical);
|
|
|
padding-bottom: var(--n-padding-vertical);
|
|
|
word-break: break-word;
|
|
|
display: inline-block;
|
|
|
vertical-align: bottom;
|
|
|
box-sizing: border-box;
|
|
|
line-height: var(--n-line-height-textarea);
|
|
|
margin: 0;
|
|
|
resize: none;
|
|
|
white-space: pre-wrap;
|
|
|
scroll-padding-block-end: var(--n-padding-vertical);
|
|
|
`),w("textarea-mirror",`
|
|
|
width: 100%;
|
|
|
pointer-events: none;
|
|
|
overflow: hidden;
|
|
|
visibility: hidden;
|
|
|
position: static;
|
|
|
white-space: pre-wrap;
|
|
|
overflow-wrap: break-word;
|
|
|
`)]),P("pair",[w("input-el, placeholder","text-align: center;"),w("separator",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-text-color);
|
|
|
white-space: nowrap;
|
|
|
`,[g("icon",`
|
|
|
color: var(--n-icon-color);
|
|
|
`),g("base-icon",`
|
|
|
color: var(--n-icon-color);
|
|
|
`)])]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
background-color: var(--n-color-disabled);
|
|
|
`,[w("border","border: var(--n-border-disabled);"),w("input-el, textarea-el",`
|
|
|
cursor: not-allowed;
|
|
|
color: var(--n-text-color-disabled);
|
|
|
text-decoration-color: var(--n-text-color-disabled);
|
|
|
`),w("placeholder","color: var(--n-placeholder-color-disabled);"),w("separator","color: var(--n-text-color-disabled);",[g("icon",`
|
|
|
color: var(--n-icon-color-disabled);
|
|
|
`),g("base-icon",`
|
|
|
color: var(--n-icon-color-disabled);
|
|
|
`)]),g("input-word-count",`
|
|
|
color: var(--n-count-text-color-disabled);
|
|
|
`),w("suffix, prefix","color: var(--n-text-color-disabled);",[g("icon",`
|
|
|
color: var(--n-icon-color-disabled);
|
|
|
`),g("internal-icon",`
|
|
|
color: var(--n-icon-color-disabled);
|
|
|
`)])]),Ne("disabled",[w("eye",`
|
|
|
color: var(--n-icon-color);
|
|
|
cursor: pointer;
|
|
|
`,[y("&:hover",`
|
|
|
color: var(--n-icon-color-hover);
|
|
|
`),y("&:active",`
|
|
|
color: var(--n-icon-color-pressed);
|
|
|
`)]),y("&:hover",[w("state-border","border: var(--n-border-hover);")]),P("focus","background-color: var(--n-color-focus);",[w("state-border",`
|
|
|
border: var(--n-border-focus);
|
|
|
box-shadow: var(--n-box-shadow-focus);
|
|
|
`)])]),w("border, state-border",`
|
|
|
box-sizing: border-box;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
pointer-events: none;
|
|
|
border-radius: inherit;
|
|
|
border: var(--n-border);
|
|
|
transition:
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`),w("state-border",`
|
|
|
border-color: #0000;
|
|
|
z-index: 1;
|
|
|
`),w("prefix","margin-right: 4px;"),w("suffix",`
|
|
|
margin-left: 4px;
|
|
|
`),w("suffix, prefix",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
flex-wrap: nowrap;
|
|
|
flex-shrink: 0;
|
|
|
line-height: var(--n-height);
|
|
|
white-space: nowrap;
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
color: var(--n-suffix-text-color);
|
|
|
`,[g("base-loading",`
|
|
|
font-size: var(--n-icon-size);
|
|
|
margin: 0 2px;
|
|
|
color: var(--n-loading-color);
|
|
|
`),g("base-clear",`
|
|
|
font-size: var(--n-icon-size);
|
|
|
`,[w("placeholder",[g("base-icon",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-icon-color);
|
|
|
font-size: var(--n-icon-size);
|
|
|
`)])]),y(">",[g("icon",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-icon-color);
|
|
|
font-size: var(--n-icon-size);
|
|
|
`)]),g("base-icon",`
|
|
|
font-size: var(--n-icon-size);
|
|
|
`)]),g("input-word-count",`
|
|
|
pointer-events: none;
|
|
|
line-height: 1.5;
|
|
|
font-size: .85em;
|
|
|
color: var(--n-count-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
margin-left: 4px;
|
|
|
font-variant: tabular-nums;
|
|
|
`),["warning","error"].map(e=>P(`${e}-status`,[Ne("disabled",[g("base-loading",`
|
|
|
color: var(--n-loading-color-${e})
|
|
|
`),w("input-el, textarea-el",`
|
|
|
caret-color: var(--n-caret-color-${e});
|
|
|
`),w("state-border",`
|
|
|
border: var(--n-border-${e});
|
|
|
`),y("&:hover",[w("state-border",`
|
|
|
border: var(--n-border-hover-${e});
|
|
|
`)]),y("&:focus",`
|
|
|
background-color: var(--n-color-focus-${e});
|
|
|
`,[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|
|
border: var(--n-border-focus-${e});
|
|
|
`)]),P("focus",`
|
|
|
background-color: var(--n-color-focus-${e});
|
|
|
`,[w("state-border",`
|
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|
|
border: var(--n-border-focus-${e});
|
|
|
`)])])]))]),Mu=g("input",[P("disabled",[w("input-el, textarea-el",`
|
|
|
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|
|
`)])]),Du=Object.assign(Object.assign({},se.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}),St=Z({name:"Input",props:Du,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),l=se("Input","-input",_u,xr,e,o);Vl&&Xo("-input-safari",Mu,o);const a=M(null),s=M(null),d=M(null),c=M(null),u=M(null),f=M(null),p=M(null),v=Fu(p),h=M(null),{localeRef:m}=Yo("Input"),x=M(e.defaultValue),C=ae(e,"value"),b=co(C,x),_=rt(e),{mergedSizeRef:k,mergedDisabledRef:z,mergedStatusRef:R}=_,S=M(!1),L=M(!1),I=M(!1),D=M(!1);let W=null;const H=$(()=>{const{placeholder:A,pair:re}=e;return re?Array.isArray(A)?A:A===void 0?["",""]:[A,A]:A===void 0?[m.value.placeholder]:[A]}),j=$(()=>{const{value:A}=I,{value:re}=b,{value:Te}=H;return!A&&(wr(re)||Array.isArray(re)&&wr(re[0]))&&Te[0]}),V=$(()=>{const{value:A}=I,{value:re}=b,{value:Te}=H;return!A&&Te[1]&&(wr(re)||Array.isArray(re)&&wr(re[1]))}),E=Ve(()=>e.internalForceFocus||S.value),Y=Ve(()=>{if(z.value||e.readonly||!e.clearable||!E.value&&!L.value)return!1;const{value:A}=b,{value:re}=E;return e.pair?!!(Array.isArray(A)&&(A[0]||A[1]))&&(L.value||re):!!A&&(L.value||re)}),K=$(()=>{const{showPasswordOn:A}=e;if(A)return A;if(e.showPasswordToggle)return"click"}),te=M(!1),xe=$(()=>{const{textDecoration:A}=e;return A?Array.isArray(A)?A.map(re=>({textDecoration:re})):[{textDecoration:A}]:["",""]}),de=M(void 0),ie=()=>{var A,re;if(e.type==="textarea"){const{autosize:Te}=e;if(Te&&(de.value=(re=(A=h.value)===null||A===void 0?void 0:A.$el)===null||re===void 0?void 0:re.offsetWidth),!s.value||typeof Te=="boolean")return;const{paddingTop:Ye,paddingBottom:Ze,lineHeight:Ge}=window.getComputedStyle(s.value),Zo=Number(Ye.slice(0,-2)),Qo=Number(Ze.slice(0,-2)),Jo=Number(Ge.slice(0,-2)),{value:pt}=d;if(!pt)return;if(Te.minRows){const vt=Math.max(Te.minRows,1),Jt=`${Zo+Qo+Jo*vt}px`;pt.style.minHeight=Jt}if(Te.maxRows){const vt=`${Zo+Qo+Jo*Te.maxRows}px`;pt.style.maxHeight=vt}}},F=$(()=>{const{maxlength:A}=e;return A===void 0?void 0:Number(A)});po(()=>{const{value:A}=b;Array.isArray(A)||qe(A)});const B=Tr().proxy;function q(A,re){const{onUpdateValue:Te,"onUpdate:value":Ye,onInput:Ze}=e,{nTriggerFormInput:Ge}=_;Te&&ce(Te,A,re),Ye&&ce(Ye,A,re),Ze&&ce(Ze,A,re),x.value=A,Ge()}function ee(A,re){const{onChange:Te}=e,{nTriggerFormChange:Ye}=_;Te&&ce(Te,A,re),x.value=A,Ye()}function be(A){const{onBlur:re}=e,{nTriggerFormBlur:Te}=_;re&&ce(re,A),Te()}function me(A){const{onFocus:re}=e,{nTriggerFormFocus:Te}=_;re&&ce(re,A),Te()}function Be(A){const{onClear:re}=e;re&&ce(re,A)}function T(A){const{onInputBlur:re}=e;re&&ce(re,A)}function ve(A){const{onInputFocus:re}=e;re&&ce(re,A)}function Se(){const{onDeactivate:A}=e;A&&ce(A)}function Fe(){const{onActivate:A}=e;A&&ce(A)}function ne(A){const{onClick:re}=e;re&&ce(re,A)}function Ce(A){const{onWrapperFocus:re}=e;re&&ce(re,A)}function ge(A){const{onWrapperBlur:re}=e;re&&ce(re,A)}function Ee(){I.value=!0}function Q(A){I.value=!1,A.target===f.value?he(A,1):he(A,0)}function he(A,re=0,Te="input"){const Ye=A.target.value;if(qe(Ye),A instanceof InputEvent&&!A.isComposing&&(I.value=!1),e.type==="textarea"){const{value:Ge}=h;Ge&&Ge.syncUnifiedContainer()}if(W=Ye,I.value)return;v.recordCursor();const Ze=G(Ye);if(Ze)if(!e.pair)Te==="input"?q(Ye,{source:re}):ee(Ye,{source:re});else{let{value:Ge}=b;Array.isArray(Ge)?Ge=[Ge[0],Ge[1]]:Ge=["",""],Ge[re]=Ye,Te==="input"?q(Ge,{source:re}):ee(Ge,{source:re})}B.$forceUpdate(),Ze||lo(v.restoreCursor)}function G(A){const{countGraphemes:re,maxlength:Te,minlength:Ye}=e;if(re){let Ge;if(Te!==void 0&&(Ge===void 0&&(Ge=re(A)),Ge>Number(Te))||Ye!==void 0&&(Ge===void 0&&(Ge=re(A)),Ge<Number(Te)))return!1}const{allowInput:Ze}=e;return typeof Ze=="function"?Ze(A):!0}function U(A){T(A),A.relatedTarget===a.value&&Se(),A.relatedTarget!==null&&(A.relatedTarget===u.value||A.relatedTarget===f.value||A.relatedTarget===s.value)||(D.value=!1),oe(A,"blur"),p.value=null}function le(A,re){ve(A),S.value=!0,D.value=!0,Fe(),oe(A,"focus"),re===0?p.value=u.value:re===1?p.value=f.value:re===2&&(p.value=s.value)}function ye(A){e.passivelyActivated&&(ge(A),oe(A,"blur"))}function _e(A){e.passivelyActivated&&(S.value=!0,Ce(A),oe(A,"focus"))}function oe(A,re){A.relatedTarget!==null&&(A.relatedTarget===u.value||A.relatedTarget===f.value||A.relatedTarget===s.value||A.relatedTarget===a.value)||(re==="focus"?(me(A),S.value=!0):re==="blur"&&(be(A),S.value=!1))}function pe(A,re){he(A,re,"change")}function Ue(A){ne(A)}function fo(A){Be(A),Po()}function Po(){e.pair?(q(["",""],{source:"clear"}),ee(["",""],{source:"clear"})):(q("",{source:"clear"}),ee("",{source:"clear"}))}function Fo(A){const{onMousedown:re}=e;re&&re(A);const{tagName:Te}=A.target;if(Te!=="INPUT"&&Te!=="TEXTAREA"){if(e.resizable){const{value:Ye}=a;if(Ye){const{left:Ze,top:Ge,width:Zo,height:Qo}=Ye.getBoundingClientRect(),Jo=14;if(Ze+Zo-Jo<A.clientX&&A.clientX<Ze+Zo&&Ge+Qo-Jo<A.clientY&&A.clientY<Ge+Qo)return}}A.preventDefault(),S.value||ue()}}function xo(){var A;L.value=!0,e.type==="textarea"&&((A=h.value)===null||A===void 0||A.handleMouseEnterWrapper())}function Co(){var A;L.value=!1,e.type==="textarea"&&((A=h.value)===null||A===void 0||A.handleMouseLeaveWrapper())}function Eo(){z.value||K.value==="click"&&(te.value=!te.value)}function _o(A){if(z.value)return;A.preventDefault();const re=Ye=>{Ye.preventDefault(),Io("mouseup",document,re)};if(Lo("mouseup",document,re),K.value!=="mousedown")return;te.value=!0;const Te=()=>{te.value=!1,Io("mouseup",document,Te)};Lo("mouseup",document,Te)}function uo(A){e.onKeyup&&ce(e.onKeyup,A)}function vo(A){switch(e.onKeydown&&ce(e.onKeydown,A),A.key){case"Escape":X();break;case"Enter":O(A);break}}function O(A){var re,Te;if(e.passivelyActivated){const{value:Ye}=D;if(Ye){e.internalDeactivateOnEnter&&X();return}A.preventDefault(),e.type==="textarea"?(re=s.value)===null||re===void 0||re.focus():(Te=u.value)===null||Te===void 0||Te.focus()}}function X(){e.passivelyActivated&&(D.value=!1,lo(()=>{var A;(A=a.value)===null||A===void 0||A.focus()}))}function ue(){var A,re,Te;z.value||(e.passivelyActivated?(A=a.value)===null||A===void 0||A.focus():((re=s.value)===null||re===void 0||re.focus(),(Te=u.value)===null||Te===void 0||Te.focus()))}function $e(){var A;!((A=a.value)===null||A===void 0)&&A.contains(document.activeElement)&&document.activeElement.blur()}function Pe(){var A,re;(A=s.value)===null||A===void 0||A.select(),(re=u.value)===null||re===void 0||re.select()}function ke(){z.value||(s.value?s.value.focus():u.value&&u.value.focus())}function Me(){const{value:A}=a;A!=null&&A.contains(document.activeElement)&&A!==document.activeElement&&X()}function Le(A){if(e.type==="textarea"){const{value:re}=s;re==null||re.scrollTo(A)}else{const{value:re}=u;re==null||re.scrollTo(A)}}function qe(A){const{type:re,pair:Te,autosize:Ye}=e;if(!Te&&Ye)if(re==="textarea"){const{value:Ze}=d;Ze&&(Ze.textContent=(A??"")+`\r
|
|
|
`)}else{const{value:Ze}=c;Ze&&(A?Ze.textContent=A:Ze.innerHTML=" ")}}function go(){ie()}const nt=M({top:"0"});function ut(A){var re;const{scrollTop:Te}=A.target;nt.value.top=`${-Te}px`,(re=h.value)===null||re===void 0||re.syncUnifiedContainer()}let Vo=null;oo(()=>{const{autosize:A,type:re}=e;A&&re==="textarea"?Vo=Xe(b,Te=>{!Array.isArray(Te)&&Te!==W&&qe(Te)}):Vo==null||Vo()});let Uo=null;oo(()=>{e.type==="textarea"?Uo=Xe(b,A=>{var re;!Array.isArray(A)&&A!==W&&((re=h.value)===null||re===void 0||re.syncUnifiedContainer())}):Uo==null||Uo()}),De(Kl,{mergedValueRef:b,maxlengthRef:F,mergedClsPrefixRef:o,countGraphemesRef:ae(e,"countGraphemes")});const ft={wrapperElRef:a,inputElRef:u,textareaElRef:s,isCompositing:I,clear:Po,focus:ue,blur:$e,select:Pe,deactivate:Me,activate:ke,scrollTo:Le},ht=eo("Input",n,o),Bt=$(()=>{const{value:A}=k,{common:{cubicBezierEaseInOut:re},self:{color:Te,borderRadius:Ye,textColor:Ze,caretColor:Ge,caretColorError:Zo,caretColorWarning:Qo,textDecorationColor:Jo,border:pt,borderDisabled:vt,borderHover:Jt,borderFocus:Vr,placeholderColor:Ur,placeholderColorDisabled:Kr,lineHeightTextarea:Gr,colorDisabled:Tt,colorFocus:Ot,textColorDisabled:ks,boxShadowFocus:Is,iconSize:Bs,colorFocusWarning:Ts,boxShadowFocusWarning:Os,borderWarning:Fs,borderFocusWarning:_s,borderHoverWarning:Ms,colorFocusError:Ds,boxShadowFocusError:Ls,borderError:Hs,borderFocusError:As,borderHoverError:Es,clearSize:js,clearColor:Ws,clearColorHover:Ns,clearColorPressed:Vs,iconColor:Us,iconColorDisabled:Ks,suffixTextColor:Gs,countTextColor:qs,countTextColorDisabled:Ys,iconColorHover:Xs,iconColorPressed:Zs,loadingColor:Qs,loadingColorError:Js,loadingColorWarning:ed,[N("padding",A)]:od,[N("fontSize",A)]:td,[N("height",A)]:rd}}=l.value,{left:nd,right:id}=yo(od);return{"--n-bezier":re,"--n-count-text-color":qs,"--n-count-text-color-disabled":Ys,"--n-color":Te,"--n-font-size":td,"--n-border-radius":Ye,"--n-height":rd,"--n-padding-left":nd,"--n-padding-right":id,"--n-text-color":Ze,"--n-caret-color":Ge,"--n-text-decoration-color":Jo,"--n-border":pt,"--n-border-disabled":vt,"--n-border-hover":Jt,"--n-border-focus":Vr,"--n-placeholder-color":Ur,"--n-placeholder-color-disabled":Kr,"--n-icon-size":Bs,"--n-line-height-textarea":Gr,"--n-color-disabled":Tt,"--n-color-focus":Ot,"--n-text-color-disabled":ks,"--n-box-shadow-focus":Is,"--n-loading-color":Qs,"--n-caret-color-warning":Qo,"--n-color-focus-warning":Ts,"--n-box-shadow-focus-warning":Os,"--n-border-warning":Fs,"--n-border-focus-warning":_s,"--n-border-hover-warning":Ms,"--n-loading-color-warning":ed,"--n-caret-color-error":Zo,"--n-color-focus-error":Ds,"--n-box-shadow-focus-error":Ls,"--n-border-error":Hs,"--n-border-focus-error":As,"--n-border-hover-error":Es,"--n-loading-color-error":Js,"--n-clear-color":Ws,"--n-clear-size":js,"--n-clear-color-hover":Ns,"--n-clear-color-pressed":Vs,"--n-icon-color":Us,"--n-icon-color-hover":Xs,"--n-icon-color-pressed":Zs,"--n-icon-color-disabled":Ks,"--n-suffix-text-color":Gs}}),it=r?We("input",$(()=>{const{value:A}=k;return A[0]}),Bt,e):void 0;return Object.assign(Object.assign({},ft),{wrapperElRef:a,inputElRef:u,inputMirrorElRef:c,inputEl2Ref:f,textareaElRef:s,textareaMirrorElRef:d,textareaScrollbarInstRef:h,rtlEnabled:ht,uncontrolledValue:x,mergedValue:b,passwordVisible:te,mergedPlaceholder:H,showPlaceholder1:j,showPlaceholder2:V,mergedFocus:E,isComposing:I,activated:D,showClearButton:Y,mergedSize:k,mergedDisabled:z,textDecorationStyle:xe,mergedClsPrefix:o,mergedBordered:t,mergedShowPasswordOn:K,placeholderStyle:nt,mergedStatus:R,textAreaScrollContainerWidth:de,handleTextAreaScroll:ut,handleCompositionStart:Ee,handleCompositionEnd:Q,handleInput:he,handleInputBlur:U,handleInputFocus:le,handleWrapperBlur:ye,handleWrapperFocus:_e,handleMouseEnter:xo,handleMouseLeave:Co,handleMouseDown:Fo,handleChange:pe,handleClick:Ue,handleClear:fo,handlePasswordToggleClick:Eo,handlePasswordToggleMousedown:_o,handleWrapperKeydown:vo,handleWrapperKeyup:uo,handleTextAreaMirrorResize:go,getTextareaScrollContainer:()=>s.value,mergedTheme:l,cssVars:r?void 0:Bt,themeClass:it==null?void 0:it.themeClass,onRender:it==null?void 0:it.onRender})},render(){var e,o;const{mergedClsPrefix:t,mergedStatus:r,themeClass:n,type:l,countGraphemes:a,onRender:s}=this,d=this.$slots;return s==null||s(),i("div",{ref:"wrapperElRef",class:[`${t}-input`,n,r&&`${t}-input--${r}-status`,{[`${t}-input--rtl`]:this.rtlEnabled,[`${t}-input--disabled`]:this.mergedDisabled,[`${t}-input--textarea`]:l==="textarea",[`${t}-input--resizable`]:this.resizable&&!this.autosize,[`${t}-input--autosize`]:this.autosize,[`${t}-input--round`]:this.round&&l!=="textarea",[`${t}-input--pair`]:this.pair,[`${t}-input--focus`]:this.mergedFocus,[`${t}-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},i("div",{class:`${t}-input-wrapper`},je(d.prefix,c=>c&&i("div",{class:`${t}-input__prefix`},c)),l==="textarea"?i(gr,{ref:"textareaScrollbarInstRef",class:`${t}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var c,u;const{textAreaScrollContainerWidth:f}=this,p={width:this.autosize&&f&&`${f}px`};return i(so,null,i("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${t}-input__textarea-el`,(c=this.inputProps)===null||c===void 0?void 0:c.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(u=this.inputProps)===null||u===void 0?void 0:u.style,p],onBlur:this.handleInputBlur,onFocus:v=>{this.handleInputFocus(v,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?i("div",{class:`${t}-input__placeholder`,style:[this.placeholderStyle,p],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?i(st,{onResize:this.handleTextAreaMirrorResize},{default:()=>i("div",{ref:"textareaMirrorElRef",class:`${t}-input__textarea-mirror`,key:"mirror"})}):null)}}):i("div",{class:`${t}-input__input`},i("input",Object.assign({type:l==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":l},this.inputProps,{ref:"inputElRef",class:[`${t}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(o=this.inputProps)===null||o===void 0?void 0:o.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?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:c=>{this.handleInputFocus(c,0)},onInput:c=>{this.handleInput(c,0)},onChange:c=>{this.handleChange(c,0)}})),this.showPlaceholder1?i("div",{class:`${t}-input__placeholder`},i("span",null,this.mergedPlaceholder[0])):null,this.autosize?i("div",{class:`${t}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&je(d.suffix,c=>c||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?i("div",{class:`${t}-input__suffix`},[je(d["clear-icon-placeholder"],u=>(this.clearable||u)&&i(gn,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>u,icon:()=>{var f,p;return(p=(f=this.$slots)["clear-icon"])===null||p===void 0?void 0:p.call(f)}})),this.internalLoadingBeforeSuffix?null:c,this.loading!==void 0?i(Ll,{clsPrefix:t,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?c:null,this.showCount&&this.type!=="textarea"?i(zi,null,{default:u=>{var f;return(f=d.count)===null||f===void 0?void 0:f.call(d,u)}}):null,this.mergedShowPasswordOn&&this.type==="password"?i("div",{class:`${t}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?ao(d["password-visible-icon"],()=>[i(He,{clsPrefix:t},{default:()=>i(yl,null)})]):ao(d["password-invisible-icon"],()=>[i(He,{clsPrefix:t},{default:()=>i(Jd,null)})])):null]):null)),this.pair?i("span",{class:`${t}-input__separator`},ao(d.separator,()=>[this.separator])):null,this.pair?i("div",{class:`${t}-input-wrapper`},i("div",{class:`${t}-input__input`},i("input",{ref:"inputEl2Ref",type:this.type,class:`${t}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?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:c=>{this.handleInputFocus(c,1)},onInput:c=>{this.handleInput(c,1)},onChange:c=>{this.handleChange(c,1)}}),this.showPlaceholder2?i("div",{class:`${t}-input__placeholder`},i("span",null,this.mergedPlaceholder[1])):null),je(d.suffix,c=>(this.clearable||c)&&i("div",{class:`${t}-input__suffix`},[this.clearable&&i(gn,{clsPrefix:t,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var u;return(u=d["clear-icon"])===null||u===void 0?void 0:u.call(d)},placeholder:()=>{var u;return(u=d["clear-icon-placeholder"])===null||u===void 0?void 0:u.call(d)}}),c]))):null,this.mergedBordered?i("div",{class:`${t}-input__border`}):null,this.mergedBordered?i("div",{class:`${t}-input__state-border`}):null,this.showCount&&l==="textarea"?i(zi,null,{default:c=>{var u;const{renderCount:f}=this;return f?f(c):(u=d.count)===null||u===void 0?void 0:u.call(d,c)}}):null)}}),Lu=g("input-group",`
|
|
|
display: inline-flex;
|
|
|
width: 100%;
|
|
|
flex-wrap: nowrap;
|
|
|
vertical-align: bottom;
|
|
|
`,[y(">",[g("input",[y("&:not(:last-child)",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`),y("&:not(:first-child)",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
margin-left: -1px!important;
|
|
|
`)]),g("button",[y("&:not(:last-child)",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`,[w("state-border, border",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`)]),y("&:not(:first-child)",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`,[w("state-border, border",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`)])]),y("*",[y("&:not(:last-child)",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`,[y(">",[g("input",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`),g("base-selection",[g("base-selection-label",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`),g("base-selection-tags",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`),w("box-shadow, border, state-border",`
|
|
|
border-top-right-radius: 0!important;
|
|
|
border-bottom-right-radius: 0!important;
|
|
|
`)])])]),y("&:not(:first-child)",`
|
|
|
margin-left: -1px!important;
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`,[y(">",[g("input",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`),g("base-selection",[g("base-selection-label",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`),g("base-selection-tags",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`),w("box-shadow, border, state-border",`
|
|
|
border-top-left-radius: 0!important;
|
|
|
border-bottom-left-radius: 0!important;
|
|
|
`)])])])])])]),Hu={},I1=Z({name:"InputGroup",props:Hu,setup(e){const{mergedClsPrefixRef:o}=Ie(e);return Xo("-input-group",Lu,o),{mergedClsPrefix:o}},render(){const{mergedClsPrefix:e}=this;return i("div",{class:`${e}-input-group`},this.$slots)}});function Au(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}const Eu={name:"AutoComplete",common:fe,peers:{InternalSelectMenu:mr,Input:Ao},self:Au},ju=Eu,Gl=No&&"loading"in document.createElement("img"),Wu=(e={})=>{var o;const{root:t=null}=e;return{hash:`${e.rootMargin||"0px 0px 0px 0px"}-${Array.isArray(e.threshold)?e.threshold.join(","):(o=e.threshold)!==null&&o!==void 0?o:"0"}`,options:Object.assign(Object.assign({},e),{root:(typeof t=="string"?document.querySelector(t):t)||document.documentElement})}},tn=new WeakMap,rn=new WeakMap,nn=new WeakMap,ql=(e,o,t)=>{if(!e)return()=>{};const r=Wu(o),{root:n}=r.options;let l;const a=tn.get(n);a?l=a:(l=new Map,tn.set(n,l));let s,d;l.has(r.hash)?(d=l.get(r.hash),d[1].has(e)||(s=d[0],d[1].add(e),s.observe(e))):(s=new IntersectionObserver(f=>{f.forEach(p=>{if(p.isIntersecting){const v=rn.get(p.target),h=nn.get(p.target);v&&v(),h&&(h.value=!0)}})},r.options),s.observe(e),d=[s,new Set([e])],l.set(r.hash,d));let c=!1;const u=()=>{c||(rn.delete(e),nn.delete(e),c=!0,d[1].has(e)&&(d[0].unobserve(e),d[1].delete(e)),d[1].size<=0&&l.delete(r.hash),l.size||tn.delete(n))};return rn.set(e,u),nn.set(e,t),u},Yl=e=>{const{borderRadius:o,avatarColor:t,cardColor:r,fontSize:n,heightTiny:l,heightSmall:a,heightMedium:s,heightLarge:d,heightHuge:c,modalColor:u,popoverColor:f}=e;return{borderRadius:o,fontSize:n,border:`2px solid ${r}`,heightTiny:l,heightSmall:a,heightMedium:s,heightLarge:d,heightHuge:c,color:Re(r,t),colorModal:Re(u,t),colorPopover:Re(f,t)}},Nu={name:"Avatar",common:Ae,self:Yl},Vu=Nu,Uu={name:"Avatar",common:fe,self:Yl},Xl=Uu,Ku="n-avatar-group",Gu=g("avatar",`
|
|
|
width: var(--n-merged-size);
|
|
|
height: var(--n-merged-size);
|
|
|
color: #FFF;
|
|
|
font-size: var(--n-font-size);
|
|
|
display: inline-flex;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
text-align: center;
|
|
|
border: var(--n-border);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
--n-merged-color: var(--n-color);
|
|
|
background-color: var(--n-merged-color);
|
|
|
transition:
|
|
|
border-color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`,[Lr(y("&","--n-merged-color: var(--n-color-modal);")),Pn(y("&","--n-merged-color: var(--n-color-popover);")),y("img",`
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
`),w("text",`
|
|
|
white-space: nowrap;
|
|
|
display: inline-block;
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
`),g("icon",`
|
|
|
vertical-align: bottom;
|
|
|
font-size: calc(var(--n-merged-size) - 6px);
|
|
|
`),w("text","line-height: 1.25")]),qu=Object.assign(Object.assign({},se.props),{size:[String,Number],src:String,circle:{type:Boolean,default:void 0},objectFit:String,round:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},onError:Function,fallbackSrc:String,intersectionObserverOptions:Object,lazy:Boolean,onLoad:Function,renderPlaceholder:Function,renderFallback:Function,imgProps:Object,color:String}),B1=Z({name:"Avatar",props:qu,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=M(!1);let n=null;const l=M(null),a=M(null),s=()=>{const{value:b}=l;if(b&&(n===null||n!==b.innerHTML)){n=b.innerHTML;const{value:_}=a;if(_){const{offsetWidth:k,offsetHeight:z}=_,{offsetWidth:R,offsetHeight:S}=b,L=.9,I=Math.min(k/R*L,z/S*L,1);b.style.transform=`translateX(-50%) translateY(-50%) scale(${I})`}}},d=ze(Ku,null),c=$(()=>{const{size:b}=e;if(b)return b;const{size:_}=d||{};return _||"medium"}),u=se("Avatar","-avatar",Gu,Vu,e,o),f=ze(Dl,null),p=$(()=>{if(d)return!0;const{round:b,circle:_}=e;return b!==void 0||_!==void 0?b||_:f?f.roundRef.value:!1}),v=$(()=>d?!0:e.bordered||!1),h=$(()=>{const b=c.value,_=p.value,k=v.value,{color:z}=e,{self:{borderRadius:R,fontSize:S,color:L,border:I,colorModal:D,colorPopover:W},common:{cubicBezierEaseInOut:H}}=u.value;let j;return typeof b=="number"?j=`${b}px`:j=u.value.self[N("height",b)],{"--n-font-size":S,"--n-border":k?I:"none","--n-border-radius":_?"50%":R,"--n-color":z||L,"--n-color-modal":z||D,"--n-color-popover":z||W,"--n-bezier":H,"--n-merged-size":`var(--n-avatar-size-override, ${j})`}}),m=t?We("avatar",$(()=>{const b=c.value,_=p.value,k=v.value,{color:z}=e;let R="";return b&&(typeof b=="number"?R+=`a${b}`:R+=b[0]),_&&(R+="b"),k&&(R+="c"),z&&(R+=Et(z)),R}),h,e):void 0,x=M(!e.lazy);po(()=>{if(e.lazy&&e.intersectionObserverOptions){let b;const _=oo(()=>{b==null||b(),b=void 0,e.lazy&&(b=ql(a.value,e.intersectionObserverOptions,x))});So(()=>{_(),b==null||b()})}}),Xe(()=>{var b;return e.src||((b=e.imgProps)===null||b===void 0?void 0:b.src)},()=>{r.value=!1});const C=M(!e.lazy);return{textRef:l,selfRef:a,mergedRoundRef:p,mergedClsPrefix:o,fitTextTransform:s,cssVars:t?void 0:h,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender,hasLoadError:r,shouldStartLoading:x,loaded:C,mergedOnError:b=>{if(!x.value)return;r.value=!0;const{onError:_,imgProps:{onError:k}={}}=e;_==null||_(b),k==null||k(b)},mergedOnLoad:b=>{const{onLoad:_,imgProps:{onLoad:k}={}}=e;_==null||_(b),k==null||k(b),C.value=!0}}},render(){var e,o;const{$slots:t,src:r,mergedClsPrefix:n,lazy:l,onRender:a,loaded:s,hasLoadError:d,imgProps:c={}}=this;a==null||a();let u;const f=!s&&!d&&(this.renderPlaceholder?this.renderPlaceholder():(o=(e=this.$slots).placeholder)===null||o===void 0?void 0:o.call(e));return this.hasLoadError?u=this.renderFallback?this.renderFallback():ao(t.fallback,()=>[i("img",{src:this.fallbackSrc,style:{objectFit:this.objectFit}})]):u=je(t.default,p=>{if(p)return i(st,{onResize:this.fitTextTransform},{default:()=>i("span",{ref:"textRef",class:`${n}-avatar__text`},p)});if(r||c.src){const v=this.src||c.src;return i("img",Object.assign(Object.assign({},c),{loading:Gl&&!this.intersectionObserverOptions&&l?"lazy":"eager",src:l&&this.intersectionObserverOptions?this.shouldStartLoading?v:void 0:v,"data-image-src":v,onLoad:this.mergedOnLoad,onError:this.mergedOnError,style:[c.style||"",{objectFit:this.objectFit},f?{height:"0",width:"0",visibility:"hidden",position:"absolute"}:""]}))}}),i("span",{ref:"selfRef",class:[`${n}-avatar`,this.themeClass],style:this.cssVars},u,l&&f)}}),Yu=()=>({gap:"-12px"}),Xu={name:"AvatarGroup",common:fe,peers:{Avatar:Xl},self:Yu},Zu=Xu,Qu={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},Ju={name:"BackTop",common:fe,self(e){const{popoverColor:o,textColor2:t,primaryColorHover:r,primaryColorPressed:n}=e;return Object.assign(Object.assign({},Qu),{color:o,textColor:t,iconColor:t,iconColorHover:r,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},ef=Ju,of={name:"Badge",common:fe,self(e){const{errorColorSuppl:o,infoColorSuppl:t,successColorSuppl:r,warningColorSuppl:n,fontFamily:l}=e;return{color:o,colorInfo:t,colorSuccess:r,colorError:o,colorWarning:n,fontSize:"12px",fontFamily:l}}},tf=of,rf=e=>{const{errorColor:o,infoColor:t,successColor:r,warningColor:n,fontFamily:l}=e;return{color:o,colorInfo:t,colorSuccess:r,colorError:o,colorWarning:n,fontSize:"12px",fontFamily:l}},nf={name:"Badge",common:Ae,self:rf},lf=nf,af=y([y("@keyframes badge-wave-spread",{from:{boxShadow:"0 0 0.5px 0px var(--n-ripple-color)",opacity:.6},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)",opacity:0}}),g("badge",`
|
|
|
display: inline-flex;
|
|
|
position: relative;
|
|
|
vertical-align: middle;
|
|
|
color: var(--n-color);
|
|
|
font-family: var(--n-font-family);
|
|
|
`,[P("as-is",[g("badge-sup",{position:"static",transform:"translateX(0)"},[ct({transformOrigin:"left bottom",originalTransform:"translateX(0)"})])]),P("dot",[g("badge-sup",`
|
|
|
height: 8px;
|
|
|
width: 8px;
|
|
|
padding: 0;
|
|
|
min-width: 8px;
|
|
|
left: 100%;
|
|
|
bottom: calc(100% - 4px);
|
|
|
`,[y("::before","border-radius: 4px;")])]),g("badge-sup",`
|
|
|
background: var(--n-color);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
color: #FFF;
|
|
|
position: absolute;
|
|
|
height: 18px;
|
|
|
line-height: 18px;
|
|
|
border-radius: 9px;
|
|
|
padding: 0 6px;
|
|
|
text-align: center;
|
|
|
font-size: var(--n-font-size);
|
|
|
transform: translateX(-50%);
|
|
|
left: 100%;
|
|
|
bottom: calc(100% - 9px);
|
|
|
font-variant-numeric: tabular-nums;
|
|
|
z-index: 1;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[ct({transformOrigin:"left bottom",originalTransform:"translateX(-50%)"}),g("base-wave",{zIndex:1,animationDuration:"2s",animationIterationCount:"infinite",animationDelay:"1s",animationTimingFunction:"var(--n-ripple-bezier)",animationName:"badge-wave-spread"}),y("&::before",`
|
|
|
opacity: 0;
|
|
|
transform: scale(1);
|
|
|
border-radius: 9px;
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
`)])])]),sf=Object.assign(Object.assign({},se.props),{value:[String,Number],max:Number,dot:Boolean,type:{type:String,default:"default"},show:{type:Boolean,default:!0},showZero:Boolean,processing:Boolean,color:String,offset:Array}),T1=Z({name:"Badge",props:sf,setup(e,{slots:o}){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),l=se("Badge","-badge",af,lf,e,t),a=M(!1),s=()=>{a.value=!0},d=()=>{a.value=!1},c=$(()=>e.show&&(e.dot||e.value!==void 0&&!(!e.showZero&&Number(e.value)<=0)||!xt(o.value)));po(()=>{c.value&&(a.value=!0)});const u=eo("Badge",n,t),f=$(()=>{const{type:h,color:m}=e,{common:{cubicBezierEaseInOut:x,cubicBezierEaseOut:C},self:{[N("color",h)]:b,fontFamily:_,fontSize:k}}=l.value;return{"--n-font-size":k,"--n-font-family":_,"--n-color":m||b,"--n-ripple-color":m||b,"--n-bezier":x,"--n-ripple-bezier":C}}),p=r?We("badge",$(()=>{let h="";const{type:m,color:x}=e;return m&&(h+=m[0]),x&&(h+=Et(x)),h}),f,e):void 0,v=$(()=>{const{offset:h}=e;if(!h)return;const[m,x]=h,C=typeof m=="number"?`${m}px`:m,b=typeof x=="number"?`${x}px`:x;return{transform:`translate(calc(${u!=null&&u.value?"50%":"-50%"} + ${C}), ${b})`}});return{rtlEnabled:u,mergedClsPrefix:t,appeared:a,showBadge:c,handleAfterEnter:s,handleAfterLeave:d,cssVars:r?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender,offsetStyle:v}},render(){var e;const{mergedClsPrefix:o,onRender:t,themeClass:r,$slots:n}=this;t==null||t();const l=(e=n.default)===null||e===void 0?void 0:e.call(n);return i("div",{class:[`${o}-badge`,this.rtlEnabled&&`${o}-badge--rtl`,r,{[`${o}-badge--dot`]:this.dot,[`${o}-badge--as-is`]:!l}],style:this.cssVars},l,i(io,{name:"fade-in-scale-up-transition",onAfterEnter:this.handleAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>this.showBadge?i("sup",{class:`${o}-badge-sup`,title:il(this.value),style:this.offsetStyle},ao(n.value,()=>[this.dot?null:i(fu,{clsPrefix:o,appeared:this.appeared,max:this.max,value:this.value})]),this.processing?i(Bl,{clsPrefix:o}):null):null}))}}),df={fontWeightActive:"400"},cf=e=>{const{fontSize:o,textColor3:t,textColor2:r,borderRadius:n,buttonColor2Hover:l,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},df),{fontSize:o,itemLineHeight:"1.25",itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:r,itemTextColorActive:r,itemBorderRadius:n,itemColorHover:l,itemColorPressed:a,separatorColor:t})},uf={name:"Breadcrumb",common:fe,self:cf},ff=uf;function gt(e){return Re(e,[255,255,255,.16])}function Sr(e){return Re(e,[0,0,0,.12])}const Zl="n-button-group",hf={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"},Ql=e=>{const{heightTiny:o,heightSmall:t,heightMedium:r,heightLarge:n,borderRadius:l,fontSizeTiny:a,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,opacityDisabled:u,textColor2:f,textColor3:p,primaryColorHover:v,primaryColorPressed:h,borderColor:m,primaryColor:x,baseColor:C,infoColor:b,infoColorHover:_,infoColorPressed:k,successColor:z,successColorHover:R,successColorPressed:S,warningColor:L,warningColorHover:I,warningColorPressed:D,errorColor:W,errorColorHover:H,errorColorPressed:j,fontWeight:V,buttonColor2:E,buttonColor2Hover:Y,buttonColor2Pressed:K,fontWeightStrong:te}=e;return Object.assign(Object.assign({},hf),{heightTiny:o,heightSmall:t,heightMedium:r,heightLarge:n,borderRadiusTiny:l,borderRadiusSmall:l,borderRadiusMedium:l,borderRadiusLarge:l,fontSizeTiny:a,fontSizeSmall:s,fontSizeMedium:d,fontSizeLarge:c,opacityDisabled:u,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:E,colorSecondaryHover:Y,colorSecondaryPressed:K,colorTertiary:E,colorTertiaryHover:Y,colorTertiaryPressed:K,colorQuaternary:"#0000",colorQuaternaryHover:Y,colorQuaternaryPressed:K,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:f,textColorTertiary:p,textColorHover:v,textColorPressed:h,textColorFocus:v,textColorDisabled:f,textColorText:f,textColorTextHover:v,textColorTextPressed:h,textColorTextFocus:v,textColorTextDisabled:f,textColorGhost:f,textColorGhostHover:v,textColorGhostPressed:h,textColorGhostFocus:v,textColorGhostDisabled:f,border:`1px solid ${m}`,borderHover:`1px solid ${v}`,borderPressed:`1px solid ${h}`,borderFocus:`1px solid ${v}`,borderDisabled:`1px solid ${m}`,rippleColor:x,colorPrimary:x,colorHoverPrimary:v,colorPressedPrimary:h,colorFocusPrimary:v,colorDisabledPrimary:x,textColorPrimary:C,textColorHoverPrimary:C,textColorPressedPrimary:C,textColorFocusPrimary:C,textColorDisabledPrimary:C,textColorTextPrimary:x,textColorTextHoverPrimary:v,textColorTextPressedPrimary:h,textColorTextFocusPrimary:v,textColorTextDisabledPrimary:f,textColorGhostPrimary:x,textColorGhostHoverPrimary:v,textColorGhostPressedPrimary:h,textColorGhostFocusPrimary:v,textColorGhostDisabledPrimary:x,borderPrimary:`1px solid ${x}`,borderHoverPrimary:`1px solid ${v}`,borderPressedPrimary:`1px solid ${h}`,borderFocusPrimary:`1px solid ${v}`,borderDisabledPrimary:`1px solid ${x}`,rippleColorPrimary:x,colorInfo:b,colorHoverInfo:_,colorPressedInfo:k,colorFocusInfo:_,colorDisabledInfo:b,textColorInfo:C,textColorHoverInfo:C,textColorPressedInfo:C,textColorFocusInfo:C,textColorDisabledInfo:C,textColorTextInfo:b,textColorTextHoverInfo:_,textColorTextPressedInfo:k,textColorTextFocusInfo:_,textColorTextDisabledInfo:f,textColorGhostInfo:b,textColorGhostHoverInfo:_,textColorGhostPressedInfo:k,textColorGhostFocusInfo:_,textColorGhostDisabledInfo:b,borderInfo:`1px solid ${b}`,borderHoverInfo:`1px solid ${_}`,borderPressedInfo:`1px solid ${k}`,borderFocusInfo:`1px solid ${_}`,borderDisabledInfo:`1px solid ${b}`,rippleColorInfo:b,colorSuccess:z,colorHoverSuccess:R,colorPressedSuccess:S,colorFocusSuccess:R,colorDisabledSuccess:z,textColorSuccess:C,textColorHoverSuccess:C,textColorPressedSuccess:C,textColorFocusSuccess:C,textColorDisabledSuccess:C,textColorTextSuccess:z,textColorTextHoverSuccess:R,textColorTextPressedSuccess:S,textColorTextFocusSuccess:R,textColorTextDisabledSuccess:f,textColorGhostSuccess:z,textColorGhostHoverSuccess:R,textColorGhostPressedSuccess:S,textColorGhostFocusSuccess:R,textColorGhostDisabledSuccess:z,borderSuccess:`1px solid ${z}`,borderHoverSuccess:`1px solid ${R}`,borderPressedSuccess:`1px solid ${S}`,borderFocusSuccess:`1px solid ${R}`,borderDisabledSuccess:`1px solid ${z}`,rippleColorSuccess:z,colorWarning:L,colorHoverWarning:I,colorPressedWarning:D,colorFocusWarning:I,colorDisabledWarning:L,textColorWarning:C,textColorHoverWarning:C,textColorPressedWarning:C,textColorFocusWarning:C,textColorDisabledWarning:C,textColorTextWarning:L,textColorTextHoverWarning:I,textColorTextPressedWarning:D,textColorTextFocusWarning:I,textColorTextDisabledWarning:f,textColorGhostWarning:L,textColorGhostHoverWarning:I,textColorGhostPressedWarning:D,textColorGhostFocusWarning:I,textColorGhostDisabledWarning:L,borderWarning:`1px solid ${L}`,borderHoverWarning:`1px solid ${I}`,borderPressedWarning:`1px solid ${D}`,borderFocusWarning:`1px solid ${I}`,borderDisabledWarning:`1px solid ${L}`,rippleColorWarning:L,colorError:W,colorHoverError:H,colorPressedError:j,colorFocusError:H,colorDisabledError:W,textColorError:C,textColorHoverError:C,textColorPressedError:C,textColorFocusError:C,textColorDisabledError:C,textColorTextError:W,textColorTextHoverError:H,textColorTextPressedError:j,textColorTextFocusError:H,textColorTextDisabledError:f,textColorGhostError:W,textColorGhostHoverError:H,textColorGhostPressedError:j,textColorGhostFocusError:H,textColorGhostDisabledError:W,borderError:`1px solid ${W}`,borderHoverError:`1px solid ${H}`,borderPressedError:`1px solid ${j}`,borderFocusError:`1px solid ${H}`,borderDisabledError:`1px solid ${W}`,rippleColorError:W,waveOpacity:"0.6",fontWeight:V,fontWeightStrong:te})},pf={name:"Button",common:Ae,self:Ql},Yt=pf,vf={name:"Button",common:fe,self(e){const o=Ql(e);return o.waveOpacity="0.8",o.colorOpacitySecondary="0.16",o.colorOpacitySecondaryHover="0.2",o.colorOpacitySecondaryPressed="0.12",o}},Ro=vf,gf=y([g("button",`
|
|
|
margin: 0;
|
|
|
font-weight: var(--n-font-weight);
|
|
|
line-height: 1;
|
|
|
font-family: inherit;
|
|
|
padding: var(--n-padding);
|
|
|
height: var(--n-height);
|
|
|
font-size: var(--n-font-size);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
color: var(--n-text-color);
|
|
|
background-color: var(--n-color);
|
|
|
width: var(--n-width);
|
|
|
white-space: nowrap;
|
|
|
outline: none;
|
|
|
position: relative;
|
|
|
z-index: auto;
|
|
|
border: none;
|
|
|
display: inline-flex;
|
|
|
flex-wrap: nowrap;
|
|
|
flex-shrink: 0;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
text-align: center;
|
|
|
cursor: pointer;
|
|
|
text-decoration: none;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`,[P("color",[w("border",{borderColor:"var(--n-border-color)"}),P("disabled",[w("border",{borderColor:"var(--n-border-color-disabled)"})]),Ne("disabled",[y("&:focus",[w("state-border",{borderColor:"var(--n-border-color-focus)"})]),y("&:hover",[w("state-border",{borderColor:"var(--n-border-color-hover)"})]),y("&:active",[w("state-border",{borderColor:"var(--n-border-color-pressed)"})]),P("pressed",[w("state-border",{borderColor:"var(--n-border-color-pressed)"})])])]),P("disabled",{backgroundColor:"var(--n-color-disabled)",color:"var(--n-text-color-disabled)"},[w("border",{border:"var(--n-border-disabled)"})]),Ne("disabled",[y("&:focus",{backgroundColor:"var(--n-color-focus)",color:"var(--n-text-color-focus)"},[w("state-border",{border:"var(--n-border-focus)"})]),y("&:hover",{backgroundColor:"var(--n-color-hover)",color:"var(--n-text-color-hover)"},[w("state-border",{border:"var(--n-border-hover)"})]),y("&:active",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[w("state-border",{border:"var(--n-border-pressed)"})]),P("pressed",{backgroundColor:"var(--n-color-pressed)",color:"var(--n-text-color-pressed)"},[w("state-border",{border:"var(--n-border-pressed)"})])]),P("loading","cursor: wait;"),g("base-wave",`
|
|
|
pointer-events: none;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
animation-iteration-count: 1;
|
|
|
animation-duration: var(--n-ripple-duration);
|
|
|
animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
|
|
|
`,[P("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),No&&"MozBoxSizing"in document.createElement("div").style?y("&::moz-focus-inner",{border:0}):null,w("border, state-border",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
border-radius: inherit;
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
pointer-events: none;
|
|
|
`),w("border",{border:"var(--n-border)"}),w("state-border",{border:"var(--n-border)",borderColor:"#0000",zIndex:1}),w("icon",`
|
|
|
margin: var(--n-icon-margin);
|
|
|
margin-left: 0;
|
|
|
height: var(--n-icon-size);
|
|
|
width: var(--n-icon-size);
|
|
|
max-width: var(--n-icon-size);
|
|
|
font-size: var(--n-icon-size);
|
|
|
position: relative;
|
|
|
flex-shrink: 0;
|
|
|
`,[g("icon-slot",`
|
|
|
height: var(--n-icon-size);
|
|
|
width: var(--n-icon-size);
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
`,[dt({top:"50%",originalTransform:"translateY(-50%)"})]),El()]),w("content",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: nowrap;
|
|
|
min-width: 0;
|
|
|
`,[y("~",[w("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),P("block",`
|
|
|
display: flex;
|
|
|
width: 100%;
|
|
|
`),P("dashed",[w("border, state-border",{borderStyle:"dashed !important"})]),P("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),y("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),y("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),mf=Object.assign(Object.assign({},se.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!Vl}}),Jl=Z({name:"Button",props:mf,setup(e){const o=M(null),t=M(null),r=M(!1),n=Ve(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),l=ze(Zl,{}),{mergedSizeRef:a}=rt({},{defaultSize:"medium",mergedSize:k=>{const{size:z}=e;if(z)return z;const{size:R}=l;if(R)return R;const{mergedSize:S}=k||{};return S?S.value:"medium"}}),s=$(()=>e.focusable&&!e.disabled),d=k=>{var z;s.value||k.preventDefault(),!e.nativeFocusBehavior&&(k.preventDefault(),!e.disabled&&s.value&&((z=o.value)===null||z===void 0||z.focus({preventScroll:!0})))},c=k=>{var z;if(!e.disabled&&!e.loading){const{onClick:R}=e;R&&ce(R,k),e.text||(z=t.value)===null||z===void 0||z.play()}},u=k=>{switch(k.key){case"Enter":if(!e.keyboard)return;r.value=!1}},f=k=>{switch(k.key){case"Enter":if(!e.keyboard||e.loading){k.preventDefault();return}r.value=!0}},p=()=>{r.value=!1},{inlineThemeDisabled:v,mergedClsPrefixRef:h,mergedRtlRef:m}=Ie(e),x=se("Button","-button",gf,Yt,e,h),C=eo("Button",m,h),b=$(()=>{const k=x.value,{common:{cubicBezierEaseInOut:z,cubicBezierEaseOut:R},self:S}=k,{rippleDuration:L,opacityDisabled:I,fontWeight:D,fontWeightStrong:W}=S,H=a.value,{dashed:j,type:V,ghost:E,text:Y,color:K,round:te,circle:xe,textColor:de,secondary:ie,tertiary:F,quaternary:B,strong:q}=e,ee={"font-weight":q?W:D};let be={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const me=V==="tertiary",Be=V==="default",T=me?"default":V;if(Y){const U=de||K;be={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":U||S[N("textColorText",T)],"--n-text-color-hover":U?gt(U):S[N("textColorTextHover",T)],"--n-text-color-pressed":U?Sr(U):S[N("textColorTextPressed",T)],"--n-text-color-focus":U?gt(U):S[N("textColorTextHover",T)],"--n-text-color-disabled":U||S[N("textColorTextDisabled",T)]}}else if(E||j){const U=de||K;be={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":K||S[N("rippleColor",T)],"--n-text-color":U||S[N("textColorGhost",T)],"--n-text-color-hover":U?gt(U):S[N("textColorGhostHover",T)],"--n-text-color-pressed":U?Sr(U):S[N("textColorGhostPressed",T)],"--n-text-color-focus":U?gt(U):S[N("textColorGhostHover",T)],"--n-text-color-disabled":U||S[N("textColorGhostDisabled",T)]}}else if(ie){const U=Be?S.textColor:me?S.textColorTertiary:S[N("color",T)],le=K||U,ye=V!=="default"&&V!=="tertiary";be={"--n-color":ye?J(le,{alpha:Number(S.colorOpacitySecondary)}):S.colorSecondary,"--n-color-hover":ye?J(le,{alpha:Number(S.colorOpacitySecondaryHover)}):S.colorSecondaryHover,"--n-color-pressed":ye?J(le,{alpha:Number(S.colorOpacitySecondaryPressed)}):S.colorSecondaryPressed,"--n-color-focus":ye?J(le,{alpha:Number(S.colorOpacitySecondaryHover)}):S.colorSecondaryHover,"--n-color-disabled":S.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":le,"--n-text-color-hover":le,"--n-text-color-pressed":le,"--n-text-color-focus":le,"--n-text-color-disabled":le}}else if(F||B){const U=Be?S.textColor:me?S.textColorTertiary:S[N("color",T)],le=K||U;F?(be["--n-color"]=S.colorTertiary,be["--n-color-hover"]=S.colorTertiaryHover,be["--n-color-pressed"]=S.colorTertiaryPressed,be["--n-color-focus"]=S.colorSecondaryHover,be["--n-color-disabled"]=S.colorTertiary):(be["--n-color"]=S.colorQuaternary,be["--n-color-hover"]=S.colorQuaternaryHover,be["--n-color-pressed"]=S.colorQuaternaryPressed,be["--n-color-focus"]=S.colorQuaternaryHover,be["--n-color-disabled"]=S.colorQuaternary),be["--n-ripple-color"]="#0000",be["--n-text-color"]=le,be["--n-text-color-hover"]=le,be["--n-text-color-pressed"]=le,be["--n-text-color-focus"]=le,be["--n-text-color-disabled"]=le}else be={"--n-color":K||S[N("color",T)],"--n-color-hover":K?gt(K):S[N("colorHover",T)],"--n-color-pressed":K?Sr(K):S[N("colorPressed",T)],"--n-color-focus":K?gt(K):S[N("colorFocus",T)],"--n-color-disabled":K||S[N("colorDisabled",T)],"--n-ripple-color":K||S[N("rippleColor",T)],"--n-text-color":de||(K?S.textColorPrimary:me?S.textColorTertiary:S[N("textColor",T)]),"--n-text-color-hover":de||(K?S.textColorHoverPrimary:S[N("textColorHover",T)]),"--n-text-color-pressed":de||(K?S.textColorPressedPrimary:S[N("textColorPressed",T)]),"--n-text-color-focus":de||(K?S.textColorFocusPrimary:S[N("textColorFocus",T)]),"--n-text-color-disabled":de||(K?S.textColorDisabledPrimary:S[N("textColorDisabled",T)])};let ve={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};Y?ve={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:ve={"--n-border":S[N("border",T)],"--n-border-hover":S[N("borderHover",T)],"--n-border-pressed":S[N("borderPressed",T)],"--n-border-focus":S[N("borderFocus",T)],"--n-border-disabled":S[N("borderDisabled",T)]};const{[N("height",H)]:Se,[N("fontSize",H)]:Fe,[N("padding",H)]:ne,[N("paddingRound",H)]:Ce,[N("iconSize",H)]:ge,[N("borderRadius",H)]:Ee,[N("iconMargin",H)]:Q,waveOpacity:he}=S,G={"--n-width":xe&&!Y?Se:"initial","--n-height":Y?"initial":Se,"--n-font-size":Fe,"--n-padding":xe||Y?"initial":te?Ce:ne,"--n-icon-size":ge,"--n-icon-margin":Q,"--n-border-radius":Y?"initial":xe||te?Se:Ee};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":z,"--n-bezier-ease-out":R,"--n-ripple-duration":L,"--n-opacity-disabled":I,"--n-wave-opacity":he},ee),be),ve),G)}),_=v?We("button",$(()=>{let k="";const{dashed:z,type:R,ghost:S,text:L,color:I,round:D,circle:W,textColor:H,secondary:j,tertiary:V,quaternary:E,strong:Y}=e;z&&(k+="a"),S&&(k+="b"),L&&(k+="c"),D&&(k+="d"),W&&(k+="e"),j&&(k+="f"),V&&(k+="g"),E&&(k+="h"),Y&&(k+="i"),I&&(k+="j"+Et(I)),H&&(k+="k"+Et(H));const{value:K}=a;return k+="l"+K[0],k+="m"+R[0],k}),b,e):void 0;return{selfElRef:o,waveElRef:t,mergedClsPrefix:h,mergedFocusable:s,mergedSize:a,showBorder:n,enterPressed:r,rtlEnabled:C,handleMousedown:d,handleKeydown:f,handleBlur:p,handleKeyup:u,handleClick:c,customColorCssVars:$(()=>{const{color:k}=e;if(!k)return null;const z=gt(k);return{"--n-border-color":k,"--n-border-color-hover":z,"--n-border-color-pressed":Sr(k),"--n-border-color-focus":z,"--n-border-color-disabled":k}}),cssVars:v?void 0:b,themeClass:_==null?void 0:_.themeClass,onRender:_==null?void 0:_.onRender}},render(){const{mergedClsPrefix:e,tag:o,onRender:t}=this;t==null||t();const r=je(this.$slots.default,n=>n&&i("span",{class:`${e}-button__content`},n));return i(o,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,i(Rt,{width:!0},{default:()=>je(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&i("span",{class:`${e}-button__icon`,style:{margin:xt(this.$slots.default)?"0":""}},i(Kt,null,{default:()=>this.loading?i(Gt,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):i("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&r,this.text?null:i(Bl,{ref:"waveElRef",clsPrefix:e}),this.showBorder?i("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?i("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),Bo=Jl,$i=Jl,Je="0!important",ea="-1px!important";function Dt(e){return P(e+"-type",[y("& +",[g("button",{},[P(e+"-type",[w("border",{borderLeftWidth:Je}),w("state-border",{left:ea})])])])])}function Lt(e){return P(e+"-type",[y("& +",[g("button",[P(e+"-type",[w("border",{borderTopWidth:Je}),w("state-border",{top:ea})])])])])}const bf=g("button-group",`
|
|
|
flex-wrap: nowrap;
|
|
|
display: inline-flex;
|
|
|
position: relative;
|
|
|
`,[Ne("vertical",{flexDirection:"row"},[Ne("rtl",[g("button",[y("&:first-child:not(:last-child)",`
|
|
|
margin-right: ${Je};
|
|
|
border-top-right-radius: ${Je};
|
|
|
border-bottom-right-radius: ${Je};
|
|
|
`),y("&:last-child:not(:first-child)",`
|
|
|
margin-left: ${Je};
|
|
|
border-top-left-radius: ${Je};
|
|
|
border-bottom-left-radius: ${Je};
|
|
|
`),y("&:not(:first-child):not(:last-child)",`
|
|
|
margin-left: ${Je};
|
|
|
margin-right: ${Je};
|
|
|
border-radius: ${Je};
|
|
|
`),Dt("default"),P("ghost",[Dt("primary"),Dt("info"),Dt("success"),Dt("warning"),Dt("error")])])])]),P("vertical",{flexDirection:"column"},[g("button",[y("&:first-child:not(:last-child)",`
|
|
|
margin-bottom: ${Je};
|
|
|
margin-left: ${Je};
|
|
|
margin-right: ${Je};
|
|
|
border-bottom-left-radius: ${Je};
|
|
|
border-bottom-right-radius: ${Je};
|
|
|
`),y("&:last-child:not(:first-child)",`
|
|
|
margin-top: ${Je};
|
|
|
margin-left: ${Je};
|
|
|
margin-right: ${Je};
|
|
|
border-top-left-radius: ${Je};
|
|
|
border-top-right-radius: ${Je};
|
|
|
`),y("&:not(:first-child):not(:last-child)",`
|
|
|
margin: ${Je};
|
|
|
border-radius: ${Je};
|
|
|
`),Lt("default"),P("ghost",[Lt("primary"),Lt("info"),Lt("success"),Lt("warning"),Lt("error")])])])]),xf={size:{type:String,default:void 0},vertical:Boolean},Cf=Z({name:"ButtonGroup",props:xf,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=Ie(e);return Xo("-button-group",bf,o),De(Zl,e),{rtlEnabled:eo("ButtonGroup",t,o),mergedClsPrefix:o}},render(){const{mergedClsPrefix:e}=this;return i("div",{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:"group"},this.$slots)}}),yf={titleFontSize:"22px"},wf=e=>{const{borderRadius:o,fontSize:t,lineHeight:r,textColor2:n,textColor1:l,textColorDisabled:a,dividerColor:s,fontWeightStrong:d,primaryColor:c,baseColor:u,hoverColor:f,cardColor:p,modalColor:v,popoverColor:h}=e;return Object.assign(Object.assign({},yf),{borderRadius:o,borderColor:Re(p,s),borderColorModal:Re(v,s),borderColorPopover:Re(h,s),textColor:n,titleFontWeight:d,titleTextColor:l,dayTextColor:a,fontSize:t,lineHeight:r,dateColorCurrent:c,dateTextColorCurrent:u,cellColorHover:Re(p,f),cellColorHoverModal:Re(v,f),cellColorHoverPopover:Re(h,f),cellColor:p,cellColorModal:v,cellColorPopover:h,barColor:c})},Sf={name:"Calendar",common:fe,peers:{Button:Ro},self:wf},zf=Sf,$f=e=>{const{fontSize:o,boxShadow2:t,popoverColor:r,textColor2:n,borderRadius:l,borderColor:a,heightSmall:s,heightMedium:d,heightLarge:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,dividerColor:v}=e;return{panelFontSize:o,boxShadow:t,color:r,textColor:n,borderRadius:l,border:`1px solid ${a}`,heightSmall:s,heightMedium:d,heightLarge:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,dividerColor:v}},Rf={name:"ColorPicker",common:fe,peers:{Input:Ao,Button:Ro},self:$f},Pf=Rf,kf={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"},oa=e=>{const{primaryColor:o,borderRadius:t,lineHeight:r,fontSize:n,cardColor:l,textColor2:a,textColor1:s,dividerColor:d,fontWeightStrong:c,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,closeColorHover:v,closeColorPressed:h,modalColor:m,boxShadow1:x,popoverColor:C,actionColor:b}=e;return Object.assign(Object.assign({},kf),{lineHeight:r,color:l,colorModal:m,colorPopover:C,colorTarget:o,colorEmbedded:b,colorEmbeddedModal:b,colorEmbeddedPopover:b,textColor:a,titleTextColor:s,borderColor:d,actionColor:b,titleFontWeight:c,closeColorHover:v,closeColorPressed:h,closeBorderRadius:t,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:x,borderRadius:t})},If={name:"Card",common:Ae,self:oa},ta=If,Bf={name:"Card",common:fe,self(e){const o=oa(e),{cardColor:t,modalColor:r,popoverColor:n}=e;return o.colorEmbedded=t,o.colorEmbeddedModal=r,o.colorEmbeddedPopover=n,o}},ra=Bf,Tf=y([g("card",`
|
|
|
font-size: var(--n-font-size);
|
|
|
line-height: var(--n-line-height);
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
background-color: var(--n-color);
|
|
|
color: var(--n-text-color);
|
|
|
word-break: break-word;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`,[dl({background:"var(--n-color-modal)"}),P("hoverable",[y("&:hover","box-shadow: var(--n-box-shadow);")]),P("content-segmented",[y(">",[w("content",{paddingTop:"var(--n-padding-bottom)"})])]),P("content-soft-segmented",[y(">",[w("content",`
|
|
|
margin: 0 var(--n-padding-left);
|
|
|
padding: var(--n-padding-bottom) 0;
|
|
|
`)])]),P("footer-segmented",[y(">",[w("footer",{paddingTop:"var(--n-padding-bottom)"})])]),P("footer-soft-segmented",[y(">",[w("footer",`
|
|
|
padding: var(--n-padding-bottom) 0;
|
|
|
margin: 0 var(--n-padding-left);
|
|
|
`)])]),y(">",[g("card-header",`
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
font-size: var(--n-title-font-size);
|
|
|
padding:
|
|
|
var(--n-padding-top)
|
|
|
var(--n-padding-left)
|
|
|
var(--n-padding-bottom)
|
|
|
var(--n-padding-left);
|
|
|
`,[w("main",`
|
|
|
font-weight: var(--n-title-font-weight);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
flex: 1;
|
|
|
min-width: 0;
|
|
|
color: var(--n-title-text-color);
|
|
|
`),w("extra",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
font-size: var(--n-font-size);
|
|
|
font-weight: 400;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-text-color);
|
|
|
`),w("close",`
|
|
|
margin: 0 0 0 8px;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`)]),w("action",`
|
|
|
box-sizing: border-box;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
background-clip: padding-box;
|
|
|
background-color: var(--n-action-color);
|
|
|
`),w("content","flex: 1; min-width: 0;"),w("content, footer",`
|
|
|
box-sizing: border-box;
|
|
|
padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left);
|
|
|
font-size: var(--n-font-size);
|
|
|
`,[y("&:first-child",{paddingTop:"var(--n-padding-bottom)"})]),w("action",`
|
|
|
background-color: var(--n-action-color);
|
|
|
padding: var(--n-padding-bottom) var(--n-padding-left);
|
|
|
border-bottom-left-radius: var(--n-border-radius);
|
|
|
border-bottom-right-radius: var(--n-border-radius);
|
|
|
`)]),g("card-cover",`
|
|
|
overflow: hidden;
|
|
|
width: 100%;
|
|
|
border-radius: var(--n-border-radius) var(--n-border-radius) 0 0;
|
|
|
`,[y("img",`
|
|
|
display: block;
|
|
|
width: 100%;
|
|
|
`)]),P("bordered",`
|
|
|
border: 1px solid var(--n-border-color);
|
|
|
`,[y("&:target","border-color: var(--n-color-target);")]),P("action-segmented",[y(">",[w("action",[y("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),P("content-segmented, content-soft-segmented",[y(">",[w("content",{transition:"border-color 0.3s var(--n-bezier)"},[y("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),P("footer-segmented, footer-soft-segmented",[y(">",[w("footer",{transition:"border-color 0.3s var(--n-bezier)"},[y("&:not(:first-child)",{borderTop:"1px solid var(--n-border-color)"})])])]),P("embedded",`
|
|
|
background-color: var(--n-color-embedded);
|
|
|
`)]),Lr(g("card",`
|
|
|
background: var(--n-color-modal);
|
|
|
`,[P("embedded",`
|
|
|
background-color: var(--n-color-embedded-modal);
|
|
|
`)])),Pn(g("card",`
|
|
|
background: var(--n-color-popover);
|
|
|
`,[P("embedded",`
|
|
|
background-color: var(--n-color-embedded-popover);
|
|
|
`)]))]),_n={title:String,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"}},Of=wo(_n),Ff=Object.assign(Object.assign({},se.props),_n),_f=Z({name:"Card",props:Ff,setup(e){const o=()=>{const{onClose:c}=e;c&&ce(c)},{inlineThemeDisabled:t,mergedClsPrefixRef:r,mergedRtlRef:n}=Ie(e),l=se("Card","-card",Tf,ta,e,r),a=eo("Card",n,r),s=$(()=>{const{size:c}=e,{self:{color:u,colorModal:f,colorTarget:p,textColor:v,titleTextColor:h,titleFontWeight:m,borderColor:x,actionColor:C,borderRadius:b,lineHeight:_,closeIconColor:k,closeIconColorHover:z,closeIconColorPressed:R,closeColorHover:S,closeColorPressed:L,closeBorderRadius:I,closeIconSize:D,closeSize:W,boxShadow:H,colorPopover:j,colorEmbedded:V,colorEmbeddedModal:E,colorEmbeddedPopover:Y,[N("padding",c)]:K,[N("fontSize",c)]:te,[N("titleFontSize",c)]:xe},common:{cubicBezierEaseInOut:de}}=l.value,{top:ie,left:F,bottom:B}=yo(K);return{"--n-bezier":de,"--n-border-radius":b,"--n-color":u,"--n-color-modal":f,"--n-color-popover":j,"--n-color-embedded":V,"--n-color-embedded-modal":E,"--n-color-embedded-popover":Y,"--n-color-target":p,"--n-text-color":v,"--n-line-height":_,"--n-action-color":C,"--n-title-text-color":h,"--n-title-font-weight":m,"--n-close-icon-color":k,"--n-close-icon-color-hover":z,"--n-close-icon-color-pressed":R,"--n-close-color-hover":S,"--n-close-color-pressed":L,"--n-border-color":x,"--n-box-shadow":H,"--n-padding-top":ie,"--n-padding-bottom":B,"--n-padding-left":F,"--n-font-size":te,"--n-title-font-size":xe,"--n-close-size":W,"--n-close-icon-size":D,"--n-close-border-radius":I}}),d=t?We("card",$(()=>e.size[0]),s,e):void 0;return{rtlEnabled:a,mergedClsPrefix:r,mergedTheme:l,handleCloseClick:o,cssVars:t?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{segmented:e,bordered:o,hoverable:t,mergedClsPrefix:r,rtlEnabled:n,onRender:l,embedded:a,tag:s,$slots:d}=this;return l==null||l(),i(s,{class:[`${r}-card`,this.themeClass,a&&`${r}-card--embedded`,{[`${r}-card--rtl`]:n,[`${r}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:o,[`${r}-card--hoverable`]:t}],style:this.cssVars,role:this.role},je(d.cover,c=>c&&i("div",{class:`${r}-card-cover`,role:"none"},c)),je(d.header,c=>c||this.title||this.closable?i("div",{class:[`${r}-card-header`,this.headerClass],style:this.headerStyle},i("div",{class:`${r}-card-header__main`,role:"heading"},c||this.title),je(d["header-extra"],u=>u&&i("div",{class:[`${r}-card-header__extra`,this.headerExtraClass],style:this.headerExtraStyle},u)),this.closable?i(Pt,{clsPrefix:r,class:`${r}-card-header__close`,onClick:this.handleCloseClick,absolute:!0}):null):null),je(d.default,c=>c&&i("div",{class:[`${r}-card__content`,this.contentClass],style:this.contentStyle,role:"none"},c)),je(d.footer,c=>c&&[i("div",{class:[`${r}-card__footer`,this.footerClass],style:this.footerStyle,role:"none"},c)]),je(d.action,c=>c&&i("div",{class:`${r}-card__action`,role:"none"},c)))}}),Mf=e=>({dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}),Df={name:"Carousel",common:fe,self:Mf},Lf=Df,Hf={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},Af=e=>{const{baseColor:o,inputColorDisabled:t,cardColor:r,modalColor:n,popoverColor:l,textColorDisabled:a,borderColor:s,primaryColor:d,textColor2:c,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,borderRadiusSmall:v,lineHeight:h}=e;return Object.assign(Object.assign({},Hf),{labelLineHeight:h,fontSizeSmall:u,fontSizeMedium:f,fontSizeLarge:p,borderRadius:v,color:o,colorChecked:d,colorDisabled:t,colorDisabledChecked:t,colorTableHeader:r,colorTableHeaderModal:n,colorTableHeaderPopover:l,checkMarkColor:o,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${s}`,borderDisabled:`1px solid ${s}`,borderDisabledChecked:`1px solid ${s}`,borderChecked:`1px solid ${d}`,borderFocus:`1px solid ${d}`,boxShadowFocus:`0 0 0 2px ${J(d,{alpha:.3})}`,textColor:c,textColorDisabled:a})},Ef={name:"Checkbox",common:fe,self(e){const{cardColor:o}=e,t=Af(e);return t.color="#0000",t.checkMarkColor=o,t}},Xt=Ef,jf=e=>{const{borderRadius:o,boxShadow2:t,popoverColor:r,textColor2:n,textColor3:l,primaryColor:a,textColorDisabled:s,dividerColor:d,hoverColor:c,fontSizeMedium:u,heightMedium:f}=e;return{menuBorderRadius:o,menuColor:r,menuBoxShadow:t,menuDividerColor:d,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:l,optionHeight:f,optionFontSize:u,optionColorHover:c,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:s,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}},Wf={name:"Cascader",common:fe,peers:{InternalSelectMenu:mr,InternalSelection:Fn,Scrollbar:$o,Checkbox:Xt,Empty:Tn},self:jf},Nf=Wf,Vf={name:"Code",common:fe,self(e){const{textColor2:o,fontSize:t,fontWeightStrong:r,textColor3:n}=e;return{textColor:o,fontSize:t,fontWeightStrong:r,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}},na=Vf,Uf=e=>{const{fontWeight:o,textColor1:t,textColor2:r,textColorDisabled:n,dividerColor:l,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:o,dividerColor:l,titleTextColor:t,titleTextColorDisabled:n,fontSize:a,textColor:r,arrowColor:r,arrowColorDisabled:n,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}},Kf={name:"Collapse",common:fe,self:Uf},Gf=Kf,qf=e=>{const{cubicBezierEaseInOut:o}=e;return{bezier:o}},Yf={name:"CollapseTransition",common:fe,self:qf},Xf=Yf,Zf={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:{type:String,default:ar},locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(qo("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},O1=Z({name:"ConfigProvider",alias:["App"],props:Zf,setup(e){const o=ze(jo,null),t=$(()=>{const{theme:h}=e;if(h===null)return;const m=o==null?void 0:o.mergedThemeRef.value;return h===void 0?m:m===void 0?h:Object.assign({},m,h)}),r=$(()=>{const{themeOverrides:h}=e;if(h!==null){if(h===void 0)return o==null?void 0:o.mergedThemeOverridesRef.value;{const m=o==null?void 0:o.mergedThemeOverridesRef.value;return m===void 0?h:Ht({},m,h)}}}),n=Ve(()=>{const{namespace:h}=e;return h===void 0?o==null?void 0:o.mergedNamespaceRef.value:h}),l=Ve(()=>{const{bordered:h}=e;return h===void 0?o==null?void 0:o.mergedBorderedRef.value:h}),a=$(()=>{const{icons:h}=e;return h===void 0?o==null?void 0:o.mergedIconsRef.value:h}),s=$(()=>{const{componentOptions:h}=e;return h!==void 0?h:o==null?void 0:o.mergedComponentPropsRef.value}),d=$(()=>{const{clsPrefix:h}=e;return h!==void 0?h:o?o.mergedClsPrefixRef.value:ar}),c=$(()=>{var h;const{rtl:m}=e;if(m===void 0)return o==null?void 0:o.mergedRtlRef.value;const x={};for(const C of m)x[C.name]=Jn(C),(h=C.peers)===null||h===void 0||h.forEach(b=>{b.name in x||(x[b.name]=Jn(b))});return x}),u=$(()=>e.breakpoints||(o==null?void 0:o.mergedBreakpointsRef.value)),f=e.inlineThemeDisabled||(o==null?void 0:o.inlineThemeDisabled),p=e.preflightStyleDisabled||(o==null?void 0:o.preflightStyleDisabled),v=$(()=>{const{value:h}=t,{value:m}=r,x=m&&Object.keys(m).length!==0,C=h==null?void 0:h.name;return C?x?`${C}-${kr(JSON.stringify(r.value))}`:C:x?kr(JSON.stringify(r.value)):""});return De(jo,{mergedThemeHashRef:v,mergedBreakpointsRef:u,mergedRtlRef:c,mergedIconsRef:a,mergedComponentPropsRef:s,mergedBorderedRef:l,mergedNamespaceRef:n,mergedClsPrefixRef:d,mergedLocaleRef:$(()=>{const{locale:h}=e;if(h!==null)return h===void 0?o==null?void 0:o.mergedLocaleRef.value:h}),mergedDateLocaleRef:$(()=>{const{dateLocale:h}=e;if(h!==null)return h===void 0?o==null?void 0:o.mergedDateLocaleRef.value:h}),mergedHljsRef:$(()=>{const{hljs:h}=e;return h===void 0?o==null?void 0:o.mergedHljsRef.value:h}),mergedKatexRef:$(()=>{const{katex:h}=e;return h===void 0?o==null?void 0:o.mergedKatexRef.value:h}),mergedThemeRef:t,mergedThemeOverridesRef:r,inlineThemeDisabled:f||!1,preflightStyleDisabled:p||!1}),{mergedClsPrefix:d,mergedBordered:l,mergedNamespace:n,mergedTheme:t,mergedThemeOverrides:r}},render(){var e,o,t,r;return this.abstract?(r=(t=this.$slots).default)===null||r===void 0?void 0:r.call(t):i(this.as||this.tag,{class:`${this.mergedClsPrefix||ar}-config-provider`},(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e))}}),Qf=e=>1-Math.pow(1-e,5);function Jf(e){const{from:o,to:t,duration:r,onUpdate:n,onFinish:l}=e,a=()=>{const d=performance.now(),c=Math.min(d-s,r),u=o+(t-o)*Qf(c/r);if(c===r){l();return}n(u),requestAnimationFrame(a)},s=performance.now();a()}const eh={to:{type:Number,default:0},precision:{type:Number,default:0},showSeparator:Boolean,locale:String,from:{type:Number,default:0},active:{type:Boolean,default:!0},duration:{type:Number,default:2e3},onFinish:Function},F1=Z({name:"NumberAnimation",props:eh,setup(e){const{localeRef:o}=Yo("name"),{duration:t}=e,r=M(e.from),n=$(()=>{const{locale:p}=e;return p!==void 0?p:o.value});let l=!1;const a=p=>{r.value=p},s=()=>{var p;r.value=e.to,l=!1,(p=e.onFinish)===null||p===void 0||p.call(e)},d=(p=e.from,v=e.to)=>{l=!0,r.value=e.from,p!==v&&Jf({from:p,to:v,duration:t,onUpdate:a,onFinish:s})},c=$(()=>{var p;const h=Cd(r.value,e.precision).toFixed(e.precision).split("."),m=new Intl.NumberFormat(n.value),x=(p=m.formatToParts(.5).find(_=>_.type==="decimal"))===null||p===void 0?void 0:p.value,C=e.showSeparator?m.format(Number(h[0])):h[0],b=h[1];return{integer:C,decimal:b,decimalSeparator:x}});function u(){l||d()}return po(()=>{oo(()=>{e.active&&d()})}),Object.assign({formattedValue:c},{play:u})},render(){const{formattedValue:{integer:e,decimal:o,decimalSeparator:t}}=this;return[e,o?t:null,o]}}),oh={name:"Popselect",common:fe,peers:{Popover:It,InternalSelectMenu:mr}},ia=oh;function th(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}const rh={name:"Popselect",common:Ae,peers:{Popover:qt,InternalSelectMenu:Ar},self:th},Mn=rh,la="n-popselect",nh=g("popselect-menu",`
|
|
|
box-shadow: var(--n-menu-box-shadow);
|
|
|
`),Dn={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},Ri=wo(Dn),ih=Z({name:"PopselectPanel",props:Dn,setup(e){const o=ze(la),{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ie(e),n=se("Popselect","-pop-select",nh,Mn,o.props,t),l=$(()=>bt(e.options,Nl("value","children")));function a(p,v){const{onUpdateValue:h,"onUpdate:value":m,onChange:x}=e;h&&ce(h,p,v),m&&ce(m,p,v),x&&ce(x,p,v)}function s(p){c(p.key)}function d(p){!at(p,"action")&&!at(p,"empty")&&p.preventDefault()}function c(p){const{value:{getNode:v}}=l;if(e.multiple)if(Array.isArray(e.value)){const h=[],m=[];let x=!0;e.value.forEach(C=>{if(C===p){x=!1;return}const b=v(C);b&&(h.push(b.key),m.push(b.rawNode))}),x&&(h.push(p),m.push(v(p).rawNode)),a(h,m)}else{const h=v(p);h&&a([p],[h.rawNode])}else if(e.value===p&&e.cancelable)a(null,null);else{const h=v(p);h&&a(p,h.rawNode);const{"onUpdate:show":m,onUpdateShow:x}=o.props;m&&ce(m,!1),x&&ce(x,!1),o.setShow(!1)}lo(()=>{o.syncPosition()})}Xe(ae(e,"options"),()=>{lo(()=>{o.syncPosition()})});const u=$(()=>{const{self:{menuBoxShadow:p}}=n.value;return{"--n-menu-box-shadow":p}}),f=r?We("select",void 0,u,o.props):void 0;return{mergedTheme:o.mergedThemeRef,mergedClsPrefix:t,treeMate:l,handleToggle:s,handleMenuMousedown:d,cssVars:r?void 0:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),i(On,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{header:()=>{var o,t;return((t=(o=this.$slots).header)===null||t===void 0?void 0:t.call(o))||[]},action:()=>{var o,t;return((t=(o=this.$slots).action)===null||t===void 0?void 0:t.call(o))||[]},empty:()=>{var o,t;return((t=(o=this.$slots).empty)===null||t===void 0?void 0:t.call(o))||[]}})}}),lh=Object.assign(Object.assign(Object.assign(Object.assign({},se.props),Wt(wt,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},wt.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),Dn),ah=Z({name:"Popselect",props:lh,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=Ie(e),t=se("Popselect","-popselect",void 0,Mn,e,o),r=M(null);function n(){var s;(s=r.value)===null||s===void 0||s.syncPosition()}function l(s){var d;(d=r.value)===null||d===void 0||d.setShow(s)}return De(la,{props:e,mergedThemeRef:t,syncPosition:n,setShow:l}),Object.assign(Object.assign({},{syncPosition:n,setShow:l}),{popoverInstRef:r,mergedTheme:t})},render(){const{mergedTheme:e}=this,o={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(t,r,n,l,a)=>{const{$attrs:s}=this;return i(ih,Object.assign({},s,{class:[s.class,t],style:[s.style,...n]},mo(this.$props,Ri),{ref:ll(r),onMouseenter:tr([l,s.onMouseenter]),onMouseleave:tr([a,s.onMouseleave])}),{header:()=>{var d,c;return(c=(d=this.$slots).header)===null||c===void 0?void 0:c.call(d)},action:()=>{var d,c;return(c=(d=this.$slots).action)===null||c===void 0?void 0:c.call(d)},empty:()=>{var d,c;return(c=(d=this.$slots).empty)===null||c===void 0?void 0:c.call(d)}})}};return i(br,Object.assign({},Wt(this.$props,Ri),o,{internalDeactivateImmediately:!0}),{trigger:()=>{var t,r;return(r=(t=this.$slots).default)===null||r===void 0?void 0:r.call(t)}})}});function aa(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}const sh={name:"Select",common:Ae,peers:{InternalSelection:Al,InternalSelectMenu:Ar},self:aa},sa=sh,dh={name:"Select",common:fe,peers:{InternalSelection:Fn,InternalSelectMenu:mr},self:aa},da=dh,ch=y([g("select",`
|
|
|
z-index: auto;
|
|
|
outline: none;
|
|
|
width: 100%;
|
|
|
position: relative;
|
|
|
`),g("select-menu",`
|
|
|
margin: 4px 0;
|
|
|
box-shadow: var(--n-menu-box-shadow);
|
|
|
`,[ct({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),uh=Object.assign(Object.assign({},se.props),{to:Oo.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,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,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},onChange:[Function,Array],items:Array}),fh=Z({name:"Select",props:uh,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:t,namespaceRef:r,inlineThemeDisabled:n}=Ie(e),l=se("Select","-select",ch,sa,e,o),a=M(e.defaultValue),s=ae(e,"value"),d=co(s,a),c=M(!1),u=M(""),f=$(()=>{const{valueField:O,childrenField:X}=e,ue=Nl(O,X);return bt(H.value,ue)}),p=$(()=>Pu(D.value,e.valueField,e.childrenField)),v=M(!1),h=co(ae(e,"show"),v),m=M(null),x=M(null),C=M(null),{localeRef:b}=Yo("Select"),_=$(()=>{var O;return(O=e.placeholder)!==null&&O!==void 0?O:b.value.placeholder}),k=Ct(e,["items","options"]),z=[],R=M([]),S=M([]),L=M(new Map),I=$(()=>{const{fallbackOption:O}=e;if(O===void 0){const{labelField:X,valueField:ue}=e;return $e=>({[X]:String($e),[ue]:$e})}return O===!1?!1:X=>Object.assign(O(X),{value:X})}),D=$(()=>S.value.concat(R.value).concat(k.value)),W=$(()=>{const{filter:O}=e;if(O)return O;const{labelField:X,valueField:ue}=e;return($e,Pe)=>{if(!Pe)return!1;const ke=Pe[X];if(typeof ke=="string")return on($e,ke);const Me=Pe[ue];return typeof Me=="string"?on($e,Me):typeof Me=="number"?on($e,String(Me)):!1}}),H=$(()=>{if(e.remote)return k.value;{const{value:O}=D,{value:X}=u;return!X.length||!e.filterable?O:Ru(O,W.value,X,e.childrenField)}});function j(O){const X=e.remote,{value:ue}=L,{value:$e}=p,{value:Pe}=I,ke=[];return O.forEach(Me=>{if($e.has(Me))ke.push($e.get(Me));else if(X&&ue.has(Me))ke.push(ue.get(Me));else if(Pe){const Le=Pe(Me);Le&&ke.push(Le)}}),ke}const V=$(()=>{if(e.multiple){const{value:O}=d;return Array.isArray(O)?j(O):[]}return null}),E=$(()=>{const{value:O}=d;return!e.multiple&&!Array.isArray(O)?O===null?null:j([O])[0]||null:null}),Y=rt(e),{mergedSizeRef:K,mergedDisabledRef:te,mergedStatusRef:xe}=Y;function de(O,X){const{onChange:ue,"onUpdate:value":$e,onUpdateValue:Pe}=e,{nTriggerFormChange:ke,nTriggerFormInput:Me}=Y;ue&&ce(ue,O,X),Pe&&ce(Pe,O,X),$e&&ce($e,O,X),a.value=O,ke(),Me()}function ie(O){const{onBlur:X}=e,{nTriggerFormBlur:ue}=Y;X&&ce(X,O),ue()}function F(){const{onClear:O}=e;O&&ce(O)}function B(O){const{onFocus:X,showOnFocus:ue}=e,{nTriggerFormFocus:$e}=Y;X&&ce(X,O),$e(),ue&&Be()}function q(O){const{onSearch:X}=e;X&&ce(X,O)}function ee(O){const{onScroll:X}=e;X&&ce(X,O)}function be(){var O;const{remote:X,multiple:ue}=e;if(X){const{value:$e}=L;if(ue){const{valueField:Pe}=e;(O=V.value)===null||O===void 0||O.forEach(ke=>{$e.set(ke[Pe],ke)})}else{const Pe=E.value;Pe&&$e.set(Pe[e.valueField],Pe)}}}function me(O){const{onUpdateShow:X,"onUpdate:show":ue}=e;X&&ce(X,O),ue&&ce(ue,O),v.value=O}function Be(){te.value||(me(!0),v.value=!0,e.filterable&&Co())}function T(){me(!1)}function ve(){u.value="",S.value=z}const Se=M(!1);function Fe(){e.filterable&&(Se.value=!0)}function ne(){e.filterable&&(Se.value=!1,h.value||ve())}function Ce(){te.value||(h.value?e.filterable?Co():T():Be())}function ge(O){var X,ue;!((ue=(X=C.value)===null||X===void 0?void 0:X.selfRef)===null||ue===void 0)&&ue.contains(O.relatedTarget)||(c.value=!1,ie(O),T())}function Ee(O){B(O),c.value=!0}function Q(O){c.value=!0}function he(O){var X;!((X=m.value)===null||X===void 0)&&X.$el.contains(O.relatedTarget)||(c.value=!1,ie(O),T())}function G(){var O;(O=m.value)===null||O===void 0||O.focus(),T()}function U(O){var X;h.value&&(!((X=m.value)===null||X===void 0)&&X.$el.contains(rr(O))||T())}function le(O){if(!Array.isArray(O))return[];if(I.value)return Array.from(O);{const{remote:X}=e,{value:ue}=p;if(X){const{value:$e}=L;return O.filter(Pe=>ue.has(Pe)||$e.has(Pe))}else return O.filter($e=>ue.has($e))}}function ye(O){_e(O.rawNode)}function _e(O){if(te.value)return;const{tag:X,remote:ue,clearFilterAfterSelect:$e,valueField:Pe}=e;if(X&&!ue){const{value:ke}=S,Me=ke[0]||null;if(Me){const Le=R.value;Le.length?Le.push(Me):R.value=[Me],S.value=z}}if(ue&&L.value.set(O[Pe],O),e.multiple){const ke=le(d.value),Me=ke.findIndex(Le=>Le===O[Pe]);if(~Me){if(ke.splice(Me,1),X&&!ue){const Le=oe(O[Pe]);~Le&&(R.value.splice(Le,1),$e&&(u.value=""))}}else ke.push(O[Pe]),$e&&(u.value="");de(ke,j(ke))}else{if(X&&!ue){const ke=oe(O[Pe]);~ke?R.value=[R.value[ke]]:R.value=z}xo(),T(),de(O[Pe],O)}}function oe(O){return R.value.findIndex(ue=>ue[e.valueField]===O)}function pe(O){h.value||Be();const{value:X}=O.target;u.value=X;const{tag:ue,remote:$e}=e;if(q(X),ue&&!$e){if(!X){S.value=z;return}const{onCreate:Pe}=e,ke=Pe?Pe(X):{[e.labelField]:X,[e.valueField]:X},{valueField:Me,labelField:Le}=e;k.value.some(qe=>qe[Me]===ke[Me]||qe[Le]===ke[Le])||R.value.some(qe=>qe[Me]===ke[Me]||qe[Le]===ke[Le])?S.value=z:S.value=[ke]}}function Ue(O){O.stopPropagation();const{multiple:X}=e;!X&&e.filterable&&T(),F(),X?de([],[]):de(null,null)}function fo(O){!at(O,"action")&&!at(O,"empty")&&O.preventDefault()}function Po(O){ee(O)}function Fo(O){var X,ue,$e,Pe,ke;if(!e.keyboard){O.preventDefault();return}switch(O.key){case" ":if(e.filterable)break;O.preventDefault();case"Enter":if(!(!((X=m.value)===null||X===void 0)&&X.isComposing)){if(h.value){const Me=(ue=C.value)===null||ue===void 0?void 0:ue.getPendingTmNode();Me?ye(Me):e.filterable||(T(),xo())}else if(Be(),e.tag&&Se.value){const Me=S.value[0];if(Me){const Le=Me[e.valueField],{value:qe}=d;e.multiple&&Array.isArray(qe)&&qe.some(go=>go===Le)||_e(Me)}}}O.preventDefault();break;case"ArrowUp":if(O.preventDefault(),e.loading)return;h.value&&(($e=C.value)===null||$e===void 0||$e.prev());break;case"ArrowDown":if(O.preventDefault(),e.loading)return;h.value?(Pe=C.value)===null||Pe===void 0||Pe.next():Be();break;case"Escape":h.value&&(Md(O),T()),(ke=m.value)===null||ke===void 0||ke.focus();break}}function xo(){var O;(O=m.value)===null||O===void 0||O.focus()}function Co(){var O;(O=m.value)===null||O===void 0||O.focusInput()}function Eo(){var O;h.value&&((O=x.value)===null||O===void 0||O.syncPosition())}be(),Xe(ae(e,"options"),be);const _o={focus:()=>{var O;(O=m.value)===null||O===void 0||O.focus()},focusInput:()=>{var O;(O=m.value)===null||O===void 0||O.focusInput()},blur:()=>{var O;(O=m.value)===null||O===void 0||O.blur()},blurInput:()=>{var O;(O=m.value)===null||O===void 0||O.blurInput()}},uo=$(()=>{const{self:{menuBoxShadow:O}}=l.value;return{"--n-menu-box-shadow":O}}),vo=n?We("select",void 0,uo,e):void 0;return Object.assign(Object.assign({},_o),{mergedStatus:xe,mergedClsPrefix:o,mergedBordered:t,namespace:r,treeMate:f,isMounted:zt(),triggerRef:m,menuRef:C,pattern:u,uncontrolledShow:v,mergedShow:h,adjustedTo:Oo(e),uncontrolledValue:a,mergedValue:d,followerRef:x,localizedPlaceholder:_,selectedOption:E,selectedOptions:V,mergedSize:K,mergedDisabled:te,focused:c,activeWithoutMenuOpen:Se,inlineThemeDisabled:n,onTriggerInputFocus:Fe,onTriggerInputBlur:ne,handleTriggerOrMenuResize:Eo,handleMenuFocus:Q,handleMenuBlur:he,handleMenuTabOut:G,handleTriggerClick:Ce,handleToggle:ye,handleDeleteOption:_e,handlePatternInput:pe,handleClear:Ue,handleTriggerBlur:ge,handleTriggerFocus:Ee,handleKeydown:Fo,handleMenuAfterLeave:ve,handleMenuClickOutside:U,handleMenuScroll:Po,handleMenuKeydown:Fo,handleMenuMousedown:fo,mergedTheme:l,cssVars:n?void 0:uo,themeClass:vo==null?void 0:vo.themeClass,onRender:vo==null?void 0:vo.onRender})},render(){return i("div",{class:`${this.mergedClsPrefix}-select`},i(_r,null,{default:()=>[i(Fr,null,{default:()=>i(du,{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,o;return[(o=(e=this.$slots).arrow)===null||o===void 0?void 0:o.call(e)]}})}),i(Or,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Oo.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i(io,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,o,t;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),Ho(i(On,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(o=this.menuProps)===null||o===void 0?void 0:o.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:"medium",renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(t=this.menuProps)===null||t===void 0?void 0:t.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}),{empty:()=>{var r,n;return[(n=(r=this.$slots).empty)===null||n===void 0?void 0:n.call(r)]},header:()=>{var r,n;return[(n=(r=this.$slots).header)===null||n===void 0?void 0:n.call(r)]},action:()=>{var r,n;return[(n=(r=this.$slots).action)===null||n===void 0?void 0:n.call(r)]}}),this.displayDirective==="show"?[[Go,this.mergedShow],[At,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[At,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),hh={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"},ca=e=>{const{textColor2:o,primaryColor:t,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:l,textColorDisabled:a,borderColor:s,borderRadius:d,fontSizeTiny:c,fontSizeSmall:u,fontSizeMedium:f,heightTiny:p,heightSmall:v,heightMedium:h}=e;return Object.assign(Object.assign({},hh),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${s}`,buttonBorderHover:`1px solid ${s}`,buttonBorderPressed:`1px solid ${s}`,buttonIconColor:o,buttonIconColorHover:o,buttonIconColorPressed:o,itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:t,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:l,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${t}`,itemBorderDisabled:`1px solid ${s}`,itemBorderRadius:d,itemSizeSmall:p,itemSizeMedium:v,itemSizeLarge:h,itemFontSizeSmall:c,itemFontSizeMedium:u,itemFontSizeLarge:f,jumperFontSizeSmall:c,jumperFontSizeMedium:u,jumperFontSizeLarge:f,jumperTextColor:o,jumperTextColorDisabled:a})},ph={name:"Pagination",common:Ae,peers:{Select:sa,Input:xr,Popselect:Mn},self:ca},vh=ph,gh={name:"Pagination",common:fe,peers:{Select:da,Input:Ao,Popselect:ia},self(e){const{primaryColor:o,opacity3:t}=e,r=J(o,{alpha:Number(t)}),n=ca(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},ua=gh,mh=e=>{var o;if(!e)return 10;const{defaultPageSize:t}=e;if(t!==void 0)return t;const r=(o=e.pageSizes)===null||o===void 0?void 0:o[0];return typeof r=="number"?r:(r==null?void 0:r.value)||10};function bh(e,o,t,r){let n=!1,l=!1,a=1,s=o;if(o===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:s,fastBackwardTo:a,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(o===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:s,fastBackwardTo:a,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const d=1,c=o;let u=e,f=e;const p=(t-5)/2;f+=Math.ceil(p),f=Math.min(Math.max(f,d+t-3),c-2),u-=Math.floor(p),u=Math.max(Math.min(u,c-t+3),d+2);let v=!1,h=!1;u>d+2&&(v=!0),f<c-2&&(h=!0);const m=[];m.push({type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}),v?(n=!0,a=u-1,m.push({type:"fast-backward",active:!1,label:void 0,options:r?Pi(d+1,u-1):null})):c>=d+1&&m.push({type:"page",label:d+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===d+1});for(let x=u;x<=f;++x)m.push({type:"page",label:x,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===x});return h?(l=!0,s=f+1,m.push({type:"fast-forward",active:!1,label:void 0,options:r?Pi(f+1,c-1):null})):f===c-2&&m[m.length-1].label!==c-1&&m.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:c-1,active:e===c-1}),m[m.length-1].label!==c&&m.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:c,active:e===c}),{hasFastBackward:n,hasFastForward:l,fastBackwardTo:a,fastForwardTo:s,items:m}}function Pi(e,o){const t=[];for(let r=e;r<=o;++r)t.push({label:`${r}`,value:r});return t}const ki=`
|
|
|
background: var(--n-item-color-hover);
|
|
|
color: var(--n-item-text-color-hover);
|
|
|
border: var(--n-item-border-hover);
|
|
|
`,Ii=[P("button",`
|
|
|
background: var(--n-button-color-hover);
|
|
|
border: var(--n-button-border-hover);
|
|
|
color: var(--n-button-icon-color-hover);
|
|
|
`)],xh=g("pagination",`
|
|
|
display: flex;
|
|
|
vertical-align: middle;
|
|
|
font-size: var(--n-item-font-size);
|
|
|
flex-wrap: nowrap;
|
|
|
`,[g("pagination-prefix",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin: var(--n-prefix-margin);
|
|
|
`),g("pagination-suffix",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin: var(--n-suffix-margin);
|
|
|
`),y("> *:not(:first-child)",`
|
|
|
margin: var(--n-item-margin);
|
|
|
`),g("select",`
|
|
|
width: var(--n-select-width);
|
|
|
`),y("&.transition-disabled",[g("pagination-item","transition: none!important;")]),g("pagination-quick-jumper",`
|
|
|
white-space: nowrap;
|
|
|
display: flex;
|
|
|
color: var(--n-jumper-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
align-items: center;
|
|
|
font-size: var(--n-jumper-font-size);
|
|
|
`,[g("input",`
|
|
|
margin: var(--n-input-margin);
|
|
|
width: var(--n-input-width);
|
|
|
`)]),g("pagination-item",`
|
|
|
position: relative;
|
|
|
cursor: pointer;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
box-sizing: border-box;
|
|
|
min-width: var(--n-item-size);
|
|
|
height: var(--n-item-size);
|
|
|
padding: var(--n-item-padding);
|
|
|
background-color: var(--n-item-color);
|
|
|
color: var(--n-item-text-color);
|
|
|
border-radius: var(--n-item-border-radius);
|
|
|
border: var(--n-item-border);
|
|
|
fill: var(--n-button-icon-color);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
fill .3s var(--n-bezier);
|
|
|
`,[P("button",`
|
|
|
background: var(--n-button-color);
|
|
|
color: var(--n-button-icon-color);
|
|
|
border: var(--n-button-border);
|
|
|
padding: 0;
|
|
|
`,[g("base-icon",`
|
|
|
font-size: var(--n-button-icon-size);
|
|
|
`)]),Ne("disabled",[P("hover",ki,Ii),y("&:hover",ki,Ii),y("&:active",`
|
|
|
background: var(--n-item-color-pressed);
|
|
|
color: var(--n-item-text-color-pressed);
|
|
|
border: var(--n-item-border-pressed);
|
|
|
`,[P("button",`
|
|
|
background: var(--n-button-color-pressed);
|
|
|
border: var(--n-button-border-pressed);
|
|
|
color: var(--n-button-icon-color-pressed);
|
|
|
`)]),P("active",`
|
|
|
background: var(--n-item-color-active);
|
|
|
color: var(--n-item-text-color-active);
|
|
|
border: var(--n-item-border-active);
|
|
|
`,[y("&:hover",`
|
|
|
background: var(--n-item-color-active-hover);
|
|
|
`)])]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
color: var(--n-item-text-color-disabled);
|
|
|
`,[P("active, button",`
|
|
|
background-color: var(--n-item-color-disabled);
|
|
|
border: var(--n-item-border-disabled);
|
|
|
`)])]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
`,[g("pagination-quick-jumper",`
|
|
|
color: var(--n-jumper-text-color-disabled);
|
|
|
`)]),P("simple",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: nowrap;
|
|
|
`,[g("pagination-quick-jumper",[g("input",`
|
|
|
margin: 0;
|
|
|
`)])])]),Ch=Object.assign(Object.assign({},se.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:Oo.propTo,showQuickJumpDropdown:{type:Boolean,default:!0},"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),_1=Z({name:"Pagination",props:Ch,setup(e){const{mergedComponentPropsRef:o,mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),l=se("Pagination","-pagination",xh,vh,e,t),{localeRef:a}=Yo("Pagination"),s=M(null),d=M(e.defaultPage),c=M(mh(e)),u=co(ae(e,"page"),d),f=co(ae(e,"pageSize"),c),p=$(()=>{const{itemCount:T}=e;if(T!==void 0)return Math.max(1,Math.ceil(T/f.value));const{pageCount:ve}=e;return ve!==void 0?Math.max(ve,1):1}),v=M("");oo(()=>{e.simple,v.value=String(u.value)});const h=M(!1),m=M(!1),x=M(!1),C=M(!1),b=()=>{e.disabled||(h.value=!0,E())},_=()=>{e.disabled||(h.value=!1,E())},k=()=>{m.value=!0,E()},z=()=>{m.value=!1,E()},R=T=>{Y(T)},S=$(()=>bh(u.value,p.value,e.pageSlot,e.showQuickJumpDropdown));oo(()=>{S.value.hasFastBackward?S.value.hasFastForward||(h.value=!1,x.value=!1):(m.value=!1,C.value=!1)});const L=$(()=>{const T=a.value.selectionSuffix;return e.pageSizes.map(ve=>typeof ve=="number"?{label:`${ve} / ${T}`,value:ve}:ve)}),I=$(()=>{var T,ve;return((ve=(T=o==null?void 0:o.value)===null||T===void 0?void 0:T.Pagination)===null||ve===void 0?void 0:ve.inputSize)||ti(e.size)}),D=$(()=>{var T,ve;return((ve=(T=o==null?void 0:o.value)===null||T===void 0?void 0:T.Pagination)===null||ve===void 0?void 0:ve.selectSize)||ti(e.size)}),W=$(()=>(u.value-1)*f.value),H=$(()=>{const T=u.value*f.value-1,{itemCount:ve}=e;return ve!==void 0&&T>ve-1?ve-1:T}),j=$(()=>{const{itemCount:T}=e;return T!==void 0?T:(e.pageCount||1)*f.value}),V=eo("Pagination",n,t),E=()=>{lo(()=>{var T;const{value:ve}=s;ve&&(ve.classList.add("transition-disabled"),(T=s.value)===null||T===void 0||T.offsetWidth,ve.classList.remove("transition-disabled"))})};function Y(T){if(T===u.value)return;const{"onUpdate:page":ve,onUpdatePage:Se,onChange:Fe,simple:ne}=e;ve&&ce(ve,T),Se&&ce(Se,T),Fe&&ce(Fe,T),d.value=T,ne&&(v.value=String(T))}function K(T){if(T===f.value)return;const{"onUpdate:pageSize":ve,onUpdatePageSize:Se,onPageSizeChange:Fe}=e;ve&&ce(ve,T),Se&&ce(Se,T),Fe&&ce(Fe,T),c.value=T,p.value<u.value&&Y(p.value)}function te(){if(e.disabled)return;const T=Math.min(u.value+1,p.value);Y(T)}function xe(){if(e.disabled)return;const T=Math.max(u.value-1,1);Y(T)}function de(){if(e.disabled)return;const T=Math.min(S.value.fastForwardTo,p.value);Y(T)}function ie(){if(e.disabled)return;const T=Math.max(S.value.fastBackwardTo,1);Y(T)}function F(T){K(T)}function B(){const T=parseInt(v.value);Number.isNaN(T)||(Y(Math.max(1,Math.min(T,p.value))),e.simple||(v.value=""))}function q(){B()}function ee(T){if(!e.disabled)switch(T.type){case"page":Y(T.label);break;case"fast-backward":ie();break;case"fast-forward":de();break}}function be(T){v.value=T.replace(/\D+/g,"")}oo(()=>{u.value,f.value,E()});const me=$(()=>{const{size:T}=e,{self:{buttonBorder:ve,buttonBorderHover:Se,buttonBorderPressed:Fe,buttonIconColor:ne,buttonIconColorHover:Ce,buttonIconColorPressed:ge,itemTextColor:Ee,itemTextColorHover:Q,itemTextColorPressed:he,itemTextColorActive:G,itemTextColorDisabled:U,itemColor:le,itemColorHover:ye,itemColorPressed:_e,itemColorActive:oe,itemColorActiveHover:pe,itemColorDisabled:Ue,itemBorder:fo,itemBorderHover:Po,itemBorderPressed:Fo,itemBorderActive:xo,itemBorderDisabled:Co,itemBorderRadius:Eo,jumperTextColor:_o,jumperTextColorDisabled:uo,buttonColor:vo,buttonColorHover:O,buttonColorPressed:X,[N("itemPadding",T)]:ue,[N("itemMargin",T)]:$e,[N("inputWidth",T)]:Pe,[N("selectWidth",T)]:ke,[N("inputMargin",T)]:Me,[N("selectMargin",T)]:Le,[N("jumperFontSize",T)]:qe,[N("prefixMargin",T)]:go,[N("suffixMargin",T)]:nt,[N("itemSize",T)]:ut,[N("buttonIconSize",T)]:Vo,[N("itemFontSize",T)]:Uo,[`${N("itemMargin",T)}Rtl`]:ft,[`${N("inputMargin",T)}Rtl`]:ht},common:{cubicBezierEaseInOut:Bt}}=l.value;return{"--n-prefix-margin":go,"--n-suffix-margin":nt,"--n-item-font-size":Uo,"--n-select-width":ke,"--n-select-margin":Le,"--n-input-width":Pe,"--n-input-margin":Me,"--n-input-margin-rtl":ht,"--n-item-size":ut,"--n-item-text-color":Ee,"--n-item-text-color-disabled":U,"--n-item-text-color-hover":Q,"--n-item-text-color-active":G,"--n-item-text-color-pressed":he,"--n-item-color":le,"--n-item-color-hover":ye,"--n-item-color-disabled":Ue,"--n-item-color-active":oe,"--n-item-color-active-hover":pe,"--n-item-color-pressed":_e,"--n-item-border":fo,"--n-item-border-hover":Po,"--n-item-border-disabled":Co,"--n-item-border-active":xo,"--n-item-border-pressed":Fo,"--n-item-padding":ue,"--n-item-border-radius":Eo,"--n-bezier":Bt,"--n-jumper-font-size":qe,"--n-jumper-text-color":_o,"--n-jumper-text-color-disabled":uo,"--n-item-margin":$e,"--n-item-margin-rtl":ft,"--n-button-icon-size":Vo,"--n-button-icon-color":ne,"--n-button-icon-color-hover":Ce,"--n-button-icon-color-pressed":ge,"--n-button-color-hover":O,"--n-button-color":vo,"--n-button-color-pressed":X,"--n-button-border":ve,"--n-button-border-hover":Se,"--n-button-border-pressed":Fe}}),Be=r?We("pagination",$(()=>{let T="";const{size:ve}=e;return T+=ve[0],T}),me,e):void 0;return{rtlEnabled:V,mergedClsPrefix:t,locale:a,selfRef:s,mergedPage:u,pageItems:$(()=>S.value.items),mergedItemCount:j,jumperValue:v,pageSizeOptions:L,mergedPageSize:f,inputSize:I,selectSize:D,mergedTheme:l,mergedPageCount:p,startIndex:W,endIndex:H,showFastForwardMenu:x,showFastBackwardMenu:C,fastForwardActive:h,fastBackwardActive:m,handleMenuSelect:R,handleFastForwardMouseenter:b,handleFastForwardMouseleave:_,handleFastBackwardMouseenter:k,handleFastBackwardMouseleave:z,handleJumperInput:be,handleBackwardClick:xe,handleForwardClick:te,handlePageItemClick:ee,handleSizePickerChange:F,handleQuickJumperChange:q,cssVars:r?void 0:me,themeClass:Be==null?void 0:Be.themeClass,onRender:Be==null?void 0:Be.onRender}},render(){const{$slots:e,mergedClsPrefix:o,disabled:t,cssVars:r,mergedPage:n,mergedPageCount:l,pageItems:a,showSizePicker:s,showQuickJumper:d,mergedTheme:c,locale:u,inputSize:f,selectSize:p,mergedPageSize:v,pageSizeOptions:h,jumperValue:m,simple:x,prev:C,next:b,prefix:_,suffix:k,label:z,goto:R,handleJumperInput:S,handleSizePickerChange:L,handleBackwardClick:I,handlePageItemClick:D,handleForwardClick:W,handleQuickJumperChange:H,onRender:j}=this;j==null||j();const V=e.prefix||_,E=e.suffix||k,Y=C||e.prev,K=b||e.next,te=z||e.label;return i("div",{ref:"selfRef",class:[`${o}-pagination`,this.themeClass,this.rtlEnabled&&`${o}-pagination--rtl`,t&&`${o}-pagination--disabled`,x&&`${o}-pagination--simple`],style:r},V?i("div",{class:`${o}-pagination-prefix`},V({page:n,pageSize:v,pageCount:l,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(xe=>{switch(xe){case"pages":return i(so,null,i("div",{class:[`${o}-pagination-item`,!Y&&`${o}-pagination-item--button`,(n<=1||n>l||t)&&`${o}-pagination-item--disabled`],onClick:I},Y?Y({page:n,pageSize:v,pageCount:l,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):i(He,{clsPrefix:o},{default:()=>this.rtlEnabled?i(vi,null):i(fi,null)})),x?i(so,null,i("div",{class:`${o}-pagination-quick-jumper`},i(St,{value:m,onUpdateValue:S,size:f,placeholder:"",disabled:t,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:H}))," / ",l):a.map((de,ie)=>{let F,B,q;const{type:ee}=de;switch(ee){case"page":const me=de.label;te?F=te({type:"page",node:me,active:de.active}):F=me;break;case"fast-forward":const Be=this.fastForwardActive?i(He,{clsPrefix:o},{default:()=>this.rtlEnabled?i(hi,null):i(pi,null)}):i(He,{clsPrefix:o},{default:()=>i(gi,null)});te?F=te({type:"fast-forward",node:Be,active:this.fastForwardActive||this.showFastForwardMenu}):F=Be,B=this.handleFastForwardMouseenter,q=this.handleFastForwardMouseleave;break;case"fast-backward":const T=this.fastBackwardActive?i(He,{clsPrefix:o},{default:()=>this.rtlEnabled?i(pi,null):i(hi,null)}):i(He,{clsPrefix:o},{default:()=>i(gi,null)});te?F=te({type:"fast-backward",node:T,active:this.fastBackwardActive||this.showFastBackwardMenu}):F=T,B=this.handleFastBackwardMouseenter,q=this.handleFastBackwardMouseleave;break}const be=i("div",{key:ie,class:[`${o}-pagination-item`,de.active&&`${o}-pagination-item--active`,ee!=="page"&&(ee==="fast-backward"&&this.showFastBackwardMenu||ee==="fast-forward"&&this.showFastForwardMenu)&&`${o}-pagination-item--hover`,t&&`${o}-pagination-item--disabled`,ee==="page"&&`${o}-pagination-item--clickable`],onClick:()=>{D(de)},onMouseenter:B,onMouseleave:q},F);if(ee==="page"&&!de.mayBeFastBackward&&!de.mayBeFastForward)return be;{const me=de.type==="page"?de.mayBeFastBackward?"fast-backward":"fast-forward":de.type;return de.type!=="page"&&!de.options?be:i(ah,{to:this.to,key:me,disabled:t,trigger:"hover",virtualScroll:!0,style:{width:"60px"},theme:c.peers.Popselect,themeOverrides:c.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:"calc(var(--n-option-height) * 4.6)"}}},nodeProps:()=>({style:{justifyContent:"center"}}),show:ee==="page"?!1:ee==="fast-backward"?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:Be=>{ee!=="page"&&(Be?ee==="fast-backward"?this.showFastBackwardMenu=Be:this.showFastForwardMenu=Be:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:de.type!=="page"&&de.options?de.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,showCheckmark:!1},{default:()=>be})}}),i("div",{class:[`${o}-pagination-item`,!K&&`${o}-pagination-item--button`,{[`${o}-pagination-item--disabled`]:n<1||n>=l||t}],onClick:W},K?K({page:n,pageSize:v,pageCount:l,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):i(He,{clsPrefix:o},{default:()=>this.rtlEnabled?i(fi,null):i(vi,null)})));case"size-picker":return!x&&s?i(fh,Object.assign({consistentMenuWidth:!1,placeholder:"",showCheckmark:!1,to:this.to},this.selectProps,{size:p,options:h,value:v,disabled:t,theme:c.peers.Select,themeOverrides:c.peerOverrides.Select,onUpdateValue:L})):null;case"quick-jumper":return!x&&d?i("div",{class:`${o}-pagination-quick-jumper`},R?R():ao(this.$slots.goto,()=>[u.goto]),i(St,{value:m,onUpdateValue:S,size:f,placeholder:"",disabled:t,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:H})):null;default:return null}}),E?i("div",{class:`${o}-pagination-suffix`},E({page:n,pageSize:v,pageCount:l,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}}),fa={padding:"8px 14px"},yh={name:"Tooltip",common:fe,peers:{Popover:It},self(e){const{borderRadius:o,boxShadow2:t,popoverColor:r,textColor2:n}=e;return Object.assign(Object.assign({},fa),{borderRadius:o,boxShadow:t,color:r,textColor:n})}},Er=yh,wh=e=>{const{borderRadius:o,boxShadow2:t,baseColor:r}=e;return Object.assign(Object.assign({},fa),{borderRadius:o,boxShadow:t,color:Re(r,"rgba(0, 0, 0, .85)"),textColor:r})},Sh={name:"Tooltip",common:Ae,peers:{Popover:qt},self:wh},jr=Sh,zh={name:"Ellipsis",common:fe,peers:{Tooltip:Er}},ha=zh,$h={name:"Ellipsis",common:Ae,peers:{Tooltip:jr}},Rh=$h,pa={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},Ph={name:"Radio",common:fe,self(e){const{borderColor:o,primaryColor:t,baseColor:r,textColorDisabled:n,inputColorDisabled:l,textColor2:a,opacityDisabled:s,borderRadius:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,heightSmall:p,heightMedium:v,heightLarge:h,lineHeight:m}=e;return Object.assign(Object.assign({},pa),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:v,buttonHeightLarge:h,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${t}`,boxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${t}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:"#0000",colorDisabled:l,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:t,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:t,buttonBorderColorHover:t,buttonColor:"#0000",buttonColorActive:t,buttonTextColor:a,buttonTextColorActive:r,buttonTextColorHover:t,opacityDisabled:s,buttonBoxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${t}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:d})}},va=Ph,kh=e=>{const{borderColor:o,primaryColor:t,baseColor:r,textColorDisabled:n,inputColorDisabled:l,textColor2:a,opacityDisabled:s,borderRadius:d,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,heightSmall:p,heightMedium:v,heightLarge:h,lineHeight:m}=e;return Object.assign(Object.assign({},pa),{labelLineHeight:m,buttonHeightSmall:p,buttonHeightMedium:v,buttonHeightLarge:h,fontSizeSmall:c,fontSizeMedium:u,fontSizeLarge:f,boxShadow:`inset 0 0 0 1px ${o}`,boxShadowActive:`inset 0 0 0 1px ${t}`,boxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${t}`,boxShadowDisabled:`inset 0 0 0 1px ${o}`,color:r,colorDisabled:l,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:t,dotColorDisabled:o,buttonBorderColor:o,buttonBorderColorActive:t,buttonBorderColorHover:o,buttonColor:r,buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:t,buttonTextColorHover:t,opacityDisabled:s,buttonBoxShadowFocus:`inset 0 0 0 1px ${t}, 0 0 0 2px ${J(t,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:d})},Ih={name:"Radio",common:Ae,self:kh},ga=Ih,Bh={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"},ma=e=>{const{primaryColor:o,textColor2:t,dividerColor:r,hoverColor:n,popoverColor:l,invertedColor:a,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:f,heightSmall:p,heightMedium:v,heightLarge:h,heightHuge:m,textColor3:x,opacityDisabled:C}=e;return Object.assign(Object.assign({},Bh),{optionHeightSmall:p,optionHeightMedium:v,optionHeightLarge:h,optionHeightHuge:m,borderRadius:s,fontSizeSmall:d,fontSizeMedium:c,fontSizeLarge:u,fontSizeHuge:f,optionTextColor:t,optionTextColorHover:t,optionTextColorActive:o,optionTextColorChildActive:o,color:l,dividerColor:r,suffixColor:t,prefixColor:t,optionColorHover:n,optionColorActive:J(o,{alpha:.1}),groupHeaderTextColor:x,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:o,optionColorActiveInverted:o,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:C})},Th={name:"Dropdown",common:Ae,peers:{Popover:qt},self:ma},ba=Th,Oh={name:"Dropdown",common:fe,peers:{Popover:It},self(e){const{primaryColorSuppl:o,primaryColor:t,popoverColor:r}=e,n=ma(e);return n.colorInverted=r,n.optionColorActive=J(t,{alpha:.15}),n.optionColorActiveInverted=o,n.optionColorHoverInverted=o,n}},Ln=Oh,Fh={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"},_h=e=>{const{cardColor:o,modalColor:t,popoverColor:r,textColor2:n,textColor1:l,tableHeaderColor:a,tableColorHover:s,iconColor:d,primaryColor:c,fontWeightStrong:u,borderRadius:f,lineHeight:p,fontSizeSmall:v,fontSizeMedium:h,fontSizeLarge:m,dividerColor:x,heightSmall:C,opacityDisabled:b,tableColorStriped:_}=e;return Object.assign(Object.assign({},Fh),{actionDividerColor:x,lineHeight:p,borderRadius:f,fontSizeSmall:v,fontSizeMedium:h,fontSizeLarge:m,borderColor:Re(o,x),tdColorHover:Re(o,s),tdColorStriped:Re(o,_),thColor:Re(o,a),thColorHover:Re(Re(o,a),s),tdColor:o,tdTextColor:n,thTextColor:l,thFontWeight:u,thButtonColorHover:s,thIconColor:d,thIconColorActive:c,borderColorModal:Re(t,x),tdColorHoverModal:Re(t,s),tdColorStripedModal:Re(t,_),thColorModal:Re(t,a),thColorHoverModal:Re(Re(t,a),s),tdColorModal:t,borderColorPopover:Re(r,x),tdColorHoverPopover:Re(r,s),tdColorStripedPopover:Re(r,_),thColorPopover:Re(r,a),thColorHoverPopover:Re(Re(r,a),s),tdColorPopover:r,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:c,loadingSize:C,opacityLoading:b})},Mh={name:"DataTable",common:fe,peers:{Button:Ro,Checkbox:Xt,Radio:va,Pagination:ua,Scrollbar:$o,Empty:kt,Popover:It,Ellipsis:ha,Dropdown:Ln},self(e){const o=_h(e);return o.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",o.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",o}},Dh=Mh,Lh=Object.assign(Object.assign({},wt),se.props),Hn=Z({name:"Tooltip",props:Lh,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=Ie(e),t=se("Tooltip","-tooltip",void 0,jr,e,o),r=M(null);return Object.assign(Object.assign({},{syncPosition(){r.value.syncPosition()},setShow(l){r.value.setShow(l)}}),{popoverRef:r,mergedTheme:t,popoverThemeOverrides:$(()=>t.value.self)})},render(){const{mergedTheme:e,internalExtraClass:o}=this;return i(br,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:o.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),Hh=g("ellipsis",{overflow:"hidden"},[Ne("line-clamp",`
|
|
|
white-space: nowrap;
|
|
|
display: inline-block;
|
|
|
vertical-align: bottom;
|
|
|
max-width: 100%;
|
|
|
`),P("line-clamp",`
|
|
|
display: -webkit-inline-box;
|
|
|
-webkit-box-orient: vertical;
|
|
|
`),P("cursor-pointer",`
|
|
|
cursor: pointer;
|
|
|
`)]);function Bi(e){return`${e}-ellipsis--line-clamp`}function Ti(e,o){return`${e}-ellipsis--cursor-${o}`}const Ah=Object.assign(Object.assign({},se.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),M1=Z({name:"Ellipsis",inheritAttrs:!1,props:Ah,setup(e,{slots:o,attrs:t}){const r=Wd(),n=se("Ellipsis","-ellipsis",Hh,Rh,e,r),l=M(null),a=M(null),s=M(null),d=M(!1),c=$(()=>{const{lineClamp:x}=e,{value:C}=d;return x!==void 0?{textOverflow:"","-webkit-line-clamp":C?"":x}:{textOverflow:C?"":"ellipsis","-webkit-line-clamp":""}});function u(){let x=!1;const{value:C}=d;if(C)return!0;const{value:b}=l;if(b){const{lineClamp:_}=e;if(v(b),_!==void 0)x=b.scrollHeight<=b.offsetHeight;else{const{value:k}=a;k&&(x=k.getBoundingClientRect().width<=b.getBoundingClientRect().width)}h(b,x)}return x}const f=$(()=>e.expandTrigger==="click"?()=>{var x;const{value:C}=d;C&&((x=s.value)===null||x===void 0||x.setShow(!1)),d.value=!C}:void 0);Qi(()=>{var x;e.tooltip&&((x=s.value)===null||x===void 0||x.setShow(!1))});const p=()=>i("span",Object.assign({},To(t,{class:[`${r.value}-ellipsis`,e.lineClamp!==void 0?Bi(r.value):void 0,e.expandTrigger==="click"?Ti(r.value,"pointer"):void 0],style:c.value}),{ref:"triggerRef",onClick:f.value,onMouseenter:e.expandTrigger==="click"?u:void 0}),e.lineClamp?o:i("span",{ref:"triggerInnerRef"},o));function v(x){if(!x)return;const C=c.value,b=Bi(r.value);e.lineClamp!==void 0?m(x,b,"add"):m(x,b,"remove");for(const _ in C)x.style[_]!==C[_]&&(x.style[_]=C[_])}function h(x,C){const b=Ti(r.value,"pointer");e.expandTrigger==="click"&&!C?m(x,b,"add"):m(x,b,"remove")}function m(x,C,b){b==="add"?x.classList.contains(C)||x.classList.add(C):x.classList.contains(C)&&x.classList.remove(C)}return{mergedTheme:n,triggerRef:l,triggerInnerRef:a,tooltipRef:s,handleClick:f,renderTrigger:p,getTooltipDisabled:u}},render(){var e;const{tooltip:o,renderTrigger:t,$slots:r}=this;if(o){const{mergedTheme:n}=this;return i(Hn,Object.assign({ref:"tooltipRef",placement:"top"},o,{getDisabled:this.getTooltipDisabled,theme:n.peers.Tooltip,themeOverrides:n.peerOverrides.Tooltip}),{trigger:t,default:(e=r.tooltip)!==null&&e!==void 0?e:r.default})}else return t()}}),Eh={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},xa="n-radio-group";function jh(e){const o=rt(e,{mergedSize(b){const{size:_}=e;if(_!==void 0)return _;if(a){const{mergedSizeRef:{value:k}}=a;if(k!==void 0)return k}return b?b.mergedSize.value:"medium"},mergedDisabled(b){return!!(e.disabled||a!=null&&a.disabledRef.value||b!=null&&b.disabled.value)}}),{mergedSizeRef:t,mergedDisabledRef:r}=o,n=M(null),l=M(null),a=ze(xa,null),s=M(e.defaultChecked),d=ae(e,"checked"),c=co(d,s),u=Ve(()=>a?a.valueRef.value===e.value:c.value),f=Ve(()=>{const{name:b}=e;if(b!==void 0)return b;if(a)return a.nameRef.value}),p=M(!1);function v(){if(a){const{doUpdateValue:b}=a,{value:_}=e;ce(b,_)}else{const{onUpdateChecked:b,"onUpdate:checked":_}=e,{nTriggerFormInput:k,nTriggerFormChange:z}=o;b&&ce(b,!0),_&&ce(_,!0),k(),z(),s.value=!0}}function h(){r.value||u.value||v()}function m(){h(),n.value&&(n.value.checked=u.value)}function x(){p.value=!1}function C(){p.value=!0}return{mergedClsPrefix:a?a.mergedClsPrefixRef:Ie(e).mergedClsPrefixRef,inputRef:n,labelRef:l,mergedName:f,mergedDisabled:r,renderSafeChecked:u,focus:p,mergedSize:t,handleRadioInputChange:m,handleRadioInputBlur:x,handleRadioInputFocus:C}}const Wh=g("radio",`
|
|
|
line-height: var(--n-label-line-height);
|
|
|
outline: none;
|
|
|
position: relative;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
display: inline-flex;
|
|
|
align-items: flex-start;
|
|
|
flex-wrap: nowrap;
|
|
|
font-size: var(--n-font-size);
|
|
|
word-break: break-word;
|
|
|
`,[P("checked",[w("dot",`
|
|
|
background-color: var(--n-color-active);
|
|
|
`)]),w("dot-wrapper",`
|
|
|
position: relative;
|
|
|
flex-shrink: 0;
|
|
|
flex-grow: 0;
|
|
|
width: var(--n-radio-size);
|
|
|
`),g("radio-input",`
|
|
|
position: absolute;
|
|
|
border: 0;
|
|
|
border-radius: inherit;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
opacity: 0;
|
|
|
z-index: 1;
|
|
|
cursor: pointer;
|
|
|
`),w("dot",`
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 0;
|
|
|
transform: translateY(-50%);
|
|
|
height: var(--n-radio-size);
|
|
|
width: var(--n-radio-size);
|
|
|
background: var(--n-color);
|
|
|
box-shadow: var(--n-box-shadow);
|
|
|
border-radius: 50%;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier);
|
|
|
`,[y("&::before",`
|
|
|
content: "";
|
|
|
opacity: 0;
|
|
|
position: absolute;
|
|
|
left: 4px;
|
|
|
top: 4px;
|
|
|
height: calc(100% - 8px);
|
|
|
width: calc(100% - 8px);
|
|
|
border-radius: 50%;
|
|
|
transform: scale(.8);
|
|
|
background: var(--n-dot-color-active);
|
|
|
transition:
|
|
|
opacity .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
transform .3s var(--n-bezier);
|
|
|
`),P("checked",{boxShadow:"var(--n-box-shadow-active)"},[y("&::before",`
|
|
|
opacity: 1;
|
|
|
transform: scale(1);
|
|
|
`)])]),w("label",`
|
|
|
color: var(--n-text-color);
|
|
|
padding: var(--n-label-padding);
|
|
|
font-weight: var(--n-label-font-weight);
|
|
|
display: inline-block;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`),Ne("disabled",`
|
|
|
cursor: pointer;
|
|
|
`,[y("&:hover",[w("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),P("focus",[y("&:not(:active)",[w("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
`,[w("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[y("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),P("checked",`
|
|
|
opacity: 1;
|
|
|
`)]),w("label",{color:"var(--n-text-color-disabled)"}),g("radio-input",`
|
|
|
cursor: not-allowed;
|
|
|
`)])]),Nh=Object.assign(Object.assign({},se.props),Eh),D1=Z({name:"Radio",props:Nh,setup(e){const o=jh(e),t=se("Radio","-radio",Wh,ga,e,o.mergedClsPrefix),r=$(()=>{const{mergedSize:{value:c}}=o,{common:{cubicBezierEaseInOut:u},self:{boxShadow:f,boxShadowActive:p,boxShadowDisabled:v,boxShadowFocus:h,boxShadowHover:m,color:x,colorDisabled:C,colorActive:b,textColor:_,textColorDisabled:k,dotColorActive:z,dotColorDisabled:R,labelPadding:S,labelLineHeight:L,labelFontWeight:I,[N("fontSize",c)]:D,[N("radioSize",c)]:W}}=t.value;return{"--n-bezier":u,"--n-label-line-height":L,"--n-label-font-weight":I,"--n-box-shadow":f,"--n-box-shadow-active":p,"--n-box-shadow-disabled":v,"--n-box-shadow-focus":h,"--n-box-shadow-hover":m,"--n-color":x,"--n-color-active":b,"--n-color-disabled":C,"--n-dot-color-active":z,"--n-dot-color-disabled":R,"--n-font-size":D,"--n-radio-size":W,"--n-text-color":_,"--n-text-color-disabled":k,"--n-label-padding":S}}),{inlineThemeDisabled:n,mergedClsPrefixRef:l,mergedRtlRef:a}=Ie(e),s=eo("Radio",a,l),d=n?We("radio",$(()=>o.mergedSize.value[0]),r,e):void 0;return Object.assign(o,{rtlEnabled:s,cssVars:n?void 0:r,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender})},render(){const{$slots:e,mergedClsPrefix:o,onRender:t,label:r}=this;return t==null||t(),i("label",{class:[`${o}-radio`,this.themeClass,this.rtlEnabled&&`${o}-radio--rtl`,this.mergedDisabled&&`${o}-radio--disabled`,this.renderSafeChecked&&`${o}-radio--checked`,this.focus&&`${o}-radio--focus`],style:this.cssVars},i("input",{ref:"inputRef",type:"radio",class:`${o}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),i("div",{class:`${o}-radio__dot-wrapper`}," ",i("div",{class:[`${o}-radio__dot`,this.renderSafeChecked&&`${o}-radio__dot--checked`]})),je(e.default,n=>!n&&!r?null:i("div",{ref:"labelRef",class:`${o}-radio__label`},n||r)))}}),Vh=g("radio-group",`
|
|
|
display: inline-block;
|
|
|
font-size: var(--n-font-size);
|
|
|
`,[w("splitor",`
|
|
|
display: inline-block;
|
|
|
vertical-align: bottom;
|
|
|
width: 1px;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier);
|
|
|
background: var(--n-button-border-color);
|
|
|
`,[P("checked",{backgroundColor:"var(--n-button-border-color-active)"}),P("disabled",{opacity:"var(--n-opacity-disabled)"})]),P("button-group",`
|
|
|
white-space: nowrap;
|
|
|
height: var(--n-height);
|
|
|
line-height: var(--n-height);
|
|
|
`,[g("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),w("splitor",{height:"var(--n-height)"})]),g("radio-button",`
|
|
|
vertical-align: bottom;
|
|
|
outline: none;
|
|
|
position: relative;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
display: inline-block;
|
|
|
box-sizing: border-box;
|
|
|
padding-left: 14px;
|
|
|
padding-right: 14px;
|
|
|
white-space: nowrap;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
background: var(--n-button-color);
|
|
|
color: var(--n-button-text-color);
|
|
|
border-top: 1px solid var(--n-button-border-color);
|
|
|
border-bottom: 1px solid var(--n-button-border-color);
|
|
|
`,[g("radio-input",`
|
|
|
pointer-events: none;
|
|
|
position: absolute;
|
|
|
border: 0;
|
|
|
border-radius: inherit;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
opacity: 0;
|
|
|
z-index: 1;
|
|
|
`),w("state-border",`
|
|
|
z-index: 1;
|
|
|
pointer-events: none;
|
|
|
position: absolute;
|
|
|
box-shadow: var(--n-button-box-shadow);
|
|
|
transition: box-shadow .3s var(--n-bezier);
|
|
|
left: -1px;
|
|
|
bottom: -1px;
|
|
|
right: -1px;
|
|
|
top: -1px;
|
|
|
`),y("&:first-child",`
|
|
|
border-top-left-radius: var(--n-button-border-radius);
|
|
|
border-bottom-left-radius: var(--n-button-border-radius);
|
|
|
border-left: 1px solid var(--n-button-border-color);
|
|
|
`,[w("state-border",`
|
|
|
border-top-left-radius: var(--n-button-border-radius);
|
|
|
border-bottom-left-radius: var(--n-button-border-radius);
|
|
|
`)]),y("&:last-child",`
|
|
|
border-top-right-radius: var(--n-button-border-radius);
|
|
|
border-bottom-right-radius: var(--n-button-border-radius);
|
|
|
border-right: 1px solid var(--n-button-border-color);
|
|
|
`,[w("state-border",`
|
|
|
border-top-right-radius: var(--n-button-border-radius);
|
|
|
border-bottom-right-radius: var(--n-button-border-radius);
|
|
|
`)]),Ne("disabled",`
|
|
|
cursor: pointer;
|
|
|
`,[y("&:hover",[w("state-border",`
|
|
|
transition: box-shadow .3s var(--n-bezier);
|
|
|
box-shadow: var(--n-button-box-shadow-hover);
|
|
|
`),Ne("checked",{color:"var(--n-button-text-color-hover)"})]),P("focus",[y("&:not(:active)",[w("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),P("checked",`
|
|
|
background: var(--n-button-color-active);
|
|
|
color: var(--n-button-text-color-active);
|
|
|
border-color: var(--n-button-border-color-active);
|
|
|
`),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
opacity: var(--n-opacity-disabled);
|
|
|
`)])]);function Uh(e,o,t){var r;const n=[];let l=!1;for(let a=0;a<e.length;++a){const s=e[a],d=(r=s.type)===null||r===void 0?void 0:r.name;d==="RadioButton"&&(l=!0);const c=s.props;if(d!=="RadioButton"){n.push(s);continue}if(a===0)n.push(s);else{const u=n[n.length-1].props,f=o===u.value,p=u.disabled,v=o===c.value,h=c.disabled,m=(f?2:0)+(p?0:1),x=(v?2:0)+(h?0:1),C={[`${t}-radio-group__splitor--disabled`]:p,[`${t}-radio-group__splitor--checked`]:f},b={[`${t}-radio-group__splitor--disabled`]:h,[`${t}-radio-group__splitor--checked`]:v},_=m<x?b:C;n.push(i("div",{class:[`${t}-radio-group__splitor`,_]}),s)}}return{children:n,isButtonGroup:l}}const Kh=Object.assign(Object.assign({},se.props),{name:String,value:[String,Number,Boolean],defaultValue:{type:[String,Number,Boolean],default:null},size:String,disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array]}),L1=Z({name:"RadioGroup",props:Kh,setup(e){const o=M(null),{mergedSizeRef:t,mergedDisabledRef:r,nTriggerFormChange:n,nTriggerFormInput:l,nTriggerFormBlur:a,nTriggerFormFocus:s}=rt(e),{mergedClsPrefixRef:d,inlineThemeDisabled:c,mergedRtlRef:u}=Ie(e),f=se("Radio","-radio-group",Vh,ga,e,d),p=M(e.defaultValue),v=ae(e,"value"),h=co(v,p);function m(z){const{onUpdateValue:R,"onUpdate:value":S}=e;R&&ce(R,z),S&&ce(S,z),p.value=z,n(),l()}function x(z){const{value:R}=o;R&&(R.contains(z.relatedTarget)||s())}function C(z){const{value:R}=o;R&&(R.contains(z.relatedTarget)||a())}De(xa,{mergedClsPrefixRef:d,nameRef:ae(e,"name"),valueRef:h,disabledRef:r,mergedSizeRef:t,doUpdateValue:m});const b=eo("Radio",u,d),_=$(()=>{const{value:z}=t,{common:{cubicBezierEaseInOut:R},self:{buttonBorderColor:S,buttonBorderColorActive:L,buttonBorderRadius:I,buttonBoxShadow:D,buttonBoxShadowFocus:W,buttonBoxShadowHover:H,buttonColor:j,buttonColorActive:V,buttonTextColor:E,buttonTextColorActive:Y,buttonTextColorHover:K,opacityDisabled:te,[N("buttonHeight",z)]:xe,[N("fontSize",z)]:de}}=f.value;return{"--n-font-size":de,"--n-bezier":R,"--n-button-border-color":S,"--n-button-border-color-active":L,"--n-button-border-radius":I,"--n-button-box-shadow":D,"--n-button-box-shadow-focus":W,"--n-button-box-shadow-hover":H,"--n-button-color":j,"--n-button-color-active":V,"--n-button-text-color":E,"--n-button-text-color-hover":K,"--n-button-text-color-active":Y,"--n-height":xe,"--n-opacity-disabled":te}}),k=c?We("radio-group",$(()=>t.value[0]),_,e):void 0;return{selfElRef:o,rtlEnabled:b,mergedClsPrefix:d,mergedValue:h,handleFocusout:C,handleFocusin:x,cssVars:c?void 0:_,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender}},render(){var e;const{mergedValue:o,mergedClsPrefix:t,handleFocusin:r,handleFocusout:n}=this,{children:l,isButtonGroup:a}=Uh(ot(Rn(this)),o,t);return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{onFocusin:r,onFocusout:n,ref:"selfElRef",class:[`${t}-radio-group`,this.rtlEnabled&&`${t}-radio-group--rtl`,this.themeClass,a&&`${t}-radio-group--button-group`],style:this.cssVars},l)}}),Ca=Z({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return i("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),ya=e=>{const{textColorBase:o,opacity1:t,opacity2:r,opacity3:n,opacity4:l,opacity5:a}=e;return{color:o,opacity1Depth:t,opacity2Depth:r,opacity3Depth:n,opacity4Depth:l,opacity5Depth:a}},Gh={name:"Icon",common:Ae,self:ya},qh=Gh,Yh={name:"Icon",common:fe,self:ya},Xh=Yh,Zh=g("icon",`
|
|
|
height: 1em;
|
|
|
width: 1em;
|
|
|
line-height: 1em;
|
|
|
text-align: center;
|
|
|
display: inline-block;
|
|
|
position: relative;
|
|
|
fill: currentColor;
|
|
|
transform: translateZ(0);
|
|
|
`,[P("color-transition",{transition:"color .3s var(--n-bezier)"}),P("depth",{color:"var(--n-color)"},[y("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),y("svg",{height:"1em",width:"1em"})]),Qh=Object.assign(Object.assign({},se.props),{depth:[String,Number],size:[Number,String],color:String,component:Object}),Jh=Z({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:Qh,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Icon","-icon",Zh,qh,e,o),n=$(()=>{const{depth:a}=e,{common:{cubicBezierEaseInOut:s},self:d}=r.value;if(a!==void 0){const{color:c,[`opacity${a}Depth`]:u}=d;return{"--n-bezier":s,"--n-color":c,"--n-opacity":u}}return{"--n-bezier":s,"--n-color":"","--n-opacity":""}}),l=t?We("icon",$(()=>`${e.depth||"d"}`),n,e):void 0;return{mergedClsPrefix:o,mergedStyle:$(()=>{const{size:a,color:s}=e;return{fontSize:ro(a),color:s}}),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$parent:o,depth:t,mergedClsPrefix:r,component:n,onRender:l,themeClass:a}=this;return!((e=o==null?void 0:o.$options)===null||e===void 0)&&e._n_icon__&&qo("icon","don't wrap `n-icon` inside `n-icon`"),l==null||l(),i("i",To(this.$attrs,{role:"img",class:[`${r}-icon`,a,{[`${r}-icon--depth`]:t,[`${r}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),n?i(n):this.$slots)}}),An="n-dropdown-menu",Wr="n-dropdown",Oi="n-dropdown-option";function mn(e,o){return e.type==="submenu"||e.type===void 0&&e[o]!==void 0}function ep(e){return e.type==="group"}function wa(e){return e.type==="divider"}function op(e){return e.type==="render"}const Sa=Z({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const o=ze(Wr),{hoverKeyRef:t,keyboardKeyRef:r,lastToggledSubmenuKeyRef:n,pendingKeyPathRef:l,activeKeyPathRef:a,animatedRef:s,mergedShowRef:d,renderLabelRef:c,renderIconRef:u,labelFieldRef:f,childrenFieldRef:p,renderOptionRef:v,nodePropsRef:h,menuPropsRef:m}=o,x=ze(Oi,null),C=ze(An),b=ze(Nt),_=$(()=>e.tmNode.rawNode),k=$(()=>{const{value:K}=p;return mn(e.tmNode.rawNode,K)}),z=$(()=>{const{disabled:K}=e.tmNode;return K}),R=$(()=>{if(!k.value)return!1;const{key:K,disabled:te}=e.tmNode;if(te)return!1;const{value:xe}=t,{value:de}=r,{value:ie}=n,{value:F}=l;return xe!==null?F.includes(K):de!==null?F.includes(K)&&F[F.length-1]!==K:ie!==null?F.includes(K):!1}),S=$(()=>r.value===null&&!s.value),L=Ld(R,300,S),I=$(()=>!!(x!=null&&x.enteringSubmenuRef.value)),D=M(!1);De(Oi,{enteringSubmenuRef:D});function W(){D.value=!0}function H(){D.value=!1}function j(){const{parentKey:K,tmNode:te}=e;te.disabled||d.value&&(n.value=K,r.value=null,t.value=te.key)}function V(){const{tmNode:K}=e;K.disabled||d.value&&t.value!==K.key&&j()}function E(K){if(e.tmNode.disabled||!d.value)return;const{relatedTarget:te}=K;te&&!at({target:te},"dropdownOption")&&!at({target:te},"scrollbarRail")&&(t.value=null)}function Y(){const{value:K}=k,{tmNode:te}=e;d.value&&!K&&!te.disabled&&(o.doSelect(te.key,te.rawNode),o.doUpdateShow(!1))}return{labelField:f,renderLabel:c,renderIcon:u,siblingHasIcon:C.showIconRef,siblingHasSubmenu:C.hasSubmenuRef,menuProps:m,popoverBody:b,animated:s,mergedShowSubmenu:$(()=>L.value&&!I.value),rawNode:_,hasSubmenu:k,pending:Ve(()=>{const{value:K}=l,{key:te}=e.tmNode;return K.includes(te)}),childActive:Ve(()=>{const{value:K}=a,{key:te}=e.tmNode,xe=K.findIndex(de=>te===de);return xe===-1?!1:xe<K.length-1}),active:Ve(()=>{const{value:K}=a,{key:te}=e.tmNode,xe=K.findIndex(de=>te===de);return xe===-1?!1:xe===K.length-1}),mergedDisabled:z,renderOption:v,nodeProps:h,handleClick:Y,handleMouseMove:V,handleMouseEnter:j,handleMouseLeave:E,handleSubmenuBeforeEnter:W,handleSubmenuAfterEnter:H}},render(){var e,o;const{animated:t,rawNode:r,mergedShowSubmenu:n,clsPrefix:l,siblingHasIcon:a,siblingHasSubmenu:s,renderLabel:d,renderIcon:c,renderOption:u,nodeProps:f,props:p,scrollable:v}=this;let h=null;if(n){const b=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,r,r.children);h=i(za,Object.assign({},b,{clsPrefix:l,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const m={class:[`${l}-dropdown-option-body`,this.pending&&`${l}-dropdown-option-body--pending`,this.active&&`${l}-dropdown-option-body--active`,this.childActive&&`${l}-dropdown-option-body--child-active`,this.mergedDisabled&&`${l}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},x=f==null?void 0:f(r),C=i("div",Object.assign({class:[`${l}-dropdown-option`,x==null?void 0:x.class],"data-dropdown-option":!0},x),i("div",To(m,p),[i("div",{class:[`${l}-dropdown-option-body__prefix`,a&&`${l}-dropdown-option-body__prefix--show-icon`]},[c?c(r):Qe(r.icon)]),i("div",{"data-dropdown-option":!0,class:`${l}-dropdown-option-body__label`},d?d(r):Qe((o=r[this.labelField])!==null&&o!==void 0?o:r.title)),i("div",{"data-dropdown-option":!0,class:[`${l}-dropdown-option-body__suffix`,s&&`${l}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?i(Jh,null,{default:()=>i(Zd,null)}):null)]),this.hasSubmenu?i(_r,null,{default:()=>[i(Fr,null,{default:()=>i("div",{class:`${l}-dropdown-offset-container`},i(Or,{show:this.mergedShowSubmenu,placement:this.placement,to:v&&this.popoverBody||void 0,teleportDisabled:!v},{default:()=>i("div",{class:`${l}-dropdown-menu-wrapper`},t?i(io,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>h}):h)}))})]}):null);return u?u({node:C,option:r}):C}}),tp=Z({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:o}=ze(An),{renderLabelRef:t,labelFieldRef:r,nodePropsRef:n,renderOptionRef:l}=ze(Wr);return{labelField:r,showIcon:e,hasSubmenu:o,renderLabel:t,nodeProps:n,renderOption:l}},render(){var e;const{clsPrefix:o,hasSubmenu:t,showIcon:r,nodeProps:n,renderLabel:l,renderOption:a}=this,{rawNode:s}=this.tmNode,d=i("div",Object.assign({class:`${o}-dropdown-option`},n==null?void 0:n(s)),i("div",{class:`${o}-dropdown-option-body ${o}-dropdown-option-body--group`},i("div",{"data-dropdown-option":!0,class:[`${o}-dropdown-option-body__prefix`,r&&`${o}-dropdown-option-body__prefix--show-icon`]},Qe(s.icon)),i("div",{class:`${o}-dropdown-option-body__label`,"data-dropdown-option":!0},l?l(s):Qe((e=s.title)!==null&&e!==void 0?e:s[this.labelField])),i("div",{class:[`${o}-dropdown-option-body__suffix`,t&&`${o}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:d,option:s}):d}}),rp=Z({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:o,clsPrefix:t}=this,{children:r}=e;return i(so,null,i(tp,{clsPrefix:t,tmNode:e,key:e.key}),r==null?void 0:r.map(n=>{const{rawNode:l}=n;return l.show===!1?null:wa(l)?i(Ca,{clsPrefix:t,key:n.key}):n.isGroup?(qo("dropdown","`group` node is not allowed to be put in `group` node."),null):i(Sa,{clsPrefix:t,tmNode:n,parentKey:o,key:n.key})}))}}),np=Z({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:o}}=this.tmNode;return i("div",o,[e==null?void 0:e()])}}),za=Z({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:o,childrenFieldRef:t}=ze(Wr);De(An,{showIconRef:$(()=>{const n=o.value;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>n?n(d):d.icon);const{rawNode:s}=l;return n?n(s):s.icon})}),hasSubmenuRef:$(()=>{const{value:n}=t;return e.tmNodes.some(l=>{var a;if(l.isGroup)return(a=l.children)===null||a===void 0?void 0:a.some(({rawNode:d})=>mn(d,n));const{rawNode:s}=l;return mn(s,n)})})});const r=M(null);return De(pr,null),De(vr,null),De(Nt,r),{bodyRef:r}},render(){const{parentKey:e,clsPrefix:o,scrollable:t}=this,r=this.tmNodes.map(n=>{const{rawNode:l}=n;return l.show===!1?null:op(l)?i(np,{tmNode:n,key:n.key}):wa(l)?i(Ca,{clsPrefix:o,key:n.key}):ep(l)?i(rp,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key}):i(Sa,{clsPrefix:o,tmNode:n,parentKey:e,key:n.key,props:l.props,scrollable:t})});return i("div",{class:[`${o}-dropdown-menu`,t&&`${o}-dropdown-menu--scrollable`],ref:"bodyRef"},t?i(kl,{contentClass:`${o}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?Fl({clsPrefix:o,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),ip=g("dropdown-menu",`
|
|
|
transform-origin: var(--v-transform-origin);
|
|
|
background-color: var(--n-color);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
box-shadow: var(--n-box-shadow);
|
|
|
position: relative;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier);
|
|
|
`,[ct(),g("dropdown-option",`
|
|
|
position: relative;
|
|
|
`,[y("a",`
|
|
|
text-decoration: none;
|
|
|
color: inherit;
|
|
|
outline: none;
|
|
|
`,[y("&::before",`
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
`)]),g("dropdown-option-body",`
|
|
|
display: flex;
|
|
|
cursor: pointer;
|
|
|
position: relative;
|
|
|
height: var(--n-option-height);
|
|
|
line-height: var(--n-option-height);
|
|
|
font-size: var(--n-font-size);
|
|
|
color: var(--n-option-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`,[y("&::before",`
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
left: 4px;
|
|
|
right: 4px;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
`),Ne("disabled",[P("pending",`
|
|
|
color: var(--n-option-text-color-hover);
|
|
|
`,[w("prefix, suffix",`
|
|
|
color: var(--n-option-text-color-hover);
|
|
|
`),y("&::before","background-color: var(--n-option-color-hover);")]),P("active",`
|
|
|
color: var(--n-option-text-color-active);
|
|
|
`,[w("prefix, suffix",`
|
|
|
color: var(--n-option-text-color-active);
|
|
|
`),y("&::before","background-color: var(--n-option-color-active);")]),P("child-active",`
|
|
|
color: var(--n-option-text-color-child-active);
|
|
|
`,[w("prefix, suffix",`
|
|
|
color: var(--n-option-text-color-child-active);
|
|
|
`)])]),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
opacity: var(--n-option-opacity-disabled);
|
|
|
`),P("group",`
|
|
|
font-size: calc(var(--n-font-size) - 1px);
|
|
|
color: var(--n-group-header-text-color);
|
|
|
`,[w("prefix",`
|
|
|
width: calc(var(--n-option-prefix-width) / 2);
|
|
|
`,[P("show-icon",`
|
|
|
width: calc(var(--n-option-icon-prefix-width) / 2);
|
|
|
`)])]),w("prefix",`
|
|
|
width: var(--n-option-prefix-width);
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
color: var(--n-prefix-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
z-index: 1;
|
|
|
`,[P("show-icon",`
|
|
|
width: var(--n-option-icon-prefix-width);
|
|
|
`),g("icon",`
|
|
|
font-size: var(--n-option-icon-size);
|
|
|
`)]),w("label",`
|
|
|
white-space: nowrap;
|
|
|
flex: 1;
|
|
|
z-index: 1;
|
|
|
`),w("suffix",`
|
|
|
box-sizing: border-box;
|
|
|
flex-grow: 0;
|
|
|
flex-shrink: 0;
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
align-items: center;
|
|
|
min-width: var(--n-option-suffix-width);
|
|
|
padding: 0 8px;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-suffix-color);
|
|
|
z-index: 1;
|
|
|
`,[P("has-submenu",`
|
|
|
width: var(--n-option-icon-suffix-width);
|
|
|
`),g("icon",`
|
|
|
font-size: var(--n-option-icon-size);
|
|
|
`)]),g("dropdown-menu","pointer-events: all;")]),g("dropdown-offset-container",`
|
|
|
pointer-events: none;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: -4px;
|
|
|
bottom: -4px;
|
|
|
`)]),g("dropdown-divider",`
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
background-color: var(--n-divider-color);
|
|
|
height: 1px;
|
|
|
margin: 4px 0;
|
|
|
`),g("dropdown-menu-wrapper",`
|
|
|
transform-origin: var(--v-transform-origin);
|
|
|
width: fit-content;
|
|
|
`),y(">",[g("scrollbar",`
|
|
|
height: inherit;
|
|
|
max-height: inherit;
|
|
|
`)]),Ne("scrollable",`
|
|
|
padding: var(--n-padding);
|
|
|
`),P("scrollable",[w("content",`
|
|
|
padding: var(--n-padding);
|
|
|
`)])]),lp={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},ap=Object.keys(wt),sp=Object.assign(Object.assign(Object.assign({},wt),lp),se.props),dp=Z({name:"Dropdown",inheritAttrs:!1,props:sp,setup(e){const o=M(!1),t=co(ae(e,"show"),o),r=$(()=>{const{keyField:H,childrenField:j}=e;return bt(e.options,{getKey(V){return V[H]},getDisabled(V){return V.disabled===!0},getIgnored(V){return V.type==="divider"||V.type==="render"},getChildren(V){return V[j]}})}),n=$(()=>r.value.treeNodes),l=M(null),a=M(null),s=M(null),d=$(()=>{var H,j,V;return(V=(j=(H=l.value)!==null&&H!==void 0?H:a.value)!==null&&j!==void 0?j:s.value)!==null&&V!==void 0?V:null}),c=$(()=>r.value.getPath(d.value).keyPath),u=$(()=>r.value.getPath(e.value).keyPath),f=Ve(()=>e.keyboard&&t.value);vd({keydown:{ArrowUp:{prevent:!0,handler:z},ArrowRight:{prevent:!0,handler:k},ArrowDown:{prevent:!0,handler:R},ArrowLeft:{prevent:!0,handler:_},Enter:{prevent:!0,handler:S},Escape:b}},f);const{mergedClsPrefixRef:p,inlineThemeDisabled:v}=Ie(e),h=se("Dropdown","-dropdown",ip,ba,e,p);De(Wr,{labelFieldRef:ae(e,"labelField"),childrenFieldRef:ae(e,"childrenField"),renderLabelRef:ae(e,"renderLabel"),renderIconRef:ae(e,"renderIcon"),hoverKeyRef:l,keyboardKeyRef:a,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:c,activeKeyPathRef:u,animatedRef:ae(e,"animated"),mergedShowRef:t,nodePropsRef:ae(e,"nodeProps"),renderOptionRef:ae(e,"renderOption"),menuPropsRef:ae(e,"menuProps"),doSelect:m,doUpdateShow:x}),Xe(t,H=>{!e.animated&&!H&&C()});function m(H,j){const{onSelect:V}=e;V&&ce(V,H,j)}function x(H){const{"onUpdate:show":j,onUpdateShow:V}=e;j&&ce(j,H),V&&ce(V,H),o.value=H}function C(){l.value=null,a.value=null,s.value=null}function b(){x(!1)}function _(){I("left")}function k(){I("right")}function z(){I("up")}function R(){I("down")}function S(){const H=L();H!=null&&H.isLeaf&&t.value&&(m(H.key,H.rawNode),x(!1))}function L(){var H;const{value:j}=r,{value:V}=d;return!j||V===null?null:(H=j.getNode(V))!==null&&H!==void 0?H:null}function I(H){const{value:j}=d,{value:{getFirstAvailableNode:V}}=r;let E=null;if(j===null){const Y=V();Y!==null&&(E=Y.key)}else{const Y=L();if(Y){let K;switch(H){case"down":K=Y.getNext();break;case"up":K=Y.getPrev();break;case"right":K=Y.getChild();break;case"left":K=Y.getParent();break}K&&(E=K.key)}}E!==null&&(l.value=null,a.value=E)}const D=$(()=>{const{size:H,inverted:j}=e,{common:{cubicBezierEaseInOut:V},self:E}=h.value,{padding:Y,dividerColor:K,borderRadius:te,optionOpacityDisabled:xe,[N("optionIconSuffixWidth",H)]:de,[N("optionSuffixWidth",H)]:ie,[N("optionIconPrefixWidth",H)]:F,[N("optionPrefixWidth",H)]:B,[N("fontSize",H)]:q,[N("optionHeight",H)]:ee,[N("optionIconSize",H)]:be}=E,me={"--n-bezier":V,"--n-font-size":q,"--n-padding":Y,"--n-border-radius":te,"--n-option-height":ee,"--n-option-prefix-width":B,"--n-option-icon-prefix-width":F,"--n-option-suffix-width":ie,"--n-option-icon-suffix-width":de,"--n-option-icon-size":be,"--n-divider-color":K,"--n-option-opacity-disabled":xe};return j?(me["--n-color"]=E.colorInverted,me["--n-option-color-hover"]=E.optionColorHoverInverted,me["--n-option-color-active"]=E.optionColorActiveInverted,me["--n-option-text-color"]=E.optionTextColorInverted,me["--n-option-text-color-hover"]=E.optionTextColorHoverInverted,me["--n-option-text-color-active"]=E.optionTextColorActiveInverted,me["--n-option-text-color-child-active"]=E.optionTextColorChildActiveInverted,me["--n-prefix-color"]=E.prefixColorInverted,me["--n-suffix-color"]=E.suffixColorInverted,me["--n-group-header-text-color"]=E.groupHeaderTextColorInverted):(me["--n-color"]=E.color,me["--n-option-color-hover"]=E.optionColorHover,me["--n-option-color-active"]=E.optionColorActive,me["--n-option-text-color"]=E.optionTextColor,me["--n-option-text-color-hover"]=E.optionTextColorHover,me["--n-option-text-color-active"]=E.optionTextColorActive,me["--n-option-text-color-child-active"]=E.optionTextColorChildActive,me["--n-prefix-color"]=E.prefixColor,me["--n-suffix-color"]=E.suffixColor,me["--n-group-header-text-color"]=E.groupHeaderTextColor),me}),W=v?We("dropdown",$(()=>`${e.size[0]}${e.inverted?"i":""}`),D,e):void 0;return{mergedClsPrefix:p,mergedTheme:h,tmNodes:n,mergedShow:t,handleAfterLeave:()=>{e.animated&&C()},doUpdateShow:x,cssVars:v?void 0:D,themeClass:W==null?void 0:W.themeClass,onRender:W==null?void 0:W.onRender}},render(){const e=(r,n,l,a,s)=>{var d;const{mergedClsPrefix:c,menuProps:u}=this;(d=this.onRender)===null||d===void 0||d.call(this);const f=(u==null?void 0:u(void 0,this.tmNodes.map(v=>v.rawNode)))||{},p={ref:ll(n),class:[r,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[...l,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:a,onMouseleave:s};return i(za,To(this.$attrs,p,f))},{mergedTheme:o}=this,t={show:this.mergedShow,theme:o.peers.Popover,themeOverrides:o.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return i(br,Object.assign({},mo(this.$props,ap),t),{trigger:()=>{var r,n;return(n=(r=this.$slots).default)===null||n===void 0?void 0:n.call(r)}})}}),cp={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"},up=e=>{const{popoverColor:o,textColor2:t,primaryColor:r,hoverColor:n,dividerColor:l,opacityDisabled:a,boxShadow2:s,borderRadius:d,iconColor:c,iconColorDisabled:u}=e;return Object.assign(Object.assign({},cp),{panelColor:o,panelBoxShadow:s,panelDividerColor:l,itemTextColor:t,itemTextColorActive:r,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:d,borderRadius:d,iconColor:c,iconColorDisabled:u})},fp={name:"TimePicker",common:fe,peers:{Scrollbar:$o,Button:Ro,Input:Ao},self:up},$a=fp,hp={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"},pp=e=>{const{hoverColor:o,fontSize:t,textColor2:r,textColorDisabled:n,popoverColor:l,primaryColor:a,borderRadiusSmall:s,iconColor:d,iconColorDisabled:c,textColor1:u,dividerColor:f,boxShadow2:p,borderRadius:v,fontWeightStrong:h}=e;return Object.assign(Object.assign({},hp),{itemFontSize:t,calendarDaysFontSize:t,calendarTitleFontSize:t,itemTextColor:r,itemTextColorDisabled:n,itemTextColorActive:l,itemTextColorCurrent:a,itemColorIncluded:J(a,{alpha:.1}),itemColorHover:o,itemColorDisabled:o,itemColorActive:a,itemBorderRadius:s,panelColor:l,panelTextColor:r,arrowColor:d,calendarTitleTextColor:u,calendarTitleColorHover:o,calendarDaysTextColor:r,panelHeaderDividerColor:f,calendarDaysDividerColor:f,calendarDividerColor:f,panelActionDividerColor:f,panelBoxShadow:p,panelBorderRadius:v,calendarTitleFontWeight:h,scrollItemBorderRadius:v,iconColor:d,iconColorDisabled:c})},vp={name:"DatePicker",common:fe,peers:{Input:Ao,Button:Ro,TimePicker:$a,Scrollbar:$o},self(e){const{popoverColor:o,hoverColor:t,primaryColor:r}=e,n=pp(e);return n.itemColorDisabled=Re(o,t),n.itemColorIncluded=J(r,{alpha:.15}),n.itemColorHover=Re(o,t),n}},gp=vp,mp={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"},bp=e=>{const{tableHeaderColor:o,textColor2:t,textColor1:r,cardColor:n,modalColor:l,popoverColor:a,dividerColor:s,borderRadius:d,fontWeightStrong:c,lineHeight:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:v}=e;return Object.assign(Object.assign({},mp),{lineHeight:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:v,titleTextColor:r,thColor:Re(n,o),thColorModal:Re(l,o),thColorPopover:Re(a,o),thTextColor:r,thFontWeight:c,tdTextColor:t,tdColor:n,tdColorModal:l,tdColorPopover:a,borderColor:Re(n,s),borderColorModal:Re(l,s),borderColorPopover:Re(a,s),borderRadius:d})},xp={name:"Descriptions",common:fe,self:bp},Cp=xp,yp={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"},Ra=e=>{const{textColor1:o,textColor2:t,modalColor:r,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:d,infoColor:c,successColor:u,warningColor:f,errorColor:p,primaryColor:v,dividerColor:h,borderRadius:m,fontWeightStrong:x,lineHeight:C,fontSize:b}=e;return Object.assign(Object.assign({},yp),{fontSize:b,lineHeight:C,border:`1px solid ${h}`,titleTextColor:o,textColor:t,color:r,closeColorHover:s,closeColorPressed:d,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeBorderRadius:m,iconColor:v,iconColorInfo:c,iconColorSuccess:u,iconColorWarning:f,iconColorError:p,borderRadius:m,titleFontWeight:x})},wp={name:"Dialog",common:Ae,peers:{Button:Yt},self:Ra},Pa=wp,Sp={name:"Dialog",common:fe,peers:{Button:Ro},self:Ra},ka=Sp,Nr={icon:Function,type:{type:String,default:"default"},title:[String,Function],closable:{type:Boolean,default:!0},negativeText:String,positiveText:String,positiveButtonProps:Object,negativeButtonProps:Object,content:[String,Function],action:Function,showIcon:{type:Boolean,default:!0},loading:Boolean,bordered:Boolean,iconPlacement:String,onPositiveClick:Function,onNegativeClick:Function,onClose:Function},Ia=wo(Nr),zp=y([g("dialog",`
|
|
|
--n-icon-margin: var(--n-icon-margin-top) var(--n-icon-margin-right) var(--n-icon-margin-bottom) var(--n-icon-margin-left);
|
|
|
word-break: break-word;
|
|
|
line-height: var(--n-line-height);
|
|
|
position: relative;
|
|
|
background: var(--n-color);
|
|
|
color: var(--n-text-color);
|
|
|
box-sizing: border-box;
|
|
|
margin: auto;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
padding: var(--n-padding);
|
|
|
transition:
|
|
|
border-color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`,[w("icon",{color:"var(--n-icon-color)"}),P("bordered",{border:"var(--n-border)"}),P("icon-top",[w("close",{margin:"var(--n-close-margin)"}),w("icon",{margin:"var(--n-icon-margin)"}),w("content",{textAlign:"center"}),w("title",{justifyContent:"center"}),w("action",{justifyContent:"center"})]),P("icon-left",[w("icon",{margin:"var(--n-icon-margin)"}),P("closable",[w("title",`
|
|
|
padding-right: calc(var(--n-close-size) + 6px);
|
|
|
`)])]),w("close",`
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
margin: var(--n-close-margin);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
z-index: 1;
|
|
|
`),w("content",`
|
|
|
font-size: var(--n-font-size);
|
|
|
margin: var(--n-content-margin);
|
|
|
position: relative;
|
|
|
word-break: break-word;
|
|
|
`,[P("last","margin-bottom: 0;")]),w("action",`
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
`,[y("> *:not(:last-child)",`
|
|
|
margin-right: var(--n-action-space);
|
|
|
`)]),w("icon",`
|
|
|
font-size: var(--n-icon-size);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`),w("title",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
font-size: var(--n-title-font-size);
|
|
|
font-weight: var(--n-title-font-weight);
|
|
|
color: var(--n-title-text-color);
|
|
|
`),g("dialog-icon-container",`
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
`)]),Lr(g("dialog",`
|
|
|
width: 446px;
|
|
|
max-width: calc(100vw - 32px);
|
|
|
`)),g("dialog",[dl(`
|
|
|
width: 446px;
|
|
|
max-width: calc(100vw - 32px);
|
|
|
`)])]),$p={default:()=>i(yt,null),info:()=>i(yt,null),success:()=>i(Ut,null),warning:()=>i($t,null),error:()=>i(Vt,null)},Ba=Z({name:"Dialog",alias:["NimbusConfirmCard","Confirm"],props:Object.assign(Object.assign({},se.props),Nr),setup(e){const{mergedComponentPropsRef:o,mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),l=eo("Dialog",n,t),a=$(()=>{var v,h;const{iconPlacement:m}=e;return m||((h=(v=o==null?void 0:o.value)===null||v===void 0?void 0:v.Dialog)===null||h===void 0?void 0:h.iconPlacement)||"left"});function s(v){const{onPositiveClick:h}=e;h&&h(v)}function d(v){const{onNegativeClick:h}=e;h&&h(v)}function c(){const{onClose:v}=e;v&&v()}const u=se("Dialog","-dialog",zp,Pa,e,t),f=$(()=>{const{type:v}=e,h=a.value,{common:{cubicBezierEaseInOut:m},self:{fontSize:x,lineHeight:C,border:b,titleTextColor:_,textColor:k,color:z,closeBorderRadius:R,closeColorHover:S,closeColorPressed:L,closeIconColor:I,closeIconColorHover:D,closeIconColorPressed:W,closeIconSize:H,borderRadius:j,titleFontWeight:V,titleFontSize:E,padding:Y,iconSize:K,actionSpace:te,contentMargin:xe,closeSize:de,[h==="top"?"iconMarginIconTop":"iconMargin"]:ie,[h==="top"?"closeMarginIconTop":"closeMargin"]:F,[N("iconColor",v)]:B}}=u.value,q=yo(ie);return{"--n-font-size":x,"--n-icon-color":B,"--n-bezier":m,"--n-close-margin":F,"--n-icon-margin-top":q.top,"--n-icon-margin-right":q.right,"--n-icon-margin-bottom":q.bottom,"--n-icon-margin-left":q.left,"--n-icon-size":K,"--n-close-size":de,"--n-close-icon-size":H,"--n-close-border-radius":R,"--n-close-color-hover":S,"--n-close-color-pressed":L,"--n-close-icon-color":I,"--n-close-icon-color-hover":D,"--n-close-icon-color-pressed":W,"--n-color":z,"--n-text-color":k,"--n-border-radius":j,"--n-padding":Y,"--n-line-height":C,"--n-border":b,"--n-content-margin":xe,"--n-title-font-size":E,"--n-title-font-weight":V,"--n-title-text-color":_,"--n-action-space":te}}),p=r?We("dialog",$(()=>`${e.type[0]}${a.value[0]}`),f,e):void 0;return{mergedClsPrefix:t,rtlEnabled:l,mergedIconPlacement:a,mergedTheme:u,handlePositiveClick:s,handleNegativeClick:d,handleCloseClick:c,cssVars:r?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender}},render(){var e;const{bordered:o,mergedIconPlacement:t,cssVars:r,closable:n,showIcon:l,title:a,content:s,action:d,negativeText:c,positiveText:u,positiveButtonProps:f,negativeButtonProps:p,handlePositiveClick:v,handleNegativeClick:h,mergedTheme:m,loading:x,type:C,mergedClsPrefix:b}=this;(e=this.onRender)===null||e===void 0||e.call(this);const _=l?i(He,{clsPrefix:b,class:`${b}-dialog__icon`},{default:()=>je(this.$slots.icon,z=>z||(this.icon?Qe(this.icon):$p[this.type]()))}):null,k=je(this.$slots.action,z=>z||u||c||d?i("div",{class:`${b}-dialog__action`},z||(d?[Qe(d)]:[this.negativeText&&i(Bo,Object.assign({theme:m.peers.Button,themeOverrides:m.peerOverrides.Button,ghost:!0,size:"small",onClick:h},p),{default:()=>Qe(this.negativeText)}),this.positiveText&&i(Bo,Object.assign({theme:m.peers.Button,themeOverrides:m.peerOverrides.Button,size:"small",type:C==="default"?"primary":C,disabled:x,loading:x,onClick:v},f),{default:()=>Qe(this.positiveText)})])):null);return i("div",{class:[`${b}-dialog`,this.themeClass,this.closable&&`${b}-dialog--closable`,`${b}-dialog--icon-${t}`,o&&`${b}-dialog--bordered`,this.rtlEnabled&&`${b}-dialog--rtl`],style:r,role:"dialog"},n?je(this.$slots.close,z=>{const R=[`${b}-dialog__close`,this.rtlEnabled&&`${b}-dialog--rtl`];return z?i("div",{class:R},z):i(Pt,{clsPrefix:b,class:R,onClick:this.handleCloseClick})}):null,l&&t==="top"?i("div",{class:`${b}-dialog-icon-container`},_):null,i("div",{class:`${b}-dialog__title`},l&&t==="left"?_:null,ao(this.$slots.header,()=>[Qe(a)])),i("div",{class:[`${b}-dialog__content`,k?"":`${b}-dialog__content--last`]},ao(this.$slots.default,()=>[Qe(s)])),k)}}),Ta="n-dialog-provider",Oa="n-dialog-api",Rp="n-dialog-reactive-list",Fa=e=>{const{modalColor:o,textColor2:t,boxShadow3:r}=e;return{color:o,textColor:t,boxShadow:r}},Pp={name:"Modal",common:Ae,peers:{Scrollbar:Hr,Dialog:Pa,Card:ta},self:Fa},kp=Pp,Ip={name:"Modal",common:fe,peers:{Scrollbar:$o,Dialog:ka,Card:ra},self:Fa},Bp=Ip,En=Object.assign(Object.assign({},_n),Nr),Tp=wo(En),Op=Z({name:"ModalBody",inheritAttrs:!1,props:Object.assign(Object.assign({show:{type:Boolean,required:!0},preset:String,displayDirective:{type:String,required:!0},trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},blockScroll:Boolean},En),{renderMask:Function,onClickoutside:Function,onBeforeLeave:{type:Function,required:!0},onAfterLeave:{type:Function,required:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0},onClose:{type:Function,required:!0},onAfterEnter:Function,onEsc:Function}),setup(e){const o=M(null),t=M(null),r=M(e.show),n=M(null),l=M(null);Xe(ae(e,"show"),x=>{x&&(r.value=!0)}),ml($(()=>e.blockScroll&&r.value));const a=ze(hl);function s(){if(a.transformOriginRef.value==="center")return"";const{value:x}=n,{value:C}=l;if(x===null||C===null)return"";if(t.value){const b=t.value.containerScrollTop;return`${x}px ${C+b}px`}return""}function d(x){if(a.transformOriginRef.value==="center")return;const C=a.getMousePosition();if(!C||!t.value)return;const b=t.value.containerScrollTop,{offsetLeft:_,offsetTop:k}=x;if(C){const z=C.y,R=C.x;n.value=-(_-R),l.value=-(k-z-b)}x.style.transformOrigin=s()}function c(x){lo(()=>{d(x)})}function u(x){x.style.transformOrigin=s(),e.onBeforeLeave()}function f(){r.value=!1,n.value=null,l.value=null,e.onAfterLeave()}function p(){const{onClose:x}=e;x&&x()}function v(){e.onNegativeClick()}function h(){e.onPositiveClick()}const m=M(null);return Xe(m,x=>{x&&lo(()=>{const C=x.el;C&&o.value!==C&&(o.value=C)})}),De(pr,o),De(vr,null),De(Nt,null),{mergedTheme:a.mergedThemeRef,appear:a.appearRef,isMounted:a.isMountedRef,mergedClsPrefix:a.mergedClsPrefixRef,bodyRef:o,scrollbarRef:t,displayed:r,childNodeRef:m,handlePositiveClick:h,handleNegativeClick:v,handleCloseClick:p,handleAfterLeave:f,handleBeforeLeave:u,handleEnter:c}},render(){const{$slots:e,$attrs:o,handleEnter:t,handleAfterLeave:r,handleBeforeLeave:n,preset:l,mergedClsPrefix:a}=this;let s=null;if(!l){if(s=hn(e),!s){qo("modal","default slot is empty");return}s=nr(s),s.props=To({class:`${a}-modal`},o,s.props||{})}return this.displayDirective==="show"||this.displayed||this.show?Ho(i("div",{role:"none",class:`${a}-modal-body-wrapper`},i(gr,{ref:"scrollbarRef",theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar,contentClass:`${a}-modal-scroll-content`},{default:()=>{var d;return[(d=this.renderMask)===null||d===void 0?void 0:d.call(this),i(zn,{disabled:!this.trapFocus,active:this.show,onEsc:this.onEsc,autoFocus:this.autoFocus},{default:()=>{var c;return i(io,{name:"fade-in-scale-up-transition",appear:(c=this.appear)!==null&&c!==void 0?c:this.isMounted,onEnter:t,onAfterEnter:this.onAfterEnter,onAfterLeave:r,onBeforeLeave:n},{default:()=>{const u=[[Go,this.show]],{onClickoutside:f}=this;return f&&u.push([At,this.onClickoutside,void 0,{capture:!0}]),Ho(this.preset==="confirm"||this.preset==="dialog"?i(Ba,Object.assign({},this.$attrs,{class:[`${a}-modal`,this.$attrs.class],ref:"bodyRef",theme:this.mergedTheme.peers.Dialog,themeOverrides:this.mergedTheme.peerOverrides.Dialog},mo(this.$props,Ia),{"aria-modal":"true"}),e):this.preset==="card"?i(_f,Object.assign({},this.$attrs,{ref:"bodyRef",class:[`${a}-modal`,this.$attrs.class],theme:this.mergedTheme.peers.Card,themeOverrides:this.mergedTheme.peerOverrides.Card},mo(this.$props,Of),{"aria-modal":"true",role:"dialog"}),e):this.childNodeRef=s,u)}})}})]}})),[[Go,this.displayDirective==="if"||this.displayed||this.show]]):null}}),Fp=y([g("modal-container",`
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
height: 0;
|
|
|
width: 0;
|
|
|
display: flex;
|
|
|
`),g("modal-mask",`
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
background-color: rgba(0, 0, 0, .4);
|
|
|
`,[jt({enterDuration:".25s",leaveDuration:".25s",enterCubicBezier:"var(--n-bezier-ease-out)",leaveCubicBezier:"var(--n-bezier-ease-out)"})]),g("modal-body-wrapper",`
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
overflow: visible;
|
|
|
`,[g("modal-scroll-content",`
|
|
|
min-height: 100%;
|
|
|
display: flex;
|
|
|
position: relative;
|
|
|
`)]),g("modal",`
|
|
|
position: relative;
|
|
|
align-self: center;
|
|
|
color: var(--n-text-color);
|
|
|
margin: auto;
|
|
|
box-shadow: var(--n-box-shadow);
|
|
|
`,[ct({duration:".25s",enterScale:".5"})])]),_p=Object.assign(Object.assign(Object.assign(Object.assign({},se.props),{show:Boolean,unstableShowMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},preset:String,to:[String,Object],displayDirective:{type:String,default:"if"},transformOrigin:{type:String,default:"mouse"},zIndex:Number,autoFocus:{type:Boolean,default:!0},trapFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0}}),En),{onEsc:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onBeforeLeave:Function,onAfterLeave:Function,onClose:Function,onPositiveClick:Function,onNegativeClick:Function,onMaskClick:Function,internalDialog:Boolean,internalAppear:{type:Boolean,default:void 0},overlayStyle:[String,Object],onBeforeHide:Function,onAfterHide:Function,onHide:Function}),Mp=Z({name:"Modal",inheritAttrs:!1,props:_p,setup(e){const o=M(null),{mergedClsPrefixRef:t,namespaceRef:r,inlineThemeDisabled:n}=Ie(e),l=se("Modal","-modal",Fp,kp,e,t),a=tl(64),s=rl(),d=zt(),c=e.internalDialog?ze(Ta,null):null,u=bl();function f(z){const{onUpdateShow:R,"onUpdate:show":S,onHide:L}=e;R&&ce(R,z),S&&ce(S,z),L&&!z&&L(z)}function p(){const{onClose:z}=e;z?Promise.resolve(z()).then(R=>{R!==!1&&f(!1)}):f(!1)}function v(){const{onPositiveClick:z}=e;z?Promise.resolve(z()).then(R=>{R!==!1&&f(!1)}):f(!1)}function h(){const{onNegativeClick:z}=e;z?Promise.resolve(z()).then(R=>{R!==!1&&f(!1)}):f(!1)}function m(){const{onBeforeLeave:z,onBeforeHide:R}=e;z&&ce(z),R&&R()}function x(){const{onAfterLeave:z,onAfterHide:R}=e;z&&ce(z),R&&R()}function C(z){var R;const{onMaskClick:S}=e;S&&S(z),e.maskClosable&&!((R=o.value)===null||R===void 0)&&R.contains(rr(z))&&f(!1)}function b(z){var R;(R=e.onEsc)===null||R===void 0||R.call(e),e.show&&e.closeOnEsc&&ul(z)&&!u.value&&f(!1)}De(hl,{getMousePosition:()=>{if(c){const{clickedRef:z,clickPositionRef:R}=c;if(z.value&&R.value)return R.value}return a.value?s.value:null},mergedClsPrefixRef:t,mergedThemeRef:l,isMountedRef:d,appearRef:ae(e,"internalAppear"),transformOriginRef:ae(e,"transformOrigin")});const _=$(()=>{const{common:{cubicBezierEaseOut:z},self:{boxShadow:R,color:S,textColor:L}}=l.value;return{"--n-bezier-ease-out":z,"--n-box-shadow":R,"--n-color":S,"--n-text-color":L}}),k=n?We("theme-class",void 0,_,e):void 0;return{mergedClsPrefix:t,namespace:r,isMounted:d,containerRef:o,presetProps:$(()=>mo(e,Tp)),handleEsc:b,handleAfterLeave:x,handleClickoutside:C,handleBeforeLeave:m,doUpdateShow:f,handleNegativeClick:h,handlePositiveClick:v,handleCloseClick:p,cssVars:n?void 0:_,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender}},render(){const{mergedClsPrefix:e}=this;return i($n,{to:this.to,show:this.show},{default:()=>{var o;(o=this.onRender)===null||o===void 0||o.call(this);const{unstableShowMask:t}=this;return Ho(i("div",{role:"none",ref:"containerRef",class:[`${e}-modal-container`,this.themeClass,this.namespace],style:this.cssVars},i(Op,Object.assign({style:this.overlayStyle},this.$attrs,{ref:"bodyWrapper",displayDirective:this.displayDirective,show:this.show,preset:this.preset,autoFocus:this.autoFocus,trapFocus:this.trapFocus,blockScroll:this.blockScroll},this.presetProps,{onEsc:this.handleEsc,onClose:this.handleCloseClick,onNegativeClick:this.handleNegativeClick,onPositiveClick:this.handlePositiveClick,onBeforeLeave:this.handleBeforeLeave,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave,onClickoutside:t?void 0:this.handleClickoutside,renderMask:t?()=>{var r;return i(io,{name:"fade-in-transition",key:"mask",appear:(r=this.internalAppear)!==null&&r!==void 0?r:this.isMounted},{default:()=>this.show?i("div",{"aria-hidden":!0,ref:"containerRef",class:`${e}-modal-mask`,onClick:this.handleClickoutside}):null})}:void 0}),this.$slots)),[[Mr,{zIndex:this.zIndex,enabled:this.show}]])}})}}),Dp=Object.assign(Object.assign({},Nr),{onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function}),Lp=Z({name:"DialogEnvironment",props:Object.assign(Object.assign({},Dp),{internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}}),setup(e){const o=M(!0);function t(){const{onInternalAfterLeave:u,internalKey:f,onAfterLeave:p}=e;u&&u(f),p&&p()}function r(u){const{onPositiveClick:f}=e;f?Promise.resolve(f(u)).then(p=>{p!==!1&&d()}):d()}function n(u){const{onNegativeClick:f}=e;f?Promise.resolve(f(u)).then(p=>{p!==!1&&d()}):d()}function l(){const{onClose:u}=e;u?Promise.resolve(u()).then(f=>{f!==!1&&d()}):d()}function a(u){const{onMaskClick:f,maskClosable:p}=e;f&&(f(u),p&&d())}function s(){const{onEsc:u}=e;u&&u()}function d(){o.value=!1}function c(u){o.value=u}return{show:o,hide:d,handleUpdateShow:c,handleAfterLeave:t,handleCloseClick:l,handleNegativeClick:n,handlePositiveClick:r,handleMaskClick:a,handleEsc:s}},render(){const{handlePositiveClick:e,handleUpdateShow:o,handleNegativeClick:t,handleCloseClick:r,handleAfterLeave:n,handleMaskClick:l,handleEsc:a,to:s,maskClosable:d,show:c}=this;return i(Mp,{show:c,onUpdateShow:o,onMaskClick:l,onEsc:a,to:s,maskClosable:d,onAfterEnter:this.onAfterEnter,onAfterLeave:n,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,internalAppear:!0,internalDialog:!0},{default:()=>i(Ba,Object.assign({},mo(this.$props,Ia),{style:this.internalStyle,onClose:r,onNegativeClick:t,onPositiveClick:e}))})}}),Hp={injectionKey:String,to:[String,Object]},H1=Z({name:"DialogProvider",props:Hp,setup(){const e=M([]),o={};function t(s={}){const d=tt(),c=el(Object.assign(Object.assign({},s),{key:d,destroy:()=>{o[`n-dialog-${d}`].hide()}}));return e.value.push(c),c}const r=["info","success","warning","error"].map(s=>d=>t(Object.assign(Object.assign({},d),{type:s})));function n(s){const{value:d}=e;d.splice(d.findIndex(c=>c.key===s),1)}function l(){Object.values(o).forEach(s=>{s.hide()})}const a={create:t,destroyAll:l,info:r[0],success:r[1],warning:r[2],error:r[3]};return De(Oa,a),De(Ta,{clickedRef:tl(64),clickPositionRef:rl()}),De(Rp,e),Object.assign(Object.assign({},a),{dialogList:e,dialogInstRefs:o,handleAfterLeave:n})},render(){var e,o;return i(so,null,[this.dialogList.map(t=>i(Lp,Wt(t,["destroy","style"],{internalStyle:t.style,to:this.to,ref:r=>{r===null?delete this.dialogInstRefs[`n-dialog-${t.key}`]:this.dialogInstRefs[`n-dialog-${t.key}`]=r},internalKey:t.key,onInternalAfterLeave:this.handleAfterLeave}))),(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e)])}});function A1(){const e=ze(Oa,null);return e===null&&Wo("use-dialog","No outer <n-dialog-provider /> founded."),e}const _a=e=>{const{textColor1:o,dividerColor:t,fontWeightStrong:r}=e;return{textColor:o,color:t,fontWeight:r}},Ap={name:"Divider",common:Ae,self:_a},Ep=Ap,jp={name:"Divider",common:fe,self:_a},Wp=jp,Np=g("divider",`
|
|
|
position: relative;
|
|
|
display: flex;
|
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
|
font-size: 16px;
|
|
|
color: var(--n-text-color);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
`,[Ne("vertical",`
|
|
|
margin-top: 24px;
|
|
|
margin-bottom: 24px;
|
|
|
`,[Ne("no-title",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`)]),w("title",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin-left: 12px;
|
|
|
margin-right: 12px;
|
|
|
white-space: nowrap;
|
|
|
font-weight: var(--n-font-weight);
|
|
|
`),P("title-position-left",[w("line",[P("left",{width:"28px"})])]),P("title-position-right",[w("line",[P("right",{width:"28px"})])]),P("dashed",[w("line",`
|
|
|
background-color: #0000;
|
|
|
height: 0px;
|
|
|
width: 100%;
|
|
|
border-style: dashed;
|
|
|
border-width: 1px 0 0;
|
|
|
`)]),P("vertical",`
|
|
|
display: inline-block;
|
|
|
height: 1em;
|
|
|
margin: 0 8px;
|
|
|
vertical-align: middle;
|
|
|
width: 1px;
|
|
|
`),w("line",`
|
|
|
border: none;
|
|
|
transition: background-color .3s var(--n-bezier), border-color .3s var(--n-bezier);
|
|
|
height: 1px;
|
|
|
width: 100%;
|
|
|
margin: 0;
|
|
|
`),Ne("dashed",[w("line",{backgroundColor:"var(--n-color)"})]),P("dashed",[w("line",{borderColor:"var(--n-color)"})]),P("vertical",{backgroundColor:"var(--n-color)"})]),Vp=Object.assign(Object.assign({},se.props),{titlePlacement:{type:String,default:"center"},dashed:Boolean,vertical:Boolean}),E1=Z({name:"Divider",props:Vp,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Divider","-divider",Np,Ep,e,o),n=$(()=>{const{common:{cubicBezierEaseInOut:a},self:{color:s,textColor:d,fontWeight:c}}=r.value;return{"--n-bezier":a,"--n-color":s,"--n-text-color":d,"--n-font-weight":c}}),l=t?We("divider",void 0,n,e):void 0;return{mergedClsPrefix:o,cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{$slots:o,titlePlacement:t,vertical:r,dashed:n,cssVars:l,mergedClsPrefix:a}=this;return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{role:"separator",class:[`${a}-divider`,this.themeClass,{[`${a}-divider--vertical`]:r,[`${a}-divider--no-title`]:!o.default,[`${a}-divider--dashed`]:n,[`${a}-divider--title-position-${t}`]:o.default&&t}],style:l},r?null:i("div",{class:`${a}-divider__line ${a}-divider__line--left`}),!r&&o.default?i(so,null,i("div",{class:`${a}-divider__title`},this.$slots),i("div",{class:`${a}-divider__line ${a}-divider__line--right`})):null)}}),Ma=e=>{const{modalColor:o,textColor1:t,textColor2:r,boxShadow3:n,lineHeight:l,fontWeightStrong:a,dividerColor:s,closeColorHover:d,closeColorPressed:c,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,borderRadius:v,primaryColorHover:h}=e;return{bodyPadding:"16px 24px",headerPadding:"16px 24px",footerPadding:"16px 24px",color:o,textColor:r,titleTextColor:t,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:l,headerBorderBottom:`1px solid ${s}`,footerBorderTop:`1px solid ${s}`,closeIconColor:u,closeIconColorHover:f,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:d,closeColorPressed:c,closeBorderRadius:v,resizableTriggerColorHover:h}},Up={name:"Drawer",common:Ae,peers:{Scrollbar:Hr},self:Ma},Kp=Up,Gp={name:"Drawer",common:fe,peers:{Scrollbar:$o},self:Ma},qp=Gp,Yp=Z({name:"NDrawerContent",inheritAttrs:!1,props:{blockScroll:Boolean,show:{type:Boolean,default:void 0},displayDirective:{type:String,required:!0},placement:{type:String,required:!0},contentClass:String,contentStyle:[Object,String],nativeScrollbar:{type:Boolean,required:!0},scrollbarProps:Object,trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},showMask:{type:[Boolean,String],required:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,onClickoutside:Function,onAfterLeave:Function,onAfterEnter:Function,onEsc:Function},setup(e){const o=M(!!e.show),t=M(null),r=ze(In);let n=0,l="",a=null;const s=M(!1),d=M(!1),c=$(()=>e.placement==="top"||e.placement==="bottom"),{mergedClsPrefixRef:u,mergedRtlRef:f}=Ie(e),p=eo("Drawer",f,u),v=I=>{d.value=!0,n=c.value?I.clientY:I.clientX,l=document.body.style.cursor,document.body.style.cursor=c.value?"ns-resize":"ew-resize",document.body.addEventListener("mousemove",k),document.body.addEventListener("mouseleave",R),document.body.addEventListener("mouseup",z)},h=()=>{a!==null&&(window.clearTimeout(a),a=null),d.value?s.value=!0:a=window.setTimeout(()=>{s.value=!0},300)},m=()=>{a!==null&&(window.clearTimeout(a),a=null),s.value=!1},{doUpdateHeight:x,doUpdateWidth:C}=r,b=I=>{const{maxWidth:D}=e;if(D&&I>D)return D;const{minWidth:W}=e;return W&&I<W?W:I},_=I=>{const{maxHeight:D}=e;if(D&&I>D)return D;const{minHeight:W}=e;return W&&I<W?W:I},k=I=>{var D,W;if(d.value)if(c.value){let H=((D=t.value)===null||D===void 0?void 0:D.offsetHeight)||0;const j=n-I.clientY;H+=e.placement==="bottom"?j:-j,H=_(H),x(H),n=I.clientY}else{let H=((W=t.value)===null||W===void 0?void 0:W.offsetWidth)||0;const j=n-I.clientX;H+=e.placement==="right"?j:-j,H=b(H),C(H),n=I.clientX}},z=()=>{d.value&&(n=0,d.value=!1,document.body.style.cursor=l,document.body.removeEventListener("mousemove",k),document.body.removeEventListener("mouseup",z),document.body.removeEventListener("mouseleave",R))},R=z;oo(()=>{e.show&&(o.value=!0)}),Xe(()=>e.show,I=>{I||z()}),So(()=>{z()});const S=$(()=>{const{show:I}=e,D=[[Go,I]];return e.showMask||D.push([At,e.onClickoutside,void 0,{capture:!0}]),D});function L(){var I;o.value=!1,(I=e.onAfterLeave)===null||I===void 0||I.call(e)}return ml($(()=>e.blockScroll&&o.value)),De(vr,t),De(Nt,null),De(pr,null),{bodyRef:t,rtlEnabled:p,mergedClsPrefix:r.mergedClsPrefixRef,isMounted:r.isMountedRef,mergedTheme:r.mergedThemeRef,displayed:o,transitionName:$(()=>({right:"slide-in-from-right-transition",left:"slide-in-from-left-transition",top:"slide-in-from-top-transition",bottom:"slide-in-from-bottom-transition"})[e.placement]),handleAfterLeave:L,bodyDirectives:S,handleMousedownResizeTrigger:v,handleMouseenterResizeTrigger:h,handleMouseleaveResizeTrigger:m,isDragging:d,isHoverOnResizeTrigger:s}},render(){const{$slots:e,mergedClsPrefix:o}=this;return this.displayDirective==="show"||this.displayed||this.show?Ho(i("div",{role:"none"},i(zn,{disabled:!this.showMask||!this.trapFocus,active:this.show,autoFocus:this.autoFocus,onEsc:this.onEsc},{default:()=>i(io,{name:this.transitionName,appear:this.isMounted,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave},{default:()=>Ho(i("div",To(this.$attrs,{role:"dialog",ref:"bodyRef","aria-modal":"true",class:[`${o}-drawer`,this.rtlEnabled&&`${o}-drawer--rtl`,`${o}-drawer--${this.placement}-placement`,this.isDragging&&`${o}-drawer--unselectable`,this.nativeScrollbar&&`${o}-drawer--native-scrollbar`]}),[this.resizable?i("div",{class:[`${o}-drawer__resize-trigger`,(this.isDragging||this.isHoverOnResizeTrigger)&&`${o}-drawer__resize-trigger--hover`],onMouseenter:this.handleMouseenterResizeTrigger,onMouseleave:this.handleMouseleaveResizeTrigger,onMousedown:this.handleMousedownResizeTrigger}):null,this.nativeScrollbar?i("div",{class:[`${o}-drawer-content-wrapper`,this.contentClass],style:this.contentStyle,role:"none"},e):i(gr,Object.assign({},this.scrollbarProps,{contentStyle:this.contentStyle,contentClass:[`${o}-drawer-content-wrapper`,this.contentClass],theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar}),e)]),this.bodyDirectives)})})),[[Go,this.displayDirective==="if"||this.displayed||this.show]]):null}}),{cubicBezierEaseIn:Xp,cubicBezierEaseOut:Zp}=zo;function Qp({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-right"}={}){return[y(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${Xp}`}),y(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${Zp}`}),y(`&.${t}-transition-enter-to`,{transform:"translateX(0)"}),y(`&.${t}-transition-enter-from`,{transform:"translateX(100%)"}),y(`&.${t}-transition-leave-from`,{transform:"translateX(0)"}),y(`&.${t}-transition-leave-to`,{transform:"translateX(100%)"})]}const{cubicBezierEaseIn:Jp,cubicBezierEaseOut:ev}=zo;function ov({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-left"}={}){return[y(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${Jp}`}),y(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${ev}`}),y(`&.${t}-transition-enter-to`,{transform:"translateX(0)"}),y(`&.${t}-transition-enter-from`,{transform:"translateX(-100%)"}),y(`&.${t}-transition-leave-from`,{transform:"translateX(0)"}),y(`&.${t}-transition-leave-to`,{transform:"translateX(-100%)"})]}const{cubicBezierEaseIn:tv,cubicBezierEaseOut:rv}=zo;function nv({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-top"}={}){return[y(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${tv}`}),y(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${rv}`}),y(`&.${t}-transition-enter-to`,{transform:"translateY(0)"}),y(`&.${t}-transition-enter-from`,{transform:"translateY(-100%)"}),y(`&.${t}-transition-leave-from`,{transform:"translateY(0)"}),y(`&.${t}-transition-leave-to`,{transform:"translateY(-100%)"})]}const{cubicBezierEaseIn:iv,cubicBezierEaseOut:lv}=zo;function av({duration:e="0.3s",leaveDuration:o="0.2s",name:t="slide-in-from-bottom"}={}){return[y(`&.${t}-transition-leave-active`,{transition:`transform ${o} ${iv}`}),y(`&.${t}-transition-enter-active`,{transition:`transform ${e} ${lv}`}),y(`&.${t}-transition-enter-to`,{transform:"translateY(0)"}),y(`&.${t}-transition-enter-from`,{transform:"translateY(100%)"}),y(`&.${t}-transition-leave-from`,{transform:"translateY(0)"}),y(`&.${t}-transition-leave-to`,{transform:"translateY(100%)"})]}const sv=y([g("drawer",`
|
|
|
word-break: break-word;
|
|
|
line-height: var(--n-line-height);
|
|
|
position: absolute;
|
|
|
pointer-events: all;
|
|
|
box-shadow: var(--n-box-shadow);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
background-color: var(--n-color);
|
|
|
color: var(--n-text-color);
|
|
|
box-sizing: border-box;
|
|
|
`,[Qp(),ov(),nv(),av(),P("unselectable",`
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
`),P("native-scrollbar",[g("drawer-content-wrapper",`
|
|
|
overflow: auto;
|
|
|
height: 100%;
|
|
|
`)]),w("resize-trigger",`
|
|
|
position: absolute;
|
|
|
background-color: #0000;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
`,[P("hover",`
|
|
|
background-color: var(--n-resize-trigger-color-hover);
|
|
|
`)]),g("drawer-content-wrapper",`
|
|
|
box-sizing: border-box;
|
|
|
`),g("drawer-content",`
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
`,[P("native-scrollbar",[g("drawer-body-content-wrapper",`
|
|
|
height: 100%;
|
|
|
overflow: auto;
|
|
|
`)]),g("drawer-body",`
|
|
|
flex: 1 0 0;
|
|
|
overflow: hidden;
|
|
|
`),g("drawer-body-content-wrapper",`
|
|
|
box-sizing: border-box;
|
|
|
padding: var(--n-body-padding);
|
|
|
`),g("drawer-header",`
|
|
|
font-weight: var(--n-title-font-weight);
|
|
|
line-height: 1;
|
|
|
font-size: var(--n-title-font-size);
|
|
|
color: var(--n-title-text-color);
|
|
|
padding: var(--n-header-padding);
|
|
|
transition: border .3s var(--n-bezier);
|
|
|
border-bottom: 1px solid var(--n-divider-color);
|
|
|
border-bottom: var(--n-header-border-bottom);
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
`,[w("close",`
|
|
|
margin-left: 6px;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`)]),g("drawer-footer",`
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
border-top: var(--n-footer-border-top);
|
|
|
transition: border .3s var(--n-bezier);
|
|
|
padding: var(--n-footer-padding);
|
|
|
`)]),P("right-placement",`
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
`,[w("resize-trigger",`
|
|
|
width: 3px;
|
|
|
height: 100%;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
transform: translateX(-1.5px);
|
|
|
cursor: ew-resize;
|
|
|
`)]),P("left-placement",`
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
`,[w("resize-trigger",`
|
|
|
width: 3px;
|
|
|
height: 100%;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
transform: translateX(1.5px);
|
|
|
cursor: ew-resize;
|
|
|
`)]),P("top-placement",`
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
`,[w("resize-trigger",`
|
|
|
width: 100%;
|
|
|
height: 3px;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
transform: translateY(1.5px);
|
|
|
cursor: ns-resize;
|
|
|
`)]),P("bottom-placement",`
|
|
|
left: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
`,[w("resize-trigger",`
|
|
|
width: 100%;
|
|
|
height: 3px;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
transform: translateY(-1.5px);
|
|
|
cursor: ns-resize;
|
|
|
`)])]),y("body",[y(">",[g("drawer-container",{position:"fixed"})])]),g("drawer-container",`
|
|
|
position: relative;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
pointer-events: none;
|
|
|
`,[y("> *",{pointerEvents:"all"})]),g("drawer-mask",`
|
|
|
background-color: rgba(0, 0, 0, .3);
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
`,[P("invisible",`
|
|
|
background-color: rgba(0, 0, 0, 0)
|
|
|
`),jt({enterDuration:"0.2s",leaveDuration:"0.2s",enterCubicBezier:"var(--n-bezier-in)",leaveCubicBezier:"var(--n-bezier-out)"})])]),dv=Object.assign(Object.assign({},se.props),{show:Boolean,width:[Number,String],height:[Number,String],placement:{type:String,default:"right"},maskClosable:{type:Boolean,default:!0},showMask:{type:[Boolean,String],default:!0},to:[String,Object],displayDirective:{type:String,default:"if"},nativeScrollbar:{type:Boolean,default:!0},zIndex:Number,onMaskClick:Function,scrollbarProps:Object,contentClass:String,contentStyle:[Object,String],trapFocus:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},maxWidth:Number,maxHeight:Number,minWidth:Number,minHeight:Number,resizable:Boolean,defaultWidth:{type:[Number,String],default:251},defaultHeight:{type:[Number,String],default:251},onUpdateWidth:[Function,Array],onUpdateHeight:[Function,Array],"onUpdate:width":[Function,Array],"onUpdate:height":[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onAfterLeave:Function,drawerStyle:[String,Object],drawerClass:String,target:null,onShow:Function,onHide:Function}),j1=Z({name:"Drawer",inheritAttrs:!1,props:dv,setup(e){const{mergedClsPrefixRef:o,namespaceRef:t,inlineThemeDisabled:r}=Ie(e),n=zt(),l=se("Drawer","-drawer",sv,Kp,e,o),a=M(e.defaultWidth),s=M(e.defaultHeight),d=co(ae(e,"width"),a),c=co(ae(e,"height"),s),u=$(()=>{const{placement:R}=e;return R==="top"||R==="bottom"?"":ro(d.value)}),f=$(()=>{const{placement:R}=e;return R==="left"||R==="right"?"":ro(c.value)}),p=R=>{const{onUpdateWidth:S,"onUpdate:width":L}=e;S&&ce(S,R),L&&ce(L,R),a.value=R},v=R=>{const{onUpdateHeight:S,"onUpdate:width":L}=e;S&&ce(S,R),L&&ce(L,R),s.value=R},h=$(()=>[{width:u.value,height:f.value},e.drawerStyle||""]);function m(R){const{onMaskClick:S,maskClosable:L}=e;L&&_(!1),S&&S(R)}function x(R){m(R)}const C=bl();function b(R){var S;(S=e.onEsc)===null||S===void 0||S.call(e),e.show&&e.closeOnEsc&&ul(R)&&!C.value&&_(!1)}function _(R){const{onHide:S,onUpdateShow:L,"onUpdate:show":I}=e;L&&ce(L,R),I&&ce(I,R),S&&!R&&ce(S,R)}De(In,{isMountedRef:n,mergedThemeRef:l,mergedClsPrefixRef:o,doUpdateShow:_,doUpdateHeight:v,doUpdateWidth:p});const k=$(()=>{const{common:{cubicBezierEaseInOut:R,cubicBezierEaseIn:S,cubicBezierEaseOut:L},self:{color:I,textColor:D,boxShadow:W,lineHeight:H,headerPadding:j,footerPadding:V,bodyPadding:E,titleFontSize:Y,titleTextColor:K,titleFontWeight:te,headerBorderBottom:xe,footerBorderTop:de,closeIconColor:ie,closeIconColorHover:F,closeIconColorPressed:B,closeColorHover:q,closeColorPressed:ee,closeIconSize:be,closeSize:me,closeBorderRadius:Be,resizableTriggerColorHover:T}}=l.value;return{"--n-line-height":H,"--n-color":I,"--n-text-color":D,"--n-box-shadow":W,"--n-bezier":R,"--n-bezier-out":L,"--n-bezier-in":S,"--n-header-padding":j,"--n-body-padding":E,"--n-footer-padding":V,"--n-title-text-color":K,"--n-title-font-size":Y,"--n-title-font-weight":te,"--n-header-border-bottom":xe,"--n-footer-border-top":de,"--n-close-icon-color":ie,"--n-close-icon-color-hover":F,"--n-close-icon-color-pressed":B,"--n-close-size":me,"--n-close-color-hover":q,"--n-close-color-pressed":ee,"--n-close-icon-size":be,"--n-close-border-radius":Be,"--n-resize-trigger-color-hover":T}}),z=r?We("drawer",void 0,k,e):void 0;return{mergedClsPrefix:o,namespace:t,mergedBodyStyle:h,handleOutsideClick:x,handleMaskClick:m,handleEsc:b,mergedTheme:l,cssVars:r?void 0:k,themeClass:z==null?void 0:z.themeClass,onRender:z==null?void 0:z.onRender,isMounted:n}},render(){const{mergedClsPrefix:e}=this;return i($n,{to:this.to,show:this.show},{default:()=>{var o;return(o=this.onRender)===null||o===void 0||o.call(this),Ho(i("div",{class:[`${e}-drawer-container`,this.namespace,this.themeClass],style:this.cssVars,role:"none"},this.showMask?i(io,{name:"fade-in-transition",appear:this.isMounted},{default:()=>this.show?i("div",{"aria-hidden":!0,class:[`${e}-drawer-mask`,this.showMask==="transparent"&&`${e}-drawer-mask--invisible`],onClick:this.handleMaskClick}):null}):null,i(Yp,Object.assign({},this.$attrs,{class:[this.drawerClass,this.$attrs.class],style:[this.mergedBodyStyle,this.$attrs.style],blockScroll:this.blockScroll,contentStyle:this.contentStyle,contentClass:this.contentClass,placement:this.placement,scrollbarProps:this.scrollbarProps,show:this.show,displayDirective:this.displayDirective,nativeScrollbar:this.nativeScrollbar,onAfterEnter:this.onAfterEnter,onAfterLeave:this.onAfterLeave,trapFocus:this.trapFocus,autoFocus:this.autoFocus,resizable:this.resizable,maxHeight:this.maxHeight,minHeight:this.minHeight,maxWidth:this.maxWidth,minWidth:this.minWidth,showMask:this.showMask,onEsc:this.handleEsc,onClickoutside:this.handleOutsideClick}),this.$slots)),[[Mr,{zIndex:this.zIndex,enabled:this.show}]])}})}}),cv={title:String,headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],bodyClass:String,bodyStyle:[Object,String],bodyContentClass:String,bodyContentStyle:[Object,String],nativeScrollbar:{type:Boolean,default:!0},scrollbarProps:Object,closable:Boolean},W1=Z({name:"DrawerContent",props:cv,setup(){const e=ze(In,null);e||Wo("drawer-content","`n-drawer-content` must be placed inside `n-drawer`.");const{doUpdateShow:o}=e;function t(){o(!1)}return{handleCloseClick:t,mergedTheme:e.mergedThemeRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{title:e,mergedClsPrefix:o,nativeScrollbar:t,mergedTheme:r,bodyClass:n,bodyStyle:l,bodyContentClass:a,bodyContentStyle:s,headerClass:d,headerStyle:c,footerClass:u,footerStyle:f,scrollbarProps:p,closable:v,$slots:h}=this;return i("div",{role:"none",class:[`${o}-drawer-content`,t&&`${o}-drawer-content--native-scrollbar`]},h.header||e||v?i("div",{class:[`${o}-drawer-header`,d],style:c,role:"none"},i("div",{class:`${o}-drawer-header__main`,role:"heading","aria-level":"1"},h.header!==void 0?h.header():e),v&&i(Pt,{onClick:this.handleCloseClick,clsPrefix:o,class:`${o}-drawer-header__close`,absolute:!0})):null,t?i("div",{class:[`${o}-drawer-body`,n],style:l,role:"none"},i("div",{class:[`${o}-drawer-body-content-wrapper`,a],style:s,role:"none"},h)):i(gr,Object.assign({themeOverrides:r.peerOverrides.Scrollbar,theme:r.peers.Scrollbar},p,{class:`${o}-drawer-body`,contentClass:[`${o}-drawer-body-content-wrapper`,a],contentStyle:s}),h),h.footer?i("div",{class:[`${o}-drawer-footer`,u],style:f,role:"none"},h.footer()):null)}}),Da={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},uv={name:"DynamicInput",common:fe,peers:{Input:Ao,Button:Ro},self(){return Da}},fv=uv,hv=()=>Da,pv={name:"DynamicInput",common:Ae,peers:{Input:xr,Button:Yt},self:hv},vv=pv,jn="n-dynamic-input",gv=Z({name:"DynamicInputInputPreset",props:{clsPrefix:{type:String,required:!0},value:{type:String,default:""},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){const{mergedThemeRef:e,placeholderRef:o}=ze(jn);return{mergedTheme:e,placeholder:o}},render(){const{mergedTheme:e,placeholder:o,value:t,clsPrefix:r,onUpdateValue:n,disabled:l}=this;return i("div",{class:`${r}-dynamic-input-preset-input`},i(St,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:t,placeholder:o,onUpdateValue:n,disabled:l}))}}),mv=Z({name:"DynamicInputPairPreset",props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:"",value:""})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(e){const{mergedThemeRef:o,keyPlaceholderRef:t,valuePlaceholderRef:r}=ze(jn);return{mergedTheme:o,keyPlaceholder:t,valuePlaceholder:r,handleKeyInput(n){e.onUpdateValue({key:n,value:e.value.value})},handleValueInput(n){e.onUpdateValue({key:e.value.key,value:n})}}},render(){const{mergedTheme:e,keyPlaceholder:o,valuePlaceholder:t,value:r,clsPrefix:n,disabled:l}=this;return i("div",{class:`${n}-dynamic-input-preset-pair`},i(St,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.key,class:`${n}-dynamic-input-pair-input`,placeholder:o,onUpdateValue:this.handleKeyInput,disabled:l}),i(St,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.value,class:`${n}-dynamic-input-pair-input`,placeholder:t,onUpdateValue:this.handleValueInput,disabled:l}))}}),bv=g("dynamic-input",{width:"100%"},[g("dynamic-input-item",`
|
|
|
margin-bottom: 10px;
|
|
|
display: flex;
|
|
|
flex-wrap: nowrap;
|
|
|
`,[g("dynamic-input-preset-input",{flex:1,alignItems:"center"}),g("dynamic-input-preset-pair",`
|
|
|
flex: 1;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[g("dynamic-input-pair-input",[y("&:first-child",{"margin-right":"12px"})])]),w("action",`
|
|
|
align-self: flex-start;
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
flex-shrink: 0;
|
|
|
flex-grow: 0;
|
|
|
margin: var(--action-margin);
|
|
|
`,[P("icon",{cursor:"pointer"})]),y("&:last-child",{marginBottom:0})]),g("form-item",`
|
|
|
padding-top: 0 !important;
|
|
|
margin-right: 0 !important;
|
|
|
`,[g("form-item-blank",{paddingTop:"0 !important"})])]),zr=new WeakMap,xv=Object.assign(Object.assign({},se.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:"input"},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:""},valuePlaceholder:{type:String,default:""},placeholder:{type:String,default:""},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),N1=Z({name:"DynamicInput",props:xv,setup(e,{slots:o}){const{mergedComponentPropsRef:t,mergedClsPrefixRef:r,mergedRtlRef:n,inlineThemeDisabled:l}=Ie(),a=ze(Ir,null),s=M(e.defaultValue),d=ae(e,"value"),c=co(d,s),u=se("DynamicInput","-dynamic-input",bv,vv,e,r),f=$(()=>{const{value:I}=c;if(Array.isArray(I)){const{max:D}=e;return D!==void 0&&I.length>=D}return!1}),p=$(()=>{const{value:I}=c;return Array.isArray(I)?I.length<=e.min:!0}),v=$(()=>{var I,D;return(D=(I=t==null?void 0:t.value)===null||I===void 0?void 0:I.DynamicInput)===null||D===void 0?void 0:D.buttonSize});function h(I){const{onInput:D,"onUpdate:value":W,onUpdateValue:H}=e;D&&ce(D,I),W&&ce(W,I),H&&ce(H,I),s.value=I}function m(I,D){if(I==null||typeof I!="object")return D;const W=qr(I)?Yr(I):I;let H=zr.get(W);return H===void 0&&zr.set(W,H=tt()),H}function x(I,D){const{value:W}=c,H=Array.from(W??[]),j=H[I];if(H[I]=D,j&&D&&typeof j=="object"&&typeof D=="object"){const V=qr(j)?Yr(j):j,E=qr(D)?Yr(D):D,Y=zr.get(V);Y!==void 0&&zr.set(E,Y)}h(H)}function C(){b(-1)}function b(I){const{value:D}=c,{onCreate:W}=e,H=Array.from(D??[]);if(W)H.splice(I+1,0,W(I+1)),h(H);else if(o.default)H.splice(I+1,0,null),h(H);else switch(e.preset){case"input":H.splice(I+1,0,""),h(H);break;case"pair":H.splice(I+1,0,{key:"",value:""}),h(H);break}}function _(I){const{value:D}=c;if(!Array.isArray(D))return;const{min:W}=e;if(D.length<=W)return;const{onRemove:H}=e;H&&H(I);const j=Array.from(D);j.splice(I,1),h(j)}function k(I,D,W){if(D<0||W<0||D>=I.length||W>=I.length||D===W)return;const H=I[D];I[D]=I[W],I[W]=H}function z(I,D){const{value:W}=c;if(!Array.isArray(W))return;const H=Array.from(W);I==="up"&&k(H,D,D-1),I==="down"&&k(H,D,D+1),h(H)}De(jn,{mergedThemeRef:u,keyPlaceholderRef:ae(e,"keyPlaceholder"),valuePlaceholderRef:ae(e,"valuePlaceholder"),placeholderRef:ae(e,"placeholder")});const R=eo("DynamicInput",n,r),S=$(()=>{const{self:{actionMargin:I,actionMarginRtl:D}}=u.value;return{"--action-margin":I,"--action-margin-rtl":D}}),L=l?We("dynamic-input",void 0,S,e):void 0;return{locale:Yo("DynamicInput").localeRef,rtlEnabled:R,buttonSize:v,mergedClsPrefix:r,NFormItem:a,uncontrolledValue:s,mergedValue:c,insertionDisabled:f,removeDisabled:p,handleCreateClick:C,ensureKey:m,handleValueChange:x,remove:_,move:z,createItem:b,mergedTheme:u,cssVars:l?void 0:S,themeClass:L==null?void 0:L.themeClass,onRender:L==null?void 0:L.onRender}},render(){const{$slots:e,itemClass:o,buttonSize:t,mergedClsPrefix:r,mergedValue:n,locale:l,mergedTheme:a,keyField:s,itemStyle:d,preset:c,showSortButton:u,NFormItem:f,ensureKey:p,handleValueChange:v,remove:h,createItem:m,move:x,onRender:C,disabled:b}=this;return C==null||C(),i("div",{class:[`${r}-dynamic-input`,this.rtlEnabled&&`${r}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(n)||n.length===0?i(Bo,Object.assign({block:!0,ghost:!0,dashed:!0,size:t},this.createButtonProps,{disabled:this.insertionDisabled||b,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>ao(e["create-button-default"],()=>[l.create]),icon:()=>ao(e["create-button-icon"],()=>[i(He,{clsPrefix:r},{default:()=>i(sr,null)})])}):n.map((_,k)=>i("div",{key:s?_[s]:p(_,k),"data-key":s?_[s]:p(_,k),class:[`${r}-dynamic-input-item`,o],style:d},pn(e.default,{value:n[k],index:k},()=>[c==="input"?i(gv,{disabled:b,clsPrefix:r,value:n[k],parentPath:f?f.path.value:void 0,path:f!=null&&f.path.value?`${f.path.value}[${k}]`:void 0,onUpdateValue:z=>{v(k,z)}}):c==="pair"?i(mv,{disabled:b,clsPrefix:r,value:n[k],parentPath:f?f.path.value:void 0,path:f!=null&&f.path.value?`${f.path.value}[${k}]`:void 0,onUpdateValue:z=>{v(k,z)}}):null]),pn(e.action,{value:n[k],index:k,create:m,remove:h,move:x},()=>[i("div",{class:`${r}-dynamic-input-item__action`},i(Cf,{size:t},{default:()=>[i(Bo,{disabled:this.removeDisabled||b,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,circle:!0,onClick:()=>{h(k)}},{icon:()=>i(He,{clsPrefix:r},{default:()=>i(wl,null)})}),i(Bo,{disabled:this.insertionDisabled||b,circle:!0,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:()=>{m(k)}},{icon:()=>i(He,{clsPrefix:r},{default:()=>i(sr,null)})}),u?i(Bo,{disabled:k===0||b,circle:!0,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:()=>{x("up",k)}},{icon:()=>i(He,{clsPrefix:r},{default:()=>i(qd,null)})}):null,u?i(Bo,{disabled:k===n.length-1||b,circle:!0,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:()=>{x("down",k)}},{icon:()=>i(He,{clsPrefix:r},{default:()=>i(Gd,null)})}):null]}))]))))}}),La={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},Cv={name:"Space",self(){return La}},Ha=Cv,yv=()=>La,wv={name:"Space",self:yv},Sv=wv;let ln;const zv=()=>{if(!No)return!0;if(ln===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const o=e.scrollHeight===1;return document.body.removeChild(e),ln=o}return ln},$v=Object.assign(Object.assign({},se.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),V1=Z({name:"Space",props:$v,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=Ie(e),r=se("Space","-space",void 0,Sv,e,o),n=eo("Space",t,o);return{useGap:zv(),rtlEnabled:n,mergedClsPrefix:o,margin:$(()=>{const{size:l}=e;if(Array.isArray(l))return{horizontal:l[0],vertical:l[1]};if(typeof l=="number")return{horizontal:l,vertical:l};const{self:{[N("gap",l)]:a}}=r.value,{row:s,col:d}=ld(a);return{horizontal:ko(d),vertical:ko(s)}})}},render(){const{vertical:e,reverse:o,align:t,inline:r,justify:n,itemClass:l,itemStyle:a,margin:s,wrap:d,mergedClsPrefix:c,rtlEnabled:u,useGap:f,wrapItem:p,internalUseGap:v}=this,h=ot(Rn(this),!1);if(!h.length)return null;const m=`${s.horizontal}px`,x=`${s.horizontal/2}px`,C=`${s.vertical}px`,b=`${s.vertical/2}px`,_=h.length-1,k=n.startsWith("space-");return i("div",{role:"none",class:[`${c}-space`,u&&`${c}-space--rtl`],style:{display:r?"inline-flex":"flex",flexDirection:e&&!o?"column":e&&o?"column-reverse":!e&&o?"row-reverse":"row",justifyContent:["start","end"].includes(n)?"flex-"+n:n,flexWrap:!d||e?"nowrap":"wrap",marginTop:f||e?"":`-${b}`,marginBottom:f||e?"":`-${b}`,alignItems:t,gap:f?`${s.vertical}px ${s.horizontal}px`:""}},!p&&(f||v)?h:h.map((z,R)=>z.type===wn?z:i("div",{role:"none",class:l,style:[a,{maxWidth:"100%"},f?"":e?{marginBottom:R!==_?C:""}:u?{marginLeft:k?n==="space-between"&&R===_?"":x:R!==_?m:"",marginRight:k?n==="space-between"&&R===0?"":x:"",paddingTop:b,paddingBottom:b}:{marginRight:k?n==="space-between"&&R===_?"":x:R!==_?m:"",marginLeft:k?n==="space-between"&&R===0?"":x:"",paddingTop:b,paddingBottom:b}]},z)))}}),Rv={name:"DynamicTags",common:fe,peers:{Input:Ao,Button:Ro,Tag:Ml,Space:Ha},self(){return{inputWidth:"64px"}}},Pv=Rv,kv={name:"Element",common:fe},Iv=kv,Bv={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},Tv={name:"Flex",self(){return Bv}},Ov=Tv,Fv={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"},Aa=e=>{const{heightSmall:o,heightMedium:t,heightLarge:r,textColor1:n,errorColor:l,warningColor:a,lineHeight:s,textColor3:d}=e;return Object.assign(Object.assign({},Fv),{blankHeightSmall:o,blankHeightMedium:t,blankHeightLarge:r,lineHeight:s,labelTextColor:n,asteriskColor:l,feedbackTextColorError:l,feedbackTextColorWarning:a,feedbackTextColor:d})},_v={name:"Form",common:Ae,self:Aa},Ea=_v,Mv={name:"Form",common:fe,self:Aa},Dv=Mv,Lv=g("form",[P("inline",`
|
|
|
width: 100%;
|
|
|
display: inline-flex;
|
|
|
align-items: flex-start;
|
|
|
align-content: space-around;
|
|
|
`,[g("form-item",{width:"auto",marginRight:"18px"},[y("&:last-child",{marginRight:0})])])]),Cr="n-form",ja="n-form-item-insts";var Hv=function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const Av=Object.assign(Object.assign({},se.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}),U1=Z({name:"Form",props:Av,setup(e){const{mergedClsPrefixRef:o}=Ie(e);se("Form","-form",Lv,Ea,e,o);const t={},r=M(void 0),n=d=>{const c=r.value;(c===void 0||d>=c)&&(r.value=d)};function l(d,c=()=>!0){return Hv(this,void 0,void 0,function*(){return yield new Promise((u,f)=>{const p=[];for(const v of wo(t)){const h=t[v];for(const m of h)m.path&&p.push(m.internalValidate(null,c))}Promise.all(p).then(v=>{const h=v.some(C=>!C.valid),m=[],x=[];v.forEach(C=>{var b,_;!((b=C.errors)===null||b===void 0)&&b.length&&m.push(C.errors),!((_=C.warnings)===null||_===void 0)&&_.length&&x.push(C.warnings)}),d&&d(m.length?m:void 0,{warnings:x.length?x:void 0}),h?f(m.length?m:void 0):u({warnings:x.length?x:void 0})})})})}function a(){for(const d of wo(t)){const c=t[d];for(const u of c)u.restoreValidation()}}return De(Cr,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:n}),De(ja,{formItems:t}),Object.assign({validate:l,restoreValidation:a},{mergedClsPrefix:o})},render(){const{mergedClsPrefix:e}=this;return i("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ev(e){const o=ze(Cr,null);return{mergedSize:$(()=>e.size!==void 0?e.size:(o==null?void 0:o.props.size)!==void 0?o.props.size:"medium")}}function jv(e){const o=ze(Cr,null),t=$(()=>{const{labelPlacement:h}=e;return h!==void 0?h:o!=null&&o.props.labelPlacement?o.props.labelPlacement:"top"}),r=$(()=>t.value==="left"&&(e.labelWidth==="auto"||(o==null?void 0:o.props.labelWidth)==="auto")),n=$(()=>{if(t.value==="top")return;const{labelWidth:h}=e;if(h!==void 0&&h!=="auto")return ro(h);if(r.value){const m=o==null?void 0:o.maxChildLabelWidthRef.value;return m!==void 0?ro(m):void 0}if((o==null?void 0:o.props.labelWidth)!==void 0)return ro(o.props.labelWidth)}),l=$(()=>{const{labelAlign:h}=e;if(h)return h;if(o!=null&&o.props.labelAlign)return o.props.labelAlign}),a=$(()=>{var h;return[(h=e.labelProps)===null||h===void 0?void 0:h.style,e.labelStyle,{width:n.value}]}),s=$(()=>{const{showRequireMark:h}=e;return h!==void 0?h:o==null?void 0:o.props.showRequireMark}),d=$(()=>{const{requireMarkPlacement:h}=e;return h!==void 0?h:(o==null?void 0:o.props.requireMarkPlacement)||"right"}),c=M(!1),u=M(!1),f=$(()=>{const{validationStatus:h}=e;if(h!==void 0)return h;if(c.value)return"error";if(u.value)return"warning"}),p=$(()=>{const{showFeedback:h}=e;return h!==void 0?h:(o==null?void 0:o.props.showFeedback)!==void 0?o.props.showFeedback:!0}),v=$(()=>{const{showLabel:h}=e;return h!==void 0?h:(o==null?void 0:o.props.showLabel)!==void 0?o.props.showLabel:!0});return{validationErrored:c,validationWarned:u,mergedLabelStyle:a,mergedLabelPlacement:t,mergedLabelAlign:l,mergedShowRequireMark:s,mergedRequireMarkPlacement:d,mergedValidationStatus:f,mergedShowFeedback:p,mergedShowLabel:v,isAutoLabelWidth:r}}function Wv(e){const o=ze(Cr,null),t=$(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:s}=e;if(s!==void 0)return s}),r=$(()=>{const a=[],{rule:s}=e;if(s!==void 0&&(Array.isArray(s)?a.push(...s):a.push(s)),o){const{rules:d}=o.props,{value:c}=t;if(d!==void 0&&c!==void 0){const u=nl(d,c);u!==void 0&&(Array.isArray(u)?a.push(...u):a.push(u))}}return a}),n=$(()=>r.value.some(a=>a.required)),l=$(()=>n.value||e.required);return{mergedRules:r,mergedRequired:l}}const{cubicBezierEaseInOut:Fi}=zo;function Nv({name:e="fade-down",fromOffset:o="-4px",enterDuration:t=".3s",leaveDuration:r=".3s",enterCubicBezier:n=Fi,leaveCubicBezier:l=Fi}={}){return[y(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${o})`}),y(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:"translateY(0)"}),y(`&.${e}-transition-leave-active`,{transition:`opacity ${r} ${l}, transform ${r} ${l}`}),y(`&.${e}-transition-enter-active`,{transition:`opacity ${t} ${n}, transform ${t} ${n}`})]}const Vv=g("form-item",`
|
|
|
display: grid;
|
|
|
line-height: var(--n-line-height);
|
|
|
`,[g("form-item-label",`
|
|
|
grid-area: label;
|
|
|
align-items: center;
|
|
|
line-height: 1.25;
|
|
|
text-align: var(--n-label-text-align);
|
|
|
font-size: var(--n-label-font-size);
|
|
|
min-height: var(--n-label-height);
|
|
|
padding: var(--n-label-padding);
|
|
|
color: var(--n-label-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
box-sizing: border-box;
|
|
|
font-weight: var(--n-label-font-weight);
|
|
|
`,[w("asterisk",`
|
|
|
white-space: nowrap;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
color: var(--n-asterisk-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`),w("asterisk-placeholder",`
|
|
|
grid-area: mark;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
visibility: hidden;
|
|
|
`)]),g("form-item-blank",`
|
|
|
grid-area: blank;
|
|
|
min-height: var(--n-blank-height);
|
|
|
`),P("auto-label-width",[g("form-item-label","white-space: nowrap;")]),P("left-labelled",`
|
|
|
grid-template-areas:
|
|
|
"label blank"
|
|
|
"label feedback";
|
|
|
grid-template-columns: auto minmax(0, 1fr);
|
|
|
grid-template-rows: auto 1fr;
|
|
|
align-items: flex-start;
|
|
|
`,[g("form-item-label",`
|
|
|
display: grid;
|
|
|
grid-template-columns: 1fr auto;
|
|
|
min-height: var(--n-blank-height);
|
|
|
height: auto;
|
|
|
box-sizing: border-box;
|
|
|
flex-shrink: 0;
|
|
|
flex-grow: 0;
|
|
|
`,[P("reverse-columns-space",`
|
|
|
grid-template-columns: auto 1fr;
|
|
|
`),P("left-mark",`
|
|
|
grid-template-areas:
|
|
|
"mark text"
|
|
|
". text";
|
|
|
`),P("right-mark",`
|
|
|
grid-template-areas:
|
|
|
"text mark"
|
|
|
"text .";
|
|
|
`),P("right-hanging-mark",`
|
|
|
grid-template-areas:
|
|
|
"text mark"
|
|
|
"text .";
|
|
|
`),w("text",`
|
|
|
grid-area: text;
|
|
|
`),w("asterisk",`
|
|
|
grid-area: mark;
|
|
|
align-self: end;
|
|
|
`)])]),P("top-labelled",`
|
|
|
grid-template-areas:
|
|
|
"label"
|
|
|
"blank"
|
|
|
"feedback";
|
|
|
grid-template-rows: minmax(var(--n-label-height), auto) 1fr;
|
|
|
grid-template-columns: minmax(0, 100%);
|
|
|
`,[P("no-label",`
|
|
|
grid-template-areas:
|
|
|
"blank"
|
|
|
"feedback";
|
|
|
grid-template-rows: 1fr;
|
|
|
`),g("form-item-label",`
|
|
|
display: flex;
|
|
|
align-items: flex-start;
|
|
|
justify-content: var(--n-label-text-align);
|
|
|
`)]),g("form-item-blank",`
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
position: relative;
|
|
|
`),g("form-item-feedback-wrapper",`
|
|
|
grid-area: feedback;
|
|
|
box-sizing: border-box;
|
|
|
min-height: var(--n-feedback-height);
|
|
|
font-size: var(--n-feedback-font-size);
|
|
|
line-height: 1.25;
|
|
|
transform-origin: top left;
|
|
|
`,[y("&:not(:empty)",`
|
|
|
padding: var(--n-feedback-padding);
|
|
|
`),g("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[P("warning",{color:"var(--n-feedback-text-color-warning)"}),P("error",{color:"var(--n-feedback-text-color-error)"}),Nv({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);var _i=function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const Wn=Object.assign(Object.assign({},se.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,showLabel:{type:Boolean,default:void 0},labelProps:Object}),Uv=wo(Wn);function Mi(e,o){return(...t)=>{try{const r=e(...t);return!o&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||r!=null&&r.then?r:(r===void 0||qo("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use `+(o?"`Promise`":"`boolean`, `Error` or `Promise`")+" typed value instead."),!0)}catch(r){qo("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(r);return}}}const Kv=Z({name:"FormItem",props:Wn,setup(e){Dd(ja,"formItems",ae(e,"path"));const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=ze(Cr,null),n=Ev(e),l=jv(e),{validationErrored:a,validationWarned:s}=l,{mergedRequired:d,mergedRules:c}=Wv(e),{mergedSize:u}=n,{mergedLabelPlacement:f,mergedLabelAlign:p,mergedRequireMarkPlacement:v}=l,h=M([]),m=M(tt()),x=r?ae(r.props,"disabled"):M(!1),C=se("Form","-form-item",Vv,Ea,e,o);Xe(ae(e,"path"),()=>{e.ignorePathChange||b()});function b(){h.value=[],a.value=!1,s.value=!1,e.feedback&&(m.value=tt())}function _(){L("blur")}function k(){L("change")}function z(){L("focus")}function R(){L("input")}function S(V,E){return _i(this,void 0,void 0,function*(){let Y,K,te,xe;return typeof V=="string"?(Y=V,K=E):V!==null&&typeof V=="object"&&(Y=V.trigger,K=V.callback,te=V.shouldRuleBeApplied,xe=V.options),yield new Promise((de,ie)=>{L(Y,te,xe).then(({valid:F,errors:B,warnings:q})=>{F?(K&&K(void 0,{warnings:q}),de({warnings:q})):(K&&K(B,{warnings:q}),ie(B))})})})}const L=(V=null,E=()=>!0,Y={suppressWarning:!0})=>_i(this,void 0,void 0,function*(){const{path:K}=e;Y?Y.first||(Y.first=e.first):Y={};const{value:te}=c,xe=r?nl(r.props.model,K||""):void 0,de={},ie={},F=(V?te.filter(Se=>Array.isArray(Se.trigger)?Se.trigger.includes(V):Se.trigger===V):te).filter(E).map((Se,Fe)=>{const ne=Object.assign({},Se);if(ne.validator&&(ne.validator=Mi(ne.validator,!1)),ne.asyncValidator&&(ne.asyncValidator=Mi(ne.asyncValidator,!0)),ne.renderMessage){const Ce=`__renderMessage__${Fe}`;ie[Ce]=ne.message,ne.message=Ce,de[Ce]=ne.renderMessage}return ne}),B=F.filter(Se=>Se.level!=="warning"),q=F.filter(Se=>Se.level==="warning"),ee=K??"__n_no_path__",be=new oi({[ee]:B}),me=new oi({[ee]:q}),{validateMessages:Be}=(r==null?void 0:r.props)||{};Be&&(be.messages(Be),me.messages(Be));const T=Se=>{h.value=Se.map(Fe=>{const ne=(Fe==null?void 0:Fe.message)||"";return{key:ne,render:()=>ne.startsWith("__renderMessage__")?de[ne]():ne}}),Se.forEach(Fe=>{var ne;!((ne=Fe.message)===null||ne===void 0)&&ne.startsWith("__renderMessage__")&&(Fe.message=ie[Fe.message])})},ve={valid:!0,errors:void 0,warnings:void 0};if(B.length){const Se=yield new Promise(Fe=>{be.validate({[ee]:xe},Y,Fe)});Se!=null&&Se.length&&(a.value=!0,ve.valid=!1,ve.errors=Se,T(Se))}if(q.length&&!ve.errors){const Se=yield new Promise(Fe=>{me.validate({[ee]:xe},Y,Fe)});Se!=null&&Se.length&&(T(Se),s.value=!0,ve.warnings=Se)}return!ve.errors&&!ve.warnings&&b(),ve});De(Ir,{path:ae(e,"path"),disabled:x,mergedSize:n.mergedSize,mergedValidationStatus:l.mergedValidationStatus,restoreValidation:b,handleContentBlur:_,handleContentChange:k,handleContentFocus:z,handleContentInput:R});const I={validate:S,restoreValidation:b,internalValidate:L},D=M(null);po(()=>{if(!l.isAutoLabelWidth.value)return;const V=D.value;if(V!==null){const E=V.style.whiteSpace;V.style.whiteSpace="nowrap",V.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(V).width.slice(0,-2))),V.style.whiteSpace=E}});const W=$(()=>{var V;const{value:E}=u,{value:Y}=f,K=Y==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:te},self:{labelTextColor:xe,asteriskColor:de,lineHeight:ie,feedbackTextColor:F,feedbackTextColorWarning:B,feedbackTextColorError:q,feedbackPadding:ee,labelFontWeight:be,[N("labelHeight",E)]:me,[N("blankHeight",E)]:Be,[N("feedbackFontSize",E)]:T,[N("feedbackHeight",E)]:ve,[N("labelPadding",K)]:Se,[N("labelTextAlign",K)]:Fe,[N(N("labelFontSize",Y),E)]:ne}}=C.value;let Ce=(V=p.value)!==null&&V!==void 0?V:Fe;return Y==="top"&&(Ce=Ce==="right"?"flex-end":"flex-start"),{"--n-bezier":te,"--n-line-height":ie,"--n-blank-height":Be,"--n-label-font-size":ne,"--n-label-text-align":Ce,"--n-label-height":me,"--n-label-padding":Se,"--n-label-font-weight":be,"--n-asterisk-color":de,"--n-label-text-color":xe,"--n-feedback-padding":ee,"--n-feedback-font-size":T,"--n-feedback-height":ve,"--n-feedback-text-color":F,"--n-feedback-text-color-warning":B,"--n-feedback-text-color-error":q}}),H=t?We("form-item",$(()=>{var V;return`${u.value[0]}${f.value[0]}${((V=p.value)===null||V===void 0?void 0:V[0])||""}`}),W,e):void 0,j=$(()=>f.value==="left"&&v.value==="left"&&p.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:D,mergedClsPrefix:o,mergedRequired:d,feedbackId:m,renderExplains:h,reverseColSpace:j},l),n),I),{cssVars:t?void 0:W,themeClass:H==null?void 0:H.themeClass,onRender:H==null?void 0:H.onRender})},render(){const{$slots:e,mergedClsPrefix:o,mergedShowLabel:t,mergedShowRequireMark:r,mergedRequireMarkPlacement:n,onRender:l}=this,a=r!==void 0?r:this.mergedRequired;l==null||l();const s=()=>{const d=this.$slots.label?this.$slots.label():this.label;if(!d)return null;const c=i("span",{class:`${o}-form-item-label__text`},d),u=a?i("span",{class:`${o}-form-item-label__asterisk`},n!=="left"?" *":"* "):n==="right-hanging"&&i("span",{class:`${o}-form-item-label__asterisk-placeholder`}," *"),{labelProps:f}=this;return i("label",Object.assign({},f,{class:[f==null?void 0:f.class,`${o}-form-item-label`,`${o}-form-item-label--${n}-mark`,this.reverseColSpace&&`${o}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[u,c]:[c,u])};return i("div",{class:[`${o}-form-item`,this.themeClass,`${o}-form-item--${this.mergedSize}-size`,`${o}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${o}-form-item--auto-label-width`,!t&&`${o}-form-item--no-label`],style:this.cssVars},t&&s(),i("div",{class:[`${o}-form-item-blank`,this.mergedValidationStatus&&`${o}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?i("div",{key:this.feedbackId,class:`${o}-form-item-feedback-wrapper`},i(io,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:d}=this;return je(e.feedback,c=>{var u;const{feedback:f}=this,p=c||f?i("div",{key:"__feedback__",class:`${o}-form-item-feedback__line`},c||f):this.renderExplains.length?(u=this.renderExplains)===null||u===void 0?void 0:u.map(({key:v,render:h})=>i("div",{key:v,class:`${o}-form-item-feedback__line`},h())):null;return p?d==="warning"?i("div",{key:"controlled-warning",class:`${o}-form-item-feedback ${o}-form-item-feedback--warning`},p):d==="error"?i("div",{key:"controlled-error",class:`${o}-form-item-feedback ${o}-form-item-feedback--error`},p):d==="success"?i("div",{key:"controlled-success",class:`${o}-form-item-feedback ${o}-form-item-feedback--success`},p):i("div",{key:"controlled-default",class:`${o}-form-item-feedback`},p):null})}})):null)}}),Di=1,Wa="n-grid",Na=1,Gv={span:{type:[Number,String],default:Na},offset:{type:[Number,String],default:0},suffix:Boolean,privateOffset:Number,privateSpan:Number,privateColStart:Number,privateShow:{type:Boolean,default:!0}},K1=Z({__GRID_ITEM__:!0,name:"GridItem",alias:["Gi"],props:Gv,setup(){const{isSsrRef:e,xGapRef:o,itemStyleRef:t,overflowRef:r,layoutShiftDisabledRef:n}=ze(Wa),l=Tr();return{overflow:r,itemStyle:t,layoutShiftDisabled:n,mergedXGap:$(()=>Do(o.value||0)),deriveStyle:()=>{e.value;const{privateSpan:a=Na,privateShow:s=!0,privateColStart:d=void 0,privateOffset:c=0}=l.vnode.props,{value:u}=o,f=Do(u||0);return{display:s?"":"none",gridColumn:`${d??`span ${a}`} / span ${a}`,marginLeft:c?`calc((100% - (${a} - 1) * ${f}) / ${a} * ${c} + ${f} * ${c})`:""}}}},render(){var e,o;if(this.layoutShiftDisabled){const{span:t,offset:r,mergedXGap:n}=this;return i("div",{style:{gridColumn:`span ${t} / span ${t}`,marginLeft:r?`calc((100% - (${t} - 1) * ${n}) / ${t} * ${r} + ${n} * ${r})`:""}},this.$slots)}return i("div",{style:[this.itemStyle,this.deriveStyle()]},(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e,{overflow:this.overflow}))}}),qv=Xi(24,null).map((e,o)=>{const t=o+1,r=`calc(100% / 24 * ${t})`;return[P(`${t}-span`,{width:r}),P(`${t}-offset`,{marginLeft:r}),P(`${t}-push`,{left:r}),P(`${t}-pull`,{right:r})]}),Yv=y([g("row",{width:"100%",display:"flex",flexWrap:"wrap"}),g("col",{verticalAlign:"top",boxSizing:"border-box",display:"inline-block",position:"relative",zIndex:"auto"},[w("box",{position:"relative",zIndex:"auto",width:"100%",height:"100%"}),qv])]),Va="n-row",Nn={gutter:{type:[Array,Number,String],default:0},alignItems:String,justifyContent:String},Xv=wo(Nn),Zv=Z({name:"Row",props:Nn,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:t}=Ie(e);Xo("-legacy-grid",Yv,o);const r=eo("Row",t,o),n=Ve(()=>{const{gutter:a}=e;return Array.isArray(a)&&a[1]||0}),l=Ve(()=>{const{gutter:a}=e;return Array.isArray(a)?a[0]:Number(a)});return De(Va,{mergedClsPrefixRef:o,gutterRef:ae(e,"gutter"),verticalGutterRef:n,horizontalGutterRef:l}),{mergedClsPrefix:o,rtlEnabled:r,styleMargin:Ve(()=>`-${ro(n.value,{c:.5})} -${ro(l.value,{c:.5})}`),styleWidth:Ve(()=>`calc(100% + ${ro(l.value)})`)}},render(){return i("div",{class:[`${this.mergedClsPrefix}-row`,this.rtlEnabled&&`${this.mergedClsPrefix}-row--rtl`],style:{margin:this.styleMargin,width:this.styleWidth,alignItems:this.alignItems,justifyContent:this.justifyContent}},this.$slots)}}),Vn={span:{type:[String,Number],default:1},push:{type:[String,Number],default:0},pull:{type:[String,Number],default:0},offset:{type:[String,Number],default:0}},Qv=wo(Vn),Jv=Z({name:"Col",props:Vn,setup(e){const o=ze(Va,null);return o||Wo("col","`n-col` must be placed inside `n-row`."),{mergedClsPrefix:o.mergedClsPrefixRef,gutter:o.gutterRef,stylePadding:$(()=>`${ro(o.verticalGutterRef.value,{c:.5})} ${ro(o.horizontalGutterRef.value,{c:.5})}`),mergedPush:$(()=>Number(e.push)-Number(e.pull))}},render(){const{$slots:e,span:o,mergedPush:t,offset:r,stylePadding:n,gutter:l,mergedClsPrefix:a}=this;return i("div",{class:[`${a}-col`,{[`${a}-col--${o}-span`]:!0,[`${a}-col--${t}-push`]:t>0,[`${a}-col--${-t}-pull`]:t<0,[`${a}-col--${r}-offset`]:r}],style:{padding:n}},l?i("div",null,e):e)}}),Un=Object.assign(Object.assign({},Vn),Wn),eg=wo(Un),og=Z({name:"FormItemCol",props:Un,setup(){const e=M(null);return{formItemInstRef:e,validate:(...r)=>{const{value:n}=e;if(n)return n.validate(...r)},restoreValidation:()=>{const{value:r}=e;r&&r.restoreValidation()}}},render(){return i(Jv,mo(this.$props,Qv),{default:()=>{const e=mo(this.$props,Uv);return i(Kv,Object.assign({ref:"formItemInstRef"},e),this.$slots)}})}}),tg=Object.assign(Object.assign({},Nn),Un),G1=Z({name:"FormItemRow",props:tg,setup(){const e=M(null);return{formItemColInstRef:e,validate:(...r)=>{const{value:n}=e;if(n)return n.validate(...r)},restoreValidation:()=>{const{value:r}=e;r&&r.restoreValidation()}}},render(){return i(Zv,mo(this.$props,Xv),{default:()=>{const e=mo(this.$props,eg);return i(og,Object.assign(Object.assign({ref:"formItemColInstRef"},e),{span:24}),this.$slots)}})}}),q1=Z({name:"GlobalStyle",setup(){if(typeof document>"u")return;const e=ze(jo,null),{body:o}=document,{style:t}=o;let r=!1,n=!0;fr(()=>{oo(()=>{var l,a;const{textColor2:s,fontSize:d,fontFamily:c,bodyColor:u,cubicBezierEaseInOut:f,lineHeight:p}=e?Ht({},((l=e.mergedThemeRef.value)===null||l===void 0?void 0:l.common)||Ae,(a=e.mergedThemeOverridesRef.value)===null||a===void 0?void 0:a.common):Ae;if(r||!o.hasAttribute("n-styled")){t.setProperty("-webkit-text-size-adjust","100%"),t.setProperty("-webkit-tap-highlight-color","transparent"),t.padding="0",t.margin="0",t.backgroundColor=u,t.color=s,t.fontSize=d,t.fontFamily=c,t.lineHeight=p;const v=`color .3s ${f}, background-color .3s ${f}`;n?setTimeout(()=>{t.transition=v},0):t.transition=v,o.setAttribute("n-styled",""),r=!0,n=!1}})}),cd(()=>{r&&o.removeAttribute("n-styled")})},render(){return null}}),rg={name:"GradientText",common:fe,self(e){const{primaryColor:o,successColor:t,warningColor:r,errorColor:n,infoColor:l,primaryColorSuppl:a,successColorSuppl:s,warningColorSuppl:d,errorColorSuppl:c,infoColorSuppl:u,fontWeightStrong:f}=e;return{fontWeight:f,rotate:"252deg",colorStartPrimary:o,colorEndPrimary:a,colorStartInfo:l,colorEndInfo:u,colorStartWarning:r,colorEndWarning:d,colorStartError:n,colorEndError:c,colorStartSuccess:t,colorEndSuccess:s}}},ng=rg,ig=e=>{const{primaryColor:o,successColor:t,warningColor:r,errorColor:n,infoColor:l,fontWeightStrong:a}=e;return{fontWeight:a,rotate:"252deg",colorStartPrimary:J(o,{alpha:.6}),colorEndPrimary:o,colorStartInfo:J(l,{alpha:.6}),colorEndInfo:l,colorStartWarning:J(r,{alpha:.6}),colorEndWarning:r,colorStartError:J(n,{alpha:.6}),colorEndError:n,colorStartSuccess:J(t,{alpha:.6}),colorEndSuccess:t}},lg={name:"GradientText",common:Ae,self:ig},ag=lg,sg=g("gradient-text",`
|
|
|
display: inline-block;
|
|
|
font-weight: var(--n-font-weight);
|
|
|
-webkit-background-clip: text;
|
|
|
background-clip: text;
|
|
|
color: #0000;
|
|
|
white-space: nowrap;
|
|
|
background-image: linear-gradient(var(--n-rotate), var(--n-color-start) 0%, var(--n-color-end) 100%);
|
|
|
transition:
|
|
|
--n-color-start .3s var(--n-bezier),
|
|
|
--n-color-end .3s var(--n-bezier);
|
|
|
`),dg=Object.assign(Object.assign({},se.props),{size:[String,Number],fontSize:[String,Number],type:{type:String,default:"primary"},color:[Object,String],gradient:[Object,String]}),Y1=Z({name:"GradientText",props:dg,setup(e){vl();const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=$(()=>{const{type:c}=e;return c==="danger"?"error":c}),n=$(()=>{let c=e.size||e.fontSize;return c&&(c=ro(c)),c||void 0}),l=$(()=>{const c=e.color||e.gradient;if(typeof c=="string")return c;if(c){const u=c.deg||0,f=c.from,p=c.to;return`linear-gradient(${u}deg, ${f} 0%, ${p} 100%)`}}),a=se("GradientText","-gradient-text",sg,ag,e,o),s=$(()=>{const{value:c}=r,{common:{cubicBezierEaseInOut:u},self:{rotate:f,[N("colorStart",c)]:p,[N("colorEnd",c)]:v,fontWeight:h}}=a.value;return{"--n-bezier":u,"--n-rotate":f,"--n-color-start":p,"--n-color-end":v,"--n-font-weight":h}}),d=t?We("gradient-text",$(()=>r.value[0]),s,e):void 0;return{mergedClsPrefix:o,compatibleType:r,styleFontSize:n,styleBgImage:l,cssVars:t?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{mergedClsPrefix:e,onRender:o}=this;return o==null||o(),i("span",{class:[`${e}-gradient-text`,`${e}-gradient-text--${this.compatibleType}-type`,this.themeClass],style:[{fontSize:this.styleFontSize,backgroundImage:this.styleBgImage},this.cssVars]},this.$slots)}}),cg={xs:0,s:640,m:1024,l:1280,xl:1536,xxl:1920},Ua=24,an="__ssr__",ug={layoutShiftDisabled:Boolean,responsive:{type:[String,Boolean],default:"self"},cols:{type:[Number,String],default:Ua},itemResponsive:Boolean,collapsed:Boolean,collapsedRows:{type:Number,default:1},itemStyle:[Object,String],xGap:{type:[Number,String],default:0},yGap:{type:[Number,String],default:0}},X1=Z({name:"Grid",inheritAttrs:!1,props:ug,setup(e){const{mergedClsPrefixRef:o,mergedBreakpointsRef:t}=Ie(e),r=/^\d+$/,n=M(void 0),l=gd((t==null?void 0:t.value)||cg),a=Ve(()=>!!(e.itemResponsive||!r.test(e.cols.toString())||!r.test(e.xGap.toString())||!r.test(e.yGap.toString()))),s=$(()=>{if(a.value)return e.responsive==="self"?n.value:l.value}),d=Ve(()=>{var C;return(C=Number(Ft(e.cols.toString(),s.value)))!==null&&C!==void 0?C:Ua}),c=Ve(()=>Ft(e.xGap.toString(),s.value)),u=Ve(()=>Ft(e.yGap.toString(),s.value)),f=C=>{n.value=C.contentRect.width},p=C=>{Zi(f,C)},v=M(!1),h=$(()=>{if(e.responsive==="self")return p}),m=M(!1),x=M();return po(()=>{const{value:C}=x;C&&C.hasAttribute(an)&&(C.removeAttribute(an),m.value=!0)}),De(Wa,{layoutShiftDisabledRef:ae(e,"layoutShiftDisabled"),isSsrRef:m,itemStyleRef:ae(e,"itemStyle"),xGapRef:c,overflowRef:v}),{isSsr:!No,contentEl:x,mergedClsPrefix:o,style:$(()=>e.layoutShiftDisabled?{width:"100%",display:"grid",gridTemplateColumns:`repeat(${e.cols}, minmax(0, 1fr))`,columnGap:Do(e.xGap),rowGap:Do(e.yGap)}:{width:"100%",display:"grid",gridTemplateColumns:`repeat(${d.value}, minmax(0, 1fr))`,columnGap:Do(c.value),rowGap:Do(u.value)}),isResponsive:a,responsiveQuery:s,responsiveCols:d,handleResize:h,overflow:v}},render(){if(this.layoutShiftDisabled)return i("div",To({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style},this.$attrs),this.$slots);const e=()=>{var o,t,r,n,l,a,s;this.overflow=!1;const d=ot(Rn(this)),c=[],{collapsed:u,collapsedRows:f,responsiveCols:p,responsiveQuery:v}=this;d.forEach(b=>{var _,k,z,R,S;if(((_=b==null?void 0:b.type)===null||_===void 0?void 0:_.__GRID_ITEM__)!==!0)return;if(kd(b)){const D=nr(b);D.props?D.props.privateShow=!1:D.props={privateShow:!1},c.push({child:D,rawChildSpan:0});return}b.dirs=((k=b.dirs)===null||k===void 0?void 0:k.filter(({dir:D})=>D!==Go))||null,((z=b.dirs)===null||z===void 0?void 0:z.length)===0&&(b.dirs=null);const L=nr(b),I=Number((S=Ft((R=L.props)===null||R===void 0?void 0:R.span,v))!==null&&S!==void 0?S:Di);I!==0&&c.push({child:L,rawChildSpan:I})});let h=0;const m=(o=c[c.length-1])===null||o===void 0?void 0:o.child;if(m!=null&&m.props){const b=(t=m.props)===null||t===void 0?void 0:t.suffix;b!==void 0&&b!==!1&&(h=Number((n=Ft((r=m.props)===null||r===void 0?void 0:r.span,v))!==null&&n!==void 0?n:Di),m.props.privateSpan=h,m.props.privateColStart=p+1-h,m.props.privateShow=(l=m.props.privateShow)!==null&&l!==void 0?l:!0)}let x=0,C=!1;for(const{child:b,rawChildSpan:_}of c){if(C&&(this.overflow=!0),!C){const k=Number((s=Ft((a=b.props)===null||a===void 0?void 0:a.offset,v))!==null&&s!==void 0?s:0),z=Math.min(_+k,p);if(b.props?(b.props.privateSpan=z,b.props.privateOffset=k):b.props={privateSpan:z,privateOffset:k},u){const R=x%p;z+R>p&&(x+=p-R),z+x+h>f*p?C=!0:x+=z}}C&&(b.props?b.props.privateShow!==!0&&(b.props.privateShow=!1):b.props={privateShow:!1})}return i("div",To({ref:"contentEl",class:`${this.mergedClsPrefix}-grid`,style:this.style,[an]:this.isSsr||void 0},this.$attrs),c.map(({child:b})=>b))};return this.isResponsive&&this.responsive==="self"?i(st,{onResize:this.handleResize},{default:e}):e()}}),fg=e=>{const{primaryColor:o,baseColor:t}=e;return{color:o,iconColor:t}},hg={name:"IconWrapper",common:fe,self:fg},pg=hg,Kn=Object.assign(Object.assign({},se.props),{onPreviewPrev:Function,onPreviewNext:Function,showToolbar:{type:Boolean,default:!0},showToolbarTooltip:Boolean}),Ka="n-image";function vg(){return{toolbarIconColor:"rgba(255, 255, 255, .9)",toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}const gg={name:"Image",common:Ae,peers:{Tooltip:jr},self:vg},mg={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"},bg=e=>{const{textColor2:o,successColor:t,infoColor:r,warningColor:n,errorColor:l,popoverColor:a,closeIconColor:s,closeIconColorHover:d,closeIconColorPressed:c,closeColorHover:u,closeColorPressed:f,textColor1:p,textColor3:v,borderRadius:h,fontWeightStrong:m,boxShadow2:x,lineHeight:C,fontSize:b}=e;return Object.assign(Object.assign({},mg),{borderRadius:h,lineHeight:C,fontSize:b,headerFontWeight:m,iconColor:o,iconColorSuccess:t,iconColorInfo:r,iconColorWarning:n,iconColorError:l,color:a,textColor:o,closeIconColor:s,closeIconColorHover:d,closeIconColorPressed:c,closeBorderRadius:h,closeColorHover:u,closeColorPressed:f,headerTextColor:p,descriptionTextColor:v,actionTextColor:o,boxShadow:x})},xg={name:"Notification",common:fe,peers:{Scrollbar:$o},self:bg},Cg=xg,yg={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"},Ga=e=>{const{textColor2:o,closeIconColor:t,closeIconColorHover:r,closeIconColorPressed:n,infoColor:l,successColor:a,errorColor:s,warningColor:d,popoverColor:c,boxShadow2:u,primaryColor:f,lineHeight:p,borderRadius:v,closeColorHover:h,closeColorPressed:m}=e;return Object.assign(Object.assign({},yg),{closeBorderRadius:v,textColor:o,textColorInfo:o,textColorSuccess:o,textColorError:o,textColorWarning:o,textColorLoading:o,color:c,colorInfo:c,colorSuccess:c,colorError:c,colorWarning:c,colorLoading:c,boxShadow:u,boxShadowInfo:u,boxShadowSuccess:u,boxShadowError:u,boxShadowWarning:u,boxShadowLoading:u,iconColor:o,iconColorInfo:l,iconColorSuccess:a,iconColorWarning:d,iconColorError:s,iconColorLoading:f,closeColorHover:h,closeColorPressed:m,closeIconColor:t,closeIconColorHover:r,closeIconColorPressed:n,closeColorHoverInfo:h,closeColorPressedInfo:m,closeIconColorInfo:t,closeIconColorHoverInfo:r,closeIconColorPressedInfo:n,closeColorHoverSuccess:h,closeColorPressedSuccess:m,closeIconColorSuccess:t,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:n,closeColorHoverError:h,closeColorPressedError:m,closeIconColorError:t,closeIconColorHoverError:r,closeIconColorPressedError:n,closeColorHoverWarning:h,closeColorPressedWarning:m,closeIconColorWarning:t,closeIconColorHoverWarning:r,closeIconColorPressedWarning:n,closeColorHoverLoading:h,closeColorPressedLoading:m,closeIconColorLoading:t,closeIconColorHoverLoading:r,closeIconColorPressedLoading:n,loadingColor:f,lineHeight:p,borderRadius:v})},wg={name:"Message",common:Ae,self:Ga},Sg=wg,zg={name:"Message",common:fe,self:Ga},$g=zg,Rg={name:"ButtonGroup",common:fe},Pg=Rg,kg={name:"InputNumber",common:fe,peers:{Button:Ro,Input:Ao},self(e){const{textColorDisabled:o}=e;return{iconColorDisabled:o}}},Ig=kg,Bg=e=>{const{textColorDisabled:o}=e;return{iconColorDisabled:o}},Tg={name:"InputNumber",common:Ae,peers:{Button:Yt,Input:xr},self:Bg},Og=Tg,Fg={name:"Layout",common:fe,peers:{Scrollbar:$o},self(e){const{textColor2:o,bodyColor:t,popoverColor:r,cardColor:n,dividerColor:l,scrollbarColor:a,scrollbarColorHover:s}=e;return{textColor:o,textColorInverted:o,color:t,colorEmbedded:t,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:l,headerBorderColorInverted:l,footerBorderColor:l,footerBorderColorInverted:l,siderBorderColor:l,siderBorderColorInverted:l,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:r,siderToggleButtonIconColor:o,siderToggleButtonIconColorInverted:o,siderToggleBarColor:Re(t,a),siderToggleBarColorHover:Re(t,s),__invertScrollbar:"false"}}},_g=Fg,qa=e=>{const{textColor2:o,cardColor:t,modalColor:r,popoverColor:n,dividerColor:l,borderRadius:a,fontSize:s,hoverColor:d}=e;return{textColor:o,color:t,colorHover:d,colorModal:r,colorHoverModal:Re(r,d),colorPopover:n,colorHoverPopover:Re(n,d),borderColor:l,borderColorModal:Re(r,l),borderColorPopover:Re(n,l),borderRadius:a,fontSize:s}},Mg={name:"List",common:Ae,self:qa},Dg=Mg,Lg={name:"List",common:fe,self:qa},Hg=Lg,Ag={name:"LoadingBar",common:fe,self(e){const{primaryColor:o}=e;return{colorError:"red",colorLoading:o,height:"2px"}}},Eg=Ag,jg={name:"Log",common:fe,peers:{Scrollbar:$o,Code:na},self(e){const{textColor2:o,inputColor:t,fontSize:r,primaryColor:n}=e;return{loaderFontSize:r,loaderTextColor:o,loaderColor:t,loaderBorder:"1px solid #0000",loadingColor:n}}},Wg=jg,Ng={name:"Mention",common:fe,peers:{InternalSelectMenu:mr,Input:Ao},self(e){const{boxShadow2:o}=e;return{menuBoxShadow:o}}},Vg=Ng,Ug=e=>{const{boxShadow2:o}=e;return{menuBoxShadow:o}},Kg={name:"Mention",common:Ae,peers:{InternalSelectMenu:Ar,Input:xr},self:Ug},Gg=Kg;function qg(e,o,t,r){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:o,itemColorActiveHoverInverted:o,itemColorActiveCollapsedInverted:o,itemTextColorInverted:e,itemTextColorHoverInverted:t,itemTextColorChildActiveInverted:t,itemTextColorChildActiveHoverInverted:t,itemTextColorActiveInverted:t,itemTextColorActiveHoverInverted:t,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:t,itemTextColorChildActiveHorizontalInverted:t,itemTextColorChildActiveHoverHorizontalInverted:t,itemTextColorActiveHorizontalInverted:t,itemTextColorActiveHoverHorizontalInverted:t,itemIconColorInverted:e,itemIconColorHoverInverted:t,itemIconColorActiveInverted:t,itemIconColorActiveHoverInverted:t,itemIconColorChildActiveInverted:t,itemIconColorChildActiveHoverInverted:t,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:t,itemIconColorActiveHorizontalInverted:t,itemIconColorActiveHoverHorizontalInverted:t,itemIconColorChildActiveHorizontalInverted:t,itemIconColorChildActiveHoverHorizontalInverted:t,arrowColorInverted:e,arrowColorHoverInverted:t,arrowColorActiveInverted:t,arrowColorActiveHoverInverted:t,arrowColorChildActiveInverted:t,arrowColorChildActiveHoverInverted:t,groupTextColorInverted:r}}const Ya=e=>{const{borderRadius:o,textColor3:t,primaryColor:r,textColor2:n,textColor1:l,fontSize:a,dividerColor:s,hoverColor:d,primaryColorHover:c}=e;return Object.assign({borderRadius:o,color:"#0000",groupTextColor:t,itemColorHover:d,itemColorActive:J(r,{alpha:.1}),itemColorActiveHover:J(r,{alpha:.1}),itemColorActiveCollapsed:J(r,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:r,itemTextColorActiveHover:r,itemTextColorChildActive:r,itemTextColorChildActiveHover:r,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:c,itemTextColorActiveHorizontal:r,itemTextColorActiveHoverHorizontal:r,itemTextColorChildActiveHorizontal:r,itemTextColorChildActiveHoverHorizontal:r,itemIconColor:l,itemIconColorHover:l,itemIconColorActive:r,itemIconColorActiveHover:r,itemIconColorChildActive:r,itemIconColorChildActiveHover:r,itemIconColorCollapsed:l,itemIconColorHorizontal:l,itemIconColorHoverHorizontal:c,itemIconColorActiveHorizontal:r,itemIconColorActiveHoverHorizontal:r,itemIconColorChildActiveHorizontal:r,itemIconColorChildActiveHoverHorizontal:r,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:r,arrowColorActiveHover:r,arrowColorChildActive:r,arrowColorChildActiveHover:r,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:s},qg("#BBB",r,"#FFF","#AAA"))},Yg={name:"Menu",common:Ae,peers:{Tooltip:jr,Dropdown:ba},self:Ya},Xg=Yg,Zg={name:"Menu",common:fe,peers:{Tooltip:Er,Dropdown:Ln},self(e){const{primaryColor:o,primaryColorSuppl:t}=e,r=Ya(e);return r.itemColorActive=J(o,{alpha:.15}),r.itemColorActiveHover=J(o,{alpha:.15}),r.itemColorActiveCollapsed=J(o,{alpha:.15}),r.itemColorActiveInverted=t,r.itemColorActiveHoverInverted=t,r.itemColorActiveCollapsedInverted=t,r}},Qg=Zg,Jg={titleFontSize:"18px",backSize:"22px"};function em(e){const{textColor1:o,textColor2:t,textColor3:r,fontSize:n,fontWeightStrong:l,primaryColorHover:a,primaryColorPressed:s}=e;return Object.assign(Object.assign({},Jg),{titleFontWeight:l,fontSize:n,titleTextColor:o,backColor:t,backColorHover:a,backColorPressed:s,subtitleTextColor:r})}const om={name:"PageHeader",common:fe,self:em},tm={iconSize:"22px"},Xa=e=>{const{fontSize:o,warningColor:t}=e;return Object.assign(Object.assign({},tm),{fontSize:o,iconColor:t})},rm={name:"Popconfirm",common:Ae,peers:{Button:Yt,Popover:qt},self:Xa},nm=rm,im={name:"Popconfirm",common:fe,peers:{Button:Ro,Popover:It},self:Xa},lm=im,Za=e=>{const{infoColor:o,successColor:t,warningColor:r,errorColor:n,textColor2:l,progressRailColor:a,fontSize:s,fontWeight:d}=e;return{fontSize:s,fontSizeCircle:"28px",fontWeightCircle:d,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:o,iconColorInfo:o,iconColorSuccess:t,iconColorWarning:r,iconColorError:n,textColorCircle:l,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:l,fillColor:o,fillColorInfo:o,fillColorSuccess:t,fillColorWarning:r,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}},am={name:"Progress",common:Ae,self:Za},Qa=am,sm={name:"Progress",common:fe,self(e){const o=Za(e);return o.textColorLineInner="rgb(0, 0, 0)",o.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",o}},Ja=sm,dm={name:"Rate",common:fe,self(e){const{railColor:o}=e;return{itemColor:o,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},cm=dm,um={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0},es=e=>{const{textColor2:o,textColor1:t,errorColor:r,successColor:n,infoColor:l,warningColor:a,lineHeight:s,fontWeightStrong:d}=e;return Object.assign(Object.assign({},um),{lineHeight:s,titleFontWeight:d,titleTextColor:t,textColor:o,iconColorError:r,iconColorSuccess:n,iconColorInfo:l,iconColorWarning:a})},fm={name:"Result",common:Ae,self:es},hm=fm,pm={name:"Result",common:fe,self:es},vm=pm,gm={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},mm={name:"Slider",common:fe,self(e){const o="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:t,modalColor:r,primaryColorSuppl:n,popoverColor:l,textColor2:a,cardColor:s,borderRadius:d,fontSize:c,opacityDisabled:u}=e;return Object.assign(Object.assign({},gm),{fontSize:c,markFontSize:c,railColor:t,railColorHover:t,fillColor:n,fillColorHover:n,opacityDisabled:u,handleColor:"#FFF",dotColor:s,dotColorModal:r,dotColorPopover:l,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:l,indicatorBoxShadow:o,indicatorTextColor:a,indicatorBorderRadius:d,dotBorder:`2px solid ${t}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}},bm=mm,os=e=>{const{opacityDisabled:o,heightTiny:t,heightSmall:r,heightMedium:n,heightLarge:l,heightHuge:a,primaryColor:s,fontSize:d}=e;return{fontSize:d,textColor:s,sizeTiny:t,sizeSmall:r,sizeMedium:n,sizeLarge:l,sizeHuge:a,color:s,opacitySpinning:o}},xm={name:"Spin",common:Ae,self:os},Cm=xm,ym={name:"Spin",common:fe,self:os},wm=ym,ts=e=>{const{textColor2:o,textColor3:t,fontSize:r,fontWeight:n}=e;return{labelFontSize:r,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:t,valuePrefixTextColor:o,valueSuffixTextColor:o,valueTextColor:o}},Sm={name:"Statistic",common:Ae,self:ts},zm=Sm,$m={name:"Statistic",common:fe,self:ts},Rm=$m,Pm={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"},km=e=>{const{fontWeightStrong:o,baseColor:t,textColorDisabled:r,primaryColor:n,errorColor:l,textColor1:a,textColor2:s}=e;return Object.assign(Object.assign({},Pm),{stepHeaderFontWeight:o,indicatorTextColorProcess:t,indicatorTextColorWait:r,indicatorTextColorFinish:n,indicatorTextColorError:l,indicatorBorderColorProcess:n,indicatorBorderColorWait:r,indicatorBorderColorFinish:n,indicatorBorderColorError:l,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:r,splitorColorWait:r,splitorColorFinish:n,splitorColorError:r,headerTextColorProcess:a,headerTextColorWait:r,headerTextColorFinish:r,headerTextColorError:l,descriptionTextColorProcess:s,descriptionTextColorWait:r,descriptionTextColorFinish:r,descriptionTextColorError:l})},Im={name:"Steps",common:fe,self:km},Bm=Im,rs={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},Tm={name:"Switch",common:fe,self(e){const{primaryColorSuppl:o,opacityDisabled:t,borderRadius:r,primaryColor:n,textColor2:l,baseColor:a}=e,s="rgba(255, 255, 255, .20)";return Object.assign(Object.assign({},rs),{iconColor:a,textColor:l,loadingColor:o,opacityDisabled:t,railColor:s,railColorActive:o,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 8px 0 ${J(n,{alpha:.3})}`})}},Om=Tm,Fm=e=>{const{primaryColor:o,opacityDisabled:t,borderRadius:r,textColor3:n}=e,l="rgba(0, 0, 0, .14)";return Object.assign(Object.assign({},rs),{iconColor:n,textColor:"white",loadingColor:o,opacityDisabled:t,railColor:l,railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 0 2px ${J(o,{alpha:.2})}`})},_m={name:"Switch",common:Ae,self:Fm},Mm=_m,Dm={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"},Lm=e=>{const{dividerColor:o,cardColor:t,modalColor:r,popoverColor:n,tableHeaderColor:l,tableColorStriped:a,textColor1:s,textColor2:d,borderRadius:c,fontWeightStrong:u,lineHeight:f,fontSizeSmall:p,fontSizeMedium:v,fontSizeLarge:h}=e;return Object.assign(Object.assign({},Dm),{fontSizeSmall:p,fontSizeMedium:v,fontSizeLarge:h,lineHeight:f,borderRadius:c,borderColor:Re(t,o),borderColorModal:Re(r,o),borderColorPopover:Re(n,o),tdColor:t,tdColorModal:r,tdColorPopover:n,tdColorStriped:Re(t,a),tdColorStripedModal:Re(r,a),tdColorStripedPopover:Re(n,a),thColor:Re(t,l),thColorModal:Re(r,l),thColorPopover:Re(n,l),thTextColor:s,tdTextColor:d,thFontWeight:u})},Hm={name:"Table",common:fe,self:Lm},Am=Hm,Em={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"},ns=e=>{const{textColor2:o,primaryColor:t,textColorDisabled:r,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:d,tabColor:c,baseColor:u,dividerColor:f,fontWeight:p,textColor1:v,borderRadius:h,fontSize:m,fontWeightStrong:x}=e;return Object.assign(Object.assign({},Em),{colorSegment:c,tabFontSizeCard:m,tabTextColorLine:v,tabTextColorActiveLine:t,tabTextColorHoverLine:t,tabTextColorDisabledLine:r,tabTextColorSegment:v,tabTextColorActiveSegment:o,tabTextColorHoverSegment:o,tabTextColorDisabledSegment:r,tabTextColorBar:v,tabTextColorActiveBar:t,tabTextColorHoverBar:t,tabTextColorDisabledBar:r,tabTextColorCard:v,tabTextColorHoverCard:v,tabTextColorActiveCard:t,tabTextColorDisabledCard:r,barColor:t,closeIconColor:n,closeIconColorHover:l,closeIconColorPressed:a,closeColorHover:s,closeColorPressed:d,closeBorderRadius:h,tabColor:c,tabColorSegment:u,tabBorderColor:f,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:h,paneTextColor:o,fontWeightStrong:x})},jm={name:"Tabs",common:Ae,self:ns},Wm=jm,Nm={name:"Tabs",common:fe,self(e){const o=ns(e),{inputColor:t}=e;return o.colorSegment=t,o.tabColorSegment=t,o}},Vm=Nm,is=e=>{const{textColor1:o,textColor2:t,fontWeightStrong:r,fontSize:n}=e;return{fontSize:n,titleTextColor:o,textColor:t,titleFontWeight:r}},Um={name:"Thing",common:Ae,self:is},Km=Um,Gm={name:"Thing",common:fe,self:is},qm=Gm,Ym={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},Xm={name:"Timeline",common:fe,self(e){const{textColor3:o,infoColorSuppl:t,errorColorSuppl:r,successColorSuppl:n,warningColorSuppl:l,textColor1:a,textColor2:s,railColor:d,fontWeightStrong:c,fontSize:u}=e;return Object.assign(Object.assign({},Ym),{contentFontSize:u,titleFontWeight:c,circleBorder:`2px solid ${o}`,circleBorderInfo:`2px solid ${t}`,circleBorderError:`2px solid ${r}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${l}`,iconColor:o,iconColorInfo:t,iconColorError:r,iconColorSuccess:n,iconColorWarning:l,titleTextColor:a,contentTextColor:s,metaTextColor:o,lineColor:d})}},Zm=Xm,Qm={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},Jm={name:"Transfer",common:fe,peers:{Checkbox:Xt,Scrollbar:$o,Input:Ao,Empty:kt,Button:Ro},self(e){const{fontWeight:o,fontSizeLarge:t,fontSizeMedium:r,fontSizeSmall:n,heightLarge:l,heightMedium:a,borderRadius:s,inputColor:d,tableHeaderColor:c,textColor1:u,textColorDisabled:f,textColor2:p,textColor3:v,hoverColor:h,closeColorHover:m,closeColorPressed:x,closeIconColor:C,closeIconColorHover:b,closeIconColorPressed:_,dividerColor:k}=e;return Object.assign(Object.assign({},Qm),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:l,fontSizeSmall:n,fontSizeMedium:r,fontSizeLarge:t,borderRadius:s,dividerColor:k,borderColor:"#0000",listColor:d,headerColor:c,titleTextColor:u,titleTextColorDisabled:f,extraTextColor:v,extraTextColorDisabled:f,itemTextColor:p,itemTextColorDisabled:f,itemColorPending:h,titleFontWeight:o,closeColorHover:m,closeColorPressed:x,closeIconColor:C,closeIconColorHover:b,closeIconColorPressed:_})}},eb=Jm,ob=e=>{const{borderRadiusSmall:o,dividerColor:t,hoverColor:r,pressedColor:n,primaryColor:l,textColor3:a,textColor2:s,textColorDisabled:d,fontSize:c}=e;return{fontSize:c,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:o,nodeColorHover:r,nodeColorPressed:n,nodeColorActive:J(l,{alpha:.1}),arrowColor:a,nodeTextColor:s,nodeTextColorDisabled:d,loadingColor:l,dropMarkColor:l,lineColor:t}},tb={name:"Tree",common:fe,peers:{Checkbox:Xt,Scrollbar:$o,Empty:kt},self(e){const{primaryColor:o}=e,t=ob(e);return t.nodeColorActive=J(o,{alpha:.15}),t}},ls=tb,rb={name:"TreeSelect",common:fe,peers:{Tree:ls,Empty:kt,InternalSelection:Fn}},nb=rb,ib={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"},as=e=>{const{primaryColor:o,textColor2:t,borderColor:r,lineHeight:n,fontSize:l,borderRadiusSmall:a,dividerColor:s,fontWeightStrong:d,textColor1:c,textColor3:u,infoColor:f,warningColor:p,errorColor:v,successColor:h,codeColor:m}=e;return Object.assign(Object.assign({},ib),{aTextColor:o,blockquoteTextColor:t,blockquotePrefixColor:r,blockquoteLineHeight:n,blockquoteFontSize:l,codeBorderRadius:a,liTextColor:t,liLineHeight:n,liFontSize:l,hrColor:s,headerFontWeight:d,headerTextColor:c,pTextColor:t,pTextColor1Depth:c,pTextColor2Depth:t,pTextColor3Depth:u,pLineHeight:n,pFontSize:l,headerBarColor:o,headerBarColorPrimary:o,headerBarColorInfo:f,headerBarColorError:v,headerBarColorWarning:p,headerBarColorSuccess:h,textColor:t,textColor1Depth:c,textColor2Depth:t,textColor3Depth:u,textColorPrimary:o,textColorInfo:f,textColorSuccess:h,textColorWarning:p,textColorError:v,codeTextColor:t,codeColor:m,codeBorder:"1px solid #0000"})},lb={name:"Typography",common:Ae,self:as},ss=lb,ab={name:"Typography",common:fe,self:as},sb=ab,ds=e=>{const{iconColor:o,primaryColor:t,errorColor:r,textColor2:n,successColor:l,opacityDisabled:a,actionColor:s,borderColor:d,hoverColor:c,lineHeight:u,borderRadius:f,fontSize:p}=e;return{fontSize:p,lineHeight:u,borderRadius:f,draggerColor:s,draggerBorder:`1px dashed ${d}`,draggerBorderHover:`1px dashed ${t}`,itemColorHover:c,itemColorHoverError:J(r,{alpha:.06}),itemTextColor:n,itemTextColorError:r,itemTextColorSuccess:l,itemIconColor:o,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${d}`}},db={name:"Upload",common:Ae,peers:{Button:Yt,Progress:Qa},self:ds},cb=db,ub={name:"Upload",common:fe,peers:{Button:Ro,Progress:Ja},self(e){const{errorColor:o}=e,t=ds(e);return t.itemColorHoverError=J(o,{alpha:.09}),t}},fb=ub,hb={name:"Watermark",common:fe,self(e){const{fontFamily:o}=e;return{fontFamily:o}}},pb=hb,vb={name:"Row",common:fe},gb=vb,mb={name:"Image",common:fe,peers:{Tooltip:Er},self:e=>{const{textColor2:o}=e;return{toolbarIconColor:o,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},bb=i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M6 5C5.75454 5 5.55039 5.17688 5.50806 5.41012L5.5 5.5V14.5C5.5 14.7761 5.72386 15 6 15C6.24546 15 6.44961 14.8231 6.49194 14.5899L6.5 14.5V5.5C6.5 5.22386 6.27614 5 6 5ZM13.8536 5.14645C13.68 4.97288 13.4106 4.9536 13.2157 5.08859L13.1464 5.14645L8.64645 9.64645C8.47288 9.82001 8.4536 10.0894 8.58859 10.2843L8.64645 10.3536L13.1464 14.8536C13.3417 15.0488 13.6583 15.0488 13.8536 14.8536C14.0271 14.68 14.0464 14.4106 13.9114 14.2157L13.8536 14.1464L9.70711 10L13.8536 5.85355C14.0488 5.65829 14.0488 5.34171 13.8536 5.14645Z",fill:"currentColor"})),xb=i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M13.5 5C13.7455 5 13.9496 5.17688 13.9919 5.41012L14 5.5V14.5C14 14.7761 13.7761 15 13.5 15C13.2545 15 13.0504 14.8231 13.0081 14.5899L13 14.5V5.5C13 5.22386 13.2239 5 13.5 5ZM5.64645 5.14645C5.82001 4.97288 6.08944 4.9536 6.28431 5.08859L6.35355 5.14645L10.8536 9.64645C11.0271 9.82001 11.0464 10.0894 10.9114 10.2843L10.8536 10.3536L6.35355 14.8536C6.15829 15.0488 5.84171 15.0488 5.64645 14.8536C5.47288 14.68 5.4536 14.4106 5.58859 14.2157L5.64645 14.1464L9.79289 10L5.64645 5.85355C5.45118 5.65829 5.45118 5.34171 5.64645 5.14645Z",fill:"currentColor"})),Cb=i("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M4.089 4.216l.057-.07a.5.5 0 0 1 .638-.057l.07.057L10 9.293l5.146-5.147a.5.5 0 0 1 .638-.057l.07.057a.5.5 0 0 1 .057.638l-.057.07L10.707 10l5.147 5.146a.5.5 0 0 1 .057.638l-.057.07a.5.5 0 0 1-.638.057l-.07-.057L10 10.707l-5.146 5.147a.5.5 0 0 1-.638.057l-.07-.057a.5.5 0 0 1-.057-.638l.057-.07L9.293 10L4.146 4.854a.5.5 0 0 1-.057-.638l.057-.07l-.057.07z",fill:"currentColor"})),yb=i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 1024 1024"},i("path",{fill:"currentColor",d:"M505.7 661a8 8 0 0 0 12.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})),wb=y([y("body >",[g("image-container","position: fixed;")]),g("image-preview-container",`
|
|
|
position: fixed;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
display: flex;
|
|
|
`),g("image-preview-overlay",`
|
|
|
z-index: -1;
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
background: rgba(0, 0, 0, .3);
|
|
|
`,[jt()]),g("image-preview-toolbar",`
|
|
|
z-index: 1;
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
border-radius: var(--n-toolbar-border-radius);
|
|
|
height: 48px;
|
|
|
bottom: 40px;
|
|
|
padding: 0 12px;
|
|
|
background: var(--n-toolbar-color);
|
|
|
box-shadow: var(--n-toolbar-box-shadow);
|
|
|
color: var(--n-toolbar-icon-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[g("base-icon",`
|
|
|
padding: 0 8px;
|
|
|
font-size: 28px;
|
|
|
cursor: pointer;
|
|
|
`),jt()]),g("image-preview-wrapper",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
display: flex;
|
|
|
pointer-events: none;
|
|
|
`,[ct()]),g("image-preview",`
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
pointer-events: all;
|
|
|
margin: auto;
|
|
|
max-height: calc(100vh - 32px);
|
|
|
max-width: calc(100vw - 32px);
|
|
|
transition: transform .3s var(--n-bezier);
|
|
|
`),g("image",`
|
|
|
display: inline-flex;
|
|
|
max-height: 100%;
|
|
|
max-width: 100%;
|
|
|
`,[Ne("preview-disabled",`
|
|
|
cursor: pointer;
|
|
|
`),y("img",`
|
|
|
border-radius: inherit;
|
|
|
`)])]),$r=32,cs=Z({name:"ImagePreview",props:Object.assign(Object.assign({},Kn),{onNext:Function,onPrev:Function,clsPrefix:{type:String,required:!0}}),setup(e){const o=se("Image","-image",wb,gg,e,ae(e,"clsPrefix"));let t=null;const r=M(null),n=M(null),l=M(void 0),a=M(!1),s=M(!1),{localeRef:d}=Yo("Image");function c(){const{value:ne}=n;if(!t||!ne)return;const{style:Ce}=ne,ge=t.getBoundingClientRect(),Ee=ge.left+ge.width/2,Q=ge.top+ge.height/2;Ce.transformOrigin=`${Ee}px ${Q}px`}function u(ne){var Ce,ge;switch(ne.key){case" ":ne.preventDefault();break;case"ArrowLeft":(Ce=e.onPrev)===null||Ce===void 0||Ce.call(e);break;case"ArrowRight":(ge=e.onNext)===null||ge===void 0||ge.call(e);break;case"Escape":be();break}}Xe(a,ne=>{ne?Lo("keydown",document,u):Io("keydown",document,u)}),So(()=>{Io("keydown",document,u)});let f=0,p=0,v=0,h=0,m=0,x=0,C=0,b=0,_=!1;function k(ne){const{clientX:Ce,clientY:ge}=ne;v=Ce-f,h=ge-p,Zi(ee)}function z(ne){const{mouseUpClientX:Ce,mouseUpClientY:ge,mouseDownClientX:Ee,mouseDownClientY:Q}=ne,he=Ee-Ce,G=Q-ge,U=`vertical${G>0?"Top":"Bottom"}`,le=`horizontal${he>0?"Left":"Right"}`;return{moveVerticalDirection:U,moveHorizontalDirection:le,deltaHorizontal:he,deltaVertical:G}}function R(ne){const{value:Ce}=r;if(!Ce)return{offsetX:0,offsetY:0};const ge=Ce.getBoundingClientRect(),{moveVerticalDirection:Ee,moveHorizontalDirection:Q,deltaHorizontal:he,deltaVertical:G}=ne||{};let U=0,le=0;return ge.width<=window.innerWidth?U=0:ge.left>0?U=(ge.width-window.innerWidth)/2:ge.right<window.innerWidth?U=-(ge.width-window.innerWidth)/2:Q==="horizontalRight"?U=Math.min((ge.width-window.innerWidth)/2,m-(he??0)):U=Math.max(-((ge.width-window.innerWidth)/2),m-(he??0)),ge.height<=window.innerHeight?le=0:ge.top>0?le=(ge.height-window.innerHeight)/2:ge.bottom<window.innerHeight?le=-(ge.height-window.innerHeight)/2:Ee==="verticalBottom"?le=Math.min((ge.height-window.innerHeight)/2,x-(G??0)):le=Math.max(-((ge.height-window.innerHeight)/2),x-(G??0)),{offsetX:U,offsetY:le}}function S(ne){Io("mousemove",document,k),Io("mouseup",document,S);const{clientX:Ce,clientY:ge}=ne;_=!1;const Ee=z({mouseUpClientX:Ce,mouseUpClientY:ge,mouseDownClientX:C,mouseDownClientY:b}),Q=R(Ee);v=Q.offsetX,h=Q.offsetY,ee()}const L=ze(Ka,null);function I(ne){var Ce,ge;if((ge=(Ce=L==null?void 0:L.previewedImgPropsRef.value)===null||Ce===void 0?void 0:Ce.onMousedown)===null||ge===void 0||ge.call(Ce,ne),ne.button!==0)return;const{clientX:Ee,clientY:Q}=ne;_=!0,f=Ee-v,p=Q-h,m=v,x=h,C=Ee,b=Q,ee(),Lo("mousemove",document,k),Lo("mouseup",document,S)}function D(ne){var Ce,ge;(ge=(Ce=L==null?void 0:L.previewedImgPropsRef.value)===null||Ce===void 0?void 0:Ce.onDblclick)===null||ge===void 0||ge.call(Ce,ne);const Ee=ie();j=j===Ee?1:Ee,ee()}const W=1.5;let H=0,j=1,V=0;function E(){j=1,H=0}function Y(){var ne;E(),V=0,(ne=e.onPrev)===null||ne===void 0||ne.call(e)}function K(){var ne;E(),V=0,(ne=e.onNext)===null||ne===void 0||ne.call(e)}function te(){V-=90,ee()}function xe(){V+=90,ee()}function de(){const{value:ne}=r;if(!ne)return 1;const{innerWidth:Ce,innerHeight:ge}=window,Ee=Math.max(1,ne.naturalHeight/(ge-$r)),Q=Math.max(1,ne.naturalWidth/(Ce-$r));return Math.max(3,Ee*2,Q*2)}function ie(){const{value:ne}=r;if(!ne)return 1;const{innerWidth:Ce,innerHeight:ge}=window,Ee=ne.naturalHeight/(ge-$r),Q=ne.naturalWidth/(Ce-$r);return Ee<1&&Q<1?1:Math.max(Ee,Q)}function F(){const ne=de();j<ne&&(H+=1,j=Math.min(ne,Math.pow(W,H)),ee())}function B(){if(j>.5){const ne=j;H-=1,j=Math.max(.5,Math.pow(W,H));const Ce=ne-j;ee(!1);const ge=R();j+=Ce,ee(!1),j-=Ce,v=ge.offsetX,h=ge.offsetY,ee()}}function q(){const ne=l.value;ne&&xl(ne,void 0)}function ee(ne=!0){var Ce;const{value:ge}=r;if(!ge)return;const{style:Ee}=ge,Q=ud((Ce=L==null?void 0:L.previewedImgPropsRef.value)===null||Ce===void 0?void 0:Ce.style);let he="";if(typeof Q=="string")he=Q+";";else for(const U in Q)he+=`${yd(U)}: ${Q[U]};`;const G=`transform-origin: center; transform: translateX(${v}px) translateY(${h}px) rotate(${V}deg) scale(${j});`;_?Ee.cssText=he+"cursor: grabbing; transition: none;"+G:Ee.cssText=he+"cursor: grab;"+G+(ne?"":"transition: none;"),ne||ge.offsetHeight}function be(){a.value=!a.value,s.value=!0}function me(){j=ie(),H=Math.ceil(Math.log(j)/Math.log(W)),v=0,h=0,ee()}const Be={setPreviewSrc:ne=>{l.value=ne},setThumbnailEl:ne=>{t=ne},toggleShow:be};function T(ne,Ce){if(e.showToolbarTooltip){const{value:ge}=o;return i(Hn,{to:!1,theme:ge.peers.Tooltip,themeOverrides:ge.peerOverrides.Tooltip,keepAliveOnHover:!1},{default:()=>d.value[Ce],trigger:()=>ne})}else return ne}const ve=$(()=>{const{common:{cubicBezierEaseInOut:ne},self:{toolbarIconColor:Ce,toolbarBorderRadius:ge,toolbarBoxShadow:Ee,toolbarColor:Q}}=o.value;return{"--n-bezier":ne,"--n-toolbar-icon-color":Ce,"--n-toolbar-color":Q,"--n-toolbar-border-radius":ge,"--n-toolbar-box-shadow":Ee}}),{inlineThemeDisabled:Se}=Ie(),Fe=Se?We("image-preview",void 0,ve,e):void 0;return Object.assign({previewRef:r,previewWrapperRef:n,previewSrc:l,show:a,appear:zt(),displayed:s,previewedImgProps:L==null?void 0:L.previewedImgPropsRef,handleWheel(ne){ne.preventDefault()},handlePreviewMousedown:I,handlePreviewDblclick:D,syncTransformOrigin:c,handleAfterLeave:()=>{E(),V=0,s.value=!1},handleDragStart:ne=>{var Ce,ge;(ge=(Ce=L==null?void 0:L.previewedImgPropsRef.value)===null||Ce===void 0?void 0:Ce.onDragstart)===null||ge===void 0||ge.call(Ce,ne),ne.preventDefault()},zoomIn:F,zoomOut:B,handleDownloadClick:q,rotateCounterclockwise:te,rotateClockwise:xe,handleSwitchPrev:Y,handleSwitchNext:K,withTooltip:T,resizeToOrignalImageSize:me,cssVars:Se?void 0:ve,themeClass:Fe==null?void 0:Fe.themeClass,onRender:Fe==null?void 0:Fe.onRender},Be)},render(){var e,o;const{clsPrefix:t}=this;return i(so,null,(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e),i($n,{show:this.show},{default:()=>{var r;return this.show||this.displayed?((r=this.onRender)===null||r===void 0||r.call(this),Ho(i("div",{class:[`${t}-image-preview-container`,this.themeClass],style:this.cssVars,onWheel:this.handleWheel},i(io,{name:"fade-in-transition",appear:this.appear},{default:()=>this.show?i("div",{class:`${t}-image-preview-overlay`,onClick:this.toggleShow}):null}),this.showToolbar?i(io,{name:"fade-in-transition",appear:this.appear},{default:()=>{if(!this.show)return null;const{withTooltip:n}=this;return i("div",{class:`${t}-image-preview-toolbar`},this.onPrev?i(so,null,n(i(He,{clsPrefix:t,onClick:this.handleSwitchPrev},{default:()=>bb}),"tipPrevious"),n(i(He,{clsPrefix:t,onClick:this.handleSwitchNext},{default:()=>xb}),"tipNext")):null,n(i(He,{clsPrefix:t,onClick:this.rotateCounterclockwise},{default:()=>i(dc,null)}),"tipCounterclockwise"),n(i(He,{clsPrefix:t,onClick:this.rotateClockwise},{default:()=>i(sc,null)}),"tipClockwise"),n(i(He,{clsPrefix:t,onClick:this.resizeToOrignalImageSize},{default:()=>i(fc,null)}),"tipOriginalSize"),n(i(He,{clsPrefix:t,onClick:this.zoomOut},{default:()=>i(uc,null)}),"tipZoomOut"),n(i(He,{clsPrefix:t,onClick:this.zoomIn},{default:()=>i(cc,null)}),"tipZoomIn"),n(i(He,{clsPrefix:t,onClick:this.handleDownloadClick},{default:()=>yb}),"tipDownload"),n(i(He,{clsPrefix:t,onClick:this.toggleShow},{default:()=>Cb}),"tipClose"))}}):null,i(io,{name:"fade-in-scale-up-transition",onAfterLeave:this.handleAfterLeave,appear:this.appear,onEnter:this.syncTransformOrigin,onBeforeLeave:this.syncTransformOrigin},{default:()=>{const{previewedImgProps:n={}}=this;return Ho(i("div",{class:`${t}-image-preview-wrapper`,ref:"previewWrapperRef"},i("img",Object.assign({},n,{draggable:!1,onMousedown:this.handlePreviewMousedown,onDblclick:this.handlePreviewDblclick,class:[`${t}-image-preview`,n.class],key:this.previewSrc,src:this.previewSrc,ref:"previewRef",onDragstart:this.handleDragStart}))),[[Go,this.show]])}})),[[Mr,{enabled:this.show}]])):null}}))}}),us="n-image-group",Sb=Kn,zb=Z({name:"ImageGroup",props:Sb,setup(e){let o;const{mergedClsPrefixRef:t}=Ie(e),r=`c${tt()}`,n=Tr(),l=d=>{var c;o=d,(c=s.value)===null||c===void 0||c.setPreviewSrc(d)};function a(d){var c,u;if(!(n!=null&&n.proxy))return;const p=n.proxy.$el.parentElement.querySelectorAll(`[data-group-id=${r}]:not([data-error=true])`);if(!p.length)return;const v=Array.from(p).findIndex(h=>h.dataset.previewSrc===o);~v?l(p[(v+d+p.length)%p.length].dataset.previewSrc):l(p[0].dataset.previewSrc),d===1?(c=e.onPreviewNext)===null||c===void 0||c.call(e):(u=e.onPreviewPrev)===null||u===void 0||u.call(e)}De(us,{mergedClsPrefixRef:t,setPreviewSrc:l,setThumbnailEl:d=>{var c;(c=s.value)===null||c===void 0||c.setThumbnailEl(d)},toggleShow:()=>{var d;(d=s.value)===null||d===void 0||d.toggleShow()},groupId:r});const s=M(null);return{mergedClsPrefix:t,previewInstRef:s,next:()=>{a(1)},prev:()=>{a(-1)}}},render(){return i(cs,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:this.mergedClsPrefix,ref:"previewInstRef",onPrev:this.prev,onNext:this.next,showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},this.$slots)}}),$b=Object.assign({alt:String,height:[String,Number],imgProps:Object,previewedImgProps:Object,lazy:Boolean,intersectionObserverOptions:Object,objectFit:{type:String,default:"fill"},previewSrc:String,fallbackSrc:String,width:[String,Number],src:String,previewDisabled:Boolean,loadDescription:String,onError:Function,onLoad:Function},Kn),Rb=Z({name:"Image",props:$b,inheritAttrs:!1,setup(e){const o=M(null),t=M(!1),r=M(null),n=ze(us,null),{mergedClsPrefixRef:l}=n||Ie(e),a={click:()=>{if(e.previewDisabled||t.value)return;const c=e.previewSrc||e.src;if(n){n.setPreviewSrc(c),n.setThumbnailEl(o.value),n.toggleShow();return}const{value:u}=r;u&&(u.setPreviewSrc(c),u.setThumbnailEl(o.value),u.toggleShow())}},s=M(!e.lazy);po(()=>{var c;(c=o.value)===null||c===void 0||c.setAttribute("data-group-id",(n==null?void 0:n.groupId)||"")}),po(()=>{if(e.lazy&&e.intersectionObserverOptions){let c;const u=oo(()=>{c==null||c(),c=void 0,c=ql(o.value,e.intersectionObserverOptions,s)});So(()=>{u(),c==null||c()})}}),oo(()=>{var c;e.src||((c=e.imgProps)===null||c===void 0||c.src),t.value=!1});const d=M(!1);return De(Ka,{previewedImgPropsRef:ae(e,"previewedImgProps")}),Object.assign({mergedClsPrefix:l,groupId:n==null?void 0:n.groupId,previewInstRef:r,imageRef:o,showError:t,shouldStartLoading:s,loaded:d,mergedOnClick:c=>{var u,f;a.click(),(f=(u=e.imgProps)===null||u===void 0?void 0:u.onClick)===null||f===void 0||f.call(u,c)},mergedOnError:c=>{if(!s.value)return;t.value=!0;const{onError:u,imgProps:{onError:f}={}}=e;u==null||u(c),f==null||f(c)},mergedOnLoad:c=>{const{onLoad:u,imgProps:{onLoad:f}={}}=e;u==null||u(c),f==null||f(c),d.value=!0}},a)},render(){var e,o;const{mergedClsPrefix:t,imgProps:r={},loaded:n,$attrs:l,lazy:a}=this,s=(o=(e=this.$slots).placeholder)===null||o===void 0?void 0:o.call(e),d=this.src||r.src,c=i("img",Object.assign(Object.assign({},r),{ref:"imageRef",width:this.width||r.width,height:this.height||r.height,src:this.showError?this.fallbackSrc:a&&this.intersectionObserverOptions?this.shouldStartLoading?d:void 0:d,alt:this.alt||r.alt,"aria-label":this.alt||r.alt,onClick:this.mergedOnClick,onError:this.mergedOnError,onLoad:this.mergedOnLoad,loading:Gl&&a&&!this.intersectionObserverOptions?"lazy":"eager",style:[r.style||"",s&&!n?{height:"0",width:"0",visibility:"hidden"}:"",{objectFit:this.objectFit}],"data-error":this.showError,"data-preview-src":this.previewSrc||this.src}));return i("div",Object.assign({},l,{role:"none",class:[l.class,`${t}-image`,(this.previewDisabled||this.showError)&&`${t}-image--preview-disabled`]}),this.groupId?c:i(cs,{theme:this.theme,themeOverrides:this.themeOverrides,clsPrefix:t,ref:"previewInstRef",showToolbar:this.showToolbar,showToolbarTooltip:this.showToolbarTooltip},{default:()=>c}),!n&&s)}});function Pb(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function kb(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^\.\d+$/.test(e))}function sn(e){return e==null?!0:!Number.isNaN(e)}function Li(e,o){return e==null?"":o===void 0?String(e):e.toFixed(o)}function dn(e){if(e===null)return null;if(typeof e=="number")return e;{const o=Number(e);return Number.isNaN(o)?null:o}}const Ib=y([g("input-number-suffix",`
|
|
|
display: inline-block;
|
|
|
margin-right: 10px;
|
|
|
`),g("input-number-prefix",`
|
|
|
display: inline-block;
|
|
|
margin-left: 10px;
|
|
|
`)]),Hi=800,Ai=100,Bb=Object.assign(Object.assign({},se.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},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]}),Z1=Z({name:"InputNumber",props:Bb,setup(e){const{mergedBorderedRef:o,mergedClsPrefixRef:t,mergedRtlRef:r}=Ie(e),n=se("InputNumber","-input-number",Ib,Og,e,t),{localeRef:l}=Yo("InputNumber"),a=rt(e),{mergedSizeRef:s,mergedDisabledRef:d,mergedStatusRef:c}=a,u=M(null),f=M(null),p=M(null),v=M(e.defaultValue),h=ae(e,"value"),m=co(h,v),x=M(""),C=Q=>{const he=String(Q).split(".")[1];return he?he.length:0},b=Q=>{const he=[e.min,e.max,e.step,Q].map(G=>G===void 0?0:C(G));return Math.max(...he)},_=Ve(()=>{const{placeholder:Q}=e;return Q!==void 0?Q:l.value.placeholder}),k=Ve(()=>{const Q=dn(e.step);return Q!==null?Q===0?1:Math.abs(Q):1}),z=Ve(()=>{const Q=dn(e.min);return Q!==null?Q:null}),R=Ve(()=>{const Q=dn(e.max);return Q!==null?Q:null}),S=Q=>{const{value:he}=m;if(Q===he){I();return}const{"onUpdate:value":G,onUpdateValue:U,onChange:le}=e,{nTriggerFormInput:ye,nTriggerFormChange:_e}=a;le&&ce(le,Q),U&&ce(U,Q),G&&ce(G,Q),v.value=Q,ye(),_e()},L=({offset:Q,doUpdateIfValid:he,fixPrecision:G,isInputing:U})=>{const{value:le}=x;if(U&&kb(le))return!1;const ye=(e.parse||Pb)(le);if(ye===null)return he&&S(null),null;if(sn(ye)){const _e=C(ye),{precision:oe}=e;if(oe!==void 0&&oe<_e&&!G)return!1;let pe=parseFloat((ye+Q).toFixed(oe??b(ye)));if(sn(pe)){const{value:Ue}=R,{value:fo}=z;if(Ue!==null&&pe>Ue){if(!he||U)return!1;pe=Ue}if(fo!==null&&pe<fo){if(!he||U)return!1;pe=fo}return e.validator&&!e.validator(pe)?!1:(he&&S(pe),pe)}}return!1},I=()=>{const{value:Q}=m;if(sn(Q)){const{format:he,precision:G}=e;he?x.value=he(Q):Q===null||G===void 0||C(Q)>G?x.value=Li(Q,void 0):x.value=Li(Q,G)}else x.value=String(Q)};I();const D=Ve(()=>L({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),W=Ve(()=>{const{value:Q}=m;if(e.validator&&Q===null)return!1;const{value:he}=k;return L({offset:-he,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),H=Ve(()=>{const{value:Q}=m;if(e.validator&&Q===null)return!1;const{value:he}=k;return L({offset:+he,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function j(Q){const{onFocus:he}=e,{nTriggerFormFocus:G}=a;he&&ce(he,Q),G()}function V(Q){var he,G;if(Q.target===((he=u.value)===null||he===void 0?void 0:he.wrapperElRef))return;const U=L({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(U!==!1){const _e=(G=u.value)===null||G===void 0?void 0:G.inputElRef;_e&&(_e.value=String(U||"")),m.value===U&&I()}else I();const{onBlur:le}=e,{nTriggerFormBlur:ye}=a;le&&ce(le,Q),ye(),lo(()=>{I()})}function E(Q){const{onClear:he}=e;he&&ce(he,Q)}function Y(){const{value:Q}=H;if(!Q){me();return}const{value:he}=m;if(he===null)e.validator||S(de());else{const{value:G}=k;L({offset:G,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function K(){const{value:Q}=W;if(!Q){be();return}const{value:he}=m;if(he===null)e.validator||S(de());else{const{value:G}=k;L({offset:-G,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const te=j,xe=V;function de(){if(e.validator)return null;const{value:Q}=z,{value:he}=R;return Q!==null?Math.max(0,Q):he!==null?Math.min(0,he):0}function ie(Q){E(Q),S(null)}function F(Q){var he,G,U;!((he=p.value)===null||he===void 0)&&he.$el.contains(Q.target)&&Q.preventDefault(),!((G=f.value)===null||G===void 0)&&G.$el.contains(Q.target)&&Q.preventDefault(),(U=u.value)===null||U===void 0||U.activate()}let B=null,q=null,ee=null;function be(){ee&&(window.clearTimeout(ee),ee=null),B&&(window.clearInterval(B),B=null)}function me(){T&&(window.clearTimeout(T),T=null),q&&(window.clearInterval(q),q=null)}function Be(){be(),ee=window.setTimeout(()=>{B=window.setInterval(()=>{K()},Ai)},Hi),Lo("mouseup",document,be,{once:!0})}let T=null;function ve(){me(),T=window.setTimeout(()=>{q=window.setInterval(()=>{Y()},Ai)},Hi),Lo("mouseup",document,me,{once:!0})}const Se=()=>{q||Y()},Fe=()=>{B||K()};function ne(Q){var he,G;if(Q.key==="Enter"){if(Q.target===((he=u.value)===null||he===void 0?void 0:he.wrapperElRef))return;L({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((G=u.value)===null||G===void 0||G.deactivate())}else if(Q.key==="ArrowUp"){if(!H.value||e.keyboard.ArrowUp===!1)return;Q.preventDefault(),L({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&Y()}else if(Q.key==="ArrowDown"){if(!W.value||e.keyboard.ArrowDown===!1)return;Q.preventDefault(),L({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&K()}}function Ce(Q){x.value=Q,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&L({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}Xe(m,()=>{I()});const ge={focus:()=>{var Q;return(Q=u.value)===null||Q===void 0?void 0:Q.focus()},blur:()=>{var Q;return(Q=u.value)===null||Q===void 0?void 0:Q.blur()},select:()=>{var Q;return(Q=u.value)===null||Q===void 0?void 0:Q.select()}},Ee=eo("InputNumber",r,t);return Object.assign(Object.assign({},ge),{rtlEnabled:Ee,inputInstRef:u,minusButtonInstRef:f,addButtonInstRef:p,mergedClsPrefix:t,mergedBordered:o,uncontrolledValue:v,mergedValue:m,mergedPlaceholder:_,displayedValueInvalid:D,mergedSize:s,mergedDisabled:d,displayedValue:x,addable:H,minusable:W,mergedStatus:c,handleFocus:te,handleBlur:xe,handleClear:ie,handleMouseDown:F,handleAddClick:Se,handleMinusClick:Fe,handleAddMousedown:ve,handleMinusMousedown:Be,handleKeyDown:ne,handleUpdateDisplayedValue:Ce,mergedTheme:n,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:$(()=>{const{self:{iconColorDisabled:Q}}=n.value,[he,G,U,le]=ur(Q);return{textColorTextDisabled:`rgb(${he}, ${G}, ${U})`,opacityDisabled:`${le}`}})})},render(){const{mergedClsPrefix:e,$slots:o}=this,t=()=>i($i,{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:()=>ao(o["minus-icon"],()=>[i(He,{clsPrefix:e},{default:()=>i(wl,null)})])}),r=()=>i($i,{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:()=>ao(o["add-icon"],()=>[i(He,{clsPrefix:e},{default:()=>i(sr,null)})])});return i("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},i(St,{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,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:()=>{var n;return this.showButton&&this.buttonPlacement==="both"?[t(),je(o.prefix,l=>l?i("span",{class:`${e}-input-number-prefix`},l):null)]:(n=o.prefix)===null||n===void 0?void 0:n.call(o)},suffix:()=>{var n;return this.showButton?[je(o.suffix,l=>l?i("span",{class:`${e}-input-number-suffix`},l):null),this.buttonPlacement==="right"?t():null,r()]:(n=o.suffix)===null||n===void 0?void 0:n.call(o)}}))}}),Tb="n-layout-sider",Ob={extraFontSize:"12px",width:"440px"},Fb={name:"Transfer",common:fe,peers:{Checkbox:Xt,Scrollbar:$o,Input:Ao,Empty:kt,Button:Ro},self(e){const{iconColorDisabled:o,iconColor:t,fontWeight:r,fontSizeLarge:n,fontSizeMedium:l,fontSizeSmall:a,heightLarge:s,heightMedium:d,heightSmall:c,borderRadius:u,inputColor:f,tableHeaderColor:p,textColor1:v,textColorDisabled:h,textColor2:m,hoverColor:x}=e;return Object.assign(Object.assign({},Ob),{itemHeightSmall:c,itemHeightMedium:d,itemHeightLarge:s,fontSizeSmall:a,fontSizeMedium:l,fontSizeLarge:n,borderRadius:u,borderColor:"#0000",listColor:f,headerColor:p,titleTextColor:v,titleTextColorDisabled:h,extraTextColor:m,filterDividerColor:"#0000",itemTextColor:m,itemTextColorDisabled:h,itemColorPending:x,titleFontWeight:r,iconColor:t,iconColorDisabled:o})}},_b=Fb,Mb=y([g("list",`
|
|
|
--n-merged-border-color: var(--n-border-color);
|
|
|
--n-merged-color: var(--n-color);
|
|
|
--n-merged-color-hover: var(--n-color-hover);
|
|
|
margin: 0;
|
|
|
font-size: var(--n-font-size);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
padding: 0;
|
|
|
list-style-type: none;
|
|
|
color: var(--n-text-color);
|
|
|
background-color: var(--n-merged-color);
|
|
|
`,[P("show-divider",[g("list-item",[y("&:not(:last-child)",[w("divider",`
|
|
|
background-color: var(--n-merged-border-color);
|
|
|
`)])])]),P("clickable",[g("list-item",`
|
|
|
cursor: pointer;
|
|
|
`)]),P("bordered",`
|
|
|
border: 1px solid var(--n-merged-border-color);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
`),P("hoverable",[g("list-item",`
|
|
|
border-radius: var(--n-border-radius);
|
|
|
`,[y("&:hover",`
|
|
|
background-color: var(--n-merged-color-hover);
|
|
|
`,[w("divider",`
|
|
|
background-color: transparent;
|
|
|
`)])])]),P("bordered, hoverable",[g("list-item",`
|
|
|
padding: 12px 20px;
|
|
|
`),w("header, footer",`
|
|
|
padding: 12px 20px;
|
|
|
`)]),w("header, footer",`
|
|
|
padding: 12px 0;
|
|
|
box-sizing: border-box;
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`,[y("&:not(:last-child)",`
|
|
|
border-bottom: 1px solid var(--n-merged-border-color);
|
|
|
`)]),g("list-item",`
|
|
|
position: relative;
|
|
|
padding: 12px 0;
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
flex-wrap: nowrap;
|
|
|
align-items: center;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`,[w("prefix",`
|
|
|
margin-right: 20px;
|
|
|
flex: 0;
|
|
|
`),w("suffix",`
|
|
|
margin-left: 20px;
|
|
|
flex: 0;
|
|
|
`),w("main",`
|
|
|
flex: 1;
|
|
|
`),w("divider",`
|
|
|
height: 1px;
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
background-color: transparent;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
pointer-events: none;
|
|
|
`)])]),Lr(g("list",`
|
|
|
--n-merged-color-hover: var(--n-color-hover-modal);
|
|
|
--n-merged-color: var(--n-color-modal);
|
|
|
--n-merged-border-color: var(--n-border-color-modal);
|
|
|
`)),Pn(g("list",`
|
|
|
--n-merged-color-hover: var(--n-color-hover-popover);
|
|
|
--n-merged-color: var(--n-color-popover);
|
|
|
--n-merged-border-color: var(--n-border-color-popover);
|
|
|
`))]),Db=Object.assign(Object.assign({},se.props),{size:{type:String,default:"medium"},bordered:Boolean,clickable:Boolean,hoverable:Boolean,showDivider:{type:Boolean,default:!0}}),fs="n-list",Q1=Z({name:"List",props:Db,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:r}=Ie(e),n=eo("List",r,o),l=se("List","-list",Mb,Dg,e,o);De(fs,{showDividerRef:ae(e,"showDivider"),mergedClsPrefixRef:o});const a=$(()=>{const{common:{cubicBezierEaseInOut:d},self:{fontSize:c,textColor:u,color:f,colorModal:p,colorPopover:v,borderColor:h,borderColorModal:m,borderColorPopover:x,borderRadius:C,colorHover:b,colorHoverModal:_,colorHoverPopover:k}}=l.value;return{"--n-font-size":c,"--n-bezier":d,"--n-text-color":u,"--n-color":f,"--n-border-radius":C,"--n-border-color":h,"--n-border-color-modal":m,"--n-border-color-popover":x,"--n-color-modal":p,"--n-color-popover":v,"--n-color-hover":b,"--n-color-hover-modal":_,"--n-color-hover-popover":k}}),s=t?We("list",void 0,a,e):void 0;return{mergedClsPrefix:o,rtlEnabled:n,cssVars:t?void 0:a,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e;const{$slots:o,mergedClsPrefix:t,onRender:r}=this;return r==null||r(),i("ul",{class:[`${t}-list`,this.rtlEnabled&&`${t}-list--rtl`,this.bordered&&`${t}-list--bordered`,this.showDivider&&`${t}-list--show-divider`,this.hoverable&&`${t}-list--hoverable`,this.clickable&&`${t}-list--clickable`,this.themeClass],style:this.cssVars},o.header?i("div",{class:`${t}-list__header`},o.header()):null,(e=o.default)===null||e===void 0?void 0:e.call(o),o.footer?i("div",{class:`${t}-list__footer`},o.footer()):null)}}),J1=Z({name:"ListItem",setup(){const e=ze(fs,null);return e||Wo("list-item","`n-list-item` must be placed in `n-list`."),{showDivider:e.showDividerRef,mergedClsPrefix:e.mergedClsPrefixRef}},render(){const{$slots:e,mergedClsPrefix:o}=this;return i("li",{class:`${o}-list-item`},e.prefix?i("div",{class:`${o}-list-item__prefix`},e.prefix()):null,e.default?i("div",{class:`${o}-list-item__main`},e):null,e.suffix?i("div",{class:`${o}-list-item__suffix`},e.suffix()):null,this.showDivider&&i("div",{class:`${o}-list-item__divider`}))}}),yr="n-menu",Gn="n-submenu",qn="n-menu-item-group",Rr=8;function Yn(e){const o=ze(yr),{props:t,mergedCollapsedRef:r}=o,n=ze(Gn,null),l=ze(qn,null),a=$(()=>t.mode==="horizontal"),s=$(()=>a.value?t.dropdownPlacement:"tmNodes"in e?"right-start":"right"),d=$(()=>{var p;return Math.max((p=t.collapsedIconSize)!==null&&p!==void 0?p:t.iconSize,t.iconSize)}),c=$(()=>{var p;return!a.value&&e.root&&r.value&&(p=t.collapsedIconSize)!==null&&p!==void 0?p:t.iconSize}),u=$(()=>{if(a.value)return;const{collapsedWidth:p,indent:v,rootIndent:h}=t,{root:m,isGroup:x}=e,C=h===void 0?v:h;return m?r.value?p/2-d.value/2:C:l&&typeof l.paddingLeftRef.value=="number"?v/2+l.paddingLeftRef.value:n&&typeof n.paddingLeftRef.value=="number"?(x?v/2:v)+n.paddingLeftRef.value:0}),f=$(()=>{const{collapsedWidth:p,indent:v,rootIndent:h}=t,{value:m}=d,{root:x}=e;return a.value||!x||!r.value?Rr:(h===void 0?v:h)+m+Rr-(p+m)/2});return{dropdownPlacement:s,activeIconSize:c,maxIconSize:d,paddingLeft:u,iconMarginRight:f,NMenu:o,NSubmenu:n}}const Xn={internalKey:{type:[String,Number],required:!0},root:Boolean,isGroup:Boolean,level:{type:Number,required:!0},title:[String,Function],extra:[String,Function]},hs=Object.assign(Object.assign({},Xn),{tmNode:{type:Object,required:!0},tmNodes:{type:Array,required:!0}}),Lb=Z({name:"MenuOptionGroup",props:hs,setup(e){De(Gn,null);const o=Yn(e);De(qn,{paddingLeftRef:o.paddingLeft});const{mergedClsPrefixRef:t,props:r}=ze(yr);return function(){const{value:n}=t,l=o.paddingLeft.value,{nodeProps:a}=r,s=a==null?void 0:a(e.tmNode.rawNode);return i("div",{class:`${n}-menu-item-group`,role:"group"},i("div",Object.assign({},s,{class:[`${n}-menu-item-group-title`,s==null?void 0:s.class],style:[(s==null?void 0:s.style)||"",l!==void 0?`padding-left: ${l}px;`:""]}),Qe(e.title),e.extra?i(so,null," ",Qe(e.extra)):null),i("div",null,e.tmNodes.map(d=>Zn(d,r))))}}}),ps=Z({name:"MenuOptionContent",props:{collapsed:Boolean,disabled:Boolean,title:[String,Function],icon:Function,extra:[String,Function],showArrow:Boolean,childActive:Boolean,hover:Boolean,paddingLeft:Number,selected:Boolean,maxIconSize:{type:Number,required:!0},activeIconSize:{type:Number,required:!0},iconMarginRight:{type:Number,required:!0},clsPrefix:{type:String,required:!0},onClick:Function,tmNode:{type:Object,required:!0},isEllipsisPlaceholder:Boolean},setup(e){const{props:o}=ze(yr);return{menuProps:o,style:$(()=>{const{paddingLeft:t}=e;return{paddingLeft:t&&`${t}px`}}),iconStyle:$(()=>{const{maxIconSize:t,activeIconSize:r,iconMarginRight:n}=e;return{width:`${t}px`,height:`${t}px`,fontSize:`${r}px`,marginRight:`${n}px`}})}},render(){const{clsPrefix:e,tmNode:o,menuProps:{renderIcon:t,renderLabel:r,renderExtra:n,expandIcon:l}}=this,a=t?t(o.rawNode):Qe(this.icon);return i("div",{onClick:s=>{var d;(d=this.onClick)===null||d===void 0||d.call(this,s)},role:"none",class:[`${e}-menu-item-content`,{[`${e}-menu-item-content--selected`]:this.selected,[`${e}-menu-item-content--collapsed`]:this.collapsed,[`${e}-menu-item-content--child-active`]:this.childActive,[`${e}-menu-item-content--disabled`]:this.disabled,[`${e}-menu-item-content--hover`]:this.hover}],style:this.style},a&&i("div",{class:`${e}-menu-item-content__icon`,style:this.iconStyle,role:"none"},[a]),i("div",{class:`${e}-menu-item-content-header`,role:"none"},this.isEllipsisPlaceholder?this.title:r?r(o.rawNode):Qe(this.title),this.extra||n?i("span",{class:`${e}-menu-item-content-header__extra`}," ",n?n(o.rawNode):Qe(this.extra)):null),this.showArrow?i(He,{ariaHidden:!0,class:`${e}-menu-item-content__arrow`,clsPrefix:e},{default:()=>l?l(o.rawNode):i(lc,null)}):null)}}),vs=Object.assign(Object.assign({},Xn),{rawNodes:{type:Array,default:()=>[]},tmNodes:{type:Array,default:()=>[]},tmNode:{type:Object,required:!0},disabled:Boolean,icon:Function,onClick:Function,domId:String,virtualChildActive:{type:Boolean,default:void 0},isEllipsisPlaceholder:Boolean}),bn=Z({name:"Submenu",props:vs,setup(e){const o=Yn(e),{NMenu:t,NSubmenu:r}=o,{props:n,mergedCollapsedRef:l,mergedThemeRef:a}=t,s=$(()=>{const{disabled:p}=e;return r!=null&&r.mergedDisabledRef.value||n.disabled?!0:p}),d=M(!1);De(Gn,{paddingLeftRef:o.paddingLeft,mergedDisabledRef:s}),De(qn,null);function c(){const{onClick:p}=e;p&&p()}function u(){s.value||(l.value||t.toggleExpand(e.internalKey),c())}function f(p){d.value=p}return{menuProps:n,mergedTheme:a,doSelect:t.doSelect,inverted:t.invertedRef,isHorizontal:t.isHorizontalRef,mergedClsPrefix:t.mergedClsPrefixRef,maxIconSize:o.maxIconSize,activeIconSize:o.activeIconSize,iconMarginRight:o.iconMarginRight,dropdownPlacement:o.dropdownPlacement,dropdownShow:d,paddingLeft:o.paddingLeft,mergedDisabled:s,mergedValue:t.mergedValueRef,childActive:Ve(()=>{var p;return(p=e.virtualChildActive)!==null&&p!==void 0?p:t.activePathRef.value.includes(e.internalKey)}),collapsed:$(()=>n.mode==="horizontal"?!1:l.value?!0:!t.mergedExpandedKeysRef.value.includes(e.internalKey)),dropdownEnabled:$(()=>!s.value&&(n.mode==="horizontal"||l.value)),handlePopoverShowChange:f,handleClick:u}},render(){var e;const{mergedClsPrefix:o,menuProps:{renderIcon:t,renderLabel:r}}=this,n=()=>{const{isHorizontal:a,paddingLeft:s,collapsed:d,mergedDisabled:c,maxIconSize:u,activeIconSize:f,title:p,childActive:v,icon:h,handleClick:m,menuProps:{nodeProps:x},dropdownShow:C,iconMarginRight:b,tmNode:_,mergedClsPrefix:k,isEllipsisPlaceholder:z,extra:R}=this,S=x==null?void 0:x(_.rawNode);return i("div",Object.assign({},S,{class:[`${k}-menu-item`,S==null?void 0:S.class],role:"menuitem"}),i(ps,{tmNode:_,paddingLeft:s,collapsed:d,disabled:c,iconMarginRight:b,maxIconSize:u,activeIconSize:f,title:p,extra:R,showArrow:!a,childActive:v,clsPrefix:k,icon:h,hover:C,onClick:m,isEllipsisPlaceholder:z}))},l=()=>i(Rt,null,{default:()=>{const{tmNodes:a,collapsed:s}=this;return s?null:i("div",{class:`${o}-submenu-children`,role:"menu"},a.map(d=>Zn(d,this.menuProps)))}});return this.root?i(dp,Object.assign({size:"large",trigger:"hover"},(e=this.menuProps)===null||e===void 0?void 0:e.dropdownProps,{themeOverrides:this.mergedTheme.peerOverrides.Dropdown,theme:this.mergedTheme.peers.Dropdown,builtinThemeOverrides:{fontSizeLarge:"14px",optionIconSizeLarge:"18px"},value:this.mergedValue,disabled:!this.dropdownEnabled,placement:this.dropdownPlacement,keyField:this.menuProps.keyField,labelField:this.menuProps.labelField,childrenField:this.menuProps.childrenField,onUpdateShow:this.handlePopoverShowChange,options:this.rawNodes,onSelect:this.doSelect,inverted:this.inverted,renderIcon:t,renderLabel:r}),{default:()=>i("div",{class:`${o}-submenu`,role:"menuitem","aria-expanded":!this.collapsed,id:this.domId},n(),this.isHorizontal?null:l())}):i("div",{class:`${o}-submenu`,role:"menuitem","aria-expanded":!this.collapsed,id:this.domId},n(),l())}}),gs=Object.assign(Object.assign({},Xn),{tmNode:{type:Object,required:!0},disabled:Boolean,icon:Function,onClick:Function}),Hb=Z({name:"MenuOption",props:gs,setup(e){const o=Yn(e),{NSubmenu:t,NMenu:r}=o,{props:n,mergedClsPrefixRef:l,mergedCollapsedRef:a}=r,s=t?t.mergedDisabledRef:{value:!1},d=$(()=>s.value||e.disabled);function c(f){const{onClick:p}=e;p&&p(f)}function u(f){d.value||(r.doSelect(e.internalKey,e.tmNode.rawNode),c(f))}return{mergedClsPrefix:l,dropdownPlacement:o.dropdownPlacement,paddingLeft:o.paddingLeft,iconMarginRight:o.iconMarginRight,maxIconSize:o.maxIconSize,activeIconSize:o.activeIconSize,mergedTheme:r.mergedThemeRef,menuProps:n,dropdownEnabled:Ve(()=>e.root&&a.value&&n.mode!=="horizontal"&&!d.value),selected:Ve(()=>r.mergedValueRef.value===e.internalKey),mergedDisabled:d,handleClick:u}},render(){const{mergedClsPrefix:e,mergedTheme:o,tmNode:t,menuProps:{renderLabel:r,nodeProps:n}}=this,l=n==null?void 0:n(t.rawNode);return i("div",Object.assign({},l,{role:"menuitem",class:[`${e}-menu-item`,l==null?void 0:l.class]}),i(Hn,{theme:o.peers.Tooltip,themeOverrides:o.peerOverrides.Tooltip,trigger:"hover",placement:this.dropdownPlacement,disabled:!this.dropdownEnabled||this.title===void 0,internalExtraClass:["menu-tooltip"]},{default:()=>r?r(t.rawNode):Qe(this.title),trigger:()=>i(ps,{tmNode:t,clsPrefix:e,paddingLeft:this.paddingLeft,iconMarginRight:this.iconMarginRight,maxIconSize:this.maxIconSize,activeIconSize:this.activeIconSize,selected:this.selected,title:this.title,extra:this.extra,disabled:this.mergedDisabled,icon:this.icon,onClick:this.handleClick})}))}}),Ab=Z({name:"MenuDivider",setup(){const e=ze(yr),{mergedClsPrefixRef:o,isHorizontalRef:t}=e;return()=>t.value?null:i("div",{class:`${o.value}-menu-divider`})}}),Eb=wo(hs),jb=wo(gs),Wb=wo(vs);function xn(e){return e.type==="divider"||e.type==="render"}function Nb(e){return e.type==="divider"}function Zn(e,o){const{rawNode:t}=e,{show:r}=t;if(r===!1)return null;if(xn(t))return Nb(t)?i(Ab,Object.assign({key:e.key},t.props)):null;const{labelField:n}=o,{key:l,level:a,isGroup:s}=e,d=Object.assign(Object.assign({},t),{title:t.title||t[n],extra:t.titleExtra||t.extra,key:l,internalKey:l,level:a,root:a===0,isGroup:s});return e.children?e.isGroup?i(Lb,mo(d,Eb,{tmNode:e,tmNodes:e.children,key:l})):i(bn,mo(d,Wb,{key:l,rawNodes:t[o.childrenField],tmNodes:e.children,tmNode:e})):i(Hb,mo(d,jb,{key:l,tmNode:e}))}const Ei=[y("&::before","background-color: var(--n-item-color-hover);"),w("arrow",`
|
|
|
color: var(--n-arrow-color-hover);
|
|
|
`),w("icon",`
|
|
|
color: var(--n-item-icon-color-hover);
|
|
|
`),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-hover);
|
|
|
`,[y("a",`
|
|
|
color: var(--n-item-text-color-hover);
|
|
|
`),w("extra",`
|
|
|
color: var(--n-item-text-color-hover);
|
|
|
`)])],ji=[w("icon",`
|
|
|
color: var(--n-item-icon-color-hover-horizontal);
|
|
|
`),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-hover-horizontal);
|
|
|
`,[y("a",`
|
|
|
color: var(--n-item-text-color-hover-horizontal);
|
|
|
`),w("extra",`
|
|
|
color: var(--n-item-text-color-hover-horizontal);
|
|
|
`)])],Vb=y([g("menu",`
|
|
|
background-color: var(--n-color);
|
|
|
color: var(--n-item-text-color);
|
|
|
overflow: hidden;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
box-sizing: border-box;
|
|
|
font-size: var(--n-font-size);
|
|
|
padding-bottom: 6px;
|
|
|
`,[P("horizontal",`
|
|
|
max-width: 100%;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
overflow: hidden;
|
|
|
padding-bottom: 0;
|
|
|
`,[g("submenu","margin: 0;"),g("menu-item","margin: 0;"),g("menu-item-content",`
|
|
|
padding: 0 20px;
|
|
|
border-bottom: 2px solid #0000;
|
|
|
`,[y("&::before","display: none;"),P("selected","border-bottom: 2px solid var(--n-border-color-horizontal)")]),g("menu-item-content",[P("selected",[w("icon","color: var(--n-item-icon-color-active-horizontal);"),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-active-horizontal);
|
|
|
`,[y("a","color: var(--n-item-text-color-active-horizontal);"),w("extra","color: var(--n-item-text-color-active-horizontal);")])]),P("child-active",`
|
|
|
border-bottom: 2px solid var(--n-border-color-horizontal);
|
|
|
`,[g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-child-active-horizontal);
|
|
|
`,[y("a",`
|
|
|
color: var(--n-item-text-color-child-active-horizontal);
|
|
|
`),w("extra",`
|
|
|
color: var(--n-item-text-color-child-active-horizontal);
|
|
|
`)]),w("icon",`
|
|
|
color: var(--n-item-icon-color-child-active-horizontal);
|
|
|
`)]),Ne("disabled",[Ne("selected, child-active",[y("&:focus-within",ji)]),P("selected",[mt(null,[w("icon","color: var(--n-item-icon-color-active-hover-horizontal);"),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-active-hover-horizontal);
|
|
|
`,[y("a","color: var(--n-item-text-color-active-hover-horizontal);"),w("extra","color: var(--n-item-text-color-active-hover-horizontal);")])])]),P("child-active",[mt(null,[w("icon","color: var(--n-item-icon-color-child-active-hover-horizontal);"),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-child-active-hover-horizontal);
|
|
|
`,[y("a","color: var(--n-item-text-color-child-active-hover-horizontal);"),w("extra","color: var(--n-item-text-color-child-active-hover-horizontal);")])])]),mt("border-bottom: 2px solid var(--n-border-color-horizontal);",ji)]),g("menu-item-content-header",[y("a","color: var(--n-item-text-color-horizontal);")])])]),Ne("responsive",[g("menu-item-content-header",`
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
`)]),P("collapsed",[g("menu-item-content",[P("selected",[y("&::before",`
|
|
|
background-color: var(--n-item-color-active-collapsed) !important;
|
|
|
`)]),g("menu-item-content-header","opacity: 0;"),w("arrow","opacity: 0;"),w("icon","color: var(--n-item-icon-color-collapsed);")])]),g("menu-item",`
|
|
|
height: var(--n-item-height);
|
|
|
margin-top: 6px;
|
|
|
position: relative;
|
|
|
`),g("menu-item-content",`
|
|
|
box-sizing: border-box;
|
|
|
line-height: 1.75;
|
|
|
height: 100%;
|
|
|
display: grid;
|
|
|
grid-template-areas: "icon content arrow";
|
|
|
grid-template-columns: auto 1fr auto;
|
|
|
align-items: center;
|
|
|
cursor: pointer;
|
|
|
position: relative;
|
|
|
padding-right: 18px;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
padding-left .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`,[y("> *","z-index: 1;"),y("&::before",`
|
|
|
z-index: auto;
|
|
|
content: "";
|
|
|
background-color: #0000;
|
|
|
position: absolute;
|
|
|
left: 8px;
|
|
|
right: 8px;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
pointer-events: none;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
`),P("disabled",`
|
|
|
opacity: .45;
|
|
|
cursor: not-allowed;
|
|
|
`),P("collapsed",[w("arrow","transform: rotate(0);")]),P("selected",[y("&::before","background-color: var(--n-item-color-active);"),w("arrow","color: var(--n-arrow-color-active);"),w("icon","color: var(--n-item-icon-color-active);"),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-active);
|
|
|
`,[y("a","color: var(--n-item-text-color-active);"),w("extra","color: var(--n-item-text-color-active);")])]),P("child-active",[g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-child-active);
|
|
|
`,[y("a",`
|
|
|
color: var(--n-item-text-color-child-active);
|
|
|
`),w("extra",`
|
|
|
color: var(--n-item-text-color-child-active);
|
|
|
`)]),w("arrow",`
|
|
|
color: var(--n-arrow-color-child-active);
|
|
|
`),w("icon",`
|
|
|
color: var(--n-item-icon-color-child-active);
|
|
|
`)]),Ne("disabled",[Ne("selected, child-active",[y("&:focus-within",Ei)]),P("selected",[mt(null,[w("arrow","color: var(--n-arrow-color-active-hover);"),w("icon","color: var(--n-item-icon-color-active-hover);"),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-active-hover);
|
|
|
`,[y("a","color: var(--n-item-text-color-active-hover);"),w("extra","color: var(--n-item-text-color-active-hover);")])])]),P("child-active",[mt(null,[w("arrow","color: var(--n-arrow-color-child-active-hover);"),w("icon","color: var(--n-item-icon-color-child-active-hover);"),g("menu-item-content-header",`
|
|
|
color: var(--n-item-text-color-child-active-hover);
|
|
|
`,[y("a","color: var(--n-item-text-color-child-active-hover);"),w("extra","color: var(--n-item-text-color-child-active-hover);")])])]),P("selected",[mt(null,[y("&::before","background-color: var(--n-item-color-active-hover);")])]),mt(null,Ei)]),w("icon",`
|
|
|
grid-area: icon;
|
|
|
color: var(--n-item-icon-color);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
font-size .3s var(--n-bezier),
|
|
|
margin-right .3s var(--n-bezier);
|
|
|
box-sizing: content-box;
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
`),w("arrow",`
|
|
|
grid-area: arrow;
|
|
|
font-size: 16px;
|
|
|
color: var(--n-arrow-color);
|
|
|
transform: rotate(180deg);
|
|
|
opacity: 1;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
transform 0.2s var(--n-bezier),
|
|
|
opacity 0.2s var(--n-bezier);
|
|
|
`),g("menu-item-content-header",`
|
|
|
grid-area: content;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier);
|
|
|
opacity: 1;
|
|
|
white-space: nowrap;
|
|
|
color: var(--n-item-text-color);
|
|
|
`,[y("a",`
|
|
|
outline: none;
|
|
|
text-decoration: none;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-item-text-color);
|
|
|
`,[y("&::before",`
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
`)]),w("extra",`
|
|
|
font-size: .93em;
|
|
|
color: var(--n-group-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)])]),g("submenu",`
|
|
|
cursor: pointer;
|
|
|
position: relative;
|
|
|
margin-top: 6px;
|
|
|
`,[g("menu-item-content",`
|
|
|
height: var(--n-item-height);
|
|
|
`),g("submenu-children",`
|
|
|
overflow: hidden;
|
|
|
padding: 0;
|
|
|
`,[dr({duration:".2s"})])]),g("menu-item-group",[g("menu-item-group-title",`
|
|
|
margin-top: 6px;
|
|
|
color: var(--n-group-text-color);
|
|
|
cursor: default;
|
|
|
font-size: .93em;
|
|
|
height: 36px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
transition:
|
|
|
padding-left .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`)])]),g("menu-tooltip",[y("a",`
|
|
|
color: inherit;
|
|
|
text-decoration: none;
|
|
|
`)]),g("menu-divider",`
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
background-color: var(--n-divider-color);
|
|
|
height: 1px;
|
|
|
margin: 6px 18px;
|
|
|
`)]);function mt(e,o){return[P("hover",e,o),y("&:hover",e,o)]}const Ub=Object.assign(Object.assign({},se.props),{options:{type:Array,default:()=>[]},collapsed:{type:Boolean,default:void 0},collapsedWidth:{type:Number,default:48},iconSize:{type:Number,default:20},collapsedIconSize:{type:Number,default:24},rootIndent:Number,indent:{type:Number,default:32},labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandAll:Boolean,defaultExpandedKeys:Array,expandedKeys:Array,value:[String,Number],defaultValue:{type:[String,Number],default:null},mode:{type:String,default:"vertical"},watchProps:{type:Array,default:void 0},disabled:Boolean,show:{type:Boolean,default:!0},inverted:Boolean,"onUpdate:expandedKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array],expandIcon:Function,renderIcon:Function,renderLabel:Function,renderExtra:Function,dropdownProps:Object,accordion:Boolean,nodeProps:Function,dropdownPlacement:{type:String,default:"bottom"},responsive:Boolean,items:Array,onOpenNamesChange:[Function,Array],onSelect:[Function,Array],onExpandedNamesChange:[Function,Array],expandedNames:Array,defaultExpandedNames:Array}),ex=Z({name:"Menu",props:Ub,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Menu","-menu",Vb,Xg,e,o),n=ze(Tb,null),l=$(()=>{var ie;const{collapsed:F}=e;if(F!==void 0)return F;if(n){const{collapseModeRef:B,collapsedRef:q}=n;if(B.value==="width")return(ie=q.value)!==null&&ie!==void 0?ie:!1}return!1}),a=$(()=>{const{keyField:ie,childrenField:F,disabledField:B}=e;return bt(e.items||e.options,{getIgnored(q){return xn(q)},getChildren(q){return q[F]},getDisabled(q){return q[B]},getKey(q){var ee;return(ee=q[ie])!==null&&ee!==void 0?ee:q.name}})}),s=$(()=>new Set(a.value.treeNodes.map(ie=>ie.key))),{watchProps:d}=e,c=M(null);d!=null&&d.includes("defaultValue")?oo(()=>{c.value=e.defaultValue}):c.value=e.defaultValue;const u=ae(e,"value"),f=co(u,c),p=M([]),v=()=>{p.value=e.defaultExpandAll?a.value.getNonLeafKeys():e.defaultExpandedNames||e.defaultExpandedKeys||a.value.getPath(f.value,{includeSelf:!1}).keyPath};d!=null&&d.includes("defaultExpandedKeys")?oo(v):v();const h=Ct(e,["expandedNames","expandedKeys"]),m=co(h,p),x=$(()=>a.value.treeNodes),C=$(()=>a.value.getPath(f.value).keyPath);De(yr,{props:e,mergedCollapsedRef:l,mergedThemeRef:r,mergedValueRef:f,mergedExpandedKeysRef:m,activePathRef:C,mergedClsPrefixRef:o,isHorizontalRef:$(()=>e.mode==="horizontal"),invertedRef:ae(e,"inverted"),doSelect:b,toggleExpand:k});function b(ie,F){const{"onUpdate:value":B,onUpdateValue:q,onSelect:ee}=e;q&&ce(q,ie,F),B&&ce(B,ie,F),ee&&ce(ee,ie,F),c.value=ie}function _(ie){const{"onUpdate:expandedKeys":F,onUpdateExpandedKeys:B,onExpandedNamesChange:q,onOpenNamesChange:ee}=e;F&&ce(F,ie),B&&ce(B,ie),q&&ce(q,ie),ee&&ce(ee,ie),p.value=ie}function k(ie){const F=Array.from(m.value),B=F.findIndex(q=>q===ie);if(~B)F.splice(B,1);else{if(e.accordion&&s.value.has(ie)){const q=F.findIndex(ee=>s.value.has(ee));q>-1&&F.splice(q,1)}F.push(ie)}_(F)}const z=ie=>{const F=a.value.getPath(ie??f.value,{includeSelf:!1}).keyPath;if(!F.length)return;const B=Array.from(m.value),q=new Set([...B,...F]);e.accordion&&s.value.forEach(ee=>{q.has(ee)&&!F.includes(ee)&&q.delete(ee)}),_(Array.from(q))},R=$(()=>{const{inverted:ie}=e,{common:{cubicBezierEaseInOut:F},self:B}=r.value,{borderRadius:q,borderColorHorizontal:ee,fontSize:be,itemHeight:me,dividerColor:Be}=B,T={"--n-divider-color":Be,"--n-bezier":F,"--n-font-size":be,"--n-border-color-horizontal":ee,"--n-border-radius":q,"--n-item-height":me};return ie?(T["--n-group-text-color"]=B.groupTextColorInverted,T["--n-color"]=B.colorInverted,T["--n-item-text-color"]=B.itemTextColorInverted,T["--n-item-text-color-hover"]=B.itemTextColorHoverInverted,T["--n-item-text-color-active"]=B.itemTextColorActiveInverted,T["--n-item-text-color-child-active"]=B.itemTextColorChildActiveInverted,T["--n-item-text-color-child-active-hover"]=B.itemTextColorChildActiveInverted,T["--n-item-text-color-active-hover"]=B.itemTextColorActiveHoverInverted,T["--n-item-icon-color"]=B.itemIconColorInverted,T["--n-item-icon-color-hover"]=B.itemIconColorHoverInverted,T["--n-item-icon-color-active"]=B.itemIconColorActiveInverted,T["--n-item-icon-color-active-hover"]=B.itemIconColorActiveHoverInverted,T["--n-item-icon-color-child-active"]=B.itemIconColorChildActiveInverted,T["--n-item-icon-color-child-active-hover"]=B.itemIconColorChildActiveHoverInverted,T["--n-item-icon-color-collapsed"]=B.itemIconColorCollapsedInverted,T["--n-item-text-color-horizontal"]=B.itemTextColorHorizontalInverted,T["--n-item-text-color-hover-horizontal"]=B.itemTextColorHoverHorizontalInverted,T["--n-item-text-color-active-horizontal"]=B.itemTextColorActiveHorizontalInverted,T["--n-item-text-color-child-active-horizontal"]=B.itemTextColorChildActiveHorizontalInverted,T["--n-item-text-color-child-active-hover-horizontal"]=B.itemTextColorChildActiveHoverHorizontalInverted,T["--n-item-text-color-active-hover-horizontal"]=B.itemTextColorActiveHoverHorizontalInverted,T["--n-item-icon-color-horizontal"]=B.itemIconColorHorizontalInverted,T["--n-item-icon-color-hover-horizontal"]=B.itemIconColorHoverHorizontalInverted,T["--n-item-icon-color-active-horizontal"]=B.itemIconColorActiveHorizontalInverted,T["--n-item-icon-color-active-hover-horizontal"]=B.itemIconColorActiveHoverHorizontalInverted,T["--n-item-icon-color-child-active-horizontal"]=B.itemIconColorChildActiveHorizontalInverted,T["--n-item-icon-color-child-active-hover-horizontal"]=B.itemIconColorChildActiveHoverHorizontalInverted,T["--n-arrow-color"]=B.arrowColorInverted,T["--n-arrow-color-hover"]=B.arrowColorHoverInverted,T["--n-arrow-color-active"]=B.arrowColorActiveInverted,T["--n-arrow-color-active-hover"]=B.arrowColorActiveHoverInverted,T["--n-arrow-color-child-active"]=B.arrowColorChildActiveInverted,T["--n-arrow-color-child-active-hover"]=B.arrowColorChildActiveHoverInverted,T["--n-item-color-hover"]=B.itemColorHoverInverted,T["--n-item-color-active"]=B.itemColorActiveInverted,T["--n-item-color-active-hover"]=B.itemColorActiveHoverInverted,T["--n-item-color-active-collapsed"]=B.itemColorActiveCollapsedInverted):(T["--n-group-text-color"]=B.groupTextColor,T["--n-color"]=B.color,T["--n-item-text-color"]=B.itemTextColor,T["--n-item-text-color-hover"]=B.itemTextColorHover,T["--n-item-text-color-active"]=B.itemTextColorActive,T["--n-item-text-color-child-active"]=B.itemTextColorChildActive,T["--n-item-text-color-child-active-hover"]=B.itemTextColorChildActiveHover,T["--n-item-text-color-active-hover"]=B.itemTextColorActiveHover,T["--n-item-icon-color"]=B.itemIconColor,T["--n-item-icon-color-hover"]=B.itemIconColorHover,T["--n-item-icon-color-active"]=B.itemIconColorActive,T["--n-item-icon-color-active-hover"]=B.itemIconColorActiveHover,T["--n-item-icon-color-child-active"]=B.itemIconColorChildActive,T["--n-item-icon-color-child-active-hover"]=B.itemIconColorChildActiveHover,T["--n-item-icon-color-collapsed"]=B.itemIconColorCollapsed,T["--n-item-text-color-horizontal"]=B.itemTextColorHorizontal,T["--n-item-text-color-hover-horizontal"]=B.itemTextColorHoverHorizontal,T["--n-item-text-color-active-horizontal"]=B.itemTextColorActiveHorizontal,T["--n-item-text-color-child-active-horizontal"]=B.itemTextColorChildActiveHorizontal,T["--n-item-text-color-child-active-hover-horizontal"]=B.itemTextColorChildActiveHoverHorizontal,T["--n-item-text-color-active-hover-horizontal"]=B.itemTextColorActiveHoverHorizontal,T["--n-item-icon-color-horizontal"]=B.itemIconColorHorizontal,T["--n-item-icon-color-hover-horizontal"]=B.itemIconColorHoverHorizontal,T["--n-item-icon-color-active-horizontal"]=B.itemIconColorActiveHorizontal,T["--n-item-icon-color-active-hover-horizontal"]=B.itemIconColorActiveHoverHorizontal,T["--n-item-icon-color-child-active-horizontal"]=B.itemIconColorChildActiveHorizontal,T["--n-item-icon-color-child-active-hover-horizontal"]=B.itemIconColorChildActiveHoverHorizontal,T["--n-arrow-color"]=B.arrowColor,T["--n-arrow-color-hover"]=B.arrowColorHover,T["--n-arrow-color-active"]=B.arrowColorActive,T["--n-arrow-color-active-hover"]=B.arrowColorActiveHover,T["--n-arrow-color-child-active"]=B.arrowColorChildActive,T["--n-arrow-color-child-active-hover"]=B.arrowColorChildActiveHover,T["--n-item-color-hover"]=B.itemColorHover,T["--n-item-color-active"]=B.itemColorActive,T["--n-item-color-active-hover"]=B.itemColorActiveHover,T["--n-item-color-active-collapsed"]=B.itemColorActiveCollapsed),T}),S=t?We("menu",$(()=>e.inverted?"a":"b"),R,e):void 0,L=tt(),I=M(null),D=M(null);let W=!0;const H=()=>{var ie;W?W=!1:(ie=I.value)===null||ie===void 0||ie.sync({showAllItemsBeforeCalculate:!0})};function j(){return document.getElementById(L)}const V=M(-1);function E(ie){V.value=e.options.length-ie}function Y(ie){ie||(V.value=-1)}const K=$(()=>{const ie=V.value;return{children:ie===-1?[]:e.options.slice(ie)}}),te=$(()=>{const{childrenField:ie,disabledField:F,keyField:B}=e;return bt([K.value],{getIgnored(q){return xn(q)},getChildren(q){return q[ie]},getDisabled(q){return q[F]},getKey(q){var ee;return(ee=q[B])!==null&&ee!==void 0?ee:q.name}})}),xe=$(()=>bt([{}]).treeNodes[0]);function de(){var ie;if(V.value===-1)return i(bn,{root:!0,level:0,key:"__ellpisisGroupPlaceholder__",internalKey:"__ellpisisGroupPlaceholder__",title:"···",tmNode:xe.value,domId:L,isEllipsisPlaceholder:!0});const F=te.value.treeNodes[0],B=C.value,q=!!(!((ie=F.children)===null||ie===void 0)&&ie.some(ee=>B.includes(ee.key)));return i(bn,{level:0,root:!0,key:"__ellpisisGroup__",internalKey:"__ellpisisGroup__",title:"···",virtualChildActive:q,tmNode:F,domId:L,rawNodes:F.rawNode.children||[],tmNodes:F.children||[],isEllipsisPlaceholder:!0})}return{mergedClsPrefix:o,controlledExpandedKeys:h,uncontrolledExpanededKeys:p,mergedExpandedKeys:m,uncontrolledValue:c,mergedValue:f,activePath:C,tmNodes:x,mergedTheme:r,mergedCollapsed:l,cssVars:t?void 0:R,themeClass:S==null?void 0:S.themeClass,overflowRef:I,counterRef:D,updateCounter:()=>{},onResize:H,onUpdateOverflow:Y,onUpdateCount:E,renderCounter:de,getCounter:j,onRender:S==null?void 0:S.onRender,showOption:z,deriveResponsiveState:H}},render(){const{mergedClsPrefix:e,mode:o,themeClass:t,onRender:r}=this;r==null||r();const n=()=>this.tmNodes.map(d=>Zn(d,this.$props)),a=o==="horizontal"&&this.responsive,s=()=>i("div",{role:o==="horizontal"?"menubar":"menu",class:[`${e}-menu`,t,`${e}-menu--${o}`,a&&`${e}-menu--responsive`,this.mergedCollapsed&&`${e}-menu--collapsed`],style:this.cssVars},a?i(fn,{ref:"overflowRef",onUpdateOverflow:this.onUpdateOverflow,getCounter:this.getCounter,onUpdateCount:this.onUpdateCount,updateCounter:this.updateCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:n,counter:this.renderCounter}):n());return a?i(st,{onResize:this.onResize},{default:s}):s()}});function Kb(e,o={debug:!1,useSelectionEnd:!1,checkWidthOverflow:!0}){const t=e.selectionStart!==null?e.selectionStart:0,r=e.selectionEnd!==null?e.selectionEnd:0,n=o.useSelectionEnd?r:t,l=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],a=navigator.userAgent.toLowerCase().includes("firefox");if(!No)throw new Error("textarea-caret-position#getCaretPosition should only be called in a browser");const s=o==null?void 0:o.debug;if(s){const h=document.querySelector("#input-textarea-caret-position-mirror-div");h!=null&&h.parentNode&&h.parentNode.removeChild(h)}const d=document.createElement("div");d.id="input-textarea-caret-position-mirror-div",document.body.appendChild(d);const c=d.style,u=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,f=e.nodeName==="INPUT";c.whiteSpace=f?"nowrap":"pre-wrap",f||(c.wordWrap="break-word"),c.position="absolute",s||(c.visibility="hidden"),l.forEach(h=>{if(f&&h==="lineHeight")if(u.boxSizing==="border-box"){const m=parseInt(u.height),x=parseInt(u.paddingTop)+parseInt(u.paddingBottom)+parseInt(u.borderTopWidth)+parseInt(u.borderBottomWidth),C=x+parseInt(u.lineHeight);m>C?c.lineHeight=`${m-x}px`:m===C?c.lineHeight=u.lineHeight:c.lineHeight="0"}else c.lineHeight=u.height;else c[h]=u[h]}),a?e.scrollHeight>parseInt(u.height)&&(c.overflowY="scroll"):c.overflow="hidden",d.textContent=e.value.substring(0,n),f&&d.textContent&&(d.textContent=d.textContent.replace(/\s/g," "));const p=document.createElement("span");p.textContent=e.value.substring(n)||".",p.style.position="relative",p.style.left=`${-e.scrollLeft}px`,p.style.top=`${-e.scrollTop}px`,d.appendChild(p);const v={top:p.offsetTop+parseInt(u.borderTopWidth),left:p.offsetLeft+parseInt(u.borderLeftWidth),absolute:!1,height:parseInt(u.fontSize)*1.5};return s?p.style.backgroundColor="#aaa":document.body.removeChild(d),v.left>=e.clientWidth&&o.checkWidthOverflow&&(v.left=e.clientWidth),v}const Gb=y([g("mention","width: 100%; z-index: auto; position: relative;"),g("mention-menu",`
|
|
|
box-shadow: var(--n-menu-box-shadow);
|
|
|
`,[ct({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),qb=Object.assign(Object.assign({},se.props),{to:Oo.propTo,autosize:[Boolean,Object],options:{type:Array,default:[]},type:{type:String,default:"text"},separator:{type:String,validator:e=>e.length!==1?(qo("mention","`separator`'s length must be 1."),!1):!0,default:" "},bordered:{type:Boolean,default:void 0},disabled:Boolean,value:String,defaultValue:{type:String,default:""},loading:Boolean,prefix:{type:[String,Array],default:"@"},placeholder:{type:String,default:""},placement:{type:String,default:"bottom-start"},size:String,renderLabel:Function,status:String,"onUpdate:show":[Array,Function],onUpdateShow:[Array,Function],"onUpdate:value":[Array,Function],onUpdateValue:[Array,Function],onSearch:Function,onSelect:Function,onFocus:Function,onBlur:Function,internalDebug:Boolean}),ox=Z({name:"Mention",props:qb,setup(e){const{namespaceRef:o,mergedClsPrefixRef:t,mergedBorderedRef:r,inlineThemeDisabled:n}=Ie(e),l=se("Mention","-mention",Gb,Gg,e,t),a=rt(e),s=M(null),d=M(null),c=M(null),u=M("");let f=null,p=null,v=null;const h=$(()=>{const{value:F}=u;return e.options.filter(B=>F?typeof B.label=="string"?B.label.startsWith(F):typeof B.value=="string"?B.value.startsWith(F):!1:!0)}),m=$(()=>bt(h.value,{getKey:F=>F.value})),x=M(null),C=M(!1),b=M(e.defaultValue),_=ae(e,"value"),k=co(_,b),z=$(()=>{const{self:{menuBoxShadow:F}}=l.value;return{"--n-menu-box-shadow":F}}),R=n?We("mention",void 0,z,e):void 0;function S(F){if(e.disabled)return;const{onUpdateShow:B,"onUpdate:show":q}=e;B&&ce(B,F),q&&ce(q,F),F||(f=null,p=null,v=null),C.value=F}function L(F){const{onUpdateValue:B,"onUpdate:value":q}=e,{nTriggerFormChange:ee,nTriggerFormInput:be}=a;q&&ce(q,F),B&&ce(B,F),be(),ee(),b.value=F}function I(){return e.type==="text"?s.value.inputElRef:s.value.textareaElRef}function D(){var F;const B=I();if(document.activeElement!==B){S(!1);return}const{selectionEnd:q}=B;if(q===null){S(!1);return}const ee=B.value,{separator:be}=e,{prefix:me}=e,Be=typeof me=="string"?[me]:me;for(let T=q-1;T>=0;--T){const ve=ee[T];if(ve===be||ve===`
|
|
|
`||ve==="\r"){S(!1);return}if(Be.includes(ve)){const Se=ee.slice(T+1,q);S(!0),(F=e.onSearch)===null||F===void 0||F.call(e,Se,ve),u.value=Se,f=ve,p=T+1,v=q;return}}S(!1)}function W(){const{value:F}=d;if(!F)return;const B=I(),q=Kb(B);q.left+=B.parentElement.offsetLeft,F.style.left=`${q.left}px`,F.style.top=`${q.top+q.height}px`}function H(){var F;C.value&&((F=c.value)===null||F===void 0||F.syncPosition())}function j(F){L(F),V()}function V(){setTimeout(()=>{W(),D(),lo().then(H)},0)}function E(F){var B,q;if(F.key==="ArrowLeft"||F.key==="ArrowRight"){if(!((B=s.value)===null||B===void 0)&&B.isCompositing)return;V()}else if(F.key==="ArrowUp"||F.key==="ArrowDown"||F.key==="Enter"){if(!((q=s.value)===null||q===void 0)&&q.isCompositing)return;const{value:ee}=x;if(C.value){if(ee)if(F.preventDefault(),F.key==="ArrowUp")ee.prev();else if(F.key==="ArrowDown")ee.next();else{const be=ee.getPendingTmNode();be?de(be):S(!1)}}else V()}}function Y(F){const{onFocus:B}=e;B==null||B(F);const{nTriggerFormFocus:q}=a;q(),V()}function K(){var F;(F=s.value)===null||F===void 0||F.focus()}function te(){var F;(F=s.value)===null||F===void 0||F.blur()}function xe(F){const{onBlur:B}=e;B==null||B(F);const{nTriggerFormBlur:q}=a;q(),S(!1)}function de(F){var B;if(f===null||p===null||v===null)return;const{rawNode:{value:q=""}}=F,ee=I(),be=ee.value,{separator:me}=e,Be=be.slice(v),T=Be.startsWith(me),ve=`${q}${T?"":me}`;L(be.slice(0,p)+ve+Be),(B=e.onSelect)===null||B===void 0||B.call(e,F.rawNode,f);const Se=p+ve.length+(T?1:0);lo().then(()=>{ee.selectionStart=Se,ee.selectionEnd=Se,D()})}function ie(){e.disabled||V()}return{namespace:o,mergedClsPrefix:t,mergedBordered:r,mergedSize:a.mergedSizeRef,mergedStatus:a.mergedStatusRef,mergedTheme:l,treeMate:m,selectMenuInstRef:x,inputInstRef:s,cursorRef:d,followerRef:c,showMenu:C,adjustedTo:Oo(e),isMounted:zt(),mergedValue:k,handleInputFocus:Y,handleInputBlur:xe,handleInputUpdateValue:j,handleInputKeyDown:E,handleSelect:de,handleInputMouseDown:ie,focus:K,blur:te,cssVars:n?void 0:z,themeClass:R==null?void 0:R.themeClass,onRender:R==null?void 0:R.onRender}},render(){const{mergedTheme:e,mergedClsPrefix:o,$slots:t}=this;return i("div",{class:`${o}-mention`},i(St,{status:this.mergedStatus,themeOverrides:e.peerOverrides.Input,theme:e.peers.Input,size:this.mergedSize,autosize:this.autosize,type:this.type,ref:"inputInstRef",placeholder:this.placeholder,onMousedown:this.handleInputMouseDown,onUpdateValue:this.handleInputUpdateValue,onKeydown:this.handleInputKeyDown,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,bordered:this.mergedBordered,disabled:this.disabled,value:this.mergedValue}),i(_r,null,{default:()=>[i(Fr,null,{default:()=>i("div",{style:{position:"absolute",width:0,height:0},ref:"cursorRef"})}),i(Or,{ref:"followerRef",placement:this.placement,show:this.showMenu,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Oo.tdkey},{default:()=>i(io,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{const{mergedTheme:r,onRender:n}=this;return n==null||n(),this.showMenu?i(On,{clsPrefix:o,theme:r.peers.InternalSelectMenu,themeOverrides:r.peerOverrides.InternalSelectMenu,autoPending:!0,ref:"selectMenuInstRef",class:[`${o}-mention-menu`,this.themeClass],loading:this.loading,treeMate:this.treeMate,virtualScroll:!1,style:this.cssVars,onToggle:this.handleSelect,renderLabel:this.renderLabel},t):null}})})]}))}}),ms={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},bs="n-message-api",xs="n-message-provider",Yb=y([g("message-wrapper",`
|
|
|
margin: var(--n-margin);
|
|
|
z-index: 0;
|
|
|
transform-origin: top center;
|
|
|
display: flex;
|
|
|
`,[dr({overflow:"visible",originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.85)"}})]),g("message",`
|
|
|
box-sizing: border-box;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier),
|
|
|
transform .3s var(--n-bezier),
|
|
|
margin-bottom .3s var(--n-bezier);
|
|
|
padding: var(--n-padding);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
flex-wrap: nowrap;
|
|
|
overflow: hidden;
|
|
|
max-width: var(--n-max-width);
|
|
|
color: var(--n-text-color);
|
|
|
background-color: var(--n-color);
|
|
|
box-shadow: var(--n-box-shadow);
|
|
|
`,[w("content",`
|
|
|
display: inline-block;
|
|
|
line-height: var(--n-line-height);
|
|
|
font-size: var(--n-font-size);
|
|
|
`),w("icon",`
|
|
|
position: relative;
|
|
|
margin: var(--n-icon-margin);
|
|
|
height: var(--n-icon-size);
|
|
|
width: var(--n-icon-size);
|
|
|
font-size: var(--n-icon-size);
|
|
|
flex-shrink: 0;
|
|
|
`,[["default","info","success","warning","error","loading"].map(e=>P(`${e}-type`,[y("> *",`
|
|
|
color: var(--n-icon-color-${e});
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)])),y("> *",`
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
`,[dt()])]),w("close",`
|
|
|
margin: var(--n-close-margin);
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
flex-shrink: 0;
|
|
|
`,[y("&:hover",`
|
|
|
color: var(--n-close-icon-color-hover);
|
|
|
`),y("&:active",`
|
|
|
color: var(--n-close-icon-color-pressed);
|
|
|
`)])]),g("message-container",`
|
|
|
z-index: 6000;
|
|
|
position: fixed;
|
|
|
height: 0;
|
|
|
overflow: visible;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
`,[P("top",`
|
|
|
top: 12px;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
`),P("top-left",`
|
|
|
top: 12px;
|
|
|
left: 12px;
|
|
|
right: 0;
|
|
|
align-items: flex-start;
|
|
|
`),P("top-right",`
|
|
|
top: 12px;
|
|
|
left: 0;
|
|
|
right: 12px;
|
|
|
align-items: flex-end;
|
|
|
`),P("bottom",`
|
|
|
bottom: 4px;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
justify-content: flex-end;
|
|
|
`),P("bottom-left",`
|
|
|
bottom: 4px;
|
|
|
left: 12px;
|
|
|
right: 0;
|
|
|
justify-content: flex-end;
|
|
|
align-items: flex-start;
|
|
|
`),P("bottom-right",`
|
|
|
bottom: 4px;
|
|
|
left: 0;
|
|
|
right: 12px;
|
|
|
justify-content: flex-end;
|
|
|
align-items: flex-end;
|
|
|
`)])]),Xb={info:()=>i(yt,null),success:()=>i(Ut,null),warning:()=>i($t,null),error:()=>i(Vt,null),default:()=>null},Zb=Z({name:"Message",props:Object.assign(Object.assign({},ms),{render:Function}),setup(e){const{inlineThemeDisabled:o,mergedRtlRef:t}=Ie(e),{props:r,mergedClsPrefixRef:n}=ze(xs),l=eo("Message",t,n),a=se("Message","-message",Yb,Sg,r,n),s=$(()=>{const{type:c}=e,{common:{cubicBezierEaseInOut:u},self:{padding:f,margin:p,maxWidth:v,iconMargin:h,closeMargin:m,closeSize:x,iconSize:C,fontSize:b,lineHeight:_,borderRadius:k,iconColorInfo:z,iconColorSuccess:R,iconColorWarning:S,iconColorError:L,iconColorLoading:I,closeIconSize:D,closeBorderRadius:W,[N("textColor",c)]:H,[N("boxShadow",c)]:j,[N("color",c)]:V,[N("closeColorHover",c)]:E,[N("closeColorPressed",c)]:Y,[N("closeIconColor",c)]:K,[N("closeIconColorPressed",c)]:te,[N("closeIconColorHover",c)]:xe}}=a.value;return{"--n-bezier":u,"--n-margin":p,"--n-padding":f,"--n-max-width":v,"--n-font-size":b,"--n-icon-margin":h,"--n-icon-size":C,"--n-close-icon-size":D,"--n-close-border-radius":W,"--n-close-size":x,"--n-close-margin":m,"--n-text-color":H,"--n-color":V,"--n-box-shadow":j,"--n-icon-color-info":z,"--n-icon-color-success":R,"--n-icon-color-warning":S,"--n-icon-color-error":L,"--n-icon-color-loading":I,"--n-close-color-hover":E,"--n-close-color-pressed":Y,"--n-close-icon-color":K,"--n-close-icon-color-pressed":te,"--n-close-icon-color-hover":xe,"--n-line-height":_,"--n-border-radius":k}}),d=o?We("message",$(()=>e.type[0]),s,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:l,messageProviderProps:r,handleClose(){var c;(c=e.onClose)===null||c===void 0||c.call(e)},cssVars:o?void 0:s,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender,placement:r.placement}},render(){const{render:e,type:o,closable:t,content:r,mergedClsPrefix:n,cssVars:l,themeClass:a,onRender:s,icon:d,handleClose:c,showIcon:u}=this;s==null||s();let f;return i("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},l]},e?e(this.$props):i("div",{class:[`${n}-message ${n}-message--${o}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(f=Qb(d,o,n))&&u?i("div",{class:`${n}-message__icon ${n}-message__icon--${o}-type`},i(Kt,null,{default:()=>f})):null,i("div",{class:`${n}-message__content`},Qe(r)),t?i(Pt,{clsPrefix:n,class:`${n}-message__close`,onClick:c,absolute:!0}):null))}});function Qb(e,o,t){if(typeof e=="function")return e();{const r=o==="loading"?i(Gt,{clsPrefix:t,strokeWidth:24,scale:.85}):Xb[o]();return r?i(He,{clsPrefix:t,key:o},{default:()=>r}):null}}const Jb=Z({name:"MessageEnvironment",props:Object.assign(Object.assign({},ms),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let o=null;const t=M(!0);po(()=>{r()});function r(){const{duration:u}=e;u&&(o=window.setTimeout(a,u))}function n(u){u.currentTarget===u.target&&o!==null&&(window.clearTimeout(o),o=null)}function l(u){u.currentTarget===u.target&&r()}function a(){const{onHide:u}=e;t.value=!1,o&&(window.clearTimeout(o),o=null),u&&u()}function s(){const{onClose:u}=e;u&&u(),a()}function d(){const{onAfterLeave:u,onInternalAfterLeave:f,onAfterHide:p,internalKey:v}=e;u&&u(),f&&f(v),p&&p()}function c(){a()}return{show:t,hide:a,handleClose:s,handleAfterLeave:d,handleMouseleave:l,handleMouseenter:n,deactivate:c}},render(){return i(Rt,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?i(Zb,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),e0=Object.assign(Object.assign({},se.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),tx=Z({name:"MessageProvider",props:e0,setup(e){const{mergedClsPrefixRef:o}=Ie(e),t=M([]),r=M({}),n={create(d,c){return l(d,Object.assign({type:"default"},c))},info(d,c){return l(d,Object.assign(Object.assign({},c),{type:"info"}))},success(d,c){return l(d,Object.assign(Object.assign({},c),{type:"success"}))},warning(d,c){return l(d,Object.assign(Object.assign({},c),{type:"warning"}))},error(d,c){return l(d,Object.assign(Object.assign({},c),{type:"error"}))},loading(d,c){return l(d,Object.assign(Object.assign({},c),{type:"loading"}))},destroyAll:s};De(xs,{props:e,mergedClsPrefixRef:o}),De(bs,n);function l(d,c){const u=tt(),f=el(Object.assign(Object.assign({},c),{content:d,key:u,destroy:()=>{var v;(v=r.value[u])===null||v===void 0||v.hide()}})),{max:p}=e;return p&&t.value.length>=p&&t.value.shift(),t.value.push(f),f}function a(d){t.value.splice(t.value.findIndex(c=>c.key===d),1),delete r.value[d]}function s(){Object.values(r.value).forEach(d=>{d.hide()})}return Object.assign({mergedClsPrefix:o,messageRefs:r,messageList:t,handleAfterLeave:a},n)},render(){var e,o,t;return i(so,null,(o=(e=this.$slots).default)===null||o===void 0?void 0:o.call(e),this.messageList.length?i(ol,{to:(t=this.to)!==null&&t!==void 0?t:"body"},i("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(r=>i(Jb,Object.assign({ref:n=>{n&&(this.messageRefs[r.key]=n)},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave},Wt(r,["destroy"],void 0),{duration:r.duration===void 0?this.duration:r.duration,keepAliveOnHover:r.keepAliveOnHover===void 0?this.keepAliveOnHover:r.keepAliveOnHover,closable:r.closable===void 0?this.closable:r.closable}))))):null)}});function rx(){const e=ze(bs,null);return e===null&&Wo("use-message","No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}const Cs="n-popconfirm",ys={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Wi=wo(ys),o0=Z({name:"NPopconfirmPanel",props:ys,setup(e){const{localeRef:o}=Yo("Popconfirm"),{inlineThemeDisabled:t}=Ie(),{mergedClsPrefixRef:r,mergedThemeRef:n,props:l}=ze(Cs),a=$(()=>{const{common:{cubicBezierEaseInOut:d},self:{fontSize:c,iconSize:u,iconColor:f}}=n.value;return{"--n-bezier":d,"--n-font-size":c,"--n-icon-size":u,"--n-icon-color":f}}),s=t?We("popconfirm-panel",void 0,a,l):void 0;return Object.assign(Object.assign({},Yo("Popconfirm")),{mergedClsPrefix:r,cssVars:t?void 0:a,localizedPositiveText:$(()=>e.positiveText||o.value.positiveText),localizedNegativeText:$(()=>e.negativeText||o.value.negativeText),positiveButtonProps:ae(l,"positiveButtonProps"),negativeButtonProps:ae(l,"negativeButtonProps"),handlePositiveClick(d){e.onPositiveClick(d)},handleNegativeClick(d){e.onNegativeClick(d)},themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender})},render(){var e;const{mergedClsPrefix:o,showIcon:t,$slots:r}=this,n=ao(r.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&i(Bo,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&i(Bo,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{class:[`${o}-popconfirm__panel`,this.themeClass],style:this.cssVars},je(r.default,l=>t||l?i("div",{class:`${o}-popconfirm__body`},t?i("div",{class:`${o}-popconfirm__icon`},ao(r.icon,()=>[i(He,{clsPrefix:o},{default:()=>i($t,null)})])):null,l):null),n?i("div",{class:[`${o}-popconfirm__action`]},n):null)}}),t0=g("popconfirm",[w("body",`
|
|
|
font-size: var(--n-font-size);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: nowrap;
|
|
|
position: relative;
|
|
|
`,[w("icon",`
|
|
|
display: flex;
|
|
|
font-size: var(--n-icon-size);
|
|
|
color: var(--n-icon-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
margin: 0 8px 0 0;
|
|
|
`)]),w("action",`
|
|
|
display: flex;
|
|
|
justify-content: flex-end;
|
|
|
`,[y("&:not(:first-child)","margin-top: 8px"),g("button",[y("&:not(:last-child)","margin-right: 8px;")])])]),r0=Object.assign(Object.assign(Object.assign({},se.props),wt),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),nx=Z({name:"Popconfirm",props:r0,__popover__:!0,setup(e){const{mergedClsPrefixRef:o}=Ie(),t=se("Popconfirm","-popconfirm",t0,nm,e,o),r=M(null);function n(s){var d;if(!(!((d=r.value)===null||d===void 0)&&d.getMergedShow()))return;const{onPositiveClick:c,"onUpdate:show":u}=e;Promise.resolve(c?c(s):!0).then(f=>{var p;f!==!1&&((p=r.value)===null||p===void 0||p.setShow(!1),u&&ce(u,!1))})}function l(s){var d;if(!(!((d=r.value)===null||d===void 0)&&d.getMergedShow()))return;const{onNegativeClick:c,"onUpdate:show":u}=e;Promise.resolve(c?c(s):!0).then(f=>{var p;f!==!1&&((p=r.value)===null||p===void 0||p.setShow(!1),u&&ce(u,!1))})}return De(Cs,{mergedThemeRef:t,mergedClsPrefixRef:o,props:e}),{setShow(s){var d;(d=r.value)===null||d===void 0||d.setShow(s)},syncPosition(){var s;(s=r.value)===null||s===void 0||s.syncPosition()},mergedTheme:t,popoverInstRef:r,handlePositiveClick:n,handleNegativeClick:l}},render(){const{$slots:e,$props:o,mergedTheme:t}=this;return i(br,Wt(o,Wi,{theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.activator||e.trigger,default:()=>{const r=mo(o,Wi);return i(o0,Object.assign(Object.assign({},r),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),n0=y([g("progress",{display:"inline-block"},[g("progress-icon",`
|
|
|
color: var(--n-icon-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`),P("line",`
|
|
|
width: 100%;
|
|
|
display: block;
|
|
|
`,[g("progress-content",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[g("progress-graph",{flex:1})]),g("progress-custom-content",{marginLeft:"14px"}),g("progress-icon",`
|
|
|
width: 30px;
|
|
|
padding-left: 14px;
|
|
|
height: var(--n-icon-size-line);
|
|
|
line-height: var(--n-icon-size-line);
|
|
|
font-size: var(--n-icon-size-line);
|
|
|
`,[P("as-text",`
|
|
|
color: var(--n-text-color-line-outer);
|
|
|
text-align: center;
|
|
|
width: 40px;
|
|
|
font-size: var(--n-font-size);
|
|
|
padding-left: 4px;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)])]),P("circle, dashboard",{width:"120px"},[g("progress-custom-content",`
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
`),g("progress-text",`
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
color: inherit;
|
|
|
font-size: var(--n-font-size-circle);
|
|
|
color: var(--n-text-color-circle);
|
|
|
font-weight: var(--n-font-weight-circle);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
white-space: nowrap;
|
|
|
`),g("progress-icon",`
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
color: var(--n-icon-color);
|
|
|
font-size: var(--n-icon-size-circle);
|
|
|
`)]),P("multiple-circle",`
|
|
|
width: 200px;
|
|
|
color: inherit;
|
|
|
`,[g("progress-text",`
|
|
|
font-weight: var(--n-font-weight-circle);
|
|
|
color: var(--n-text-color-circle);
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
top: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)]),g("progress-content",{position:"relative"}),g("progress-graph",{position:"relative"},[g("progress-graph-circle",[y("svg",{verticalAlign:"bottom"}),g("progress-graph-circle-fill",`
|
|
|
stroke: var(--n-fill-color);
|
|
|
transition:
|
|
|
opacity .3s var(--n-bezier),
|
|
|
stroke .3s var(--n-bezier),
|
|
|
stroke-dasharray .3s var(--n-bezier);
|
|
|
`,[P("empty",{opacity:0})]),g("progress-graph-circle-rail",`
|
|
|
transition: stroke .3s var(--n-bezier);
|
|
|
overflow: hidden;
|
|
|
stroke: var(--n-rail-color);
|
|
|
`)]),g("progress-graph-line",[P("indicator-inside",[g("progress-graph-line-rail",`
|
|
|
height: 16px;
|
|
|
line-height: 16px;
|
|
|
border-radius: 10px;
|
|
|
`,[g("progress-graph-line-fill",`
|
|
|
height: inherit;
|
|
|
border-radius: 10px;
|
|
|
`),g("progress-graph-line-indicator",`
|
|
|
background: #0000;
|
|
|
white-space: nowrap;
|
|
|
text-align: right;
|
|
|
margin-left: 14px;
|
|
|
margin-right: 14px;
|
|
|
height: inherit;
|
|
|
font-size: 12px;
|
|
|
color: var(--n-text-color-line-inner);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)])]),P("indicator-inside-label",`
|
|
|
height: 16px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[g("progress-graph-line-rail",`
|
|
|
flex: 1;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
`),g("progress-graph-line-indicator",`
|
|
|
background: var(--n-fill-color);
|
|
|
font-size: 12px;
|
|
|
transform: translateZ(0);
|
|
|
display: flex;
|
|
|
vertical-align: middle;
|
|
|
height: 16px;
|
|
|
line-height: 16px;
|
|
|
padding: 0 10px;
|
|
|
border-radius: 10px;
|
|
|
position: absolute;
|
|
|
white-space: nowrap;
|
|
|
color: var(--n-text-color-line-inner);
|
|
|
transition:
|
|
|
right .2s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
`)]),g("progress-graph-line-rail",`
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
height: var(--n-rail-height);
|
|
|
border-radius: 5px;
|
|
|
background-color: var(--n-rail-color);
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
`,[g("progress-graph-line-fill",`
|
|
|
background: var(--n-fill-color);
|
|
|
position: relative;
|
|
|
border-radius: 5px;
|
|
|
height: inherit;
|
|
|
width: 100%;
|
|
|
max-width: 0%;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
max-width .2s var(--n-bezier);
|
|
|
`,[P("processing",[y("&::after",`
|
|
|
content: "";
|
|
|
background-image: var(--n-line-bg-processing);
|
|
|
animation: progress-processing-animation 2s var(--n-bezier) infinite;
|
|
|
`)])])])])])]),y("@keyframes progress-processing-animation",`
|
|
|
0% {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 100%;
|
|
|
opacity: 1;
|
|
|
}
|
|
|
66% {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
opacity: 0;
|
|
|
}
|
|
|
100% {
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
opacity: 0;
|
|
|
}
|
|
|
`)]),i0={success:i(Ut,null),error:i(Vt,null),warning:i($t,null),info:i(yt,null)},l0=Z({name:"ProgressLine",props:{clsPrefix:{type:String,required:!0},percentage:{type:Number,default:0},railColor:String,railStyle:[String,Object],fillColor:String,status:{type:String,required:!0},indicatorPlacement:{type:String,required:!0},indicatorTextColor:String,unit:{type:String,default:"%"},processing:{type:Boolean,required:!0},showIndicator:{type:Boolean,required:!0},height:[String,Number],railBorderRadius:[String,Number],fillBorderRadius:[String,Number]},setup(e,{slots:o}){const t=$(()=>ro(e.height)),r=$(()=>e.railBorderRadius!==void 0?ro(e.railBorderRadius):e.height!==void 0?ro(e.height,{c:.5}):""),n=$(()=>e.fillBorderRadius!==void 0?ro(e.fillBorderRadius):e.railBorderRadius!==void 0?ro(e.railBorderRadius):e.height!==void 0?ro(e.height,{c:.5}):"");return()=>{const{indicatorPlacement:l,railColor:a,railStyle:s,percentage:d,unit:c,indicatorTextColor:u,status:f,showIndicator:p,fillColor:v,processing:h,clsPrefix:m}=e;return i("div",{class:`${m}-progress-content`,role:"none"},i("div",{class:`${m}-progress-graph`,"aria-hidden":!0},i("div",{class:[`${m}-progress-graph-line`,{[`${m}-progress-graph-line--indicator-${l}`]:!0}]},i("div",{class:`${m}-progress-graph-line-rail`,style:[{backgroundColor:a,height:t.value,borderRadius:r.value},s]},i("div",{class:[`${m}-progress-graph-line-fill`,h&&`${m}-progress-graph-line-fill--processing`],style:{maxWidth:`${e.percentage}%`,backgroundColor:v,height:t.value,lineHeight:t.value,borderRadius:n.value}},l==="inside"?i("div",{class:`${m}-progress-graph-line-indicator`,style:{color:u}},o.default?o.default():`${d}${c}`):null)))),p&&l==="outside"?i("div",null,o.default?i("div",{class:`${m}-progress-custom-content`,style:{color:u},role:"none"},o.default()):f==="default"?i("div",{role:"none",class:`${m}-progress-icon ${m}-progress-icon--as-text`,style:{color:u}},d,c):i("div",{class:`${m}-progress-icon`,"aria-hidden":!0},i(He,{clsPrefix:m},{default:()=>i0[f]}))):null)}}}),a0={success:i(Ut,null),error:i(Vt,null),warning:i($t,null),info:i(yt,null)},s0=Z({name:"ProgressCircle",props:{clsPrefix:{type:String,required:!0},status:{type:String,required:!0},strokeWidth:{type:Number,required:!0},fillColor:String,railColor:String,railStyle:[String,Object],percentage:{type:Number,default:0},offsetDegree:{type:Number,default:0},showIndicator:{type:Boolean,required:!0},indicatorTextColor:String,unit:String,viewBoxWidth:{type:Number,required:!0},gapDegree:{type:Number,required:!0},gapOffsetDegree:{type:Number,default:0}},setup(e,{slots:o}){function t(r,n,l){const{gapDegree:a,viewBoxWidth:s,strokeWidth:d}=e,c=50,u=0,f=c,p=0,v=2*c,h=50+d/2,m=`M ${h},${h} m ${u},${f}
|
|
|
a ${c},${c} 0 1 1 ${p},${-v}
|
|
|
a ${c},${c} 0 1 1 ${-p},${v}`,x=Math.PI*2*c,C={stroke:l,strokeDasharray:`${r/100*(x-a)}px ${s*8}px`,strokeDashoffset:`-${a/2}px`,transformOrigin:n?"center":void 0,transform:n?`rotate(${n}deg)`:void 0};return{pathString:m,pathStyle:C}}return()=>{const{fillColor:r,railColor:n,strokeWidth:l,offsetDegree:a,status:s,percentage:d,showIndicator:c,indicatorTextColor:u,unit:f,gapOffsetDegree:p,clsPrefix:v}=e,{pathString:h,pathStyle:m}=t(100,0,n),{pathString:x,pathStyle:C}=t(d,a,r),b=100+l;return i("div",{class:`${v}-progress-content`,role:"none"},i("div",{class:`${v}-progress-graph`,"aria-hidden":!0},i("div",{class:`${v}-progress-graph-circle`,style:{transform:p?`rotate(${p}deg)`:void 0}},i("svg",{viewBox:`0 0 ${b} ${b}`},i("g",null,i("path",{class:`${v}-progress-graph-circle-rail`,d:h,"stroke-width":l,"stroke-linecap":"round",fill:"none",style:m})),i("g",null,i("path",{class:[`${v}-progress-graph-circle-fill`,d===0&&`${v}-progress-graph-circle-fill--empty`],d:x,"stroke-width":l,"stroke-linecap":"round",fill:"none",style:C}))))),c?i("div",null,o.default?i("div",{class:`${v}-progress-custom-content`,role:"none"},o.default()):s!=="default"?i("div",{class:`${v}-progress-icon`,"aria-hidden":!0},i(He,{clsPrefix:v},{default:()=>a0[s]})):i("div",{class:`${v}-progress-text`,style:{color:u},role:"none"},i("span",{class:`${v}-progress-text__percentage`},d),i("span",{class:`${v}-progress-text__unit`},f))):null)}}});function Ni(e,o,t=100){return`m ${t/2} ${t/2-e} a ${e} ${e} 0 1 1 0 ${2*e} a ${e} ${e} 0 1 1 0 -${2*e}`}const d0=Z({name:"ProgressMultipleCircle",props:{clsPrefix:{type:String,required:!0},viewBoxWidth:{type:Number,required:!0},percentage:{type:Array,default:[0]},strokeWidth:{type:Number,required:!0},circleGap:{type:Number,required:!0},showIndicator:{type:Boolean,required:!0},fillColor:{type:Array,default:()=>[]},railColor:{type:Array,default:()=>[]},railStyle:{type:Array,default:()=>[]}},setup(e,{slots:o}){const t=$(()=>e.percentage.map((n,l)=>`${Math.PI*n/100*(e.viewBoxWidth/2-e.strokeWidth/2*(1+2*l)-e.circleGap*l)*2}, ${e.viewBoxWidth*8}`));return()=>{const{viewBoxWidth:r,strokeWidth:n,circleGap:l,showIndicator:a,fillColor:s,railColor:d,railStyle:c,percentage:u,clsPrefix:f}=e;return i("div",{class:`${f}-progress-content`,role:"none"},i("div",{class:`${f}-progress-graph`,"aria-hidden":!0},i("div",{class:`${f}-progress-graph-circle`},i("svg",{viewBox:`0 0 ${r} ${r}`},u.map((p,v)=>i("g",{key:v},i("path",{class:`${f}-progress-graph-circle-rail`,d:Ni(r/2-n/2*(1+2*v)-l*v,n,r),"stroke-width":n,"stroke-linecap":"round",fill:"none",style:[{strokeDashoffset:0,stroke:d[v]},c[v]]}),i("path",{class:[`${f}-progress-graph-circle-fill`,p===0&&`${f}-progress-graph-circle-fill--empty`],d:Ni(r/2-n/2*(1+2*v)-l*v,n,r),"stroke-width":n,"stroke-linecap":"round",fill:"none",style:{strokeDasharray:t.value[v],strokeDashoffset:0,stroke:s[v]}})))))),a&&o.default?i("div",null,i("div",{class:`${f}-progress-text`},o.default())):null)}}}),c0=Object.assign(Object.assign({},se.props),{processing:Boolean,type:{type:String,default:"line"},gapDegree:Number,gapOffsetDegree:Number,status:{type:String,default:"default"},railColor:[String,Array],railStyle:[String,Array],color:[String,Array],viewBoxWidth:{type:Number,default:100},strokeWidth:{type:Number,default:7},percentage:[Number,Array],unit:{type:String,default:"%"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{type:String,default:"outside"},indicatorPlacement:{type:String,default:"outside"},indicatorTextColor:String,circleGap:{type:Number,default:1},height:Number,borderRadius:[String,Number],fillBorderRadius:[String,Number],offsetDegree:Number}),u0=Z({name:"Progress",props:c0,setup(e){const o=$(()=>e.indicatorPlacement||e.indicatorPosition),t=$(()=>{if(e.gapDegree||e.gapDegree===0)return e.gapDegree;if(e.type==="dashboard")return 75}),{mergedClsPrefixRef:r,inlineThemeDisabled:n}=Ie(e),l=se("Progress","-progress",n0,Qa,e,r),a=$(()=>{const{status:d}=e,{common:{cubicBezierEaseInOut:c},self:{fontSize:u,fontSizeCircle:f,railColor:p,railHeight:v,iconSizeCircle:h,iconSizeLine:m,textColorCircle:x,textColorLineInner:C,textColorLineOuter:b,lineBgProcessing:_,fontWeightCircle:k,[N("iconColor",d)]:z,[N("fillColor",d)]:R}}=l.value;return{"--n-bezier":c,"--n-fill-color":R,"--n-font-size":u,"--n-font-size-circle":f,"--n-font-weight-circle":k,"--n-icon-color":z,"--n-icon-size-circle":h,"--n-icon-size-line":m,"--n-line-bg-processing":_,"--n-rail-color":p,"--n-rail-height":v,"--n-text-color-circle":x,"--n-text-color-line-inner":C,"--n-text-color-line-outer":b}}),s=n?We("progress",$(()=>e.status[0]),a,e):void 0;return{mergedClsPrefix:r,mergedIndicatorPlacement:o,gapDeg:t,cssVars:n?void 0:a,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{type:e,cssVars:o,indicatorTextColor:t,showIndicator:r,status:n,railColor:l,railStyle:a,color:s,percentage:d,viewBoxWidth:c,strokeWidth:u,mergedIndicatorPlacement:f,unit:p,borderRadius:v,fillBorderRadius:h,height:m,processing:x,circleGap:C,mergedClsPrefix:b,gapDeg:_,gapOffsetDegree:k,themeClass:z,$slots:R,onRender:S}=this;return S==null||S(),i("div",{class:[z,`${b}-progress`,`${b}-progress--${e}`,`${b}-progress--${n}`],style:o,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":d,role:e==="circle"||e==="line"||e==="dashboard"?"progressbar":"none"},e==="circle"||e==="dashboard"?i(s0,{clsPrefix:b,status:n,showIndicator:r,indicatorTextColor:t,railColor:l,fillColor:s,railStyle:a,offsetDegree:this.offsetDegree,percentage:d,viewBoxWidth:c,strokeWidth:u,gapDegree:_===void 0?e==="dashboard"?75:0:_,gapOffsetDegree:k,unit:p},R):e==="line"?i(l0,{clsPrefix:b,status:n,showIndicator:r,indicatorTextColor:t,railColor:l,fillColor:s,railStyle:a,percentage:d,processing:x,indicatorPlacement:f,unit:p,fillBorderRadius:h,railBorderRadius:v,height:m},R):e==="multiple-circle"?i(d0,{clsPrefix:b,strokeWidth:u,railColor:l,fillColor:s,railStyle:a,viewBoxWidth:c,percentage:d,showIndicator:r,circleGap:C},R):null)}}),f0={name:"QrCode",common:fe,self:e=>({borderRadius:e.borderRadius})},h0=f0,p0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("circle",{fill:"#FFCB4C",cx:"18",cy:"17.018",r:"17"}),i("path",{fill:"#65471B",d:"M14.524 21.036c-.145-.116-.258-.274-.312-.464-.134-.46.13-.918.59-1.021 4.528-1.021 7.577 1.363 7.706 1.465.384.306.459.845.173 1.205-.286.358-.828.401-1.211.097-.11-.084-2.523-1.923-6.182-1.098-.274.061-.554-.016-.764-.184z"}),i("ellipse",{fill:"#65471B",cx:"13.119",cy:"11.174",rx:"2.125",ry:"2.656"}),i("ellipse",{fill:"#65471B",cx:"24.375",cy:"12.236",rx:"2.125",ry:"2.656"}),i("path",{fill:"#F19020",d:"M17.276 35.149s1.265-.411 1.429-1.352c.173-.972-.624-1.167-.624-1.167s1.041-.208 1.172-1.376c.123-1.101-.861-1.363-.861-1.363s.97-.4 1.016-1.539c.038-.959-.995-1.428-.995-1.428s5.038-1.221 5.556-1.341c.516-.12 1.32-.615 1.069-1.694-.249-1.08-1.204-1.118-1.697-1.003-.494.115-6.744 1.566-8.9 2.068l-1.439.334c-.54.127-.785-.11-.404-.512.508-.536.833-1.129.946-2.113.119-1.035-.232-2.313-.433-2.809-.374-.921-1.005-1.649-1.734-1.899-1.137-.39-1.945.321-1.542 1.561.604 1.854.208 3.375-.833 4.293-2.449 2.157-3.588 3.695-2.83 6.973.828 3.575 4.377 5.876 7.952 5.048l3.152-.681z"}),i("path",{fill:"#65471B",d:"M9.296 6.351c-.164-.088-.303-.224-.391-.399-.216-.428-.04-.927.393-1.112 4.266-1.831 7.699-.043 7.843.034.433.231.608.747.391 1.154-.216.405-.74.546-1.173.318-.123-.063-2.832-1.432-6.278.047-.257.109-.547.085-.785-.042zm12.135 3.75c-.156-.098-.286-.243-.362-.424-.187-.442.023-.927.468-1.084 4.381-1.536 7.685.48 7.823.567.415.26.555.787.312 1.178-.242.39-.776.495-1.191.238-.12-.072-2.727-1.621-6.267-.379-.266.091-.553.046-.783-.096z"})),v0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("path",{fill:"#FFCC4D",d:"M36 18c0 9.941-8.059 18-18 18-9.94 0-18-8.059-18-18C0 8.06 8.06 0 18 0c9.941 0 18 8.06 18 18"}),i("ellipse",{fill:"#664500",cx:"18",cy:"27",rx:"5",ry:"6"}),i("path",{fill:"#664500",d:"M5.999 11c-.208 0-.419-.065-.599-.2-.442-.331-.531-.958-.2-1.4C8.462 5.05 12.816 5 13 5c.552 0 1 .448 1 1 0 .551-.445.998-.996 1-.155.002-3.568.086-6.204 3.6-.196.262-.497.4-.801.4zm24.002 0c-.305 0-.604-.138-.801-.4-2.64-3.521-6.061-3.598-6.206-3.6-.55-.006-.994-.456-.991-1.005C22.006 5.444 22.45 5 23 5c.184 0 4.537.05 7.8 4.4.332.442.242 1.069-.2 1.4-.18.135-.39.2-.599.2zm-16.087 4.5l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L12.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L13.914 15.5zm11 0l1.793-1.793c.391-.391.391-1.023 0-1.414s-1.023-.391-1.414 0L23.5 14.086l-1.793-1.793c-.391-.391-1.023-.391-1.414 0s-.391 1.023 0 1.414l1.793 1.793-1.793 1.793c-.391.391-.391 1.023 0 1.414.195.195.451.293.707.293s.512-.098.707-.293l1.793-1.793 1.793 1.793c.195.195.451.293.707.293s.512-.098.707-.293c.391-.391.391-1.023 0-1.414L24.914 15.5z"})),g0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("ellipse",{fill:"#292F33",cx:"18",cy:"26",rx:"18",ry:"10"}),i("ellipse",{fill:"#66757F",cx:"18",cy:"24",rx:"18",ry:"10"}),i("path",{fill:"#E1E8ED",d:"M18 31C3.042 31 1 16 1 12h34c0 2-1.958 19-17 19z"}),i("path",{fill:"#77B255",d:"M35 12.056c0 5.216-7.611 9.444-17 9.444S1 17.271 1 12.056C1 6.84 8.611 3.611 18 3.611s17 3.229 17 8.445z"}),i("ellipse",{fill:"#A6D388",cx:"18",cy:"13",rx:"15",ry:"7"}),i("path",{d:"M21 17c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.739-1.109.9-2.246.478-3.377-.461-1.236-1.438-1.996-1.731-2.077-.553 0-.958-.443-.958-.996 0-.552.491-.995 1.043-.995.997 0 2.395 1.153 3.183 2.625 1.034 1.933.91 4.039-.351 5.929-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.196-.451.294-.707.294zm-6-2c-.256 0-.512-.098-.707-.293-2.337-2.337-2.376-4.885-.125-8.262.727-1.091.893-2.083.494-2.947-.444-.961-1.431-1.469-1.684-1.499-.552 0-.989-.447-.989-1 0-.552.458-1 1.011-1 .997 0 2.585.974 3.36 2.423.481.899 1.052 2.761-.528 5.131-1.961 2.942-1.531 4.332-.125 5.738.391.391.391 1.023 0 1.414-.195.197-.451.295-.707.295z",fill:"#5C913B"})),m0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 36"},i("path",{fill:"#EF9645",d:"M15.5 2.965c1.381 0 2.5 1.119 2.5 2.5v.005L20.5.465c1.381 0 2.5 1.119 2.5 2.5V4.25l2.5-1.535c1.381 0 2.5 1.119 2.5 2.5V8.75L29 18H15.458L15.5 2.965z"}),i("path",{fill:"#FFDC5D",d:"M4.625 16.219c1.381-.611 3.354.208 4.75 2.188.917 1.3 1.187 3.151 2.391 3.344.46.073 1.234-.313 1.234-1.397V4.5s0-2 2-2 2 2 2 2v11.633c0-.029 1-.064 1-.082V2s0-2 2-2 2 2 2 2v14.053c0 .017 1 .041 1 .069V4.25s0-2 2-2 2 2 2 2v12.638c0 .118 1 .251 1 .398V8.75s0-2 2-2 2 2 2 2V24c0 6.627-5.373 12-12 12-4.775 0-8.06-2.598-9.896-5.292C8.547 28.423 8.096 26.051 8 25.334c0 0-.123-1.479-1.156-2.865-1.469-1.969-2.5-3.156-3.125-3.866-.317-.359-.625-1.707.906-2.384z"})),b0=g("result",`
|
|
|
color: var(--n-text-color);
|
|
|
line-height: var(--n-line-height);
|
|
|
font-size: var(--n-font-size);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier);
|
|
|
`,[g("result-icon",`
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`,[w("status-image",`
|
|
|
font-size: var(--n-icon-size);
|
|
|
width: 1em;
|
|
|
height: 1em;
|
|
|
`),g("base-icon",`
|
|
|
color: var(--n-icon-color);
|
|
|
font-size: var(--n-icon-size);
|
|
|
`)]),g("result-content",{marginTop:"24px"}),g("result-footer",`
|
|
|
margin-top: 24px;
|
|
|
text-align: center;
|
|
|
`),g("result-header",[w("title",`
|
|
|
margin-top: 16px;
|
|
|
font-weight: var(--n-title-font-weight);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
text-align: center;
|
|
|
color: var(--n-title-text-color);
|
|
|
font-size: var(--n-title-font-size);
|
|
|
`),w("description",`
|
|
|
margin-top: 4px;
|
|
|
text-align: center;
|
|
|
font-size: var(--n-font-size);
|
|
|
`)])]),x0={403:m0,404:p0,418:g0,500:v0,info:i(yt,null),success:i(Ut,null),warning:i($t,null),error:i(Vt,null)},C0=Object.assign(Object.assign({},se.props),{size:{type:String,default:"medium"},status:{type:String,default:"info"},title:String,description:String}),ix=Z({name:"Result",props:C0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Result","-result",b0,hm,e,o),n=$(()=>{const{size:a,status:s}=e,{common:{cubicBezierEaseInOut:d},self:{textColor:c,lineHeight:u,titleTextColor:f,titleFontWeight:p,[N("iconColor",s)]:v,[N("fontSize",a)]:h,[N("titleFontSize",a)]:m,[N("iconSize",a)]:x}}=r.value;return{"--n-bezier":d,"--n-font-size":h,"--n-icon-size":x,"--n-line-height":u,"--n-text-color":c,"--n-title-font-size":m,"--n-title-font-weight":p,"--n-title-text-color":f,"--n-icon-color":v||""}}),l=t?We("result",$(()=>{const{size:a,status:s}=e;let d="";return a&&(d+=a[0]),s&&(d+=s[0]),d}),n,e):void 0;return{mergedClsPrefix:o,cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e;const{status:o,$slots:t,mergedClsPrefix:r,onRender:n}=this;return n==null||n(),i("div",{class:[`${r}-result`,this.themeClass],style:this.cssVars},i("div",{class:`${r}-result-icon`},((e=t.icon)===null||e===void 0?void 0:e.call(t))||i(He,{clsPrefix:r},{default:()=>x0[o]})),i("div",{class:`${r}-result-header`},this.title?i("div",{class:`${r}-result-header__title`},this.title):null,this.description?i("div",{class:`${r}-result-header__description`},this.description):null),t.default&&i("div",{class:`${r}-result-content`},t),t.footer&&i("div",{class:`${r}-result-footer`},t.footer()))}}),y0={name:"Skeleton",common:fe,self(e){const{heightSmall:o,heightMedium:t,heightLarge:r,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:o,heightMedium:t,heightLarge:r}}},w0=e=>{const{heightSmall:o,heightMedium:t,heightLarge:r,borderRadius:n}=e;return{color:"#eee",colorEnd:"#ddd",borderRadius:n,heightSmall:o,heightMedium:t,heightLarge:r}},S0={name:"Skeleton",common:Ae,self:w0},z0=y([g("skeleton",`
|
|
|
height: 1em;
|
|
|
width: 100%;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
transition:
|
|
|
--n-color-start .3s var(--n-bezier),
|
|
|
--n-color-end .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
|
|
|
background-color: var(--n-color-start);
|
|
|
`),y("@keyframes skeleton-loading",`
|
|
|
0% {
|
|
|
background: var(--n-color-start);
|
|
|
}
|
|
|
40% {
|
|
|
background: var(--n-color-end);
|
|
|
}
|
|
|
80% {
|
|
|
background: var(--n-color-start);
|
|
|
}
|
|
|
100% {
|
|
|
background: var(--n-color-start);
|
|
|
}
|
|
|
`)]),$0=Object.assign(Object.assign({},se.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),lx=Z({name:"Skeleton",inheritAttrs:!1,props:$0,setup(e){vl();const{mergedClsPrefixRef:o}=Ie(e),t=se("Skeleton","-skeleton",z0,S0,e,o);return{mergedClsPrefix:o,style:$(()=>{var r,n;const l=t.value,{common:{cubicBezierEaseInOut:a}}=l,s=l.self,{color:d,colorEnd:c,borderRadius:u}=s;let f;const{circle:p,sharp:v,round:h,width:m,height:x,size:C,text:b,animated:_}=e;C!==void 0&&(f=s[N("height",C)]);const k=p?(r=m??x)!==null&&r!==void 0?r:f:m,z=(n=p?m??x:x)!==null&&n!==void 0?n:f;return{display:b?"inline-block":"",verticalAlign:b?"-0.125em":"",borderRadius:p?"50%":h?"4096px":v?"":u,width:typeof k=="number"?Do(k):k,height:typeof z=="number"?Do(z):z,animation:_?"":"none","--n-bezier":a,"--n-color-start":d,"--n-color-end":c}})}},render(){const{repeat:e,style:o,mergedClsPrefix:t,$attrs:r}=this,n=i("div",To({class:`${t}-skeleton`,style:o},r));return e>1?i(so,null,Xi(e,null).map(l=>[n,`
|
|
|
`])):n}}),R0=y([y("@keyframes spin-rotate",`
|
|
|
from {
|
|
|
transform: rotate(0);
|
|
|
}
|
|
|
to {
|
|
|
transform: rotate(360deg);
|
|
|
}
|
|
|
`),g("spin-container",`
|
|
|
position: relative;
|
|
|
`,[g("spin-body",`
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
`,[jt()])]),g("spin-body",`
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
flex-direction: column;
|
|
|
`),g("spin",`
|
|
|
display: inline-flex;
|
|
|
height: var(--n-size);
|
|
|
width: var(--n-size);
|
|
|
font-size: var(--n-size);
|
|
|
color: var(--n-color);
|
|
|
`,[P("rotate",`
|
|
|
animation: spin-rotate 2s linear infinite;
|
|
|
`)]),g("spin-description",`
|
|
|
display: inline-block;
|
|
|
font-size: var(--n-font-size);
|
|
|
color: var(--n-text-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
margin-top: 8px;
|
|
|
`),g("spin-content",`
|
|
|
opacity: 1;
|
|
|
transition: opacity .3s var(--n-bezier);
|
|
|
pointer-events: all;
|
|
|
`,[P("spinning",`
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
pointer-events: none;
|
|
|
opacity: var(--n-opacity-spinning);
|
|
|
`)])]),P0={small:20,medium:18,large:16},k0=Object.assign(Object.assign({},se.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),ax=Z({name:"Spin",props:k0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Spin","-spin",R0,Cm,e,o),n=$(()=>{const{size:d}=e,{common:{cubicBezierEaseInOut:c},self:u}=r.value,{opacitySpinning:f,color:p,textColor:v}=u,h=typeof d=="number"?Do(d):u[N("size",d)];return{"--n-bezier":c,"--n-opacity-spinning":f,"--n-size":h,"--n-color":p,"--n-text-color":v}}),l=t?We("spin",$(()=>{const{size:d}=e;return typeof d=="number"?String(d):d[0]}),n,e):void 0,a=Ct(e,["spinning","show"]),s=M(!1);return oo(d=>{let c;if(a.value){const{delay:u}=e;if(u){c=window.setTimeout(()=>{s.value=!0},u),d(()=>{clearTimeout(c)});return}}s.value=a.value}),{mergedClsPrefix:o,active:s,mergedStrokeWidth:$(()=>{const{strokeWidth:d}=e;if(d!==void 0)return d;const{size:c}=e;return P0[typeof c=="number"?"medium":c]}),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e,o;const{$slots:t,mergedClsPrefix:r,description:n}=this,l=t.icon&&this.rotate,a=(n||t.description)&&i("div",{class:`${r}-spin-description`},n||((e=t.description)===null||e===void 0?void 0:e.call(t))),s=t.icon?i("div",{class:[`${r}-spin-body`,this.themeClass]},i("div",{class:[`${r}-spin`,l&&`${r}-spin--rotate`],style:t.default?"":this.cssVars},t.icon()),a):i("div",{class:[`${r}-spin-body`,this.themeClass]},i(Gt,{clsPrefix:r,style:t.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${r}-spin`}),a);return(o=this.onRender)===null||o===void 0||o.call(this),t.default?i("div",{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},i("div",{class:[`${r}-spin-content`,this.active&&`${r}-spin-content--spinning`,this.contentClass],style:this.contentStyle},t),i(io,{name:"fade-in-transition"},{default:()=>this.active?s:null})):s}}),I0={name:"Split",common:fe},B0=I0,T0=g("statistic",[w("label",`
|
|
|
font-weight: var(--n-label-font-weight);
|
|
|
transition: .3s color var(--n-bezier);
|
|
|
font-size: var(--n-label-font-size);
|
|
|
color: var(--n-label-text-color);
|
|
|
`),g("statistic-value",`
|
|
|
margin-top: 4px;
|
|
|
font-weight: var(--n-value-font-weight);
|
|
|
`,[w("prefix",`
|
|
|
margin: 0 4px 0 0;
|
|
|
font-size: var(--n-value-font-size);
|
|
|
transition: .3s color var(--n-bezier);
|
|
|
color: var(--n-value-prefix-text-color);
|
|
|
`,[g("icon",{verticalAlign:"-0.125em"})]),w("content",`
|
|
|
font-size: var(--n-value-font-size);
|
|
|
transition: .3s color var(--n-bezier);
|
|
|
color: var(--n-value-text-color);
|
|
|
`),w("suffix",`
|
|
|
margin: 0 0 0 4px;
|
|
|
font-size: var(--n-value-font-size);
|
|
|
transition: .3s color var(--n-bezier);
|
|
|
color: var(--n-value-suffix-text-color);
|
|
|
`,[g("icon",{verticalAlign:"-0.125em"})])])]),O0=Object.assign(Object.assign({},se.props),{tabularNums:Boolean,label:String,value:[String,Number]}),sx=Z({name:"Statistic",props:O0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t,mergedRtlRef:r}=Ie(e),n=se("Statistic","-statistic",T0,zm,e,o),l=eo("Statistic",r,o),a=$(()=>{const{self:{labelFontWeight:d,valueFontSize:c,valueFontWeight:u,valuePrefixTextColor:f,labelTextColor:p,valueSuffixTextColor:v,valueTextColor:h,labelFontSize:m},common:{cubicBezierEaseInOut:x}}=n.value;return{"--n-bezier":x,"--n-label-font-size":m,"--n-label-font-weight":d,"--n-label-text-color":p,"--n-value-font-weight":u,"--n-value-font-size":c,"--n-value-prefix-text-color":f,"--n-value-suffix-text-color":v,"--n-value-text-color":h}}),s=t?We("statistic",void 0,a,e):void 0;return{rtlEnabled:l,mergedClsPrefix:o,cssVars:t?void 0:a,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){var e;const{mergedClsPrefix:o,$slots:{default:t,label:r,prefix:n,suffix:l}}=this;return(e=this.onRender)===null||e===void 0||e.call(this),i("div",{class:[`${o}-statistic`,this.themeClass,this.rtlEnabled&&`${o}-statistic--rtl`],style:this.cssVars},je(r,a=>i("div",{class:`${o}-statistic__label`},this.label||a)),i("div",{class:`${o}-statistic-value`,style:{fontVariantNumeric:this.tabularNums?"tabular-nums":""}},je(n,a=>a&&i("span",{class:`${o}-statistic-value__prefix`},a)),this.value!==void 0?i("span",{class:`${o}-statistic-value__content`},this.value):je(t,a=>a&&i("span",{class:`${o}-statistic-value__content`},a)),je(l,a=>a&&i("span",{class:`${o}-statistic-value__suffix`},a))))}}),F0=g("switch",`
|
|
|
height: var(--n-height);
|
|
|
min-width: var(--n-width);
|
|
|
vertical-align: middle;
|
|
|
user-select: none;
|
|
|
-webkit-user-select: none;
|
|
|
display: inline-flex;
|
|
|
outline: none;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
`,[w("children-placeholder",`
|
|
|
height: var(--n-rail-height);
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
overflow: hidden;
|
|
|
pointer-events: none;
|
|
|
visibility: hidden;
|
|
|
`),w("rail-placeholder",`
|
|
|
display: flex;
|
|
|
flex-wrap: none;
|
|
|
`),w("button-placeholder",`
|
|
|
width: calc(1.75 * var(--n-rail-height));
|
|
|
height: var(--n-rail-height);
|
|
|
`),g("base-loading",`
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%) translateY(-50%);
|
|
|
font-size: calc(var(--n-button-width) - 4px);
|
|
|
color: var(--n-loading-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`,[dt({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),w("checked, unchecked",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-text-color);
|
|
|
box-sizing: border-box;
|
|
|
position: absolute;
|
|
|
white-space: nowrap;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
line-height: 1;
|
|
|
`),w("checked",`
|
|
|
right: 0;
|
|
|
padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
|
`),w("unchecked",`
|
|
|
left: 0;
|
|
|
justify-content: flex-end;
|
|
|
padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
|
`),y("&:focus",[w("rail",`
|
|
|
box-shadow: var(--n-box-shadow-focus);
|
|
|
`)]),P("round",[w("rail","border-radius: calc(var(--n-rail-height) / 2);",[w("button","border-radius: calc(var(--n-button-height) / 2);")])]),Ne("disabled",[Ne("icon",[P("rubber-band",[P("pressed",[w("rail",[w("button","max-width: var(--n-button-width-pressed);")])]),w("rail",[y("&:active",[w("button","max-width: var(--n-button-width-pressed);")])]),P("active",[P("pressed",[w("rail",[w("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),w("rail",[y("&:active",[w("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),P("active",[w("rail",[w("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),w("rail",`
|
|
|
overflow: hidden;
|
|
|
height: var(--n-rail-height);
|
|
|
min-width: var(--n-rail-width);
|
|
|
border-radius: var(--n-rail-border-radius);
|
|
|
cursor: pointer;
|
|
|
position: relative;
|
|
|
transition:
|
|
|
opacity .3s var(--n-bezier),
|
|
|
background .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier);
|
|
|
background-color: var(--n-rail-color);
|
|
|
`,[w("button-icon",`
|
|
|
color: var(--n-icon-color);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
font-size: calc(var(--n-button-height) - 4px);
|
|
|
position: absolute;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
line-height: 1;
|
|
|
`,[dt()]),w("button",`
|
|
|
align-items: center;
|
|
|
top: var(--n-offset);
|
|
|
left: var(--n-offset);
|
|
|
height: var(--n-button-height);
|
|
|
width: var(--n-button-width-pressed);
|
|
|
max-width: var(--n-button-width);
|
|
|
border-radius: var(--n-button-border-radius);
|
|
|
background-color: var(--n-button-color);
|
|
|
box-shadow: var(--n-button-box-shadow);
|
|
|
box-sizing: border-box;
|
|
|
cursor: inherit;
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
left .3s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier),
|
|
|
max-width .3s var(--n-bezier),
|
|
|
box-shadow .3s var(--n-bezier);
|
|
|
`)]),P("active",[w("rail","background-color: var(--n-rail-color-active);")]),P("loading",[w("rail",`
|
|
|
cursor: wait;
|
|
|
`)]),P("disabled",[w("rail",`
|
|
|
cursor: not-allowed;
|
|
|
opacity: .5;
|
|
|
`)])]),_0=Object.assign(Object.assign({},se.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let or;const dx=Z({name:"Switch",props:_0,setup(e){or===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?or=CSS.supports("width","max(1px)"):or=!1:or=!0);const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Switch","-switch",F0,Mm,e,o),n=rt(e),{mergedSizeRef:l,mergedDisabledRef:a}=n,s=M(e.defaultValue),d=ae(e,"value"),c=co(d,s),u=$(()=>c.value===e.checkedValue),f=M(!1),p=M(!1),v=$(()=>{const{railStyle:L}=e;if(L)return L({focused:p.value,checked:u.value})});function h(L){const{"onUpdate:value":I,onChange:D,onUpdateValue:W}=e,{nTriggerFormInput:H,nTriggerFormChange:j}=n;I&&ce(I,L),W&&ce(W,L),D&&ce(D,L),s.value=L,H(),j()}function m(){const{nTriggerFormFocus:L}=n;L()}function x(){const{nTriggerFormBlur:L}=n;L()}function C(){e.loading||a.value||(c.value!==e.checkedValue?h(e.checkedValue):h(e.uncheckedValue))}function b(){p.value=!0,m()}function _(){p.value=!1,x(),f.value=!1}function k(L){e.loading||a.value||L.key===" "&&(c.value!==e.checkedValue?h(e.checkedValue):h(e.uncheckedValue),f.value=!1)}function z(L){e.loading||a.value||L.key===" "&&(L.preventDefault(),f.value=!0)}const R=$(()=>{const{value:L}=l,{self:{opacityDisabled:I,railColor:D,railColorActive:W,buttonBoxShadow:H,buttonColor:j,boxShadowFocus:V,loadingColor:E,textColor:Y,iconColor:K,[N("buttonHeight",L)]:te,[N("buttonWidth",L)]:xe,[N("buttonWidthPressed",L)]:de,[N("railHeight",L)]:ie,[N("railWidth",L)]:F,[N("railBorderRadius",L)]:B,[N("buttonBorderRadius",L)]:q},common:{cubicBezierEaseInOut:ee}}=r.value;let be,me,Be;return or?(be=`calc((${ie} - ${te}) / 2)`,me=`max(${ie}, ${te})`,Be=`max(${F}, calc(${F} + ${te} - ${ie}))`):(be=Do((ko(ie)-ko(te))/2),me=Do(Math.max(ko(ie),ko(te))),Be=ko(ie)>ko(te)?F:Do(ko(F)+ko(te)-ko(ie))),{"--n-bezier":ee,"--n-button-border-radius":q,"--n-button-box-shadow":H,"--n-button-color":j,"--n-button-width":xe,"--n-button-width-pressed":de,"--n-button-height":te,"--n-height":me,"--n-offset":be,"--n-opacity-disabled":I,"--n-rail-border-radius":B,"--n-rail-color":D,"--n-rail-color-active":W,"--n-rail-height":ie,"--n-rail-width":F,"--n-width":Be,"--n-box-shadow-focus":V,"--n-loading-color":E,"--n-text-color":Y,"--n-icon-color":K}}),S=t?We("switch",$(()=>l.value[0]),R,e):void 0;return{handleClick:C,handleBlur:_,handleFocus:b,handleKeyup:k,handleKeydown:z,mergedRailStyle:v,pressed:f,mergedClsPrefix:o,mergedValue:c,checked:u,mergedDisabled:a,cssVars:t?void 0:R,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:o,checked:t,mergedRailStyle:r,onRender:n,$slots:l}=this;n==null||n();const{checked:a,unchecked:s,icon:d,"checked-icon":c,"unchecked-icon":u}=l,f=!(xt(d)&&xt(c)&&xt(u));return i("div",{role:"switch","aria-checked":t,class:[`${e}-switch`,this.themeClass,f&&`${e}-switch--icon`,t&&`${e}-switch--active`,o&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},i("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:r},je(a,p=>je(s,v=>p||v?i("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},i("div",{class:`${e}-switch__rail-placeholder`},i("div",{class:`${e}-switch__button-placeholder`}),p),i("div",{class:`${e}-switch__rail-placeholder`},i("div",{class:`${e}-switch__button-placeholder`}),v)):null)),i("div",{class:`${e}-switch__button`},je(d,p=>je(c,v=>je(u,h=>i(Kt,null,{default:()=>this.loading?i(Gt,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(v||p)?i("div",{class:`${e}-switch__button-icon`,key:v?"checked-icon":"icon"},v||p):!this.checked&&(h||p)?i("div",{class:`${e}-switch__button-icon`,key:h?"unchecked-icon":"icon"},h||p):null})))),je(a,p=>p&&i("div",{key:"checked",class:`${e}-switch__checked`},p)),je(s,p=>p&&i("div",{key:"unchecked",class:`${e}-switch__unchecked`},p)))))}}),Qn="n-tabs",ws={tab:[String,Number,Object,Function],name:{type:[String,Number],required:!0},disabled:Boolean,displayDirective:{type:String,default:"if"},closable:{type:Boolean,default:void 0},tabProps:Object,label:[String,Number,Object,Function]},cx=Z({__TAB_PANE__:!0,name:"TabPane",alias:["TabPanel"],props:ws,setup(e){const o=ze(Qn,null);return o||Wo("tab-pane","`n-tab-pane` must be placed inside `n-tabs`."),{style:o.paneStyleRef,class:o.paneClassRef,mergedClsPrefix:o.mergedClsPrefixRef}},render(){return i("div",{class:[`${this.mergedClsPrefix}-tab-pane`,this.class],style:this.style},this.$slots)}}),M0=Object.assign({internalLeftPadded:Boolean,internalAddable:Boolean,internalCreatedByPane:Boolean},Wt(ws,["displayDirective"])),Cn=Z({__TAB__:!0,inheritAttrs:!1,name:"Tab",props:M0,setup(e){const{mergedClsPrefixRef:o,valueRef:t,typeRef:r,closableRef:n,tabStyleRef:l,addTabStyleRef:a,tabClassRef:s,addTabClassRef:d,tabChangeIdRef:c,onBeforeLeaveRef:u,triggerRef:f,handleAdd:p,activateTab:v,handleClose:h}=ze(Qn);return{trigger:f,mergedClosable:$(()=>{if(e.internalAddable)return!1;const{closable:m}=e;return m===void 0?n.value:m}),style:l,addStyle:a,tabClass:s,addTabClass:d,clsPrefix:o,value:t,type:r,handleClose(m){m.stopPropagation(),!e.disabled&&h(e.name)},activateTab(){if(e.disabled)return;if(e.internalAddable){p();return}const{name:m}=e,x=++c.id;if(m!==t.value){const{value:C}=u;C?Promise.resolve(C(e.name,t.value)).then(b=>{b&&c.id===x&&v(m)}):v(m)}}}},render(){const{internalAddable:e,clsPrefix:o,name:t,disabled:r,label:n,tab:l,value:a,mergedClosable:s,trigger:d,$slots:{default:c}}=this,u=n??l;return i("div",{class:`${o}-tabs-tab-wrapper`},this.internalLeftPadded?i("div",{class:`${o}-tabs-tab-pad`}):null,i("div",Object.assign({key:t,"data-name":t,"data-disabled":r?!0:void 0},To({class:[`${o}-tabs-tab`,a===t&&`${o}-tabs-tab--active`,r&&`${o}-tabs-tab--disabled`,s&&`${o}-tabs-tab--closable`,e&&`${o}-tabs-tab--addable`,e?this.addTabClass:this.tabClass],onClick:d==="click"?this.activateTab:void 0,onMouseenter:d==="hover"?this.activateTab:void 0,style:e?this.addStyle:this.style},this.internalCreatedByPane?this.tabProps||{}:this.$attrs)),i("span",{class:`${o}-tabs-tab__label`},e?i(so,null,i("div",{class:`${o}-tabs-tab__height-placeholder`}," "),i(He,{clsPrefix:o},{default:()=>i(sr,null)})):c?c():typeof u=="object"?u:Qe(u??t)),s&&this.type==="card"?i(Pt,{clsPrefix:o,class:`${o}-tabs-tab__close`,onClick:this.handleClose,disabled:r}):null))}}),D0=g("tabs",`
|
|
|
box-sizing: border-box;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`,[P("segment-type",[g("tabs-rail",[y("&.transition-disabled",[g("tabs-capsule",`
|
|
|
transition: none;
|
|
|
`)])])]),P("top",[g("tab-pane",`
|
|
|
padding: var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left);
|
|
|
`)]),P("left",[g("tab-pane",`
|
|
|
padding: var(--n-pane-padding-right) var(--n-pane-padding-bottom) var(--n-pane-padding-left) var(--n-pane-padding-top);
|
|
|
`)]),P("left, right",`
|
|
|
flex-direction: row;
|
|
|
`,[g("tabs-bar",`
|
|
|
width: 2px;
|
|
|
right: 0;
|
|
|
transition:
|
|
|
top .2s var(--n-bezier),
|
|
|
max-height .2s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
`),g("tabs-tab",`
|
|
|
padding: var(--n-tab-padding-vertical);
|
|
|
`)]),P("right",`
|
|
|
flex-direction: row-reverse;
|
|
|
`,[g("tab-pane",`
|
|
|
padding: var(--n-pane-padding-left) var(--n-pane-padding-top) var(--n-pane-padding-right) var(--n-pane-padding-bottom);
|
|
|
`),g("tabs-bar",`
|
|
|
left: 0;
|
|
|
`)]),P("bottom",`
|
|
|
flex-direction: column-reverse;
|
|
|
justify-content: flex-end;
|
|
|
`,[g("tab-pane",`
|
|
|
padding: var(--n-pane-padding-bottom) var(--n-pane-padding-right) var(--n-pane-padding-top) var(--n-pane-padding-left);
|
|
|
`),g("tabs-bar",`
|
|
|
top: 0;
|
|
|
`)]),g("tabs-rail",`
|
|
|
padding: 3px;
|
|
|
border-radius: var(--n-tab-border-radius);
|
|
|
width: 100%;
|
|
|
background-color: var(--n-color-segment);
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`,[g("tabs-capsule",`
|
|
|
border-radius: var(--n-tab-border-radius);
|
|
|
position: absolute;
|
|
|
pointer-events: none;
|
|
|
background-color: var(--n-tab-color-segment);
|
|
|
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08);
|
|
|
transition: 0.3s;
|
|
|
`),g("tabs-tab-wrapper",`
|
|
|
flex-basis: 0;
|
|
|
flex-grow: 1;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
`,[g("tabs-tab",`
|
|
|
overflow: hidden;
|
|
|
border-radius: var(--n-tab-border-radius);
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
`,[P("active",`
|
|
|
font-weight: var(--n-font-weight-strong);
|
|
|
color: var(--n-tab-text-color-active);
|
|
|
`),y("&:hover",`
|
|
|
color: var(--n-tab-text-color-hover);
|
|
|
`)])])]),P("flex",[g("tabs-nav",{width:"100%"},[g("tabs-wrapper",{width:"100%"},[g("tabs-tab",{marginRight:0})])])]),g("tabs-nav",`
|
|
|
box-sizing: border-box;
|
|
|
line-height: 1.5;
|
|
|
display: flex;
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`,[w("prefix, suffix",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
`),w("prefix","padding-right: 16px;"),w("suffix","padding-left: 16px;")]),P("top, bottom",[g("tabs-nav-scroll-wrapper",[y("&::before",`
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
width: 20px;
|
|
|
`),y("&::after",`
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
width: 20px;
|
|
|
`),P("shadow-start",[y("&::before",`
|
|
|
box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, .12);
|
|
|
`)]),P("shadow-end",[y("&::after",`
|
|
|
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, .12);
|
|
|
`)])])]),P("left, right",[g("tabs-nav-scroll-content",`
|
|
|
flex-direction: column;
|
|
|
`),g("tabs-nav-scroll-wrapper",[y("&::before",`
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
height: 20px;
|
|
|
`),y("&::after",`
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
height: 20px;
|
|
|
`),P("shadow-start",[y("&::before",`
|
|
|
box-shadow: inset 0 10px 8px -8px rgba(0, 0, 0, .12);
|
|
|
`)]),P("shadow-end",[y("&::after",`
|
|
|
box-shadow: inset 0 -10px 8px -8px rgba(0, 0, 0, .12);
|
|
|
`)])])]),g("tabs-nav-scroll-wrapper",`
|
|
|
flex: 1;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
`,[g("tabs-nav-y-scroll",`
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
overflow-y: auto;
|
|
|
scrollbar-width: none;
|
|
|
`,[y("&::-webkit-scrollbar",`
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
`)]),y("&::before, &::after",`
|
|
|
transition: box-shadow .3s var(--n-bezier);
|
|
|
pointer-events: none;
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
`)]),g("tabs-nav-scroll-content",`
|
|
|
display: flex;
|
|
|
position: relative;
|
|
|
min-width: 100%;
|
|
|
min-height: 100%;
|
|
|
width: fit-content;
|
|
|
box-sizing: border-box;
|
|
|
`),g("tabs-wrapper",`
|
|
|
display: inline-flex;
|
|
|
flex-wrap: nowrap;
|
|
|
position: relative;
|
|
|
`),g("tabs-tab-wrapper",`
|
|
|
display: flex;
|
|
|
flex-wrap: nowrap;
|
|
|
flex-shrink: 0;
|
|
|
flex-grow: 0;
|
|
|
`),g("tabs-tab",`
|
|
|
cursor: pointer;
|
|
|
white-space: nowrap;
|
|
|
flex-wrap: nowrap;
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
color: var(--n-tab-text-color);
|
|
|
font-size: var(--n-tab-font-size);
|
|
|
background-clip: padding-box;
|
|
|
padding: var(--n-tab-padding);
|
|
|
transition:
|
|
|
box-shadow .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier);
|
|
|
`,[P("disabled",{cursor:"not-allowed"}),w("close",`
|
|
|
margin-left: 6px;
|
|
|
transition:
|
|
|
background-color .3s var(--n-bezier),
|
|
|
color .3s var(--n-bezier);
|
|
|
`),w("label",`
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
z-index: 1;
|
|
|
`)]),g("tabs-bar",`
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
height: 2px;
|
|
|
border-radius: 1px;
|
|
|
background-color: var(--n-bar-color);
|
|
|
transition:
|
|
|
left .2s var(--n-bezier),
|
|
|
max-width .2s var(--n-bezier),
|
|
|
opacity .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
`,[y("&.transition-disabled",`
|
|
|
transition: none;
|
|
|
`),P("disabled",`
|
|
|
background-color: var(--n-tab-text-color-disabled)
|
|
|
`)]),g("tabs-pane-wrapper",`
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
transition: max-height .2s var(--n-bezier);
|
|
|
`),g("tab-pane",`
|
|
|
color: var(--n-pane-text-color);
|
|
|
width: 100%;
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
opacity .2s var(--n-bezier);
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
`,[y("&.next-transition-leave-active, &.prev-transition-leave-active, &.next-transition-enter-active, &.prev-transition-enter-active",`
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier),
|
|
|
transform .2s var(--n-bezier),
|
|
|
opacity .2s var(--n-bezier);
|
|
|
`),y("&.next-transition-leave-active, &.prev-transition-leave-active",`
|
|
|
position: absolute;
|
|
|
`),y("&.next-transition-enter-from, &.prev-transition-leave-to",`
|
|
|
transform: translateX(32px);
|
|
|
opacity: 0;
|
|
|
`),y("&.next-transition-leave-to, &.prev-transition-enter-from",`
|
|
|
transform: translateX(-32px);
|
|
|
opacity: 0;
|
|
|
`),y("&.next-transition-leave-from, &.next-transition-enter-to, &.prev-transition-leave-from, &.prev-transition-enter-to",`
|
|
|
transform: translateX(0);
|
|
|
opacity: 1;
|
|
|
`)]),g("tabs-tab-pad",`
|
|
|
box-sizing: border-box;
|
|
|
width: var(--n-tab-gap);
|
|
|
flex-grow: 0;
|
|
|
flex-shrink: 0;
|
|
|
`),P("line-type, bar-type",[g("tabs-tab",`
|
|
|
font-weight: var(--n-tab-font-weight);
|
|
|
box-sizing: border-box;
|
|
|
vertical-align: bottom;
|
|
|
`,[y("&:hover",{color:"var(--n-tab-text-color-hover)"}),P("active",`
|
|
|
color: var(--n-tab-text-color-active);
|
|
|
font-weight: var(--n-tab-font-weight-active);
|
|
|
`),P("disabled",{color:"var(--n-tab-text-color-disabled)"})])]),g("tabs-nav",[P("line-type",[P("top",[w("prefix, suffix",`
|
|
|
border-bottom: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-nav-scroll-content",`
|
|
|
border-bottom: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-bar",`
|
|
|
bottom: -1px;
|
|
|
`)]),P("left",[w("prefix, suffix",`
|
|
|
border-right: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-nav-scroll-content",`
|
|
|
border-right: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-bar",`
|
|
|
right: -1px;
|
|
|
`)]),P("right",[w("prefix, suffix",`
|
|
|
border-left: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-nav-scroll-content",`
|
|
|
border-left: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-bar",`
|
|
|
left: -1px;
|
|
|
`)]),P("bottom",[w("prefix, suffix",`
|
|
|
border-top: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-nav-scroll-content",`
|
|
|
border-top: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-bar",`
|
|
|
top: -1px;
|
|
|
`)]),w("prefix, suffix",`
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),g("tabs-nav-scroll-content",`
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),g("tabs-bar",`
|
|
|
border-radius: 0;
|
|
|
`)]),P("card-type",[w("prefix, suffix",`
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
border-bottom: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-pad",`
|
|
|
flex-grow: 1;
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),g("tabs-tab-pad",`
|
|
|
transition: border-color .3s var(--n-bezier);
|
|
|
`),g("tabs-tab",`
|
|
|
font-weight: var(--n-tab-font-weight);
|
|
|
border: 1px solid var(--n-tab-border-color);
|
|
|
background-color: var(--n-tab-color);
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
vertical-align: bottom;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
font-size: var(--n-tab-font-size);
|
|
|
color: var(--n-tab-text-color);
|
|
|
`,[P("addable",`
|
|
|
padding-left: 8px;
|
|
|
padding-right: 8px;
|
|
|
font-size: 16px;
|
|
|
`,[w("height-placeholder",`
|
|
|
width: 0;
|
|
|
font-size: var(--n-tab-font-size);
|
|
|
`),Ne("disabled",[y("&:hover",`
|
|
|
color: var(--n-tab-text-color-hover);
|
|
|
`)])]),P("closable","padding-right: 8px;"),P("active",`
|
|
|
background-color: #0000;
|
|
|
font-weight: var(--n-tab-font-weight-active);
|
|
|
color: var(--n-tab-text-color-active);
|
|
|
`),P("disabled","color: var(--n-tab-text-color-disabled);")]),g("tabs-scroll-padding","border-bottom: 1px solid var(--n-tab-border-color);")]),P("left, right",[g("tabs-wrapper",`
|
|
|
flex-direction: column;
|
|
|
`,[g("tabs-tab-wrapper",`
|
|
|
flex-direction: column;
|
|
|
`,[g("tabs-tab-pad",`
|
|
|
height: var(--n-tab-gap-vertical);
|
|
|
width: 100%;
|
|
|
`)])])]),P("top",[P("card-type",[g("tabs-tab",`
|
|
|
border-top-left-radius: var(--n-tab-border-radius);
|
|
|
border-top-right-radius: var(--n-tab-border-radius);
|
|
|
`,[P("active",`
|
|
|
border-bottom: 1px solid #0000;
|
|
|
`)]),g("tabs-tab-pad",`
|
|
|
border-bottom: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-pad",`
|
|
|
border-bottom: 1px solid var(--n-tab-border-color);
|
|
|
`)])]),P("left",[P("card-type",[g("tabs-tab",`
|
|
|
border-top-left-radius: var(--n-tab-border-radius);
|
|
|
border-bottom-left-radius: var(--n-tab-border-radius);
|
|
|
`,[P("active",`
|
|
|
border-right: 1px solid #0000;
|
|
|
`)]),g("tabs-tab-pad",`
|
|
|
border-right: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-pad",`
|
|
|
border-right: 1px solid var(--n-tab-border-color);
|
|
|
`)])]),P("right",[P("card-type",[g("tabs-tab",`
|
|
|
border-top-right-radius: var(--n-tab-border-radius);
|
|
|
border-bottom-right-radius: var(--n-tab-border-radius);
|
|
|
`,[P("active",`
|
|
|
border-left: 1px solid #0000;
|
|
|
`)]),g("tabs-tab-pad",`
|
|
|
border-left: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-pad",`
|
|
|
border-left: 1px solid var(--n-tab-border-color);
|
|
|
`)])]),P("bottom",[P("card-type",[g("tabs-tab",`
|
|
|
border-bottom-left-radius: var(--n-tab-border-radius);
|
|
|
border-bottom-right-radius: var(--n-tab-border-radius);
|
|
|
`,[P("active",`
|
|
|
border-top: 1px solid #0000;
|
|
|
`)]),g("tabs-tab-pad",`
|
|
|
border-top: 1px solid var(--n-tab-border-color);
|
|
|
`),g("tabs-pad",`
|
|
|
border-top: 1px solid var(--n-tab-border-color);
|
|
|
`)])])])]),L0=Object.assign(Object.assign({},se.props),{value:[String,Number],defaultValue:[String,Number],trigger:{type:String,default:"click"},type:{type:String,default:"bar"},closable:Boolean,justifyContent:String,size:{type:String,default:"medium"},placement:{type:String,default:"top"},tabStyle:[String,Object],tabClass:String,addTabStyle:[String,Object],addTabClass:String,barWidth:Number,paneClass:String,paneStyle:[String,Object],paneWrapperClass:String,paneWrapperStyle:[String,Object],addable:[Boolean,Object],tabsPadding:{type:Number,default:0},animated:Boolean,onBeforeLeave:Function,onAdd:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClose:[Function,Array],labelSize:String,activeName:[String,Number],onActiveNameChange:[Function,Array]}),ux=Z({name:"Tabs",props:L0,setup(e,{slots:o}){var t,r,n,l;const{mergedClsPrefixRef:a,inlineThemeDisabled:s}=Ie(e),d=se("Tabs","-tabs",D0,Wm,e,a),c=M(null),u=M(null),f=M(null),p=M(null),v=M(null),h=M(null),m=M(!0),x=M(!0),C=Ct(e,["labelSize","size"]),b=Ct(e,["activeName","value"]),_=M((r=(t=b.value)!==null&&t!==void 0?t:e.defaultValue)!==null&&r!==void 0?r:o.default?(l=(n=ot(o.default())[0])===null||n===void 0?void 0:n.props)===null||l===void 0?void 0:l.name:null),k=co(b,_),z={id:0},R=$(()=>{if(!(!e.justifyContent||e.type==="card"))return{display:"flex",justifyContent:e.justifyContent}});Xe(k,()=>{z.id=0,W(),H()});function S(){var G;const{value:U}=k;return U===null?null:(G=c.value)===null||G===void 0?void 0:G.querySelector(`[data-name="${U}"]`)}function L(G){if(e.type==="card")return;const{value:U}=u;if(!U)return;const le=U.style.opacity==="0";if(G){const ye=`${a.value}-tabs-bar--disabled`,{barWidth:_e,placement:oe}=e;if(G.dataset.disabled==="true"?U.classList.add(ye):U.classList.remove(ye),["top","bottom"].includes(oe)){if(D(["top","maxHeight","height"]),typeof _e=="number"&&G.offsetWidth>=_e){const pe=Math.floor((G.offsetWidth-_e)/2)+G.offsetLeft;U.style.left=`${pe}px`,U.style.maxWidth=`${_e}px`}else U.style.left=`${G.offsetLeft}px`,U.style.maxWidth=`${G.offsetWidth}px`;U.style.width="8192px",le&&(U.style.transition="none"),U.offsetWidth,le&&(U.style.transition="",U.style.opacity="1")}else{if(D(["left","maxWidth","width"]),typeof _e=="number"&&G.offsetHeight>=_e){const pe=Math.floor((G.offsetHeight-_e)/2)+G.offsetTop;U.style.top=`${pe}px`,U.style.maxHeight=`${_e}px`}else U.style.top=`${G.offsetTop}px`,U.style.maxHeight=`${G.offsetHeight}px`;U.style.height="8192px",le&&(U.style.transition="none"),U.offsetHeight,le&&(U.style.transition="",U.style.opacity="1")}}}function I(){if(e.type==="card")return;const{value:G}=u;G&&(G.style.opacity="0")}function D(G){const{value:U}=u;if(U)for(const le of G)U.style[le]=""}function W(){if(e.type==="card")return;const G=S();G?L(G):I()}function H(G){var U;const le=(U=v.value)===null||U===void 0?void 0:U.$el;if(!le)return;const ye=S();if(!ye)return;const{scrollLeft:_e,offsetWidth:oe}=le,{offsetLeft:pe,offsetWidth:Ue}=ye;_e>pe?le.scrollTo({top:0,left:pe,behavior:"smooth"}):pe+Ue>_e+oe&&le.scrollTo({top:0,left:pe+Ue-oe,behavior:"smooth"})}const j=M(null);let V=0,E=null;function Y(G){const U=j.value;if(U){V=G.getBoundingClientRect().height;const le=`${V}px`,ye=()=>{U.style.height=le,U.style.maxHeight=le};E?(ye(),E(),E=null):E=ye}}function K(G){const U=j.value;if(U){const le=G.getBoundingClientRect().height,ye=()=>{document.body.offsetHeight,U.style.maxHeight=`${le}px`,U.style.height=`${Math.max(V,le)}px`};E?(E(),E=null,ye()):E=ye}}function te(){const G=j.value;if(G){G.style.maxHeight="",G.style.height="";const{paneWrapperStyle:U}=e;if(typeof U=="string")G.style.cssText=U;else if(U){const{maxHeight:le,height:ye}=U;le!==void 0&&(G.style.maxHeight=le),ye!==void 0&&(G.style.height=ye)}}}const xe={value:[]},de=M("next");function ie(G){const U=k.value;let le="next";for(const ye of xe.value){if(ye===U)break;if(ye===G){le="prev";break}}de.value=le,F(G)}function F(G){const{onActiveNameChange:U,onUpdateValue:le,"onUpdate:value":ye}=e;U&&ce(U,G),le&&ce(le,G),ye&&ce(ye,G),_.value=G}function B(G){const{onClose:U}=e;U&&ce(U,G)}function q(){const{value:G}=u;if(!G)return;const U="transition-disabled";G.classList.add(U),W(),G.classList.remove(U)}const ee=M(null);function be({disabledTransition:G}){const U=c.value;if(!U)return;G&&U.classList.add("transition-disabled");const le=S();if(le&&ee.value){const ye=le.getBoundingClientRect();ee.value.style.width=`${ye.width}px`,ee.value.style.height=`${ye.height}px`,ee.value.style.transform=`translateX(${ye.left-U.getBoundingClientRect().left-ko(getComputedStyle(U).paddingLeft)}px)`}G&&U.classList.remove("transition-disabled")}Xe([k],()=>{e.type==="segment"&&lo(()=>{be({disabledTransition:!1})})}),po(()=>{e.type==="segment"&&be({disabledTransition:!0})});let me=0;function Be(G){var U;if(G.contentRect.width===0&&G.contentRect.height===0||me===G.contentRect.width)return;me=G.contentRect.width;const{type:le}=e;if((le==="line"||le==="bar")&&q(),le!=="segment"){const{placement:ye}=e;Ce((ye==="top"||ye==="bottom"?(U=v.value)===null||U===void 0?void 0:U.$el:h.value)||null)}}const T=Xr(Be,64);Xe([()=>e.justifyContent,()=>e.size],()=>{lo(()=>{const{type:G}=e;(G==="line"||G==="bar")&&q()})});const ve=M(!1);function Se(G){var U;const{target:le,contentRect:{width:ye}}=G,_e=le.parentElement.offsetWidth;if(!ve.value)_e<ye&&(ve.value=!0);else{const{value:oe}=p;if(!oe)return;_e-ye>oe.$el.offsetWidth&&(ve.value=!1)}Ce(((U=v.value)===null||U===void 0?void 0:U.$el)||null)}const Fe=Xr(Se,64);function ne(){const{onAdd:G}=e;G&&G(),lo(()=>{const U=S(),{value:le}=v;!U||!le||le.scrollTo({left:U.offsetLeft,top:0,behavior:"smooth"})})}function Ce(G){if(!G)return;const{placement:U}=e;if(U==="top"||U==="bottom"){const{scrollLeft:le,scrollWidth:ye,offsetWidth:_e}=G;m.value=le<=0,x.value=le+_e>=ye}else{const{scrollTop:le,scrollHeight:ye,offsetHeight:_e}=G;m.value=le<=0,x.value=le+_e>=ye}}const ge=Xr(G=>{Ce(G.target)},64);De(Qn,{triggerRef:ae(e,"trigger"),tabStyleRef:ae(e,"tabStyle"),tabClassRef:ae(e,"tabClass"),addTabStyleRef:ae(e,"addTabStyle"),addTabClassRef:ae(e,"addTabClass"),paneClassRef:ae(e,"paneClass"),paneStyleRef:ae(e,"paneStyle"),mergedClsPrefixRef:a,typeRef:ae(e,"type"),closableRef:ae(e,"closable"),valueRef:k,tabChangeIdRef:z,onBeforeLeaveRef:ae(e,"onBeforeLeave"),activateTab:ie,handleClose:B,handleAdd:ne}),md(()=>{W(),H()}),oo(()=>{const{value:G}=f;if(!G)return;const{value:U}=a,le=`${U}-tabs-nav-scroll-wrapper--shadow-start`,ye=`${U}-tabs-nav-scroll-wrapper--shadow-end`;m.value?G.classList.remove(le):G.classList.add(le),x.value?G.classList.remove(ye):G.classList.add(ye)});const Ee={syncBarPosition:()=>{W()}},Q=$(()=>{const{value:G}=C,{type:U}=e,le={card:"Card",bar:"Bar",line:"Line",segment:"Segment"}[U],ye=`${G}${le}`,{self:{barColor:_e,closeIconColor:oe,closeIconColorHover:pe,closeIconColorPressed:Ue,tabColor:fo,tabBorderColor:Po,paneTextColor:Fo,tabFontWeight:xo,tabBorderRadius:Co,tabFontWeightActive:Eo,colorSegment:_o,fontWeightStrong:uo,tabColorSegment:vo,closeSize:O,closeIconSize:X,closeColorHover:ue,closeColorPressed:$e,closeBorderRadius:Pe,[N("panePadding",G)]:ke,[N("tabPadding",ye)]:Me,[N("tabPaddingVertical",ye)]:Le,[N("tabGap",ye)]:qe,[N("tabGap",`${ye}Vertical`)]:go,[N("tabTextColor",U)]:nt,[N("tabTextColorActive",U)]:ut,[N("tabTextColorHover",U)]:Vo,[N("tabTextColorDisabled",U)]:Uo,[N("tabFontSize",G)]:ft},common:{cubicBezierEaseInOut:ht}}=d.value;return{"--n-bezier":ht,"--n-color-segment":_o,"--n-bar-color":_e,"--n-tab-font-size":ft,"--n-tab-text-color":nt,"--n-tab-text-color-active":ut,"--n-tab-text-color-disabled":Uo,"--n-tab-text-color-hover":Vo,"--n-pane-text-color":Fo,"--n-tab-border-color":Po,"--n-tab-border-radius":Co,"--n-close-size":O,"--n-close-icon-size":X,"--n-close-color-hover":ue,"--n-close-color-pressed":$e,"--n-close-border-radius":Pe,"--n-close-icon-color":oe,"--n-close-icon-color-hover":pe,"--n-close-icon-color-pressed":Ue,"--n-tab-color":fo,"--n-tab-font-weight":xo,"--n-tab-font-weight-active":Eo,"--n-tab-padding":Me,"--n-tab-padding-vertical":Le,"--n-tab-gap":qe,"--n-tab-gap-vertical":go,"--n-pane-padding-left":yo(ke,"left"),"--n-pane-padding-right":yo(ke,"right"),"--n-pane-padding-top":yo(ke,"top"),"--n-pane-padding-bottom":yo(ke,"bottom"),"--n-font-weight-strong":uo,"--n-tab-color-segment":vo}}),he=s?We("tabs",$(()=>`${C.value[0]}${e.type[0]}`),Q,e):void 0;return Object.assign({mergedClsPrefix:a,mergedValue:k,renderedNames:new Set,segmentCapsuleElRef:ee,tabsPaneWrapperRef:j,tabsElRef:c,barElRef:u,addTabInstRef:p,xScrollInstRef:v,scrollWrapperElRef:f,addTabFixed:ve,tabWrapperStyle:R,handleNavResize:T,mergedSize:C,handleScroll:ge,handleTabsResize:Fe,cssVars:s?void 0:Q,themeClass:he==null?void 0:he.themeClass,animationDirection:de,renderNameListRef:xe,yScrollElRef:h,onAnimationBeforeLeave:Y,onAnimationEnter:K,onAnimationAfterEnter:te,onRender:he==null?void 0:he.onRender},Ee)},render(){const{mergedClsPrefix:e,type:o,placement:t,addTabFixed:r,addable:n,mergedSize:l,renderNameListRef:a,onRender:s,paneWrapperClass:d,paneWrapperStyle:c,$slots:{default:u,prefix:f,suffix:p}}=this;s==null||s();const v=u?ot(u()).filter(z=>z.type.__TAB_PANE__===!0):[],h=u?ot(u()).filter(z=>z.type.__TAB__===!0):[],m=!h.length,x=o==="card",C=o==="segment",b=!x&&!C&&this.justifyContent;a.value=[];const _=()=>{const z=i("div",{style:this.tabWrapperStyle,class:[`${e}-tabs-wrapper`]},b?null:i("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}),m?v.map((R,S)=>(a.value.push(R.props.name),cn(i(Cn,Object.assign({},R.props,{internalCreatedByPane:!0,internalLeftPadded:S!==0&&(!b||b==="center"||b==="start"||b==="end")}),R.children?{default:R.children.tab}:void 0)))):h.map((R,S)=>(a.value.push(R.props.name),cn(S!==0&&!b?Ki(R):R))),!r&&n&&x?Ui(n,(m?v.length:h.length)!==0):null,b?null:i("div",{class:`${e}-tabs-scroll-padding`,style:{width:`${this.tabsPadding}px`}}));return i("div",{ref:"tabsElRef",class:`${e}-tabs-nav-scroll-content`},x&&n?i(st,{onResize:this.handleTabsResize},{default:()=>z}):z,x?i("div",{class:`${e}-tabs-pad`}):null,x?null:i("div",{ref:"barElRef",class:`${e}-tabs-bar`}))},k=C?"top":t;return i("div",{class:[`${e}-tabs`,this.themeClass,`${e}-tabs--${o}-type`,`${e}-tabs--${l}-size`,b&&`${e}-tabs--flex`,`${e}-tabs--${k}`],style:this.cssVars},i("div",{class:[`${e}-tabs-nav--${o}-type`,`${e}-tabs-nav--${k}`,`${e}-tabs-nav`]},je(f,z=>z&&i("div",{class:`${e}-tabs-nav__prefix`},z)),C?i("div",{class:`${e}-tabs-rail`,ref:"tabsElRef"},i("div",{class:`${e}-tabs-capsule`,ref:"segmentCapsuleElRef"},i("div",{class:`${e}-tabs-wrapper`},i("div",{class:`${e}-tabs-tab`}))),m?v.map((z,R)=>(a.value.push(z.props.name),i(Cn,Object.assign({},z.props,{internalCreatedByPane:!0,internalLeftPadded:R!==0}),z.children?{default:z.children.tab}:void 0))):h.map((z,R)=>(a.value.push(z.props.name),R===0?z:Ki(z)))):i(st,{onResize:this.handleNavResize},{default:()=>i("div",{class:`${e}-tabs-nav-scroll-wrapper`,ref:"scrollWrapperElRef"},["top","bottom"].includes(k)?i(hd,{ref:"xScrollInstRef",onScroll:this.handleScroll},{default:_}):i("div",{class:`${e}-tabs-nav-y-scroll`,onScroll:this.handleScroll,ref:"yScrollElRef"},_()))}),r&&n&&x?Ui(n,!0):null,je(p,z=>z&&i("div",{class:`${e}-tabs-nav__suffix`},z))),m&&(this.animated&&(k==="top"||k==="bottom")?i("div",{ref:"tabsPaneWrapperRef",style:c,class:[`${e}-tabs-pane-wrapper`,d]},Vi(v,this.mergedValue,this.renderedNames,this.onAnimationBeforeLeave,this.onAnimationEnter,this.onAnimationAfterEnter,this.animationDirection)):Vi(v,this.mergedValue,this.renderedNames)))}});function Vi(e,o,t,r,n,l,a){const s=[];return e.forEach(d=>{const{name:c,displayDirective:u,"display-directive":f}=d.props,p=h=>u===h||f===h,v=o===c;if(d.key!==void 0&&(d.key=c),v||p("show")||p("show:lazy")&&t.has(c)){t.has(c)||t.add(c);const h=!p("if");s.push(h?Ho(d,[[Go,v]]):d)}}),a?i(Sn,{name:`${a}-transition`,onBeforeLeave:r,onEnter:n,onAfterEnter:l},{default:()=>s}):s}function Ui(e,o){return i(Cn,{ref:"addTabInstRef",key:"__addable",name:"__addable",internalCreatedByPane:!0,internalAddable:!0,internalLeftPadded:o,disabled:typeof e=="object"&&e.disabled})}function Ki(e){const o=nr(e);return o.props?o.props.internalLeftPadded=!0:o.props={internalLeftPadded:!0},o}function cn(e){return Array.isArray(e.dynamicProps)?e.dynamicProps.includes("internalLeftPadded")||e.dynamicProps.push("internalLeftPadded"):e.dynamicProps=["internalLeftPadded"],e}const H0=g("thing",`
|
|
|
display: flex;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
font-size: var(--n-font-size);
|
|
|
color: var(--n-text-color);
|
|
|
`,[g("thing-avatar",`
|
|
|
margin-right: 12px;
|
|
|
margin-top: 2px;
|
|
|
`),g("thing-avatar-header-wrapper",`
|
|
|
display: flex;
|
|
|
flex-wrap: nowrap;
|
|
|
`,[g("thing-header-wrapper",`
|
|
|
flex: 1;
|
|
|
`)]),g("thing-main",`
|
|
|
flex-grow: 1;
|
|
|
`,[g("thing-header",`
|
|
|
display: flex;
|
|
|
margin-bottom: 4px;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
`,[w("title",`
|
|
|
font-size: 16px;
|
|
|
font-weight: var(--n-title-font-weight);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-title-text-color);
|
|
|
`)]),w("description",[y("&:not(:last-child)",`
|
|
|
margin-bottom: 4px;
|
|
|
`)]),w("content",[y("&:not(:first-child)",`
|
|
|
margin-top: 12px;
|
|
|
`)]),w("footer",[y("&:not(:first-child)",`
|
|
|
margin-top: 12px;
|
|
|
`)]),w("action",[y("&:not(:first-child)",`
|
|
|
margin-top: 12px;
|
|
|
`)])])]),A0=Object.assign(Object.assign({},se.props),{title:String,titleExtra:String,description:String,descriptionClass:String,descriptionStyle:[String,Object],content:String,contentClass:String,contentStyle:[String,Object],contentIndented:Boolean}),fx=Z({name:"Thing",props:A0,setup(e,{slots:o}){const{mergedClsPrefixRef:t,inlineThemeDisabled:r,mergedRtlRef:n}=Ie(e),l=se("Thing","-thing",H0,Km,e,t),a=eo("Thing",n,t),s=$(()=>{const{self:{titleTextColor:c,textColor:u,titleFontWeight:f,fontSize:p},common:{cubicBezierEaseInOut:v}}=l.value;return{"--n-bezier":v,"--n-font-size":p,"--n-text-color":u,"--n-title-font-weight":f,"--n-title-text-color":c}}),d=r?We("thing",void 0,s,e):void 0;return()=>{var c;const{value:u}=t,f=a?a.value:!1;return(c=d==null?void 0:d.onRender)===null||c===void 0||c.call(d),i("div",{class:[`${u}-thing`,d==null?void 0:d.themeClass,f&&`${u}-thing--rtl`],style:r?void 0:s.value},o.avatar&&e.contentIndented?i("div",{class:`${u}-thing-avatar`},o.avatar()):null,i("div",{class:`${u}-thing-main`},!e.contentIndented&&(o.header||e.title||o["header-extra"]||e.titleExtra||o.avatar)?i("div",{class:`${u}-thing-avatar-header-wrapper`},o.avatar?i("div",{class:`${u}-thing-avatar`},o.avatar()):null,o.header||e.title||o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header-wrapper`},i("div",{class:`${u}-thing-header`},o.header||e.title?i("div",{class:`${u}-thing-header__title`},o.header?o.header():e.title):null,o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header__extra`},o["header-extra"]?o["header-extra"]():e.titleExtra):null),o.description||e.description?i("div",{class:[`${u}-thing-main__description`,e.descriptionClass],style:e.descriptionStyle},o.description?o.description():e.description):null):null):i(so,null,o.header||e.title||o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header`},o.header||e.title?i("div",{class:`${u}-thing-header__title`},o.header?o.header():e.title):null,o["header-extra"]||e.titleExtra?i("div",{class:`${u}-thing-header__extra`},o["header-extra"]?o["header-extra"]():e.titleExtra):null):null,o.description||e.description?i("div",{class:[`${u}-thing-main__description`,e.descriptionClass],style:e.descriptionStyle},o.description?o.description():e.description):null),o.default||e.content?i("div",{class:[`${u}-thing-main__content`,e.contentClass],style:e.contentStyle},o.default?o.default():e.content):null,o.footer?i("div",{class:`${u}-thing-main__footer`},o.footer()):null,o.action?i("div",{class:`${u}-thing-main__action`},o.action()):null))}}}),E0=g("h",`
|
|
|
font-size: var(--n-font-size);
|
|
|
font-weight: var(--n-font-weight);
|
|
|
margin: var(--n-margin);
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-text-color);
|
|
|
`,[y("&:first-child",{marginTop:0}),P("prefix-bar",{position:"relative",paddingLeft:"var(--n-prefix-width)"},[P("align-text",{paddingLeft:0},[y("&::before",{left:"calc(-1 * var(--n-prefix-width))"})]),y("&::before",`
|
|
|
content: "";
|
|
|
width: var(--n-bar-width);
|
|
|
border-radius: calc(var(--n-bar-width) / 2);
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
left: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
position: absolute;
|
|
|
`),y("&::before",{backgroundColor:"var(--n-bar-color)"})])]),j0=Object.assign(Object.assign({},se.props),{type:{type:String,default:"default"},prefix:String,alignText:Boolean}),Zt=e=>Z({name:`H${e}`,props:j0,setup(o){const{mergedClsPrefixRef:t,inlineThemeDisabled:r}=Ie(o),n=se("Typography","-h",E0,ss,o,t),l=$(()=>{const{type:s}=o,{common:{cubicBezierEaseInOut:d},self:{headerFontWeight:c,headerTextColor:u,[N("headerPrefixWidth",e)]:f,[N("headerFontSize",e)]:p,[N("headerMargin",e)]:v,[N("headerBarWidth",e)]:h,[N("headerBarColor",s)]:m}}=n.value;return{"--n-bezier":d,"--n-font-size":p,"--n-margin":v,"--n-bar-color":m,"--n-bar-width":h,"--n-font-weight":c,"--n-text-color":u,"--n-prefix-width":f}}),a=r?We(`h${e}`,$(()=>o.type[0]),l,o):void 0;return{mergedClsPrefix:t,cssVars:r?void 0:l,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var o;const{prefix:t,alignText:r,mergedClsPrefix:n,cssVars:l,$slots:a}=this;return(o=this.onRender)===null||o===void 0||o.call(this),i(`h${e}`,{class:[`${n}-h`,`${n}-h${e}`,this.themeClass,{[`${n}-h--prefix-bar`]:t,[`${n}-h--align-text`]:r}],style:l},a)}});Zt("1");Zt("2");const hx=Zt("3");Zt("4");Zt("5");Zt("6");const W0=g("text",`
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
color: var(--n-text-color);
|
|
|
`,[P("strong",`
|
|
|
font-weight: var(--n-font-weight-strong);
|
|
|
`),P("italic",{fontStyle:"italic"}),P("underline",{textDecoration:"underline"}),P("code",`
|
|
|
line-height: 1.4;
|
|
|
display: inline-block;
|
|
|
font-family: var(--n-font-famliy-mono);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
box-sizing: border-box;
|
|
|
padding: .05em .35em 0 .35em;
|
|
|
border-radius: var(--n-code-border-radius);
|
|
|
font-size: .9em;
|
|
|
color: var(--n-code-text-color);
|
|
|
background-color: var(--n-code-color);
|
|
|
border: var(--n-code-border);
|
|
|
`)]),N0=Object.assign(Object.assign({},se.props),{code:Boolean,type:{type:String,default:"default"},delete:Boolean,strong:Boolean,italic:Boolean,underline:Boolean,depth:[String,Number],tag:String,as:{type:String,validator:()=>!0,default:void 0}}),px=Z({name:"Text",props:N0,setup(e){const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Typography","-text",W0,ss,e,o),n=$(()=>{const{depth:a,type:s}=e,d=s==="default"?a===void 0?"textColor":`textColor${a}Depth`:N("textColor",s),{common:{fontWeightStrong:c,fontFamilyMono:u,cubicBezierEaseInOut:f},self:{codeTextColor:p,codeBorderRadius:v,codeColor:h,codeBorder:m,[d]:x}}=r.value;return{"--n-bezier":f,"--n-text-color":x,"--n-font-weight-strong":c,"--n-font-famliy-mono":u,"--n-code-border-radius":v,"--n-code-text-color":p,"--n-code-color":h,"--n-code-border":m}}),l=t?We("text",$(()=>`${e.type[0]}${e.depth||""}`),n,e):void 0;return{mergedClsPrefix:o,compitableTag:Ct(e,["as","tag"]),cssVars:t?void 0:n,themeClass:l==null?void 0:l.themeClass,onRender:l==null?void 0:l.onRender}},render(){var e,o,t;const{mergedClsPrefix:r}=this;(e=this.onRender)===null||e===void 0||e.call(this);const n=[`${r}-text`,this.themeClass,{[`${r}-text--code`]:this.code,[`${r}-text--delete`]:this.delete,[`${r}-text--strong`]:this.strong,[`${r}-text--italic`]:this.italic,[`${r}-text--underline`]:this.underline}],l=(t=(o=this.$slots).default)===null||t===void 0?void 0:t.call(o);return this.code?i("code",{class:n,style:this.cssVars},this.delete?i("del",null,l):l):this.delete?i("del",{class:n,style:this.cssVars},l):i(this.compitableTag||"span",{class:n,style:this.cssVars},l)}}),Qt="n-upload",Ss="__UPLOAD_DRAGGER__",V0=Z({name:"UploadDragger",[Ss]:!0,setup(e,{slots:o}){const t=ze(Qt,null);return t||Wo("upload-dragger","`n-upload-dragger` must be placed inside `n-upload`."),()=>{const{mergedClsPrefixRef:{value:r},mergedDisabledRef:{value:n},maxReachedRef:{value:l}}=t;return i("div",{class:[`${r}-upload-dragger`,(n||l)&&`${r}-upload-dragger--disabled`]},o)}}});var yn=function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const zs=e=>e.includes("image/"),Gi=(e="")=>{const o=e.split("/"),r=o[o.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]},qi=/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i,$s=e=>{if(e.type)return zs(e.type);const o=Gi(e.name||"");if(qi.test(o))return!0;const t=e.thumbnailUrl||e.url||"",r=Gi(t);return!!(/^data:image\//.test(t)||qi.test(r))};function U0(e){return yn(this,void 0,void 0,function*(){return yield new Promise(o=>{if(!e.type||!zs(e.type)){o("");return}o(window.URL.createObjectURL(e))})})}const K0=No&&window.FileReader&&window.File;function G0(e){return e.isDirectory}function q0(e){return e.isFile}function Y0(e,o){return yn(this,void 0,void 0,function*(){const t=[];function r(n){return yn(this,void 0,void 0,function*(){for(const l of n)if(l){if(o&&G0(l)){const a=l.createReader();try{const s=yield new Promise((d,c)=>{a.readEntries(d,c)});yield r(s)}catch{}}else if(q0(l))try{const a=yield new Promise((s,d)=>{l.file(s,d)});t.push({file:a,entry:l,source:"dnd"})}catch{}}})}return yield r(e),t})}function cr(e){const{id:o,name:t,percentage:r,status:n,url:l,file:a,thumbnailUrl:s,type:d,fullPath:c,batchId:u}=e;return{id:o,name:t,percentage:r??null,status:n,url:l??null,file:a??null,thumbnailUrl:s??null,type:d??null,fullPath:c??null,batchId:u??null}}function X0(e,o,t){return e=e.toLowerCase(),o=o.toLocaleLowerCase(),t=t.toLocaleLowerCase(),t.split(",").map(n=>n.trim()).filter(Boolean).some(n=>{if(n.startsWith(".")){if(e.endsWith(n))return!0}else if(n.includes("/")){const[l,a]=o.split("/"),[s,d]=n.split("/");if((s==="*"||l&&s&&s===l)&&(d==="*"||a&&d&&d===a))return!0}else return!0;return!1})}const Rs=Z({name:"UploadTrigger",props:{abstract:Boolean},setup(e,{slots:o}){const t=ze(Qt,null);t||Wo("upload-trigger","`n-upload-trigger` must be placed inside `n-upload`.");const{mergedClsPrefixRef:r,mergedDisabledRef:n,maxReachedRef:l,listTypeRef:a,dragOverRef:s,openOpenFileDialog:d,draggerInsideRef:c,handleFileAddition:u,mergedDirectoryDndRef:f,triggerClassRef:p,triggerStyleRef:v}=t,h=$(()=>a.value==="image-card");function m(){n.value||l.value||d()}function x(k){k.preventDefault(),s.value=!0}function C(k){k.preventDefault(),s.value=!0}function b(k){k.preventDefault(),s.value=!1}function _(k){var z;if(k.preventDefault(),!c.value||n.value||l.value){s.value=!1;return}const R=(z=k.dataTransfer)===null||z===void 0?void 0:z.items;R!=null&&R.length?Y0(Array.from(R).map(S=>S.webkitGetAsEntry()),f.value).then(S=>{u(S)}).finally(()=>{s.value=!1}):s.value=!1}return()=>{var k;const{value:z}=r;return e.abstract?(k=o.default)===null||k===void 0?void 0:k.call(o,{handleClick:m,handleDrop:_,handleDragOver:x,handleDragEnter:C,handleDragLeave:b}):i("div",{class:[`${z}-upload-trigger`,(n.value||l.value)&&`${z}-upload-trigger--disabled`,h.value&&`${z}-upload-trigger--image-card`,p.value],style:v.value,onClick:m,onDrop:_,onDragover:x,onDragenter:C,onDragleave:b},h.value?i(V0,null,{default:()=>ao(o.default,()=>[i(He,{clsPrefix:z},{default:()=>i(sr,null)})])}):o)}}}),Z0=Z({name:"UploadProgress",props:{show:Boolean,percentage:{type:Number,required:!0},status:{type:String,required:!0}},setup(){return{mergedTheme:ze(Qt).mergedThemeRef}},render(){return i(Rt,null,{default:()=>this.show?i(u0,{type:"line",showIndicator:!1,percentage:this.percentage,status:this.status,height:2,theme:this.mergedTheme.peers.Progress,themeOverrides:this.mergedTheme.peerOverrides.Progress}):null})}}),Q0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},i("g",{fill:"none"},i("path",{d:"M21.75 3A3.25 3.25 0 0 1 25 6.25v15.5A3.25 3.25 0 0 1 21.75 25H6.25A3.25 3.25 0 0 1 3 21.75V6.25A3.25 3.25 0 0 1 6.25 3h15.5zm.583 20.4l-7.807-7.68a.75.75 0 0 0-.968-.07l-.084.07l-7.808 7.68c.183.065.38.1.584.1h15.5c.204 0 .4-.035.583-.1l-7.807-7.68l7.807 7.68zM21.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v15.5c0 .208.036.408.103.593l7.82-7.692a2.25 2.25 0 0 1 3.026-.117l.129.117l7.82 7.692c.066-.185.102-.385.102-.593V6.25a1.75 1.75 0 0 0-1.75-1.75zm-3.25 3a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm0 1.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2z",fill:"currentColor"}))),J0=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 28 28"},i("g",{fill:"none"},i("path",{d:"M6.4 2A2.4 2.4 0 0 0 4 4.4v19.2A2.4 2.4 0 0 0 6.4 26h15.2a2.4 2.4 0 0 0 2.4-2.4V11.578c0-.729-.29-1.428-.805-1.944l-6.931-6.931A2.4 2.4 0 0 0 14.567 2H6.4zm-.9 2.4a.9.9 0 0 1 .9-.9H14V10a2 2 0 0 0 2 2h6.5v11.6a.9.9 0 0 1-.9.9H6.4a.9.9 0 0 1-.9-.9V4.4zm16.44 6.1H16a.5.5 0 0 1-.5-.5V4.06l6.44 6.44z",fill:"currentColor"})));var e1=function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};const Pr={paddingMedium:"0 3px",heightMedium:"24px",iconSizeMedium:"18px"},o1=Z({name:"UploadFile",props:{clsPrefix:{type:String,required:!0},file:{type:Object,required:!0},listType:{type:String,required:!0}},setup(e){const o=ze(Qt),t=M(null),r=M(""),n=$(()=>{const{file:z}=e;return z.status==="finished"?"success":z.status==="error"?"error":"info"}),l=$(()=>{const{file:z}=e;if(z.status==="error")return"error"}),a=$(()=>{const{file:z}=e;return z.status==="uploading"}),s=$(()=>{if(!o.showCancelButtonRef.value)return!1;const{file:z}=e;return["uploading","pending","error"].includes(z.status)}),d=$(()=>{if(!o.showRemoveButtonRef.value)return!1;const{file:z}=e;return["finished"].includes(z.status)}),c=$(()=>{if(!o.showDownloadButtonRef.value)return!1;const{file:z}=e;return["finished"].includes(z.status)}),u=$(()=>{if(!o.showRetryButtonRef.value)return!1;const{file:z}=e;return["error"].includes(z.status)}),f=Ve(()=>r.value||e.file.thumbnailUrl||e.file.url),p=$(()=>{if(!o.showPreviewButtonRef.value)return!1;const{file:{status:z},listType:R}=e;return["finished"].includes(z)&&f.value&&R==="image-card"});function v(){o.submit(e.file.id)}function h(z){z.preventDefault();const{file:R}=e;["finished","pending","error"].includes(R.status)?x(R):["uploading"].includes(R.status)?b(R):qo("upload","The button clicked type is unknown.")}function m(z){z.preventDefault(),C(e.file)}function x(z){const{xhrMap:R,doChange:S,onRemoveRef:{value:L},mergedFileListRef:{value:I}}=o;Promise.resolve(L?L({file:Object.assign({},z),fileList:I}):!0).then(D=>{if(D===!1)return;const W=Object.assign({},z,{status:"removed"});R.delete(z.id),S(W,void 0,{remove:!0})})}function C(z){const{onDownloadRef:{value:R}}=o;Promise.resolve(R?R(Object.assign({},z)):!0).then(S=>{S!==!1&&xl(z.url,z.name)})}function b(z){const{xhrMap:R}=o,S=R.get(z.id);S==null||S.abort(),x(Object.assign({},z))}function _(){const{onPreviewRef:{value:z}}=o;if(z)z(e.file);else if(e.listType==="image-card"){const{value:R}=t;if(!R)return;R.click()}}const k=()=>e1(this,void 0,void 0,function*(){const{listType:z}=e;z!=="image"&&z!=="image-card"||o.shouldUseThumbnailUrlRef.value(e.file)&&(r.value=yield o.getFileThumbnailUrlResolver(e.file))});return oo(()=>{k()}),{mergedTheme:o.mergedThemeRef,progressStatus:n,buttonType:l,showProgress:a,disabled:o.mergedDisabledRef,showCancelButton:s,showRemoveButton:d,showDownloadButton:c,showRetryButton:u,showPreviewButton:p,mergedThumbnailUrl:f,shouldUseThumbnailUrl:o.shouldUseThumbnailUrlRef,renderIcon:o.renderIconRef,imageRef:t,handleRemoveOrCancelClick:h,handleDownloadClick:m,handleRetryClick:v,handlePreviewClick:_}},render(){const{clsPrefix:e,mergedTheme:o,listType:t,file:r,renderIcon:n}=this;let l;const a=t==="image";a||t==="image-card"?l=!this.shouldUseThumbnailUrl(r)||!this.mergedThumbnailUrl?i("span",{class:`${e}-upload-file-info__thumbnail`},n?n(r):$s(r)?i(He,{clsPrefix:e},{default:()=>Q0}):i(He,{clsPrefix:e},{default:()=>J0})):i("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,class:`${e}-upload-file-info__thumbnail`,onClick:this.handlePreviewClick},t==="image-card"?i(Rb,{src:this.mergedThumbnailUrl||void 0,previewSrc:r.url||void 0,alt:r.name,ref:"imageRef"}):i("img",{src:this.mergedThumbnailUrl||void 0,alt:r.name})):l=i("span",{class:`${e}-upload-file-info__thumbnail`},n?n(r):i(He,{clsPrefix:e},{default:()=>i(Yd,null)}));const d=i(Z0,{show:this.showProgress,percentage:r.percentage||0,status:this.progressStatus}),c=t==="text"||t==="image";return i("div",{class:[`${e}-upload-file`,`${e}-upload-file--${this.progressStatus}-status`,r.url&&r.status!=="error"&&t!=="image-card"&&`${e}-upload-file--with-url`,`${e}-upload-file--${t}-type`]},i("div",{class:`${e}-upload-file-info`},l,i("div",{class:`${e}-upload-file-info__name`},c&&(r.url&&r.status!=="error"?i("a",{rel:"noopener noreferer",target:"_blank",href:r.url||void 0,onClick:this.handlePreviewClick},r.name):i("span",{onClick:this.handlePreviewClick},r.name)),a&&d),i("div",{class:[`${e}-upload-file-info__action`,`${e}-upload-file-info__action--${t}-type`]},this.showPreviewButton?i(Bo,{key:"preview",quaternary:!0,type:this.buttonType,onClick:this.handlePreviewClick,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,builtinThemeOverrides:Pr},{icon:()=>i(He,{clsPrefix:e},{default:()=>i(yl,null)})}):null,(this.showRemoveButton||this.showCancelButton)&&!this.disabled&&i(Bo,{key:"cancelOrTrash",theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,quaternary:!0,builtinThemeOverrides:Pr,type:this.buttonType,onClick:this.handleRemoveOrCancelClick},{icon:()=>i(Kt,null,{default:()=>this.showRemoveButton?i(He,{clsPrefix:e,key:"trash"},{default:()=>i(ec,null)}):i(He,{clsPrefix:e,key:"cancel"},{default:()=>i(rc,null)})})}),this.showRetryButton&&!this.disabled&&i(Bo,{key:"retry",quaternary:!0,type:this.buttonType,onClick:this.handleRetryClick,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,builtinThemeOverrides:Pr},{icon:()=>i(He,{clsPrefix:e},{default:()=>i(ac,null)})}),this.showDownloadButton?i(Bo,{key:"download",quaternary:!0,type:this.buttonType,onClick:this.handleDownloadClick,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,builtinThemeOverrides:Pr},{icon:()=>i(He,{clsPrefix:e},{default:()=>i(oc,null)})}):null)),!a&&d)}}),t1=Z({name:"UploadFileList",setup(e,{slots:o}){const t=ze(Qt,null);t||Wo("upload-file-list","`n-upload-file-list` must be placed inside `n-upload`.");const{abstractRef:r,mergedClsPrefixRef:n,listTypeRef:l,mergedFileListRef:a,fileListClassRef:s,fileListStyleRef:d,cssVarsRef:c,themeClassRef:u,maxReachedRef:f,showTriggerRef:p,imageGroupPropsRef:v}=t,h=$(()=>l.value==="image-card"),m=()=>a.value.map(C=>i(o1,{clsPrefix:n.value,key:C.id,file:C,listType:l.value})),x=()=>h.value?i(zb,Object.assign({},v.value),{default:m}):i(Rt,{group:!0},{default:m});return()=>{const{value:C}=n,{value:b}=r;return i("div",{class:[`${C}-upload-file-list`,h.value&&`${C}-upload-file-list--grid`,b?u==null?void 0:u.value:void 0,s.value],style:[b&&c?c.value:"",d.value]},x(),p.value&&!f.value&&h.value&&i(Rs,null,o))}}}),r1=y([g("upload","width: 100%;",[P("dragger-inside",[g("upload-trigger",`
|
|
|
display: block;
|
|
|
`)]),P("drag-over",[g("upload-dragger",`
|
|
|
border: var(--n-dragger-border-hover);
|
|
|
`)])]),g("upload-dragger",`
|
|
|
cursor: pointer;
|
|
|
box-sizing: border-box;
|
|
|
width: 100%;
|
|
|
text-align: center;
|
|
|
border-radius: var(--n-border-radius);
|
|
|
padding: 24px;
|
|
|
opacity: 1;
|
|
|
transition:
|
|
|
opacity .3s var(--n-bezier),
|
|
|
border-color .3s var(--n-bezier),
|
|
|
background-color .3s var(--n-bezier);
|
|
|
background-color: var(--n-dragger-color);
|
|
|
border: var(--n-dragger-border);
|
|
|
`,[y("&:hover",`
|
|
|
border: var(--n-dragger-border-hover);
|
|
|
`),P("disabled",`
|
|
|
cursor: not-allowed;
|
|
|
`)]),g("upload-trigger",`
|
|
|
display: inline-block;
|
|
|
box-sizing: border-box;
|
|
|
opacity: 1;
|
|
|
transition: opacity .3s var(--n-bezier);
|
|
|
`,[y("+",[g("upload-file-list","margin-top: 8px;")]),P("disabled",`
|
|
|
opacity: var(--n-item-disabled-opacity);
|
|
|
cursor: not-allowed;
|
|
|
`),P("image-card",`
|
|
|
width: 96px;
|
|
|
height: 96px;
|
|
|
`,[g("base-icon",`
|
|
|
font-size: 24px;
|
|
|
`),g("upload-dragger",`
|
|
|
padding: 0;
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
`)])]),g("upload-file-list",`
|
|
|
line-height: var(--n-line-height);
|
|
|
opacity: 1;
|
|
|
transition: opacity .3s var(--n-bezier);
|
|
|
`,[y("a, img","outline: none;"),P("disabled",`
|
|
|
opacity: var(--n-item-disabled-opacity);
|
|
|
cursor: not-allowed;
|
|
|
`,[g("upload-file","cursor: not-allowed;")]),P("grid",`
|
|
|
display: grid;
|
|
|
grid-template-columns: repeat(auto-fill, 96px);
|
|
|
grid-gap: 8px;
|
|
|
margin-top: 0;
|
|
|
`),g("upload-file",`
|
|
|
display: block;
|
|
|
box-sizing: border-box;
|
|
|
cursor: default;
|
|
|
padding: 0px 12px 0 6px;
|
|
|
transition: background-color .3s var(--n-bezier);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
`,[dr(),g("progress",[dr({foldPadding:!0})]),y("&:hover",`
|
|
|
background-color: var(--n-item-color-hover);
|
|
|
`,[g("upload-file-info",[w("action",`
|
|
|
opacity: 1;
|
|
|
`)])]),P("image-type",`
|
|
|
border-radius: var(--n-border-radius);
|
|
|
text-decoration: underline;
|
|
|
text-decoration-color: #0000;
|
|
|
`,[g("upload-file-info",`
|
|
|
padding-top: 0px;
|
|
|
padding-bottom: 0px;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
padding: 6px 0;
|
|
|
`,[g("progress",`
|
|
|
padding: 2px 0;
|
|
|
margin-bottom: 0;
|
|
|
`),w("name",`
|
|
|
padding: 0 8px;
|
|
|
`),w("thumbnail",`
|
|
|
width: 32px;
|
|
|
height: 32px;
|
|
|
font-size: 28px;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
`,[y("img",`
|
|
|
width: 100%;
|
|
|
`)])])]),P("text-type",[g("progress",`
|
|
|
box-sizing: border-box;
|
|
|
padding-bottom: 6px;
|
|
|
margin-bottom: 6px;
|
|
|
`)]),P("image-card-type",`
|
|
|
position: relative;
|
|
|
width: 96px;
|
|
|
height: 96px;
|
|
|
border: var(--n-item-border-image-card);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
padding: 0;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier);
|
|
|
border-radius: var(--n-border-radius);
|
|
|
overflow: hidden;
|
|
|
`,[g("progress",`
|
|
|
position: absolute;
|
|
|
left: 8px;
|
|
|
bottom: 8px;
|
|
|
right: 8px;
|
|
|
width: unset;
|
|
|
`),g("upload-file-info",`
|
|
|
padding: 0;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
`,[w("thumbnail",`
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
font-size: 36px;
|
|
|
`,[y("img",`
|
|
|
width: 100%;
|
|
|
`)])]),y("&::before",`
|
|
|
position: absolute;
|
|
|
z-index: 1;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
border-radius: inherit;
|
|
|
opacity: 0;
|
|
|
transition: opacity .2s var(--n-bezier);
|
|
|
content: "";
|
|
|
`),y("&:hover",[y("&::before","opacity: 1;"),g("upload-file-info",[w("thumbnail","opacity: .12;")])])]),P("error-status",[y("&:hover",`
|
|
|
background-color: var(--n-item-color-hover-error);
|
|
|
`),g("upload-file-info",[w("name","color: var(--n-item-text-color-error);"),w("thumbnail","color: var(--n-item-text-color-error);")]),P("image-card-type",`
|
|
|
border: var(--n-item-border-image-card-error);
|
|
|
`)]),P("with-url",`
|
|
|
cursor: pointer;
|
|
|
`,[g("upload-file-info",[w("name",`
|
|
|
color: var(--n-item-text-color-success);
|
|
|
text-decoration-color: var(--n-item-text-color-success);
|
|
|
`,[y("a",`
|
|
|
text-decoration: underline;
|
|
|
`)])])]),g("upload-file-info",`
|
|
|
position: relative;
|
|
|
padding-top: 6px;
|
|
|
padding-bottom: 6px;
|
|
|
display: flex;
|
|
|
flex-wrap: nowrap;
|
|
|
`,[w("thumbnail",`
|
|
|
font-size: 18px;
|
|
|
opacity: 1;
|
|
|
transition: opacity .2s var(--n-bezier);
|
|
|
color: var(--n-item-icon-color);
|
|
|
`,[g("base-icon",`
|
|
|
margin-right: 2px;
|
|
|
vertical-align: middle;
|
|
|
transition: color .3s var(--n-bezier);
|
|
|
`)]),w("action",`
|
|
|
padding-top: inherit;
|
|
|
padding-bottom: inherit;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
top: 0;
|
|
|
bottom: 0;
|
|
|
width: 80px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
transition: opacity .2s var(--n-bezier);
|
|
|
justify-content: flex-end;
|
|
|
opacity: 0;
|
|
|
`,[g("button",[y("&:not(:last-child)",{marginRight:"4px"}),g("base-icon",[y("svg",[dt()])])]),P("image-type",`
|
|
|
position: relative;
|
|
|
max-width: 80px;
|
|
|
width: auto;
|
|
|
`),P("image-card-type",`
|
|
|
z-index: 2;
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
top: 0;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
`)]),w("name",`
|
|
|
color: var(--n-item-text-color);
|
|
|
flex: 1;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
text-overflow: ellipsis;
|
|
|
overflow: hidden;
|
|
|
flex-direction: column;
|
|
|
text-decoration-color: #0000;
|
|
|
font-size: var(--n-font-size);
|
|
|
transition:
|
|
|
color .3s var(--n-bezier),
|
|
|
text-decoration-color .3s var(--n-bezier);
|
|
|
`,[y("a",`
|
|
|
color: inherit;
|
|
|
text-decoration: underline;
|
|
|
`)])])])]),g("upload-file-input",`
|
|
|
display: none;
|
|
|
width: 0;
|
|
|
height: 0;
|
|
|
opacity: 0;
|
|
|
`)]);var Yi=function(e,o,t,r){function n(l){return l instanceof t?l:new t(function(a){a(l)})}return new(t||(t=Promise))(function(l,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function d(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?l(u.value):n(u.value).then(s,d)}c((r=r.apply(e,o||[])).next())})};function n1(e,o,t){const{doChange:r,xhrMap:n}=e;let l=0;function a(d){var c;let u=Object.assign({},o,{status:"error",percentage:l});n.delete(o.id),u=cr(((c=e.onError)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}function s(d){var c;if(e.isErrorState){if(e.isErrorState(t)){a(d);return}}else if(t.status<200||t.status>=300){a(d);return}let u=Object.assign({},o,{status:"finished",percentage:l});n.delete(o.id),u=cr(((c=e.onFinish)===null||c===void 0?void 0:c.call(e,{file:u,event:d}))||u),r(u,d)}return{handleXHRLoad:s,handleXHRError:a,handleXHRAbort(d){const c=Object.assign({},o,{status:"removed",file:null,percentage:l});n.delete(o.id),r(c,d)},handleXHRProgress(d){const c=Object.assign({},o,{status:"uploading"});if(d.lengthComputable){const u=Math.ceil(d.loaded/d.total*100);c.percentage=u,l=u}r(c,d)}}}function i1(e){const{inst:o,file:t,data:r,headers:n,withCredentials:l,action:a,customRequest:s}=e,{doChange:d}=e.inst;let c=0;s({file:t,data:r,headers:n,withCredentials:l,action:a,onProgress(u){const f=Object.assign({},t,{status:"uploading"}),p=u.percent;f.percentage=p,c=p,d(f)},onFinish(){var u;let f=Object.assign({},t,{status:"finished",percentage:c});f=cr(((u=o.onFinish)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)},onError(){var u;let f=Object.assign({},t,{status:"error",percentage:c});f=cr(((u=o.onError)===null||u===void 0?void 0:u.call(o,{file:f}))||f),d(f)}})}function l1(e,o,t){const r=n1(e,o,t);t.onabort=r.handleXHRAbort,t.onerror=r.handleXHRError,t.onload=r.handleXHRLoad,t.upload&&(t.upload.onprogress=r.handleXHRProgress)}function Ps(e,o){return typeof e=="function"?e({file:o}):e||{}}function a1(e,o,t){const r=Ps(o,t);r&&Object.keys(r).forEach(n=>{e.setRequestHeader(n,r[n])})}function s1(e,o,t){const r=Ps(o,t);r&&Object.keys(r).forEach(n=>{e.append(n,r[n])})}function d1(e,o,t,{method:r,action:n,withCredentials:l,responseType:a,headers:s,data:d}){const c=new XMLHttpRequest;c.responseType=a,e.xhrMap.set(t.id,c),c.withCredentials=l;const u=new FormData;if(s1(u,d,t),t.file!==null&&u.append(o,t.file),l1(e,t,c),n!==void 0){c.open(r.toUpperCase(),n),a1(c,s,t),c.send(u);const f=Object.assign({},t,{status:"uploading"});e.doChange(f)}}const c1=Object.assign(Object.assign({},se.props),{name:{type:String,default:"file"},accept:String,action:String,customRequest:Function,directory:Boolean,directoryDnd:{type:Boolean,default:void 0},method:{type:String,default:"POST"},multiple:Boolean,showFileList:{type:Boolean,default:!0},data:[Object,Function],headers:[Object,Function],withCredentials:Boolean,responseType:{type:String,default:""},disabled:{type:Boolean,default:void 0},onChange:Function,onRemove:Function,onFinish:Function,onError:Function,onBeforeUpload:Function,isErrorState:Function,onDownload:Function,defaultUpload:{type:Boolean,default:!0},fileList:Array,"onUpdate:fileList":[Function,Array],onUpdateFileList:[Function,Array],fileListClass:String,fileListStyle:[String,Object],defaultFileList:{type:Array,default:()=>[]},showCancelButton:{type:Boolean,default:!0},showRemoveButton:{type:Boolean,default:!0},showDownloadButton:Boolean,showRetryButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},listType:{type:String,default:"text"},onPreview:Function,shouldUseThumbnailUrl:{type:Function,default:e=>K0?$s(e):!1},createThumbnailUrl:Function,abstract:Boolean,max:Number,showTrigger:{type:Boolean,default:!0},imageGroupProps:Object,inputProps:Object,triggerClass:String,triggerStyle:[String,Object],renderIcon:Function}),vx=Z({name:"Upload",props:c1,setup(e){e.abstract&&e.listType==="image-card"&&Wo("upload","when the list-type is image-card, abstract is not supported.");const{mergedClsPrefixRef:o,inlineThemeDisabled:t}=Ie(e),r=se("Upload","-upload",r1,cb,e,o),n=rt(e),l=$(()=>{const{max:I}=e;return I!==void 0?v.value.length>=I:!1}),a=M(e.defaultFileList),s=ae(e,"fileList"),d=M(null),c={value:!1},u=M(!1),f=new Map,p=co(s,a),v=$(()=>p.value.map(cr));function h(){var I;(I=d.value)===null||I===void 0||I.click()}function m(I){const D=I.target;b(D.files?Array.from(D.files).map(W=>({file:W,entry:null,source:"input"})):null,I),D.value=""}function x(I){const{"onUpdate:fileList":D,onUpdateFileList:W}=e;D&&ce(D,I),W&&ce(W,I),a.value=I}const C=$(()=>e.multiple||e.directory);function b(I,D){if(!I||I.length===0)return;const{onBeforeUpload:W}=e;I=C.value?I:[I[0]];const{max:H,accept:j}=e;I=I.filter(({file:E,source:Y})=>Y==="dnd"&&(j!=null&&j.trim())?X0(E.name,E.type,j):!0),H&&(I=I.slice(0,H-v.value.length));const V=tt();Promise.all(I.map(({file:E,entry:Y})=>Yi(this,void 0,void 0,function*(){var K;const te={id:tt(),batchId:V,name:E.name,status:"pending",percentage:0,file:E,url:null,type:E.type,thumbnailUrl:null,fullPath:(K=Y==null?void 0:Y.fullPath)!==null&&K!==void 0?K:`/${E.webkitRelativePath||E.name}`};return!W||(yield W({file:te,fileList:v.value}))!==!1?te:null}))).then(E=>Yi(this,void 0,void 0,function*(){let Y=Promise.resolve();E.forEach(K=>{Y=Y.then(lo).then(()=>{K&&k(K,D,{append:!0})})}),yield Y})).then(()=>{e.defaultUpload&&_()})}function _(I){const{method:D,action:W,withCredentials:H,headers:j,data:V,name:E}=e,Y=I!==void 0?v.value.filter(te=>te.id===I):v.value,K=I!==void 0;Y.forEach(te=>{const{status:xe}=te;(xe==="pending"||xe==="error"&&K)&&(e.customRequest?i1({inst:{doChange:k,xhrMap:f,onFinish:e.onFinish,onError:e.onError},file:te,action:W,withCredentials:H,headers:j,data:V,customRequest:e.customRequest}):d1({doChange:k,xhrMap:f,onFinish:e.onFinish,onError:e.onError,isErrorState:e.isErrorState},E,te,{method:D,action:W,withCredentials:H,responseType:e.responseType,headers:j,data:V}))})}const k=(I,D,W={append:!1,remove:!1})=>{const{append:H,remove:j}=W,V=Array.from(v.value),E=V.findIndex(Y=>Y.id===I.id);if(H||j||~E){H?V.push(I):j?V.splice(E,1):V.splice(E,1,I);const{onChange:Y}=e;Y&&Y({file:I,fileList:V,event:D}),x(V)}};function z(I){var D;if(I.thumbnailUrl)return I.thumbnailUrl;const{createThumbnailUrl:W}=e;return W?(D=W(I.file,I))!==null&&D!==void 0?D:I.url||"":I.url?I.url:I.file?U0(I.file):""}const R=$(()=>{const{common:{cubicBezierEaseInOut:I},self:{draggerColor:D,draggerBorder:W,draggerBorderHover:H,itemColorHover:j,itemColorHoverError:V,itemTextColorError:E,itemTextColorSuccess:Y,itemTextColor:K,itemIconColor:te,itemDisabledOpacity:xe,lineHeight:de,borderRadius:ie,fontSize:F,itemBorderImageCardError:B,itemBorderImageCard:q}}=r.value;return{"--n-bezier":I,"--n-border-radius":ie,"--n-dragger-border":W,"--n-dragger-border-hover":H,"--n-dragger-color":D,"--n-font-size":F,"--n-item-color-hover":j,"--n-item-color-hover-error":V,"--n-item-disabled-opacity":xe,"--n-item-icon-color":te,"--n-item-text-color":K,"--n-item-text-color-error":E,"--n-item-text-color-success":Y,"--n-line-height":de,"--n-item-border-image-card-error":B,"--n-item-border-image-card":q}}),S=t?We("upload",void 0,R,e):void 0;De(Qt,{mergedClsPrefixRef:o,mergedThemeRef:r,showCancelButtonRef:ae(e,"showCancelButton"),showDownloadButtonRef:ae(e,"showDownloadButton"),showRemoveButtonRef:ae(e,"showRemoveButton"),showRetryButtonRef:ae(e,"showRetryButton"),onRemoveRef:ae(e,"onRemove"),onDownloadRef:ae(e,"onDownload"),mergedFileListRef:v,triggerClassRef:ae(e,"triggerClass"),triggerStyleRef:ae(e,"triggerStyle"),shouldUseThumbnailUrlRef:ae(e,"shouldUseThumbnailUrl"),renderIconRef:ae(e,"renderIcon"),xhrMap:f,submit:_,doChange:k,showPreviewButtonRef:ae(e,"showPreviewButton"),onPreviewRef:ae(e,"onPreview"),getFileThumbnailUrlResolver:z,listTypeRef:ae(e,"listType"),dragOverRef:u,openOpenFileDialog:h,draggerInsideRef:c,handleFileAddition:b,mergedDisabledRef:n.mergedDisabledRef,maxReachedRef:l,fileListClassRef:ae(e,"fileListClass"),fileListStyleRef:ae(e,"fileListStyle"),abstractRef:ae(e,"abstract"),acceptRef:ae(e,"accept"),cssVarsRef:t?void 0:R,themeClassRef:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender,showTriggerRef:ae(e,"showTrigger"),imageGroupPropsRef:ae(e,"imageGroupProps"),mergedDirectoryDndRef:$(()=>{var I;return(I=e.directoryDnd)!==null&&I!==void 0?I:e.directory})});const L={clear:()=>{a.value=[]},submit:_,openOpenFileDialog:h};return Object.assign({mergedClsPrefix:o,draggerInsideRef:c,inputElRef:d,mergedTheme:r,dragOver:u,mergedMultiple:C,cssVars:t?void 0:R,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender,handleFileInputChange:m},L)},render(){var e,o;const{draggerInsideRef:t,mergedClsPrefix:r,$slots:n,directory:l,onRender:a}=this;if(n.default&&!this.abstract){const d=n.default()[0];!((e=d==null?void 0:d.type)===null||e===void 0)&&e[Ss]&&(t.value=!0)}const s=i("input",Object.assign({},this.inputProps,{ref:"inputElRef",type:"file",class:`${r}-upload-file-input`,accept:this.accept,multiple:this.mergedMultiple,onChange:this.handleFileInputChange,webkitdirectory:l||void 0,directory:l||void 0}));return this.abstract?i(so,null,(o=n.default)===null||o===void 0?void 0:o.call(n),i(ol,{to:"body"},s)):(a==null||a(),i("div",{class:[`${r}-upload`,t.value&&`${r}-upload--dragger-inside`,this.dragOver&&`${r}-upload--drag-over`,this.themeClass],style:this.cssVars},s,this.showTrigger&&this.listType!=="image-card"&&i(Rs,null,n),this.showFileList&&i(t1,null,n)))}}),u1=()=>({}),f1={name:"Equation",common:fe,self:u1},h1=f1,gx={name:"dark",common:fe,Alert:pu,Anchor:$u,AutoComplete:ju,Avatar:Xl,AvatarGroup:Zu,BackTop:ef,Badge:tf,Breadcrumb:ff,Button:Ro,ButtonGroup:Pg,Calendar:zf,Card:ra,Carousel:Lf,Cascader:Nf,Checkbox:Xt,Code:na,Collapse:Gf,CollapseTransition:Xf,ColorPicker:Pf,DataTable:Dh,DatePicker:gp,Descriptions:Cp,Dialog:ka,Divider:Wp,Drawer:qp,Dropdown:Ln,DynamicInput:fv,DynamicTags:Pv,Element:Iv,Empty:kt,Ellipsis:ha,Equation:h1,Flex:Ov,Form:Dv,GradientText:ng,Icon:Xh,IconWrapper:pg,Image:mb,Input:Ao,InputNumber:Ig,LegacyTransfer:_b,Layout:_g,List:Hg,LoadingBar:Eg,Log:Wg,Menu:Qg,Mention:Vg,Message:$g,Modal:Bp,Notification:Cg,PageHeader:om,Pagination:ua,Popconfirm:lm,Popover:It,Popselect:ia,Progress:Ja,QrCode:h0,Radio:va,Rate:cm,Result:vm,Row:gb,Scrollbar:$o,Select:da,Skeleton:y0,Slider:bm,Space:Ha,Spin:wm,Statistic:Rm,Steps:Bm,Switch:Om,Table:Am,Tabs:Vm,Tag:Ml,Thing:qm,TimePicker:$a,Timeline:Zm,Tooltip:Er,Transfer:eb,Tree:ls,TreeSelect:nb,Typography:sb,Upload:fb,Watermark:pb,Split:B0};export{Kv as $,Z1 as A,vx as B,D1 as C,L1 as D,N1 as E,A1 as F,Q1 as G,J1 as H,M1 as I,Tc as J,nx as K,I1 as L,en as M,hx as N,fx as O,dp as P,E1 as Q,_1 as R,Y1 as S,k1 as T,lx as U,K1 as V,X1 as W,zb as X,F1 as Y,sx as Z,px as _,V1 as a,Jv as a0,Zv as a1,ix as a2,W1 as a3,j1 as a4,dx as a5,St as b,G1 as c,U1 as d,Bo as e,cx as f,ux as g,_f as h,Mp as i,Jh as j,ax as k,T1 as l,Rb as m,ex as n,B1 as o,O1 as p,gx as q,H1 as r,tx as s,q1 as t,rx as u,ox as v,Rs as w,u0 as x,Hn as y,t1 as z};
|