mirror of https://github.com/rocboss/paopao-ce
253 lines
45 KiB
253 lines
45 KiB
import{d as se,h as n,r as m,aD as Bt,aE as _t,a1 as lt,aF as je,aG as $t,aH as At,n as re,l as x,m as D,p as Ze,o as Y,q as Me,t as ve,aI as Et,s as B,aJ as Ve,S as De,aK as st,v as Qe,y as qe,aL as Lt,an as He,aM as Ye,aa as Ge,aN as Dt,aO as jt,u as dt,aP as Vt,g as Ne,aQ as Nt,I as ut,aR as Wt,f as Ut,aS as Kt,aT as Je,aU as Ht,aV as Zt,aW as Jt,aX as qt,aY as Qt,aZ as Yt,a_ as Xe,a$ as Gt,k as U,b0 as Xt,x as en,K as tn,_ as nn,N as Oe}from"./index.f480f018.js";import{N as on}from"./Skeleton.57e98fe3.js";var et=se({name:"Backward",render(){return n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("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"}))}}),tt=se({name:"FastBackward",render(){return n("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("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"}))))}}),nt=se({name:"FastForward",render(){return n("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("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"}))))}}),ot=se({name:"Forward",render(){return n("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n("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"}))}}),rt=se({name:"More",render(){return n("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},n("g",{fill:"currentColor","fill-rule":"nonzero"},n("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"}))))}});const pe="v-hidden",rn=At("[v-hidden]",{display:"none!important"});var at=se({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateOverflow:Function},setup(e,{slots:r}){const d=m(null),f=m(null);function u(){const{value:g}=d,{getCounter:s,getTail:R}=e;let p;if(s!==void 0?p=s():p=f.value,!g||!p)return;p.hasAttribute(pe)&&p.removeAttribute(pe);const{children:b}=g,M=g.offsetWidth,S=[],P=r.tail?R==null?void 0:R():null;let C=P?P.offsetWidth:0,y=!1;const $=g.children.length-(r.tail?1:0);for(let A=0;A<$-1;++A){if(A<0)continue;const j=b[A];if(y){j.hasAttribute(pe)||j.setAttribute(pe,"");continue}else j.hasAttribute(pe)&&j.removeAttribute(pe);const K=j.offsetWidth;if(C+=K,S[A]=K,C>M){const{updateCounter:E}=e;for(let k=A;k>=0;--k){const W=$-1-k;E!==void 0?E(W):p.textContent=`${W}`;const H=p.offsetWidth;if(C-=S[k],C+H<=M||k===0){y=!0,A=k-1,P&&(A===-1?(P.style.maxWidth=`${M-H}px`,P.style.boxSizing="border-box"):P.style.maxWidth="");break}}}}const{onUpdateOverflow:O}=e;y?O!==void 0&&O(!0):(O!==void 0&&O(!1),p.setAttribute(pe,""))}const w=Bt();return rn.mount({id:"vueuc/overflow",head:!0,anchorMetaName:_t,ssr:w}),lt(u),{selfRef:d,counterRef:f,sync:u}},render(){const{$slots:e}=this;return je(this.sync),n("div",{class:"v-overflow",ref:"selfRef"},[$t(e,"default"),e.counter?e.counter():n("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}}),an=re([x("base-selection",`
|
|
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);
|
|
`,[x("base-loading",`
|
|
color: var(--n-loading-color);
|
|
`),x("base-selection-tags","min-height: var(--n-height);"),D("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);
|
|
`),D("state-border",`
|
|
z-index: 1;
|
|
border-color: #0000;
|
|
`),x("base-suffix",`
|
|
cursor: pointer;
|
|
position: absolute;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
right: 10px;
|
|
`,[D("arrow",`
|
|
font-size: var(--n-arrow-size);
|
|
color: var(--n-arrow-color);
|
|
transition: color .3s var(--n-bezier);
|
|
`)]),x("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);
|
|
`,[D("wrapper",`
|
|
flex-basis: 0;
|
|
flex-grow: 1;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
`)]),x("base-selection-placeholder",`
|
|
color: var(--n-placeholder-color);
|
|
`),x("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);
|
|
`),x("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;
|
|
`,[x("base-selection-input",`
|
|
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);
|
|
`,[D("content",`
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
`)]),D("render-label",`
|
|
color: var(--n-text-color);
|
|
`)]),Ze("disabled",[re("&:hover",[D("state-border",`
|
|
box-shadow: var(--n-box-shadow-hover);
|
|
border: var(--n-border-hover);
|
|
`)]),Y("focus",[D("state-border",`
|
|
box-shadow: var(--n-box-shadow-focus);
|
|
border: var(--n-border-focus);
|
|
`)]),Y("active",[D("state-border",`
|
|
box-shadow: var(--n-box-shadow-active);
|
|
border: var(--n-border-active);
|
|
`),x("base-selection-label","background-color: var(--n-color-active);"),x("base-selection-tags","background-color: var(--n-color-active);")])]),Y("disabled","cursor: not-allowed;",[D("arrow",`
|
|
color: var(--n-arrow-color-disabled);
|
|
`),x("base-selection-label",`
|
|
cursor: not-allowed;
|
|
background-color: var(--n-color-disabled);
|
|
`,[x("base-selection-input",`
|
|
cursor: not-allowed;
|
|
color: var(--n-text-color-disabled);
|
|
`),D("render-label",`
|
|
color: var(--n-text-color-disabled);
|
|
`)]),x("base-selection-tags",`
|
|
cursor: not-allowed;
|
|
background-color: var(--n-color-disabled);
|
|
`),x("base-selection-placeholder",`
|
|
cursor: not-allowed;
|
|
color: var(--n-placeholder-color-disabled);
|
|
`)]),x("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;
|
|
`,[D("input",`
|
|
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);
|
|
`),D("mirror",`
|
|
position: absolute;
|
|
left: 0;
|
|
top: 0;
|
|
white-space: pre;
|
|
visibility: hidden;
|
|
user-select: none;
|
|
opacity: 0;
|
|
`)]),["warning","error"].map(e=>Y(`${e}-status`,[D("state-border",`border: var(--n-border-${e});`),Ze("disabled",[re("&:hover",[D("state-border",`
|
|
box-shadow: var(--n-box-shadow-hover-${e});
|
|
border: var(--n-border-hover-${e});
|
|
`)]),Y("active",[D("state-border",`
|
|
box-shadow: var(--n-box-shadow-active-${e});
|
|
border: var(--n-border-active-${e});
|
|
`),x("base-selection-label",`background-color: var(--n-color-active-${e});`),x("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Y("focus",[D("state-border",`
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|
border: var(--n-border-focus-${e});
|
|
`)])])]))]),x("base-selection-popover",`
|
|
margin-bottom: -3px;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
`),x("base-selection-tag-wrapper",`
|
|
max-width: 100%;
|
|
display: inline-flex;
|
|
padding: 0 7px 3px 0;
|
|
`,[re("&:last-child","padding-right: 0;"),x("tag",`
|
|
font-size: 14px;
|
|
max-width: 100%;
|
|
`,[D("content",`
|
|
line-height: 1.25;
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
`)])])]),ln=se({name:"InternalSelection",props:Object.assign(Object.assign({},Me.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},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,onKeyup:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean}),setup(e){const r=m(null),d=m(null),f=m(null),u=m(null),w=m(null),g=m(null),s=m(null),R=m(null),p=m(null),b=m(null),M=m(!1),S=m(!1),P=m(!1),C=Me("InternalSelection","-internal-selection",an,Et,e,ve(e,"clsPrefix")),y=B(()=>e.clearable&&!e.disabled&&(P.value||e.active)),$=B(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Ve(e.selectedOption.label,e.selectedOption,!0):e.placeholder),O=B(()=>{const o=e.selectedOption;if(!!o)return o.label}),A=B(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function j(){var o;const{value:l}=r;if(l){const{value:_}=d;_&&(_.style.width=`${l.offsetWidth}px`,e.maxTagCount!=="responsive"&&((o=p.value)===null||o===void 0||o.sync()))}}function K(){const{value:o}=b;o&&(o.style.display="none")}function E(){const{value:o}=b;o&&(o.style.display="inline-block")}De(ve(e,"active"),o=>{o||K()}),De(ve(e,"pattern"),()=>{e.multiple&&je(j)});function k(o){const{onFocus:l}=e;l&&l(o)}function W(o){const{onBlur:l}=e;l&&l(o)}function H(o){const{onDeleteOption:l}=e;l&&l(o)}function V(o){const{onClear:l}=e;l&&l(o)}function I(o){const{onPatternInput:l}=e;l&&l(o)}function ae(o){var l;(!o.relatedTarget||!(!((l=f.value)===null||l===void 0)&&l.contains(o.relatedTarget)))&&k(o)}function de(o){var l;!((l=f.value)===null||l===void 0)&&l.contains(o.relatedTarget)||W(o)}function ue(o){V(o)}function ne(){P.value=!0}function ie(){P.value=!1}function ee(o){!e.active||!e.filterable||o.target!==d.value&&o.preventDefault()}function le(o){H(o)}function G(o){if(o.code==="Backspace"&&!Z.value&&!e.pattern.length){const{selectedOptions:l}=e;l!=null&&l.length&&le(l[l.length-1])}}const Z=m(!1);let J=null;function q(o){const{value:l}=r;if(l){const _=o.target.value;l.textContent=_,j()}Z.value?J=o:I(o)}function X(){Z.value=!0}function a(){Z.value=!1,I(J),J=null}function c(o){var l;S.value=!0,(l=e.onPatternFocus)===null||l===void 0||l.call(e,o)}function L(o){var l;S.value=!1,(l=e.onPatternBlur)===null||l===void 0||l.call(e,o)}function N(){var o,l;if(e.filterable)S.value=!1,(o=g.value)===null||o===void 0||o.blur(),(l=d.value)===null||l===void 0||l.blur();else if(e.multiple){const{value:_}=u;_==null||_.blur()}else{const{value:_}=w;_==null||_.blur()}}function Q(){var o,l,_;e.filterable?(S.value=!1,(o=g.value)===null||o===void 0||o.focus()):e.multiple?(l=u.value)===null||l===void 0||l.focus():(_=w.value)===null||_===void 0||_.focus()}function me(){const{value:o}=d;o&&(E(),o.focus())}function ce(){const{value:o}=d;o&&o.blur()}function Ie(o){const{value:l}=s;l&&l.setTextContent(`+${o}`)}function Re(){const{value:o}=R;return o}function Fe(){return d.value}let he=null;function be(){he!==null&&window.clearTimeout(he)}function ke(){e.disabled||e.active||(be(),he=window.setTimeout(()=>{M.value=!0},100))}function Te(){be()}function ze(o){o||(be(),M.value=!1)}lt(()=>{st(()=>{const o=g.value;!o||(o.tabIndex=e.disabled||S.value?-1:0)})});const{inlineThemeDisabled:we}=e,Ce=B(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:l},self:{borderRadius:_,color:Be,placeholderColor:_e,textColor:$e,paddingSingle:xe,paddingMultiple:ye,caretColor:Ae,colorDisabled:ge,textColorDisabled:Ee,placeholderColorDisabled:Se,colorActive:oe,boxShadowFocus:t,boxShadowActive:i,boxShadowHover:v,border:F,borderFocus:h,borderHover:T,borderActive:z,arrowColor:fe,arrowColorDisabled:Pe,loadingColor:Le,colorActiveWarning:Ue,boxShadowFocusWarning:Ke,boxShadowActiveWarning:ft,boxShadowHoverWarning:vt,borderWarning:ht,borderFocusWarning:bt,borderHoverWarning:gt,borderActiveWarning:pt,colorActiveError:mt,boxShadowFocusError:wt,boxShadowActiveError:Ct,boxShadowHoverError:xt,borderError:yt,borderFocusError:St,borderHoverError:Pt,borderActiveError:Ot,clearColor:Mt,clearColorHover:It,clearColorPressed:Rt,clearSize:Ft,arrowSize:kt,[Qe("height",o)]:Tt,[Qe("fontSize",o)]:zt}}=C.value;return{"--n-bezier":l,"--n-border":F,"--n-border-active":z,"--n-border-focus":h,"--n-border-hover":T,"--n-border-radius":_,"--n-box-shadow-active":i,"--n-box-shadow-focus":t,"--n-box-shadow-hover":v,"--n-caret-color":Ae,"--n-color":Be,"--n-color-active":oe,"--n-color-disabled":ge,"--n-font-size":zt,"--n-height":Tt,"--n-padding-single":xe,"--n-padding-multiple":ye,"--n-placeholder-color":_e,"--n-placeholder-color-disabled":Se,"--n-text-color":$e,"--n-text-color-disabled":Ee,"--n-arrow-color":fe,"--n-arrow-color-disabled":Pe,"--n-loading-color":Le,"--n-color-active-warning":Ue,"--n-box-shadow-focus-warning":Ke,"--n-box-shadow-active-warning":ft,"--n-box-shadow-hover-warning":vt,"--n-border-warning":ht,"--n-border-focus-warning":bt,"--n-border-hover-warning":gt,"--n-border-active-warning":pt,"--n-color-active-error":mt,"--n-box-shadow-focus-error":wt,"--n-box-shadow-active-error":Ct,"--n-box-shadow-hover-error":xt,"--n-border-error":yt,"--n-border-focus-error":St,"--n-border-hover-error":Pt,"--n-border-active-error":Ot,"--n-clear-size":Ft,"--n-clear-color":Mt,"--n-clear-color-hover":It,"--n-clear-color-pressed":Rt,"--n-arrow-size":kt}}),te=we?qe("internal-selection",B(()=>e.size[0]),Ce,e):void 0;return{mergedTheme:C,mergedClearable:y,patternInputFocused:S,filterablePlaceholder:$,label:O,selected:A,showTagsPanel:M,isCompositing:Z,counterRef:s,counterWrapperRef:R,patternInputMirrorRef:r,patternInputRef:d,selfRef:f,multipleElRef:u,singleElRef:w,patternInputWrapperRef:g,overflowRef:p,inputTagElRef:b,handleMouseDown:ee,handleFocusin:ae,handleClear:ue,handleMouseEnter:ne,handleMouseLeave:ie,handleDeleteOption:le,handlePatternKeyDown:G,handlePatternInputInput:q,handlePatternInputBlur:L,handlePatternInputFocus:c,handleMouseEnterCounter:ke,handleMouseLeaveCounter:Te,handleFocusout:de,handleCompositionEnd:a,handleCompositionStart:X,onPopoverUpdateShow:ze,focus:Q,focusInput:me,blur:N,blurInput:ce,updateCounter:Ie,getCounter:Re,getTail:Fe,renderLabel:e.renderLabel,cssVars:we?void 0:Ce,themeClass:te==null?void 0:te.themeClass,onRender:te==null?void 0:te.onRender}},render(){const{status:e,multiple:r,size:d,disabled:f,filterable:u,maxTagCount:w,bordered:g,clsPrefix:s,onRender:R,renderTag:p,renderLabel:b}=this;R==null||R();const M=w==="responsive",S=typeof w=="number",P=M||S,C=n(Lt,{clsPrefix:s,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var $,O;return(O=($=this.$slots).arrow)===null||O===void 0?void 0:O.call($)}});let y;if(r){const $=I=>n("div",{class:`${s}-base-selection-tag-wrapper`,key:I.value},p?p({option:I,handleClose:()=>this.handleDeleteOption(I)}):n(He,{size:d,closable:!I.disabled,disabled:f,internalStopClickPropagation:!0,onClose:()=>this.handleDeleteOption(I)},{default:()=>b?b(I,!0):Ve(I.label,I,!0)})),O=(S?this.selectedOptions.slice(0,w):this.selectedOptions).map($),A=u?n("div",{class:`${s}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},n("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:f,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})),n("span",{ref:"patternInputMirrorRef",class:`${s}-base-selection-input-tag__mirror`},this.pattern)):null,j=M?()=>n("div",{class:`${s}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},n(He,{size:d,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:f})):void 0;let K;if(S){const I=this.selectedOptions.length-w;I>0&&(K=n("div",{class:`${s}-base-selection-tag-wrapper`,key:"__counter__"},n(He,{size:d,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:f},{default:()=>`+${I}`})))}const E=M?u?n(at,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:()=>O,counter:j,tail:()=>A}):n(at,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:()=>O,counter:j}):S?O.concat(K):O,k=P?()=>n("div",{class:`${s}-base-selection-popover`},M?O:this.selectedOptions.map($)):void 0,W=P?{show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover}:null,V=(this.selected?!1:this.active?!this.pattern&&!this.isCompositing:!0)?n("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`},this.placeholder):null;if(u){const I=n("div",{ref:"patternInputWrapperRef",class:`${s}-base-selection-tags`},E,M?null:A,C);y=n(Ge,null,P?n(Ye,Object.assign({},W),{trigger:()=>I,default:k}):I,V)}else{const I=n("div",{ref:"multipleElRef",class:`${s}-base-selection-tags`,tabindex:f?void 0:0},E,C);y=n(Ge,null,P?n(Ye,Object.assign({},W),{trigger:()=>I,default:k}):I,V)}}else if(u){const $=this.pattern||this.isCompositing,O=this.active?!$:!this.selected,A=this.active?!1:this.selected;y=n("div",{ref:"patternInputWrapperRef",class:`${s}-base-selection-label`},n("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${s}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:f,disabled:f,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),A?n("div",{class:`${s}-base-selection-label__render-label ${s}-base-selection-overlay`,key:"input"},n("div",{class:`${s}-base-selection-overlay__wrapper`},p?p({option:this.selectedOption,handleClose:()=>{}}):b?b(this.selectedOption,!0):Ve(this.label,this.selectedOption,!0))):null,O?n("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:"placeholder"},n("div",{class:`${s}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,C)}else y=n("div",{ref:"singleElRef",class:`${s}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?n("div",{class:`${s}-base-selection-input`,title:Dt(this.label),key:"input"},n("div",{class:`${s}-base-selection-input__content`},p?p({option:this.selectedOption,handleClose:()=>{}}):b?b(this.selectedOption,!0):Ve(this.label,this.selectedOption,!0))):n("div",{class:`${s}-base-selection-placeholder ${s}-base-selection-overlay`,key:"placeholder"},this.placeholder),C);return n("div",{ref:"selfRef",class:[`${s}-base-selection`,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,onKeyup:this.onKeyup,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,g?n("div",{class:`${s}-base-selection__border`}):null,g?n("div",{class:`${s}-base-selection__state-border`}):null)}});function sn(e){return We(e)?e.name||e.key||"key-required":e.value}function We(e){return e.type==="group"}function ct(e){return e.type==="ignored"}const dn={getKey:sn,getIsGroup:We,getIgnored:ct};function it(e,r){try{return!!(1+r.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function un(e,r,d){if(!r)return e;function f(u){if(!Array.isArray(u))return[];const w=[];for(const g of u)if(We(g)){const s=f(g.children);s.length&&w.push(Object.assign({},g,{children:s}))}else{if(ct(g))continue;r(d,g)&&w.push(g)}return w}return f(e)}function cn(e){const r=new Map;return e.forEach(d=>{We(d)?d.children.forEach(f=>{r.set(f.value,f)}):r.set(d.value,d)}),r}function fn(e,r){return r?typeof r.label=="string"?it(e,r.label):r.value!==void 0?it(e,String(r.value)):!1:!1}var vn=re([x("select",`
|
|
z-index: auto;
|
|
outline: none;
|
|
width: 100%;
|
|
position: relative;
|
|
`),x("select-menu",`
|
|
margin: 4px 0;
|
|
box-shadow: var(--n-menu-box-shadow);
|
|
`,[jt()])]);const hn=Object.assign(Object.assign({},Me.props),{to:Je.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},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:{type:Function,default:fn},placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:{type:Function,default:e=>({label:e,value:e})},fallbackOption:{type:[Function,Boolean],default:()=>e=>({label:String(e),value:e})},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,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,onChange:[Function,Array],items:Array});var bn=se({name:"Select",props:hn,setup(e){const{mergedClsPrefixRef:r,mergedBorderedRef:d,namespaceRef:f,inlineThemeDisabled:u}=dt(e),w=Me("Select","-select",vn,Vt,e,r),g=m(e.defaultValue),s=ve(e,"value"),R=Ne(s,g),p=m(!1),b=m(""),M=B(()=>Nt(I.value,dn)),S=B(()=>cn(V.value)),P=m(!1),C=Ne(ve(e,"show"),P),y=m(null),$=m(null),O=m(null),{localeRef:A}=ut("Select"),j=B(()=>{var t;return(t=e.placeholder)!==null&&t!==void 0?t:A.value.placeholder}),K=Wt(e,["items","options"]),E=m([]),k=m([]),W=m(new Map),H=B(()=>{const{fallbackOption:t}=e;return t?i=>Object.assign(t(i),{value:i}):!1}),V=B(()=>k.value.concat(E.value).concat(K.value)),I=B(()=>{if(e.remote)return K.value;{const{value:t}=V,{value:i}=b;if(!i.length||!e.filterable)return t;{const{filter:v}=e;return un(t,v,i)}}});function ae(t){const i=e.remote,{value:v}=W,{value:F}=S,{value:h}=H,T=[];return t.forEach(z=>{if(F.has(z))T.push(F.get(z));else if(i&&v.has(z))T.push(v.get(z));else if(h){const fe=h(z);fe&&T.push(fe)}}),T}const de=B(()=>{if(e.multiple){const{value:t}=R;return Array.isArray(t)?ae(t):[]}return null}),ue=B(()=>{const{value:t}=R;return!e.multiple&&!Array.isArray(t)?t===null?null:ae([t])[0]||null:null}),ne=Ut(e),{mergedSizeRef:ie,mergedDisabledRef:ee,mergedStatusRef:le}=ne;function G(t,i){const{onChange:v,"onUpdate:value":F,onUpdateValue:h}=e,{nTriggerFormChange:T,nTriggerFormInput:z}=ne;v&&U(v,t,i),h&&U(h,t,i),F&&U(F,t,i),g.value=t,T(),z()}function Z(t){const{onBlur:i}=e,{nTriggerFormBlur:v}=ne;i&&U(i,t),v()}function J(){const{onClear:t}=e;t&&U(t)}function q(t){const{onFocus:i}=e,{nTriggerFormFocus:v}=ne;i&&U(i,t),v()}function X(t){const{onSearch:i}=e;i&&U(i,t)}function a(t){const{onScroll:i}=e;i&&U(i,t)}function c(){var t;const{remote:i,multiple:v}=e;if(i){const{value:F}=W;if(v)(t=de.value)===null||t===void 0||t.forEach(h=>{F.set(h.value,h)});else{const h=ue.value;h&&F.set(h.value,h)}}}function L(t){const{onUpdateShow:i,"onUpdate:show":v}=e;i&&U(i,t),v&&U(v,t),P.value=t}function N(){ee.value||(L(!0),P.value=!0,e.filterable&&Ae())}function Q(){L(!1)}function me(){b.value="",k.value=[]}const ce=m(!1);function Ie(){e.filterable&&(ce.value=!0)}function Re(){e.filterable&&(ce.value=!1,C.value||me())}function Fe(){ee.value||(C.value?e.filterable||Q():N())}function he(t){var i,v;!((v=(i=O.value)===null||i===void 0?void 0:i.selfRef)===null||v===void 0)&&v.contains(t.relatedTarget)||(p.value=!1,Z(t),Q())}function be(t){q(t),p.value=!0}function ke(t){p.value=!0}function Te(t){var i;!((i=y.value)===null||i===void 0)&&i.$el.contains(t.relatedTarget)||(p.value=!1,Z(t),Q())}function ze(){var t;(t=y.value)===null||t===void 0||t.focus(),Q()}function we(t){var i;C.value&&(!((i=y.value)===null||i===void 0)&&i.$el.contains(t.target)||Q())}function Ce(t){if(!Array.isArray(t))return[];if(H.value)return Array.from(t);{const{remote:i}=e,{value:v}=S;if(i){const{value:F}=W;return t.filter(h=>v.has(h)||F.has(h))}else return t.filter(F=>v.has(F))}}function te(t){o(t.rawNode)}function o(t){if(ee.value)return;const{tag:i,remote:v,clearFilterAfterSelect:F}=e;if(i&&!v){const{value:h}=k,T=h[0]||null;T&&(E.value.push(T),k.value=[])}if(v&&W.value.set(t.value,t),e.multiple){const h=Ce(R.value),T=h.findIndex(z=>z===t.value);if(~T){if(h.splice(T,1),i&&!v){const z=l(t.value);~z&&(E.value.splice(z,1),F&&(b.value=""))}}else h.push(t.value),F&&(b.value="");G(h,ae(h))}else{if(i&&!v){const h=l(t.value);~h?E.value=[E.value[h]]:E.value=[]}ye(),Q(),G(t.value,t)}}function l(t){return E.value.findIndex(v=>v.value===t)}function _(t){C.value||N();const{value:i}=t.target;b.value=i;const{tag:v,remote:F}=e;if(X(i),v&&!F){if(!i){k.value=[];return}const h=e.onCreate(i);K.value.some(T=>T.value===h.value)||E.value.some(T=>T.value===h.value)?k.value=[]:k.value=[h]}}function Be(t){t.stopPropagation();const{multiple:i}=e;!i&&e.filterable&&Q(),J(),i?G([],[]):G(null,null)}function _e(t){Gt(t,"action")||t.preventDefault()}function $e(t){a(t)}function xe(t){var i,v,F,h,T;switch(t.code){case"Space":if(e.filterable)break;t.preventDefault();case"Enter":case"NumpadEnter":if(!(!((i=y.value)===null||i===void 0)&&i.isCompositing)){if(C.value){const z=(v=O.value)===null||v===void 0?void 0:v.getPendingTmNode();z?te(z):e.filterable||(Q(),ye())}else if(N(),e.tag&&ce.value){const z=k.value[0];if(z){const fe=z.value,{value:Pe}=R;e.multiple&&Array.isArray(Pe)&&Pe.some(Le=>Le===fe)||o(z)}}}t.preventDefault();break;case"ArrowUp":if(t.preventDefault(),e.loading)return;C.value&&((F=O.value)===null||F===void 0||F.prev());break;case"ArrowDown":if(t.preventDefault(),e.loading)return;C.value?(h=O.value)===null||h===void 0||h.next():N();break;case"Escape":Q(),(T=y.value)===null||T===void 0||T.focus();break}}function ye(){var t;(t=y.value)===null||t===void 0||t.focus()}function Ae(){var t;(t=y.value)===null||t===void 0||t.focusInput()}function ge(){var t;(t=$.value)===null||t===void 0||t.syncPosition()}c(),De(ve(e,"options"),c),De(I,()=>{!C.value||je(ge)}),De(R,()=>{!C.value||je(ge)});const Ee={focus:()=>{var t;(t=y.value)===null||t===void 0||t.focus()},blur:()=>{var t;(t=y.value)===null||t===void 0||t.blur()}},Se=B(()=>{const{self:{menuBoxShadow:t}}=w.value;return{"--n-menu-box-shadow":t}}),oe=u?qe("select",void 0,Se,e):void 0;return Object.assign(Object.assign({},Ee),{mergedStatus:le,mergedClsPrefix:r,mergedBordered:d,namespace:f,treeMate:M,isMounted:Kt(),triggerRef:y,menuRef:O,pattern:b,uncontrolledShow:P,mergedShow:C,adjustedTo:Je(e),uncontrolledValue:g,mergedValue:R,followerRef:$,localizedPlaceholder:j,selectedOption:ue,selectedOptions:de,mergedSize:ie,mergedDisabled:ee,focused:p,activeWithoutMenuOpen:ce,inlineThemeDisabled:u,onTriggerInputFocus:Ie,onTriggerInputBlur:Re,handleMenuFocus:ke,handleMenuBlur:Te,handleMenuTabOut:ze,handleTriggerClick:Fe,handleToggle:te,handleDeleteOption:o,handlePatternInput:_,handleClear:Be,handleTriggerBlur:he,handleTriggerFocus:be,handleKeydown:xe,syncPosition:ge,handleMenuAfterLeave:me,handleMenuClickOutside:we,handleMenuScroll:$e,handleMenuKeydown:xe,handleMenuMousedown:_e,mergedTheme:w,cssVars:u?void 0:Se,themeClass:oe==null?void 0:oe.themeClass,onRender:oe==null?void 0:oe.onRender})},render(){return n("div",{class:`${this.mergedClsPrefix}-select`},n(Ht,null,{default:()=>[n(Zt,null,{default:()=>n(ln,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,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,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},{arrow:()=>{var e,r;return[(r=(e=this.$slots).arrow)===null||r===void 0?void 0:r.call(e)]}})}),n(Jt,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Je.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>n(qt,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,r,d;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),Qt(n(on,Object.assign({},this.menuProps,{ref:"menuRef",inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(r=this.menuProps)===null||r===void 0?void 0:r.class],clsPrefix:this.mergedClsPrefix,focusable:!0,autoPending:!0,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:[(d=this.menuProps)===null||d===void 0?void 0:d.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,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var f,u;return[(u=(f=this.$slots).empty)===null||u===void 0?void 0:u.call(f)]},action:()=>{var f,u;return[(u=(f=this.$slots).action)===null||u===void 0?void 0:u.call(f)]}}),this.displayDirective==="show"?[[Yt,this.mergedShow],[Xe,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Xe,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}});function gn(e,r,d=9){if(r===1)return[1];if(r===2)return[1,2];const f=1,u=r;let w=e,g=e;const s=(d-5)/2;g+=Math.ceil(s),g=Math.min(Math.max(g,f+d-3),u-2),w-=Math.floor(s),w=Math.max(Math.min(w,u-d+3),f+2);let R=!1,p=!1;w>f+2&&(R=!0),g<u-2&&(p=!0);const b=[];b.push(f),R?b.push(-2):u>=f+1&&b.push(f+1);for(let M=w;M<=g;++M)b.push(M);return p?b.push(-1):g===u-2&&b[b.length-1]!==u-1&&b.push(u-1),b[b.length-1]!==u&&b.push(u),b}function pn(e,r){return e.map(d=>{switch(d){case-2:return{type:"fast-backward",active:!1};case-1:return{type:"fast-forward",active:!1};default:return d===r?{type:"page",label:d,active:!0}:{type:"page",label:d,active:!1}}})}function mn(e,r,d){const f=gn(e,r,d);return pn(f,e)}var wn=x("pagination",`
|
|
display: flex;
|
|
vertical-align: middle;
|
|
font-size: var(--n-item-font-size);
|
|
flex-wrap: nowrap;
|
|
`,[x("pagination-prefix",`
|
|
display: flex;
|
|
align-items: center;
|
|
margin: var(--n-prefix-margin);
|
|
`),x("pagination-suffix",`
|
|
display: flex;
|
|
align-items: center;
|
|
margin: var(--n-suffix-margin);
|
|
`),re("> *:not(:first-child)",{margin:"var(--n-item-margin)"}),x("select",{width:"var(--n-select-width)"}),re("&.transition-disabled",[x("pagination-item",{transition:"none!important"})]),x("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-jumter-font-size);
|
|
`,[x("input",`
|
|
margin: var(--n-input-margin);
|
|
width: var(--n-input-width);
|
|
`)]),x("pagination-item",`
|
|
position: relative;
|
|
cursor: pointer;
|
|
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);
|
|
`,[Y("button",`
|
|
background: var(--n-button-color);
|
|
color: var(--n-button-icon-color);
|
|
border: var(--n-button-border);
|
|
`,[x("base-icon",`
|
|
font-size: var(--n-button-icon-size);
|
|
`)]),Ze("disabled",[re("&:hover",{background:"var(--n-item-color-hover)",color:"var(--n-item-text-color-hover)",border:"var(--n-item-border-hover)"},[Y("button",{background:"var(--n-button-color-hover)",border:"var(--n-button-border-hover)",color:"var(--n-button-icon-color-hover)"})]),re("&:active",{background:"var(--n-item-color-pressed)",color:"var(--n-item-text-color-pressed)",border:"var(--n-item-border-pressed)"},[Y("button",{background:"var(--n-button-color-pressed)",border:"var(--n-button-border-pressed)",color:"var(--n-button-icon-color-pressed)"})]),Y("active",{background:"var(--n-item-color-active)",color:"var(--n-item-text-color-active)",border:"var(--n-item-border-active)"},[re("&:hover",{background:"var(--n-item-color-active-hover)"})])]),Y("disabled",`
|
|
cursor: not-allowed;
|
|
color: var(--n-item-text-color-disabled);
|
|
`,[Y("active, button",{backgroundColor:"var(--n-item-color-disabled)",border:"var(--n-item-border-disabled)"})])]),Y("disabled",{cursor:"not-allowed"},[x("pagination-quick-jumper",{color:"var(--n-jumper-text-color-disabled)"})])]);const Cn=Object.assign(Object.assign({},Me.props),{page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:{type:Number,default:10},pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,disabled:Boolean,pageSlot:{type:Number,default:9},prev:Function,next:Function,prefix:Function,suffix:Function,label:Function,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]});var Sn=se({name:"Pagination",props:Cn,setup(e){const{mergedComponentPropsRef:r,mergedClsPrefixRef:d,inlineThemeDisabled:f,mergedRtlRef:u}=dt(e),w=Me("Pagination","-pagination",wn,Xt,e,d),{localeRef:g}=ut("Pagination"),s=m(null),R=m(null),p=m(""),b=m(e.defaultPage),M=m(e.defaultPageSize),S=Ne(ve(e,"page"),b),P=Ne(ve(e,"pageSize"),M),C=B(()=>{const{itemCount:a}=e;if(a!==void 0)return Math.max(1,Math.ceil(a/P.value));const{pageCount:c}=e;return c!==void 0?c:1}),y=m(!1),$=m(!1),O=B(()=>{const a=g.value.selectionSuffix;return e.pageSizes.map(c=>typeof c=="number"?{label:`${c} / ${a}`,value:c}:c)}),A=B(()=>{var a,c;return((c=(a=r==null?void 0:r.value)===null||a===void 0?void 0:a.Pagination)===null||c===void 0?void 0:c.inputSize)||"small"}),j=B(()=>{var a,c;return((c=(a=r==null?void 0:r.value)===null||a===void 0?void 0:a.Pagination)===null||c===void 0?void 0:c.selectSize)||"small"}),K=B(()=>(S.value-1)*P.value),E=B(()=>{const a=S.value*P.value-1,{itemCount:c}=e;return c!==void 0&&a>c?c:a}),k=B(()=>{const{itemCount:a}=e;return a!==void 0?a:(e.pageCount||1)*P.value}),W=en("Pagination",u,d),H=()=>{je(()=>{var a;const{value:c}=s;!c||(c.classList.add("transition-disabled"),(a=s.value)===null||a===void 0||a.offsetWidth,c.classList.remove("transition-disabled"))})};function V(a){if(a===S.value)return;const{"onUpdate:page":c,onUpdatePage:L,onChange:N}=e;c&&U(c,a),L&&U(L,a),N&&U(N,a),b.value=a}function I(a){if(a===P.value)return;const{"onUpdate:pageSize":c,onUpdatePageSize:L,onPageSizeChange:N}=e;c&&U(c,a),L&&U(L,a),N&&U(N,a),M.value=a,C.value<S.value&&V(C.value)}function ae(){if(e.disabled)return;const a=Math.min(S.value+1,C.value);V(a)}function de(){if(e.disabled)return;const a=Math.max(S.value-1,1);V(a)}function ue(){if(e.disabled)return;const a=Math.min(S.value+(e.pageSlot-4),C.value);V(a)}function ne(){if(e.disabled)return;const a=Math.max(S.value-(e.pageSlot-4),1);V(a)}function ie(a){I(a)}function ee(a){var c;if(a.code==="Enter"||a.code==="NumpadEnter"){const L=parseInt(p.value);!Number.isNaN(L)&&L>=1&&L<=C.value&&(V(L),p.value="",(c=R.value)===null||c===void 0||c.blur())}}function le(a){if(!e.disabled)switch(a.type){case"page":V(a.label);break;case"fast-backward":ne();break;case"fast-forward":ue();break}}function G(a){if(!e.disabled){switch(a.type){case"fast-backward":$.value=!0;break;case"fast-forward":y.value=!0;break;default:return}H()}}function Z(a){if(!e.disabled){switch(a.type){case"fast-backward":$.value=!1;break;case"fast-forward":y.value=!1;break;default:return}H()}}function J(a){p.value=a}st(()=>{S.value,P.value,H()});const q=B(()=>{const{self:{itemSize:a,itemPadding:c,itemMargin:L,itemMarginRtl:N,inputWidth:Q,selectWidth:me,inputMargin:ce,inputMarginRtl:Ie,selectMargin:Re,buttonBorder:Fe,buttonBorderHover:he,buttonBorderPressed:be,buttonIconColor:ke,buttonIconColorHover:Te,buttonIconColorPressed:ze,buttonIconSize:we,itemTextColor:Ce,itemTextColorHover:te,itemTextColorPressed:o,itemTextColorActive:l,itemTextColorDisabled:_,itemColor:Be,itemColorHover:_e,itemColorPressed:$e,itemColorActive:xe,itemColorActiveHover:ye,itemColorDisabled:Ae,itemBorder:ge,itemBorderHover:Ee,itemBorderPressed:Se,itemBorderActive:oe,itemBorderDisabled:t,itemBorderRadius:i,itemFontSize:v,jumperFontSize:F,jumperTextColor:h,jumperTextColorDisabled:T,prefixMargin:z,suffixMargin:fe,buttonColor:Pe,buttonColorHover:Le,buttonColorPressed:Ue},common:{cubicBezierEaseInOut:Ke}}=w.value;return{"--n-prefix-margin":z,"--n-suffix-margin":fe,"--n-item-font-size":v,"--n-select-width":me,"--n-select-margin":Re,"--n-input-width":Q,"--n-input-margin":ce,"--n-input-margin-rtl":Ie,"--n-item-size":a,"--n-item-text-color":Ce,"--n-item-text-color-disabled":_,"--n-item-text-color-hover":te,"--n-item-text-color-active":l,"--n-item-text-color-pressed":o,"--n-item-color":Be,"--n-item-color-hover":_e,"--n-item-color-disabled":Ae,"--n-item-color-active":xe,"--n-item-color-active-hover":ye,"--n-item-color-pressed":$e,"--n-item-border":ge,"--n-item-border-hover":Ee,"--n-item-border-disabled":t,"--n-item-border-active":oe,"--n-item-border-pressed":Se,"--n-item-padding":c,"--n-item-border-radius":i,"--n-bezier":Ke,"--n-jumper-font-size":F,"--n-jumper-text-color":h,"--n-jumper-text-color-disabled":T,"--n-item-margin":L,"--n-item-margin-rtl":N,"--n-button-icon-size":we,"--n-button-icon-color":ke,"--n-button-icon-color-hover":Te,"--n-button-icon-color-pressed":ze,"--n-button-color-hover":Le,"--n-button-color":Pe,"--n-button-color-pressed":Ue,"--n-button-border":Fe,"--n-button-border-hover":he,"--n-button-border-pressed":be}}),X=f?qe("pagination",void 0,q,e):void 0;return{rtlEnabled:W,mergedClsPrefix:d,locale:g,selfRef:s,jumperRef:R,mergedPage:S,showFastBackward:$,showFastForward:y,pageItems:B(()=>mn(S.value,C.value,e.pageSlot)),mergedItemCount:k,jumperValue:p,pageSizeOptions:O,mergedPageSize:P,inputSize:A,selectSize:j,mergedTheme:w,mergedPageCount:C,startIndex:K,endIndex:E,handleJumperInput:J,handleBackwardClick:de,handleForwardClick:ae,handlePageItemClick:le,handleSizePickerChange:ie,handleQuickJumperKeyUp:ee,handlePageItemMouseEnter:G,handlePageItemMouseLeave:Z,cssVars:f?void 0:q,themeClass:X==null?void 0:X.themeClass,onRender:X==null?void 0:X.onRender}},render(){const{$slots:e,mergedClsPrefix:r,disabled:d,cssVars:f,mergedPage:u,mergedPageCount:w,pageItems:g,showFastBackward:s,showFastForward:R,showSizePicker:p,showQuickJumper:b,mergedTheme:M,locale:S,inputSize:P,selectSize:C,mergedPageSize:y,pageSizeOptions:$,jumperValue:O,prev:A,next:j,prefix:K,suffix:E,label:k,handleJumperInput:W,handleSizePickerChange:H,handleBackwardClick:V,handlePageItemClick:I,handlePageItemMouseEnter:ae,handlePageItemMouseLeave:de,handleForwardClick:ue,handleQuickJumperKeyUp:ne,onRender:ie}=this;ie==null||ie();const ee=e.prefix||K,le=e.suffix||E,G=A||e.prev,Z=j||e.next,J=k||e.label;return n("div",{ref:"selfRef",class:[`${r}-pagination`,this.themeClass,this.rtlEnabled&&`${r}-pagination--rtl`,d&&`${r}-pagination--disabled`],style:f},ee?n("div",{class:`${r}-pagination-prefix`},ee({page:u,pageSize:y,pageCount:w,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,n("div",{class:[`${r}-pagination-item`,!G&&`${r}-pagination-item--button`,(u<=1||u>w||d)&&`${r}-pagination-item--disabled`],onClick:V},G?G({page:u,pageSize:y,pageCount:w,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):n(Oe,{clsPrefix:r},{default:()=>this.rtlEnabled?n(ot,null):n(et,null)})),g.map((q,X)=>{let a;switch(q.type){case"page":const c=q.label;J?a=J({type:"page",node:c,active:q.active}):a=c;break;case"fast-forward":const L=R?n(Oe,{clsPrefix:r},{default:()=>this.rtlEnabled?n(tt,null):n(nt,null)}):n(Oe,{clsPrefix:r},{default:()=>n(rt,null)});J?a=J({type:"fast-forward",node:L,active:R}):a=L;break;case"fast-backward":const N=s?n(Oe,{clsPrefix:r},{default:()=>this.rtlEnabled?n(nt,null):n(tt,null)}):n(Oe,{clsPrefix:r},{default:()=>n(rt,null)});J?a=J({type:"fast-backward",node:N,active:s}):a=N;break}return n("div",{key:X,class:[`${r}-pagination-item`,{[`${r}-pagination-item--active`]:q.active,[`${r}-pagination-item--disabled`]:d}],onClick:()=>I(q),onMouseenter:()=>ae(q),onMouseleave:()=>de(q)},a)}),n("div",{class:[`${r}-pagination-item`,!Z&&`${r}-pagination-item--button`,{[`${r}-pagination-item--disabled`]:u<1||u>=w||d}],onClick:ue},Z?Z({page:u,pageSize:y,pageCount:w,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):n(Oe,{clsPrefix:r},{default:()=>this.rtlEnabled?n(et,null):n(ot,null)})),p?n(bn,{size:C,placeholder:"",options:$,value:y,disabled:d,theme:M.peers.Select,themeOverrides:M.peerOverrides.Select,onUpdateValue:H}):null,b?n("div",{class:`${r}-pagination-quick-jumper`},tn(this.$slots.goto,()=>[S.goto]),n(nn,{ref:"jumperRef",value:O,onUpdateValue:W,size:P,placeholder:"",disabled:d,theme:M.peers.Input,themeOverrides:M.peerOverrides.Input,onKeyup:ne})):null,le?n("div",{class:`${r}-pagination-suffix`},le({page:u,pageSize:y,pageCount:w,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}});export{Sn as _};
|