1526 lines
268 KiB
JavaScript
1526 lines
268 KiB
JavaScript
|
|
import{H as Ae,R as Qo,D as lt,E as yn,C as D,I as R,Z as Ze,p as pt,d as ve,h as s,aI as fn,aH as hn,aM as Bn,aN as da,aO as ca,U as Wt,aP as ua,aQ as er,B as se,aD as Nt,aF as et,P as Un,aR as An,aS as tr,r as fa,c as k,e as q,f as H,aa as _t,af as eo,S as zt,g as to,N as nt,n as ut,u as Ge,s as Te,a8 as fe,J as ft,l as Lt,aT as nr,aU as Ht,aV as no,T as wn,b as W,a as Ye,x as oo,W as yt,aW as Cn,aX as Sn,j as kt,aY as ha,aZ as Bt,a_ as St,a2 as At,a$ as va,o as Pe,b0 as ga,b1 as po,a1 as J,v as $t,b2 as ro,b3 as pa,b4 as bo,F as Et,b5 as ao,V as Tt,b6 as ba,b7 as ma,Y as bt,X as Ut,M as nn,G as jt,b8 as or,b9 as rr,Q as vn,aE as gn,ba as io,bb as ar,aG as xa,bc as ya,bd as mo,be as wa,bf as Ca,bg as Sa,bh as pn,y as ka,A as Ra,bi as xo,bj as Pa,K as za,bk as Fa,bl as Ma,q as Ta,bm as $a,m as Oa,bn as Be,a7 as ot,aA as _a,_ as Ia,bo as ir,bp as bn,bq as Ba,ae as yo,aL as Aa,br as Ea,bs as La,ag as mn,bt as Da,ab as lr,bu as Ha,bv as ja,bw as Na,bx as Va}from"./index-DnpM0Ntg.js";function Wa(e,t,n){var o;const r=Ae(e,null);if(r===null)return;const a=(o=Qo())===null||o===void 0?void 0:o.proxy;lt(n,l),l(n.value),yn(()=>{l(void 0,n.value)});function l(c,u){if(!r)return;const h=r[t];u!==void 0&&i(h,u),c!==void 0&&d(h,c)}function i(c,u){c[u]||(c[u]=[]),c[u].splice(c[u].findIndex(h=>h===a),1)}function d(c,u){c[u]||(c[u]=[]),~c[u].findIndex(h=>h===a)||c[u].push(a)}}function wo(e){return e&-e}class sr{constructor(t,n){this.l=t,this.min=n;const o=new Array(t+1);for(let r=0;r<t+1;++r)o[r]=0;this.ft=o}add(t,n){if(n===0)return;const{l:o,ft:r}=this;for(t+=1;t<=o;)r[t]+=n,t+=wo(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:o,l:r}=this;if(t>r)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let a=t*o;for(;t>0;)a+=n[t],t-=wo(t);return a}getBound(t){let n=0,o=this.l;for(;o>n;){const r=Math.floor((n+o)/2),a=this.sum(r);if(a>t){o=r;continue}else if(a<t){if(n===r)return this.sum(n+1)<=t?n+1:r;n=r}else return r}return n}}let ln;function Ua(){return typeof document>"u"?!1:(ln===void 0&&("matchMedia"in window?ln=window.matchMedia("(pointer:coarse)").matches:ln=!1),ln)}let En;function Co(){return typeof document>"u"?1:(En===void 0&&(En="chrome"in window?window.devicePixelRatio:1),En)}const dr="VVirtualListXScroll";function Ka({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const o=D(0),r=D(0),a=R(()=>{const c=e.value;if(c.length===0)return null;const u=new sr(c.length,0);return c.forEach((h,v)=>{u.add(v,h.width)}),u}),l=Ze(()=>{const c=a.value;return c!==null?Math.max(c.getBound(r.value)-1,0):0}),i=c=>{const u=a.value;return u!==null?u.sum(c):0},d=Ze(()=>{const c=a.value;return c!==null?Math.min(c.getBound(r.value+o.value)+1,e.value.length-1):0});return pt(dr,{startIndexRef:l,endIndexRef:d,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:i}),{listWidthRef:o,scrollLeftRef:r}}const So=ve({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:o,renderColRef:r,renderItemWithColsRef:a}=Ae(dr);return{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:a,getLeft:o}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:o,renderItemWithCols:r,getLeft:a,item:l}=this;if(r!=null)return r({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:l,getLeft:a});if(o!=null){const i=[];for(let d=e;d<=t;++d){const c=n[d];i.push(o({column:c,left:a(d),item:l}))}return i}return null}}),qa=Bn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Bn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Bn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),lo=ve({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibl
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
height: 1em;
|
|||
|
|
width: 1em;
|
|||
|
|
position: relative;
|
|||
|
|
`,[q(">",[H("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;
|
|||
|
|
`,[q("&:hover",`
|
|||
|
|
color: var(--n-clear-color-hover)!important;
|
|||
|
|
`),q("&:active",`
|
|||
|
|
color: var(--n-clear-color-pressed)!important;
|
|||
|
|
`)]),H("placeholder",`
|
|||
|
|
display: flex;
|
|||
|
|
`),H("clear, placeholder",`
|
|||
|
|
position: absolute;
|
|||
|
|
left: 50%;
|
|||
|
|
top: 50%;
|
|||
|
|
transform: translateX(-50%) translateY(-50%);
|
|||
|
|
`,[_t({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),Kn=ve({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return to("-base-clear",Li,se(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return s("div",{class:`${e}-base-clear`},s(eo,null,{default:()=>{var t,n;return this.show?s("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},zt(this.$slots.icon,()=>[s(nt,{clsPrefix:e},{default:()=>s(_i,null)})])):s("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),Di=ve({props:{onFocus:Function,onBlur:Function},setup(e){return()=>s("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),Hi={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function ji(e){const{textColorDisabled:t,iconColor:n,textColor2:o,fontSizeTiny:r,fontSizeSmall:a,fontSizeMedium:l,fontSizeLarge:i,fontSizeHuge:d}=e;return Object.assign(Object.assign({},Hi),{fontSizeTiny:r,fontSizeSmall:a,fontSizeMedium:l,fontSizeLarge:i,fontSizeHuge:d,textColor:t,iconColor:n,extraTextColor:o})}const so={name:"Empty",common:ut,self:ji},Ni=k("empty",`
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
align-items: center;
|
|||
|
|
font-size: var(--n-font-size);
|
|||
|
|
`,[H("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);
|
|||
|
|
`,[q("+",[H("description",`
|
|||
|
|
margin-top: 8px;
|
|||
|
|
`)])]),H("description",`
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
color: var(--n-text-color);
|
|||
|
|
`),H("extra",`
|
|||
|
|
text-align: center;
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
margin-top: 12px;
|
|||
|
|
color: var(--n-extra-text-color);
|
|||
|
|
`)]),Vi=Object.assign(Object.assign({},Te.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),fr=ve({name:"Empty",props:Vi,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:o}=Ge(e),r=Te("Empty","-empty",Ni,so,e,t),{localeRef:a}=rn("Empty"),l=R(()=>{var u,h,v;return(u=e.description)!==null&&u!==void 0?u:(v=(h=o==null?void 0:o.value)===null||h===void 0?void 0:h.Empty)===null||v===void 0?void 0:v.description}),i=R(()=>{var u,h;return((h=(u=o==null?void 0:o.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>s(Ii,null))}),d=R(()=>{const{size:u}=e,{common:{cubicBezierEaseInOut:h},self:{[fe("iconSize",u)]:v,[fe("fontSize",u)]:g,textColor:f,iconColor:p,extraTextColor:b}}=r.value;return{"--n-icon-size":v,"--n-font-size":g,"--n-bezier":h,"--n-text-color":f,"--n-icon-color":p,"--n-extra-text-color":b}}),c=n?ft("empty",R(()=>{let u="";const{size:h}=e;return u+=h[0],u}),d,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:i,localizedDescription:R(()=>l.value||a.value.description),cssVars:n?void 0:d,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),s("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?s("div",{class:`${t}-empty__icon`},e.icon?e.icon():s(nt,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?s("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?s("div",{class:`${t}-empty__extra`},e.extra()):null)}}),Wi={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Ui(e){const{borderRadius:t,popoverColor:n,textColor3:o,dividerColor:r,textColor2:a,primaryColorPressed:l,textColorDisabled:i,primaryColor:d,opacityDisabled:c,hoverColor:u,fontSizeTiny:h,fontSizeSmall:v,fontSizeMedium:g,fontSizeLarge:f,fontSizeHuge:p,heightTiny:b,heightSmall:m,heightMedium:y,heightLarge:C,heightHuge:T}=e;return Object.assign(Object.assign({},Wi),{optionFontSizeTiny:h,optionFontSizeSmall:v,optionFontSizeMedium:g,optionFontSizeLarge:f,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:m,optionHeightMedium:y,optionHeightLarge:C,optionHeightHuge:T,borderRadius:t,color:n,groupHeaderTextColor:o,actionDividerColor:r,optionTextColor:a,optionTextColorPressed:l,optionTextColorDisabled:i,optionTextColorActive:d,optionOpacityDisabled:c,optionCheckColor:d,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:a,loadingColor:d})}const co=Lt({name:"InternalSelectMenu",common:ut,peers:{Scrollbar:nr,Empty:so},self:Ui}),$o=ve({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:o}=Ae(no);return{labelField:n,nodeProps:o,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:o,tmNode:{rawNode:r}}=this,a=o==null?void 0:o(r),l=t?t(r,!1):Ht(r[this.labelField],r,!1),i=s("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),l);return r.render?r.render({node:i,option:r}):n?n({node:i,option:r,selected:!1}):i}});function Ki(e,t){return s(wn,{name:"fade-in-scale-up-transition"},{default:()=>e?s(nt,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>s(Oi)}):null})}const Oo=ve({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:o,valueSetRef:r,renderLabelRef:a,renderOptionRef:l,labelFieldRef:i,valueFieldRef:d,showCheckmarkRef:c,nodePropsRef:u,handleOptio
|
|||
|
|
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);
|
|||
|
|
`,[k("scrollbar",`
|
|||
|
|
max-height: var(--n-height);
|
|||
|
|
`),k("virtual-list",`
|
|||
|
|
max-height: var(--n-height);
|
|||
|
|
`),k("base-select-option",`
|
|||
|
|
min-height: var(--n-option-height);
|
|||
|
|
font-size: var(--n-option-font-size);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
`,[H("content",`
|
|||
|
|
z-index: 1;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
overflow: hidden;
|
|||
|
|
`)]),k("base-select-group-header",`
|
|||
|
|
min-height: var(--n-option-height);
|
|||
|
|
font-size: .93em;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
`),k("base-select-menu-option-wrapper",`
|
|||
|
|
position: relative;
|
|||
|
|
width: 100%;
|
|||
|
|
`),H("loading, empty",`
|
|||
|
|
display: flex;
|
|||
|
|
padding: 12px 32px;
|
|||
|
|
flex: 1;
|
|||
|
|
justify-content: center;
|
|||
|
|
`),H("loading",`
|
|||
|
|
color: var(--n-loading-color);
|
|||
|
|
font-size: var(--n-loading-size);
|
|||
|
|
`),H("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);
|
|||
|
|
`),H("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);
|
|||
|
|
`),k("base-select-group-header",`
|
|||
|
|
position: relative;
|
|||
|
|
cursor: default;
|
|||
|
|
padding: var(--n-option-padding);
|
|||
|
|
color: var(--n-group-header-text-color);
|
|||
|
|
`),k("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;
|
|||
|
|
`,[W("show-checkmark",`
|
|||
|
|
padding-right: calc(var(--n-option-padding-right) + 20px);
|
|||
|
|
`),q("&::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);
|
|||
|
|
`),q("&:active",`
|
|||
|
|
color: var(--n-option-text-color-pressed);
|
|||
|
|
`),W("grouped",`
|
|||
|
|
padding-left: calc(var(--n-option-padding-left) * 1.5);
|
|||
|
|
`),W("pending",[q("&::before",`
|
|||
|
|
background-color: var(--n-option-color-pending);
|
|||
|
|
`)]),W("selected",`
|
|||
|
|
color: var(--n-option-text-color-active);
|
|||
|
|
`,[q("&::before",`
|
|||
|
|
background-color: var(--n-option-color-active);
|
|||
|
|
`),W("pending",[q("&::before",`
|
|||
|
|
background-color: var(--n-option-color-active-pending);
|
|||
|
|
`)])]),W("disabled",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
`,[Ye("selected",`
|
|||
|
|
color: var(--n-option-text-color-disabled);
|
|||
|
|
`),W("selected",`
|
|||
|
|
opacity: var(--n-option-opacity-disabled);
|
|||
|
|
`)]),H("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);
|
|||
|
|
`,[oo({enterScale:"0.5"})])])]),hr=ve({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Te.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:t,mergedRtlRef:n}=Ge(e),o=kt("InternalSelectMenu",n,t),r=Te("InternalSelectMenu","-internal-select-menu",qi,co,e,se(e,"clsPrefix")),a=D(null),l=D(null),i=D(null),d=R(()=>e.treeMate.getFlattenedNodes()),c=R(()=>ha(d.value)),u=D(null);function h(){const{treeMate:S}=e;let M=null;const{value:j}=e;j===null?M=S.getFirstAvailableNode():(e.multiple?M=S.getNode((j||[])[(j||[]).length-1]):M=S.getNode(j),(!M||M.disabled)&&(M=S.getFirstAvailableNode())),$(M||null)}function v(){const{value:S}=u;S&&!e.treeMate.getNode(S.key)&&(u.value=null)}let g;lt(()=>e.show,S=>{S?g=lt(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?h():v(),At(V)):v()},{immediate:!0}):g==null||g()},{immediate:!0}),yn(()=>{g==null||g()});const f=R(()=>Nt(r.value.self[fe("optionHeight",e.size)])),p=R(()=>Bt(r.value.self[fe("padding",e.size)])),b=R(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),m=R(()=>{const S=d.value;return S&&S.length===0});function y(S){const{onToggle:M}=e;M&&M(S)}function C(S){const{onScroll:M}=e;M&&M(S)}function T(S){var M;(M=i.value)===null||M===void 0||M.sync(),C(S)}function F(){var S;(S=i.value)===null||S===void 0||S.sync()}function z(){const{value:S}=u;return S||null}function N(S,M){M.disabled||$(M,!1)}function X(S,M){M.disabled||y(M)}function _(S){var M;St(S,"action")||(M=e.onKeyup)===null||M===void 0||M.call(e,S)}function A(S){var M;St(S,"action")||(M=e.onKeydown)===null||M===void 0||M.call(e,S)}function Z(S){var M;(M=e.onMousedown)===null||M===void 0||M.call(e,S),!e.focusable&&S.preventDefault()}function B(){const{value:S}=u;S&&$(S.getNext({loop:!0}),!0)}function P(){const{value:S}=u;S&&$(S.getPrev({loop:!0}),!0)}function $(S,M=!1){u.value=S,M&&V()}function V(){var S,M;const j=u.value;if(!j)return;const ee=c.value(j.key);ee!==null&&(e.virtualScroll?(S=l.value)===null||S===void 0||S.scrollTo({index:ee}):(M=i.value)===null||M===void 0||M.scrollTo({index:ee,elSize:f.value}))}function K(S){var M,j;!((M=a.value)===null||M===void 0)&&M.contains(S.target)&&((j=e.onFocus)===null||j===void 0||j.call(e,S))}function G(S){var M,j;!((M=a.value)===null||M===void 0)&&M.contains(S.relatedTarget)||(j=e.onBlur)===null||j===void 0||j.call(e,S)}pt(no,{handleOptionMouseEnter:N,handleOptionClick:X,valueSetRef:b,pendingTmNodeRef:u,nodePropsRef:se(e,"nodeProps"),showCheckmarkRef:se(e,"showCheckmark"),multipleRef:se(e,"multiple"),valueRef:se(e,"value"),renderLabelRef:se(e,"renderLabel"),renderOptionRef:se(e,"renderOption"),labelFieldRef:se(e,"labelField"),valueFieldRef:se(e,"valueField")}),pt(va,a),Wt(()=>{const{value:S}=i;S&&S.sync()});const Y=R(()=>{const{size:S}=e,{common:{cubicBezierEaseInOut:M},self:{height:j,borderRadius:ee,color:be,groupHeaderTextColor:ye,actionDividerColor:me,optionTextColorPressed:E,optionTextColor:ne,optionTextColorDisabled:we,optionTextColorActive:ce,optionOpacityDisabled:Ce,optionCheckColor:xe,actionTextColor:Ue,optionColorPending:Ne,optionColorActive:Ke,loadingColor:qe,loadingSize:ue,optionColorActivePending:Se,[fe("optionFontSize",S)]:Ee,[fe("optionHeight",S)]:_e,[fe("optionPadding",S)]:Ie}}=r.value;return{"--n-height":j,"--n-action-divider-color":me,"--n-action-text
|
|||
|
|
--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);
|
|||
|
|
`,[W("strong",`
|
|||
|
|
font-weight: var(--n-font-weight-strong);
|
|||
|
|
`),H("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);
|
|||
|
|
`),H("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);
|
|||
|
|
`),H("avatar",`
|
|||
|
|
display: flex;
|
|||
|
|
margin: 0 6px 0 0;
|
|||
|
|
`),H("close",`
|
|||
|
|
margin: var(--n-close-margin);
|
|||
|
|
transition:
|
|||
|
|
background-color .3s var(--n-bezier),
|
|||
|
|
color .3s var(--n-bezier);
|
|||
|
|
`),W("round",`
|
|||
|
|
padding: 0 calc(var(--n-height) / 3);
|
|||
|
|
border-radius: calc(var(--n-height) / 2);
|
|||
|
|
`,[H("icon",`
|
|||
|
|
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
|
|||
|
|
`),H("avatar",`
|
|||
|
|
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
|
|||
|
|
`),W("closable",`
|
|||
|
|
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
|
|||
|
|
`)]),W("icon, avatar",[W("round",`
|
|||
|
|
padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
|
|||
|
|
`)]),W("disabled",`
|
|||
|
|
cursor: not-allowed !important;
|
|||
|
|
opacity: var(--n-opacity-disabled);
|
|||
|
|
`),W("checkable",`
|
|||
|
|
cursor: pointer;
|
|||
|
|
box-shadow: none;
|
|||
|
|
color: var(--n-text-color-checkable);
|
|||
|
|
background-color: var(--n-color-checkable);
|
|||
|
|
`,[Ye("disabled",[q("&:hover","background-color: var(--n-color-hover-checkable);",[Ye("checked","color: var(--n-text-color-hover-checkable);")]),q("&:active","background-color: var(--n-color-pressed-checkable);",[Ye("checked","color: var(--n-text-color-pressed-checkable);")])]),W("checked",`
|
|||
|
|
color: var(--n-text-color-checked);
|
|||
|
|
background-color: var(--n-color-checked);
|
|||
|
|
`,[Ye("disabled",[q("&:hover","background-color: var(--n-color-checked-hover);"),q("&:active","background-color: var(--n-color-checked-pressed);")])])])]),Qi=Object.assign(Object.assign(Object.assign({},Te.props),Zi),{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}),el=$t("n-tag"),Dn=ve({name:"Tag",props:Qi,slots:Object,setup(e){const t=D(null),{mergedBorderedRef:n,mergedClsPrefixRef:o,inlineThemeDisabled:r,mergedRtlRef:a}=Ge(e),l=Te("Tag","-tag",Ji,Yi,e,o);pt(el,{roundRef:se(e,"round")});function i(){if(!e.disabled&&e.checkable){const{checked:g,onCheckedChange:f,onUpdateChecked:p,"onUpdate:checked":b}=e;p&&p(!g),b&&b(!g),f&&f(!g)}}function d(g){if(e.triggerClickOnClose||g.stopPropagation(),!e.disabled){const{onClose:f}=e;f&&J(f,g)}}const c={setTextContent(g){const{value:f}=t;f&&(f.textContent=g)}},u=kt("Tag",a,o),h=R(()=>{const{type:g,size:f,color:{color:p,textColor:b}={}}=e,{common:{cubicBezierEaseInOut:m},self:{padding:y,closeMargin:C,borderRadius:T,opacityDisabled:F,textColorCheckable:z,textColorHoverCheckable:N,textColorPressedCheckable:X,textColorChecked:_,colorCheckable:A,colorHoverCheckable:Z,colorPressedCheckable:B,colorChecked:P,colorCheckedHover:$,colorCheckedPressed:V,closeBorderRadius:K,fontWeightStrong:G,[fe("colorBordered",g)]:Y,[fe("closeSize",f)]:oe,[fe("closeIconSize",f)]:Q,[fe("fontSize",f)]:I,[fe("height",f)]:S,[fe("color",g)]:M,[fe("textColor",g)]:j,[fe("border",g)]:ee,[fe("closeIconColor",g)]:be,[fe("closeIconColorHover",g)]:ye,[fe("closeIconColorPressed",g)]:me,[fe("closeColorHover",g)]:E,[fe("closeColorPressed",g)]:ne}}=l.value,we=Bt(C);return{"--n-font-weight-strong":G,"--n-avatar-size-override":`calc(${S} - 8px)`,"--n-bezier":m,"--n-border-radius":T,"--n-border":ee,"--n-close-icon-size":Q,"--n-close-color-pressed":ne,"--n-close-color-hover":E,"--n-close-border-radius":K,"--n-close-icon-color":be,"--n-close-icon-color-hover":ye,"--n-close-icon-color-pressed":me,"--n-close-icon-color-disabled":be,"--n-close-margin-top":we.top,"--n-close-margin-right":we.right,"--n-close-margin-bottom":we.bottom,"--n-close-margin-left":we.left,"--n-close-size":oe,"--n-color":p||(n.value?Y:M),"--n-color-checkable":A,"--n-color-checked":P,"--n-color-checked-hover":$,"--n-color-checked-pressed":V,"--n-color-hover-checkable":Z,"--n-color-pressed-checkable":B,"--n-font-size":I,"--n-height":S,"--n-opacity-disabled":F,"--n-padding":y,"--n-text-color":b||j,"--n-text-color-checkable":z,"--n-text-color-checked":_,"--n-text-color-hover-checkable":N,"--n-text-color-pressed-checkable":X}}),v=r?ft("tag",R(()=>{let g="";const{type:f,size:p,color:{color:b,textColor:m}={}}=e;return g+=f[0],g+=p[0],b&&(g+=`a${po(b)}`),m&&(g+=`b${po(m)}`),n.value&&(g+="c"),g}),h,e):void 0;return Object.assign(Object.assign({},c),{rtlEnabled:u,mergedClsPrefix:o,contentRef:t,mergedBordered:n,handleClick:i,handleCloseClick:d,cssVars:r?void 0:h,themeClass:v==null?void 0:v.themeClass,onRender:v==null?void 0:v.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:o,closable:r,color:{borderColor:a}={},round:l,onRender:i,$slots:d}=this;i==null||i();const c=yt(d.avatar,h=>h&&s("div",{class:`${n}-tag__avatar`},h)),u=yt(d.icon,h=>h&&s("div",{class:`${n}-tag__icon`},h));return s("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:o,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:l,[`${n}-tag--avatar`]:c,[`${n}-tag--icon`]:u,[`${n}-tag--closable`]:r}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||c,s("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&r?s(ga,{c
|
|||
|
|
--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);
|
|||
|
|
`,[k("base-loading",`
|
|||
|
|
color: var(--n-loading-color);
|
|||
|
|
`),k("base-selection-tags","min-height: var(--n-height);"),H("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);
|
|||
|
|
`),H("state-border",`
|
|||
|
|
z-index: 1;
|
|||
|
|
border-color: #0000;
|
|||
|
|
`),k("base-suffix",`
|
|||
|
|
cursor: pointer;
|
|||
|
|
position: absolute;
|
|||
|
|
top: 50%;
|
|||
|
|
transform: translateY(-50%);
|
|||
|
|
right: 10px;
|
|||
|
|
`,[H("arrow",`
|
|||
|
|
font-size: var(--n-arrow-size);
|
|||
|
|
color: var(--n-arrow-color);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
`)]),k("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);
|
|||
|
|
`,[H("wrapper",`
|
|||
|
|
flex-basis: 0;
|
|||
|
|
flex-grow: 1;
|
|||
|
|
overflow: hidden;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
`)]),k("base-selection-placeholder",`
|
|||
|
|
color: var(--n-placeholder-color);
|
|||
|
|
`,[H("inner",`
|
|||
|
|
max-width: 100%;
|
|||
|
|
overflow: hidden;
|
|||
|
|
`)]),k("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);
|
|||
|
|
`),k("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;
|
|||
|
|
`,[k("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);
|
|||
|
|
`,[H("content",`
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
overflow: hidden;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
`)]),H("render-label",`
|
|||
|
|
color: var(--n-text-color);
|
|||
|
|
`)]),Ye("disabled",[q("&:hover",[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-hover);
|
|||
|
|
border: var(--n-border-hover);
|
|||
|
|
`)]),W("focus",[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-focus);
|
|||
|
|
border: var(--n-border-focus);
|
|||
|
|
`)]),W("active",[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-active);
|
|||
|
|
border: var(--n-border-active);
|
|||
|
|
`),k("base-selection-label","background-color: var(--n-color-active);"),k("base-selection-tags","background-color: var(--n-color-active);")])]),W("disabled","cursor: not-allowed;",[H("arrow",`
|
|||
|
|
color: var(--n-arrow-color-disabled);
|
|||
|
|
`),k("base-selection-label",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
background-color: var(--n-color-disabled);
|
|||
|
|
`,[k("base-selection-input",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
color: var(--n-text-color-disabled);
|
|||
|
|
`),H("render-label",`
|
|||
|
|
color: var(--n-text-color-disabled);
|
|||
|
|
`)]),k("base-selection-tags",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
background-color: var(--n-color-disabled);
|
|||
|
|
`),k("base-selection-placeholder",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
color: var(--n-placeholder-color-disabled);
|
|||
|
|
`)]),k("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;
|
|||
|
|
`,[H("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);
|
|||
|
|
`),H("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=>W(`${e}-status`,[H("state-border",`border: var(--n-border-${e});`),Ye("disabled",[q("&:hover",[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-hover-${e});
|
|||
|
|
border: var(--n-border-hover-${e});
|
|||
|
|
`)]),W("active",[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-active-${e});
|
|||
|
|
border: var(--n-border-active-${e});
|
|||
|
|
`),k("base-selection-label",`background-color: var(--n-color-active-${e});`),k("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),W("focus",[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|||
|
|
border: var(--n-border-focus-${e});
|
|||
|
|
`)])])]))]),k("base-selection-popover",`
|
|||
|
|
margin-bottom: -3px;
|
|||
|
|
display: flex;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
margin-right: -8px;
|
|||
|
|
`),k("base-selection-tag-wrapper",`
|
|||
|
|
max-width: 100%;
|
|||
|
|
display: inline-flex;
|
|||
|
|
padding: 0 7px 3px 0;
|
|||
|
|
`,[q("&:last-child","padding-right: 0;"),k("tag",`
|
|||
|
|
font-size: 14px;
|
|||
|
|
max-width: 100%;
|
|||
|
|
`,[H("content",`
|
|||
|
|
line-height: 1.25;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
overflow: hidden;
|
|||
|
|
`)])])]),rl=ve({name:"InternalSelection",props:Object.assign(Object.assign({},Te.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:t,mergedRtlRef:n}=Ge(e),o=kt("InternalSelection",n,t),r=D(null),a=D(null),l=D(null),i=D(null),d=D(null),c=D(null),u=D(null),h=D(null),v=D(null),g=D(null),f=D(!1),p=D(!1),b=D(!1),m=Te("InternalSelection","-internal-selection",ol,gr,e,se(e,"clsPrefix")),y=R(()=>e.clearable&&!e.disabled&&(b.value||e.active)),C=R(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Ht(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),T=R(()=>{const U=e.selectedOption;if(U)return U[e.labelField]}),F=R(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function z(){var U;const{value:ae}=r;if(ae){const{value:ke}=a;ke&&(ke.style.width=`${ae.offsetWidth}px`,e.maxTagCount!=="responsive"&&((U=v.value)===null||U===void 0||U.sync({showAllItemsBeforeCalculate:!1})))}}function N(){const{value:U}=g;U&&(U.style.display="none")}function X(){const{value:U}=g;U&&(U.style.display="inline-block")}lt(se(e,"active"),U=>{U||N()}),lt(se(e,"pattern"),()=>{e.multiple&&At(z)});function _(U){const{onFocus:ae}=e;ae&&ae(U)}function A(U){const{onBlur:ae}=e;ae&&ae(U)}function Z(U){const{onDeleteOption:ae}=e;ae&&ae(U)}function B(U){const{onClear:ae}=e;ae&&ae(U)}function P(U){const{onPatternInput:ae}=e;ae&&ae(U)}function $(U){var ae;(!U.relatedTarget||!(!((ae=l.value)===null||ae===void 0)&&ae.contains(U.relatedTarget)))&&_(U)}function V(U){var ae;!((ae=l.value)===null||ae===void 0)&&ae.contains(U.relatedTarget)||A(U)}function K(U){B(U)}function G(){b.value=!0}function Y(){b.value=!1}function oe(U){!e.active||!e.filterable||U.target!==a.value&&U.preventDefault()}function Q(U){Z(U)}const I=D(!1);function S(U){if(U.key==="Backspace"&&!I.value&&!e.pattern.length){const{selectedOptions:ae}=e;ae!=null&&ae.length&&Q(ae[ae.length-1])}}let M=null;function j(U){const{value:ae}=r;if(ae){const ke=U.target.value;ae.textContent=ke,z()}e.ignoreComposition&&I.value?M=U:P(U)}function ee(){I.value=!0}function be(){I.value=!1,e.ignoreComposition&&P(M),M=null}function ye(U){var ae;p.value=!0,(ae=e.onPatternFocus)===null||ae===void 0||ae.call(e,U)}function me(U){var ae;p.value=!1,(ae=e.onPatternBlur)===null||ae===void 0||ae.call(e,U)}function E(){var U,ae;if(e.filterable)p.value=!1,(U=c.value)===null||U===void 0||U.blur(),(ae=a.value)===null||ae===void 0||ae.blur();else if(e.multiple){const{value:ke}=i;ke==null||ke.blur()}else{const{value:ke}=d;ke==null||ke.blur()}}function ne(){var U,ae,ke;e.filterable?(p.value=!1,(U=c.value)===null||U===void 0||U.focus()):e.multiple?(ae=i.value)===null||ae===void 0||ae.focus():(ke=d.value)===null||ke===void 0||ke.focus()}function we(){const{value:U}=a;U&&(X(),U.focus())}function ce(){const{value:U}=a;U&&U.blur()}function Ce(U){const{value:ae}=u;ae&&ae.setTextContent(`+${U}`)}function xe(){const{value:U}=h;return U}function Ue(){return a.value}let Ne=null;function Ke(){Ne!==null&&window.clearTimeout(Ne)}function qe(){e.active||(Ke(),Ne=window.setTimeout(()=>{F.value&&(f.value=!0)},100))}function
|
|||
|
|
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);
|
|||
|
|
font-weight: var(--n-font-weight);
|
|||
|
|
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
|
|||
|
|
`,[H("input, textarea",`
|
|||
|
|
overflow: hidden;
|
|||
|
|
flex-grow: 1;
|
|||
|
|
position: relative;
|
|||
|
|
`),H("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);
|
|||
|
|
`),H("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;
|
|||
|
|
`,[q("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
|
|||
|
|
width: 0;
|
|||
|
|
height: 0;
|
|||
|
|
display: none;
|
|||
|
|
`),q("&::placeholder",`
|
|||
|
|
color: #0000;
|
|||
|
|
-webkit-text-fill-color: transparent !important;
|
|||
|
|
`),q("&:-webkit-autofill ~",[H("placeholder","display: none;")])]),W("round",[Ye("textarea","border-radius: calc(var(--n-height) / 2);")]),H("placeholder",`
|
|||
|
|
pointer-events: none;
|
|||
|
|
position: absolute;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
overflow: hidden;
|
|||
|
|
color: var(--n-placeholder-color);
|
|||
|
|
`,[q("span",`
|
|||
|
|
width: 100%;
|
|||
|
|
display: inline-block;
|
|||
|
|
`)]),W("textarea",[H("placeholder","overflow: visible;")]),Ye("autosize","width: 100%;"),W("autosize",[H("textarea-el, input-el",`
|
|||
|
|
position: absolute;
|
|||
|
|
top: 0;
|
|||
|
|
left: 0;
|
|||
|
|
height: 100%;
|
|||
|
|
`)]),k("input-wrapper",`
|
|||
|
|
overflow: hidden;
|
|||
|
|
display: inline-flex;
|
|||
|
|
flex-grow: 1;
|
|||
|
|
position: relative;
|
|||
|
|
padding-left: var(--n-padding-left);
|
|||
|
|
padding-right: var(--n-padding-right);
|
|||
|
|
`),H("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;
|
|||
|
|
`),H("input-el",`
|
|||
|
|
padding: 0;
|
|||
|
|
height: var(--n-height);
|
|||
|
|
line-height: var(--n-height);
|
|||
|
|
`,[q("&[type=password]::-ms-reveal","display: none;"),q("+",[H("placeholder",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
`)])]),Ye("textarea",[H("placeholder","white-space: nowrap;")]),H("eye",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
`),W("textarea","width: 100%;",[k("input-word-count",`
|
|||
|
|
position: absolute;
|
|||
|
|
right: var(--n-padding-right);
|
|||
|
|
bottom: var(--n-padding-vertical);
|
|||
|
|
`),W("resizable",[k("input-wrapper",`
|
|||
|
|
resize: vertical;
|
|||
|
|
min-height: var(--n-height);
|
|||
|
|
`)]),H("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);
|
|||
|
|
`),H("textarea-mirror",`
|
|||
|
|
width: 100%;
|
|||
|
|
pointer-events: none;
|
|||
|
|
overflow: hidden;
|
|||
|
|
visibility: hidden;
|
|||
|
|
position: static;
|
|||
|
|
white-space: pre-wrap;
|
|||
|
|
overflow-wrap: break-word;
|
|||
|
|
`)]),W("pair",[H("input-el, placeholder","text-align: center;"),H("separator",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
color: var(--n-text-color);
|
|||
|
|
white-space: nowrap;
|
|||
|
|
`,[k("icon",`
|
|||
|
|
color: var(--n-icon-color);
|
|||
|
|
`),k("base-icon",`
|
|||
|
|
color: var(--n-icon-color);
|
|||
|
|
`)])]),W("disabled",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
background-color: var(--n-color-disabled);
|
|||
|
|
`,[H("border","border: var(--n-border-disabled);"),H("input-el, textarea-el",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
color: var(--n-text-color-disabled);
|
|||
|
|
text-decoration-color: var(--n-text-color-disabled);
|
|||
|
|
`),H("placeholder","color: var(--n-placeholder-color-disabled);"),H("separator","color: var(--n-text-color-disabled);",[k("icon",`
|
|||
|
|
color: var(--n-icon-color-disabled);
|
|||
|
|
`),k("base-icon",`
|
|||
|
|
color: var(--n-icon-color-disabled);
|
|||
|
|
`)]),k("input-word-count",`
|
|||
|
|
color: var(--n-count-text-color-disabled);
|
|||
|
|
`),H("suffix, prefix","color: var(--n-text-color-disabled);",[k("icon",`
|
|||
|
|
color: var(--n-icon-color-disabled);
|
|||
|
|
`),k("internal-icon",`
|
|||
|
|
color: var(--n-icon-color-disabled);
|
|||
|
|
`)])]),Ye("disabled",[H("eye",`
|
|||
|
|
color: var(--n-icon-color);
|
|||
|
|
cursor: pointer;
|
|||
|
|
`,[q("&:hover",`
|
|||
|
|
color: var(--n-icon-color-hover);
|
|||
|
|
`),q("&:active",`
|
|||
|
|
color: var(--n-icon-color-pressed);
|
|||
|
|
`)]),q("&:hover",[H("state-border","border: var(--n-border-hover);")]),W("focus","background-color: var(--n-color-focus);",[H("state-border",`
|
|||
|
|
border: var(--n-border-focus);
|
|||
|
|
box-shadow: var(--n-box-shadow-focus);
|
|||
|
|
`)])]),H("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);
|
|||
|
|
`),H("state-border",`
|
|||
|
|
border-color: #0000;
|
|||
|
|
z-index: 1;
|
|||
|
|
`),H("prefix","margin-right: 4px;"),H("suffix",`
|
|||
|
|
margin-left: 4px;
|
|||
|
|
`),H("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);
|
|||
|
|
`,[k("base-loading",`
|
|||
|
|
font-size: var(--n-icon-size);
|
|||
|
|
margin: 0 2px;
|
|||
|
|
color: var(--n-loading-color);
|
|||
|
|
`),k("base-clear",`
|
|||
|
|
font-size: var(--n-icon-size);
|
|||
|
|
`,[H("placeholder",[k("base-icon",`
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
color: var(--n-icon-color);
|
|||
|
|
font-size: var(--n-icon-size);
|
|||
|
|
`)])]),q(">",[k("icon",`
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
color: var(--n-icon-color);
|
|||
|
|
font-size: var(--n-icon-size);
|
|||
|
|
`)]),k("base-icon",`
|
|||
|
|
font-size: var(--n-icon-size);
|
|||
|
|
`)]),k("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=>W(`${e}-status`,[Ye("disabled",[k("base-loading",`
|
|||
|
|
color: var(--n-loading-color-${e})
|
|||
|
|
`),H("input-el, textarea-el",`
|
|||
|
|
caret-color: var(--n-caret-color-${e});
|
|||
|
|
`),H("state-border",`
|
|||
|
|
border: var(--n-border-${e});
|
|||
|
|
`),q("&:hover",[H("state-border",`
|
|||
|
|
border: var(--n-border-hover-${e});
|
|||
|
|
`)]),q("&:focus",`
|
|||
|
|
background-color: var(--n-color-focus-${e});
|
|||
|
|
`,[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|||
|
|
border: var(--n-border-focus-${e});
|
|||
|
|
`)]),W("focus",`
|
|||
|
|
background-color: var(--n-color-focus-${e});
|
|||
|
|
`,[H("state-border",`
|
|||
|
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|||
|
|
border: var(--n-border-focus-${e});
|
|||
|
|
`)])])]))]),sl=k("input",[W("disabled",[H("input-el, textarea-el",`
|
|||
|
|
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|||
|
|
`)])]);function dl(e){let t=0;for(const n of e)t++;return t}function sn(e){return e===""||e==null}function cl(e){const t=D(null);function n(){const{value:a}=e;if(!(a!=null&&a.focus)){r();return}const{selectionStart:l,selectionEnd:i,value:d}=a;if(l==null||i==null){r();return}t.value={start:l,end:i,beforeText:d.slice(0,l),afterText:d.slice(i)}}function o(){var a;const{value:l}=t,{value:i}=e;if(!l||!i)return;const{value:d}=i,{start:c,beforeText:u,afterText:h}=l;let v=d.length;if(d.endsWith(h))v=d.length-h.length;else if(d.startsWith(u))v=u.length;else{const g=u[c-1],f=d.indexOf(g,c-1);f!==-1&&(v=f+1)}(a=i.setSelectionRange)===null||a===void 0||a.call(i,v,v)}function r(){t.value=null}return lt(e,r),{recordCursor:n,restoreCursor:o}}const _o=ve({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:n,maxlengthRef:o,mergedClsPrefixRef:r,countGraphemesRef:a}=Ae(br),l=R(()=>{const{value:i}=n;return i===null||Array.isArray(i)?0:(a.value||dl)(i)});return()=>{const{value:i}=o,{value:d}=n;return s("span",{class:`${r.value}-input-word-count`},ba(t.default,{value:d===null||Array.isArray(d)?"":d},()=>[i===void 0?l.value:`${l.value} / ${i}`]))}}}),ul=Object.assign(Object.assign({},Te.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}),Io=ve({name:"Input",props:ul,slots:Object,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:o,mergedRtlRef:r}=Ge(e),a=Te("Input","-input",ll,pr,e,t);ma&&to("-input-safari",sl,t);const l=D(null),i=D(null),d=D(null),c=D(null),u=D(null),h=D(null),v=D(null),g=cl(v),f=D(null),{localeRef:p}=rn("Input"),b=D(e.defaultValue),m=se(e,"value"),y=bt(m,b),C=Ut(e),{mergedSizeRef:T,mergedDisabledRef:F,mergedStatusRef:z}=C,N=D(!1),X=D(!1),_=D(!1),A=D(!1);let Z=null;const B=R(()=>{const{placeholder:x,pair:L}=e;return L?Array.isArray(x)?x:x===void 0?["",""]:[x,x]:x===void 0?[p.value.placeholder]:[x]}),P=R(()=>{const{value:x}=_,{value:L}=y,{value:de}=B;return!x&&(sn(L)||Array.isArray(L)&&sn(L[0]))&&de[0]}),$=R(()=>{const{value:x}=_,{value:L}=y,{value:de}=B;return!x&&de[1]&&(sn(L)||Array.isArray(L)&&sn(L[1]))}),V=Ze(()=>e.internalForceFocus||N.value),K=Ze(()=>{if(F.value||e.readonly||!e.clearable||!V.value&&!X.value)return!1;const{value:x}=y,{value:L}=V;return e.pair?!!(Array.isArray(x)&&(x[0]||x[1]))&&(X.value||L):!!x&&(X.value||L)}),G=R(()=>{const{showPasswordOn:x}=e;if(x)return x;if(e.showPasswordToggle)return"click"}),Y=D(!1),oe=R(()=>{const{textDecoration:x}=e;return x?Array.isArray(x)?x.map(L=>({textDecoration:L})):[{textDecoration:x}]:["",""]}),Q=D(void 0),I=()=>{var x,L;if(e.type==="textarea"){const{autosize:de}=e;if(de&&(Q.value=(L=(x=f.value)===null||x===void 0?void 0:x.$el)===null||L===void 0?void 0:L.offsetWidth),!i.value||typeof de
|
|||
|
|
`)}else{const{value:Oe}=c;Oe&&(x?Oe.textContent=x:Oe.innerHTML=" ")}}function Qe(){I()}const $e=D({top:"0"});function it(x){var L;const{scrollTop:de}=x.target;$e.value.top=`${-de}px`,(L=f.value)===null||L===void 0||L.syncUnifiedContainer()}let st=null;Tt(()=>{const{autosize:x,type:L}=e;x&&L==="textarea"?st=lt(y,de=>{!Array.isArray(de)&&de!==Z&&Ve(de)}):st==null||st()});let dt=null;Tt(()=>{e.type==="textarea"?dt=lt(y,x=>{var L;!Array.isArray(x)&&x!==Z&&((L=f.value)===null||L===void 0||L.syncUnifiedContainer())}):dt==null||dt()}),pt(br,{mergedValueRef:y,maxlengthRef:S,mergedClsPrefixRef:t,countGraphemesRef:se(e,"countGraphemes")});const ht={wrapperElRef:l,inputElRef:u,textareaElRef:i,isCompositing:_,clear:rt,focus:te,blur:ie,select:le,deactivate:pe,activate:ge,scrollTo:Fe},vt=kt("Input",r,t),Ct=R(()=>{const{value:x}=T,{common:{cubicBezierEaseInOut:L},self:{color:de,borderRadius:Re,textColor:Oe,caretColor:Me,caretColorError:De,caretColorWarning:We,textDecorationColor:mt,border:Rt,borderDisabled:Pt,borderHover:Ot,borderFocus:Kt,placeholderColor:qt,placeholderColorDisabled:Xt,lineHeightTextarea:Gt,colorDisabled:Yt,colorFocus:Ft,textColorDisabled:Mt,boxShadowFocus:kn,iconSize:Rn,colorFocusWarning:Pn,boxShadowFocusWarning:zn,borderWarning:Fn,borderFocusWarning:Mn,borderHoverWarning:Tn,colorFocusError:$n,boxShadowFocusError:On,borderError:_n,borderFocusError:In,borderHoverError:Nr,clearSize:Vr,clearColor:Wr,clearColorHover:Ur,clearColorPressed:Kr,iconColor:qr,iconColorDisabled:Xr,suffixTextColor:Gr,countTextColor:Yr,countTextColorDisabled:Zr,iconColorHover:Jr,iconColorPressed:Qr,loadingColor:ea,loadingColorError:ta,loadingColorWarning:na,fontWeight:oa,[fe("padding",x)]:ra,[fe("fontSize",x)]:aa,[fe("height",x)]:ia}}=a.value,{left:la,right:sa}=Bt(ra);return{"--n-bezier":L,"--n-count-text-color":Yr,"--n-count-text-color-disabled":Zr,"--n-color":de,"--n-font-size":aa,"--n-font-weight":oa,"--n-border-radius":Re,"--n-height":ia,"--n-padding-left":la,"--n-padding-right":sa,"--n-text-color":Oe,"--n-caret-color":Me,"--n-text-decoration-color":mt,"--n-border":Rt,"--n-border-disabled":Pt,"--n-border-hover":Ot,"--n-border-focus":Kt,"--n-placeholder-color":qt,"--n-placeholder-color-disabled":Xt,"--n-icon-size":Rn,"--n-line-height-textarea":Gt,"--n-color-disabled":Yt,"--n-color-focus":Ft,"--n-text-color-disabled":Mt,"--n-box-shadow-focus":kn,"--n-loading-color":ea,"--n-caret-color-warning":We,"--n-color-focus-warning":Pn,"--n-box-shadow-focus-warning":zn,"--n-border-warning":Fn,"--n-border-focus-warning":Mn,"--n-border-hover-warning":Tn,"--n-loading-color-warning":na,"--n-caret-color-error":De,"--n-color-focus-error":$n,"--n-box-shadow-focus-error":On,"--n-border-error":_n,"--n-border-focus-error":In,"--n-border-hover-error":Nr,"--n-loading-color-error":ta,"--n-clear-color":Wr,"--n-clear-size":Vr,"--n-clear-color-hover":Ur,"--n-clear-color-pressed":Kr,"--n-icon-color":qr,"--n-icon-color-hover":Jr,"--n-icon-color-pressed":Qr,"--n-icon-color-disabled":Xr,"--n-suffix-text-color":Gr}}),gt=o?ft("input",R(()=>{const{value:x}=T;return x[0]}),Ct,e):void 0;return Object.assign(Object.assign({},ht),{wrapperElRef:l,inputElRef:u,inputMirrorElRef:c,inputEl2Ref:h,textareaElRef:i,textareaMirrorElRef:d,textareaScrollbarInstRef:f,rtlEnabled:vt,uncontrolledValue:b,mergedValue:y,passwordVisible:Y,mergedPlaceholder:B,showPlaceholder1:P,showPlaceholder2:$,mergedFocus:V,isComposing:_,activated:A,showClearButton:K,mergedSize:T,mergedDisabled:F,textDecorationStyle:oe,mergedClsPrefix:t,mergedBordered:n,mergedShowPasswordOn:G,placeholderStyle:$e,mergedStatus:z,textAreaScrollContainerWidth:Q,handleTextAreaScroll:it,handleCompositionStart:Ne,handleCompositionEnd:Ke,handleInput:qe,handleInputBlur:Se,handleInputFocus:Ee,handleWrapperBlur:_e,handleWrapperFocus:Ie,handleMouseEnter:Xe,handleMouseLeave:je,handleMouseDown:at,handleChange:ae,handleClick:ke,handleClear:He,handlePasswordToggleClick:tt,handlePasswordToggleMousedown:Le,handleWrapperKeydown:he,handleWrapperKeyup:re,handleTextAreaMirrorResize:Qe,getTextareaScrollContainer:()=>i.value,mergedTheme:a,cssVars:o?voi
|
|||
|
|
font-size: var(--n-font-size);
|
|||
|
|
outline: none;
|
|||
|
|
cursor: pointer;
|
|||
|
|
display: inline-flex;
|
|||
|
|
flex-wrap: nowrap;
|
|||
|
|
align-items: flex-start;
|
|||
|
|
word-break: break-word;
|
|||
|
|
line-height: var(--n-size);
|
|||
|
|
--n-merged-color-table: var(--n-color-table);
|
|||
|
|
`,[W("show-label","line-height: var(--n-label-line-height);"),q("&:hover",[k("checkbox-box",[H("border","border: var(--n-border-checked);")])]),q("&:focus:not(:active)",[k("checkbox-box",[H("border",`
|
|||
|
|
border: var(--n-border-focus);
|
|||
|
|
box-shadow: var(--n-box-shadow-focus);
|
|||
|
|
`)])]),W("inside-table",[k("checkbox-box",`
|
|||
|
|
background-color: var(--n-merged-color-table);
|
|||
|
|
`)]),W("checked",[k("checkbox-box",`
|
|||
|
|
background-color: var(--n-color-checked);
|
|||
|
|
`,[k("checkbox-icon",[q(".check-icon",`
|
|||
|
|
opacity: 1;
|
|||
|
|
transform: scale(1);
|
|||
|
|
`)])])]),W("indeterminate",[k("checkbox-box",[k("checkbox-icon",[q(".check-icon",`
|
|||
|
|
opacity: 0;
|
|||
|
|
transform: scale(.5);
|
|||
|
|
`),q(".line-icon",`
|
|||
|
|
opacity: 1;
|
|||
|
|
transform: scale(1);
|
|||
|
|
`)])])]),W("checked, indeterminate",[q("&:focus:not(:active)",[k("checkbox-box",[H("border",`
|
|||
|
|
border: var(--n-border-checked);
|
|||
|
|
box-shadow: var(--n-box-shadow-focus);
|
|||
|
|
`)])]),k("checkbox-box",`
|
|||
|
|
background-color: var(--n-color-checked);
|
|||
|
|
border-left: 0;
|
|||
|
|
border-top: 0;
|
|||
|
|
`,[H("border",{border:"var(--n-border-checked)"})])]),W("disabled",{cursor:"not-allowed"},[W("checked",[k("checkbox-box",`
|
|||
|
|
background-color: var(--n-color-disabled-checked);
|
|||
|
|
`,[H("border",{border:"var(--n-border-disabled-checked)"}),k("checkbox-icon",[q(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),k("checkbox-box",`
|
|||
|
|
background-color: var(--n-color-disabled);
|
|||
|
|
`,[H("border",`
|
|||
|
|
border: var(--n-border-disabled);
|
|||
|
|
`),k("checkbox-icon",[q(".check-icon, .line-icon",`
|
|||
|
|
fill: var(--n-check-mark-color-disabled);
|
|||
|
|
`)])]),H("label",`
|
|||
|
|
color: var(--n-text-color-disabled);
|
|||
|
|
`)]),k("checkbox-box-wrapper",`
|
|||
|
|
position: relative;
|
|||
|
|
width: var(--n-size);
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
flex-grow: 0;
|
|||
|
|
user-select: none;
|
|||
|
|
-webkit-user-select: none;
|
|||
|
|
`),k("checkbox-box",`
|
|||
|
|
position: absolute;
|
|||
|
|
left: 0;
|
|||
|
|
top: 50%;
|
|||
|
|
transform: translateY(-50%);
|
|||
|
|
height: var(--n-size);
|
|||
|
|
width: var(--n-size);
|
|||
|
|
display: inline-block;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
border-radius: var(--n-border-radius);
|
|||
|
|
background-color: var(--n-color);
|
|||
|
|
transition: background-color 0.3s var(--n-bezier);
|
|||
|
|
`,[H("border",`
|
|||
|
|
transition:
|
|||
|
|
border-color .3s var(--n-bezier),
|
|||
|
|
box-shadow .3s var(--n-bezier);
|
|||
|
|
border-radius: inherit;
|
|||
|
|
position: absolute;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
border: var(--n-border);
|
|||
|
|
`),k("checkbox-icon",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
position: absolute;
|
|||
|
|
left: 1px;
|
|||
|
|
right: 1px;
|
|||
|
|
top: 1px;
|
|||
|
|
bottom: 1px;
|
|||
|
|
`,[q(".check-icon, .line-icon",`
|
|||
|
|
width: 100%;
|
|||
|
|
fill: var(--n-check-mark-color);
|
|||
|
|
opacity: 0;
|
|||
|
|
transform: scale(0.5);
|
|||
|
|
transform-origin: center;
|
|||
|
|
transition:
|
|||
|
|
fill 0.3s var(--n-bezier),
|
|||
|
|
transform 0.3s var(--n-bezier),
|
|||
|
|
opacity 0.3s var(--n-bezier),
|
|||
|
|
border-color 0.3s var(--n-bezier);
|
|||
|
|
`),_t({left:"1px",top:"1px"})])]),H("label",`
|
|||
|
|
color: var(--n-text-color);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
user-select: none;
|
|||
|
|
-webkit-user-select: none;
|
|||
|
|
padding: var(--n-label-padding);
|
|||
|
|
font-weight: var(--n-label-font-weight);
|
|||
|
|
`,[q("&:empty",{display:"none"})])]),or(k("checkbox",`
|
|||
|
|
--n-merged-color-table: var(--n-color-table-modal);
|
|||
|
|
`)),rr(k("checkbox",`
|
|||
|
|
--n-merged-color-table: var(--n-color-table-popover);
|
|||
|
|
`))]),wl=Object.assign(Object.assign({},Te.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),uo=ve({name:"Checkbox",props:wl,setup(e){const t=Ae(wr,null),n=D(null),{mergedClsPrefixRef:o,inlineThemeDisabled:r,mergedRtlRef:a}=Ge(e),l=D(e.defaultChecked),i=se(e,"checked"),d=bt(i,l),c=Ze(()=>{if(t){const z=t.valueSetRef.value;return z&&e.value!==void 0?z.has(e.value):!1}else return d.value===e.checkedValue}),u=Ut(e,{mergedSize(z){const{size:N}=e;if(N!==void 0)return N;if(t){const{value:X}=t.mergedSizeRef;if(X!==void 0)return X}if(z){const{mergedSize:X}=z;if(X!==void 0)return X.value}return"medium"},mergedDisabled(z){const{disabled:N}=e;if(N!==void 0)return N;if(t){if(t.disabledRef.value)return!0;const{maxRef:{value:X},checkedCountRef:_}=t;if(X!==void 0&&_.value>=X&&!c.value)return!0;const{minRef:{value:A}}=t;if(A!==void 0&&_.value<=A&&c.value)return!0}return z?z.disabled.value:!1}}),{mergedDisabledRef:h,mergedSizeRef:v}=u,g=Te("Checkbox","-checkbox",yl,yr,e,o);function f(z){if(t&&e.value!==void 0)t.toggleCheckbox(!c.value,e.value);else{const{onChange:N,"onUpdate:checked":X,onUpdateChecked:_}=e,{nTriggerFormInput:A,nTriggerFormChange:Z}=u,B=c.value?e.uncheckedValue:e.checkedValue;X&&J(X,B,z),_&&J(_,B,z),N&&J(N,B,z),A(),Z(),l.value=B}}function p(z){h.value||f(z)}function b(z){if(!h.value)switch(z.key){case" ":case"Enter":f(z)}}function m(z){switch(z.key){case" ":z.preventDefault()}}const y={focus:()=>{var z;(z=n.value)===null||z===void 0||z.focus()},blur:()=>{var z;(z=n.value)===null||z===void 0||z.blur()}},C=kt("Checkbox",a,o),T=R(()=>{const{value:z}=v,{common:{cubicBezierEaseInOut:N},self:{borderRadius:X,color:_,colorChecked:A,colorDisabled:Z,colorTableHeader:B,colorTableHeaderModal:P,colorTableHeaderPopover:$,checkMarkColor:V,checkMarkColorDisabled:K,border:G,borderFocus:Y,borderDisabled:oe,borderChecked:Q,boxShadowFocus:I,textColor:S,textColorDisabled:M,checkMarkColorDisabledChecked:j,colorDisabledChecked:ee,borderDisabledChecked:be,labelPadding:ye,labelLineHeight:me,labelFontWeight:E,[fe("fontSize",z)]:ne,[fe("size",z)]:we}}=g.value;return{"--n-label-line-height":me,"--n-label-font-weight":E,"--n-size":we,"--n-bezier":N,"--n-border-radius":X,"--n-border":G,"--n-border-checked":Q,"--n-border-focus":Y,"--n-border-disabled":oe,"--n-border-disabled-checked":be,"--n-box-shadow-focus":I,"--n-color":_,"--n-color-checked":A,"--n-color-table":B,"--n-color-table-modal":P,"--n-color-table-popover":$,"--n-color-disabled":Z,"--n-color-disabled-checked":ee,"--n-text-color":S,"--n-text-color-disabled":M,"--n-check-mark-color":V,"--n-check-mark-color-disabled":K,"--n-check-mark-color-disabled-checked":j,"--n-font-size":ne,"--n-label-padding":ye}}),F=r?ft("checkbox",R(()=>v.value[0]),T,e):void 0;return Object.assign(u,y,{rtlEnabled:C,selfRef:n,mergedClsPrefix:o,mergedDisabled:h,renderedChecked:c,mergedTheme:g,labelId:vn(),handleClick:p,handleKeyUp:b,handleKeyDown:m,cssVars:r?void 0:T,themeClass:F==null?void 0:F.themeClass,onRender:F==null?void 0:F.onRender})},render(){var e;const{$slots:t,renderedChecked:n,mergedDisabled:o,indeterminate:r,privateInsideTable:a,cssVars:l,labelId:i,label:d,mergedClsPrefix:c,focusable:u,handleKeyUp:h,handleKeyDown:v,handleClick:g}=this;(e=this.onRender)===null||e===void 0||e.call(this);const f=yt(t.default,p=>d||p?s("span",{class:`${c}-checkbox__label`,id:i},d||p):null);return s("div",{ref:"selfRef",class:[`${c}-checkbox`,this.themeClass,this.rtlEnabled&&`${c}-checkbox--rtl`,n&&`${c}-checkbox--checked`,o&&`${c}-checkbox--disabled`,r&&`${c}-checkbox--indeterminate`,a&&`${c}-checkbox--inside-table`,f&&`${c}-checkbox--show-label`],tabindex:o||!u?void 0:0,role:"checkbox"
|
|||
|
|
box-shadow: var(--n-menu-box-shadow);
|
|||
|
|
`),ho={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]},Bo=gn(ho),kl=ve({name:"PopselectPanel",props:ho,setup(e){const t=Ae(Cr),{mergedClsPrefixRef:n,inlineThemeDisabled:o}=Ge(e),r=Te("Popselect","-pop-select",Sl,fo,t.props,n),a=R(()=>io(e.options,xr("value","children")));function l(v,g){const{onUpdateValue:f,"onUpdate:value":p,onChange:b}=e;f&&J(f,v,g),p&&J(p,v,g),b&&J(b,v,g)}function i(v){c(v.key)}function d(v){!St(v,"action")&&!St(v,"empty")&&!St(v,"header")&&v.preventDefault()}function c(v){const{value:{getNode:g}}=a;if(e.multiple)if(Array.isArray(e.value)){const f=[],p=[];let b=!0;e.value.forEach(m=>{if(m===v){b=!1;return}const y=g(m);y&&(f.push(y.key),p.push(y.rawNode))}),b&&(f.push(v),p.push(g(v).rawNode)),l(f,p)}else{const f=g(v);f&&l([v],[f.rawNode])}else if(e.value===v&&e.cancelable)l(null,null);else{const f=g(v);f&&l(v,f.rawNode);const{"onUpdate:show":p,onUpdateShow:b}=t.props;p&&J(p,!1),b&&J(b,!1),t.setShow(!1)}At(()=>{t.syncPosition()})}lt(se(e,"options"),()=>{At(()=>{t.syncPosition()})});const u=R(()=>{const{self:{menuBoxShadow:v}}=r.value;return{"--n-menu-box-shadow":v}}),h=o?ft("select",void 0,u,t.props):void 0;return{mergedTheme:t.mergedThemeRef,mergedClsPrefix:n,treeMate:a,handleToggle:i,handleMenuMousedown:d,cssVars:o?void 0:u,themeClass:h==null?void 0:h.themeClass,onRender:h==null?void 0:h.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),s(hr,{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 t,n;return((n=(t=this.$slots).header)===null||n===void 0?void 0:n.call(t))||[]},action:()=>{var t,n;return((n=(t=this.$slots).action)===null||n===void 0?void 0:n.call(t))||[]},empty:()=>{var t,n;return((n=(t=this.$slots).empty)===null||n===void 0?void 0:n.call(t))||[]}})}}),Rl=Object.assign(Object.assign(Object.assign(Object.assign({},Te.props),ar(mo,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},mo.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),ho),Pl=ve({name:"Popselect",props:Rl,slots:Object,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=Ge(e),n=Te("Popselect","-popselect",void 0,fo,e,t),o=D(null);function r(){var i;(i=o.value)===null||i===void 0||i.syncPosition()}function a(i){var d;(d=o.value)===null||d===void 0||d.setShow(i)}return pt(Cr,{props:e,mergedThemeRef:n,syncPosition:r,setShow:a}),Object.assign(Object.assign({},{syncPosition:r,setShow:a}),{popoverInstRef:o,mergedTheme:n})},render(){const{mergedTheme:e}=this,t={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(n,o,r,a,l)=>{const{$attrs:i}=this;return s(kl,Object.assign({},i,{class:[i.class,n],style:[i.style,...r]},xa(this.$props,Bo),{ref:ya(o),onMouseenter:en([a,i.onMouseenter]),onMouseleave:en([l,i.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 s(ao,Object.assign({},ar(this.$props,Bo),t,{internalDeactivateImme
|
|||
|
|
z-index: auto;
|
|||
|
|
outline: none;
|
|||
|
|
width: 100%;
|
|||
|
|
position: relative;
|
|||
|
|
font-weight: var(--n-font-weight);
|
|||
|
|
`),k("select-menu",`
|
|||
|
|
margin: 4px 0;
|
|||
|
|
box-shadow: var(--n-menu-box-shadow);
|
|||
|
|
`,[oo({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),Ml=Object.assign(Object.assign({},Te.props),{to:pn.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,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),Tl=ve({name:"Select",props:Ml,slots:Object,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:o,inlineThemeDisabled:r}=Ge(e),a=Te("Select","-select",Fl,Sr,e,t),l=D(e.defaultValue),i=se(e,"value"),d=bt(i,l),c=D(!1),u=D(""),h=Pa(e,["items","options"]),v=D([]),g=D([]),f=R(()=>g.value.concat(v.value).concat(h.value)),p=R(()=>{const{filter:w}=e;if(w)return w;const{labelField:O,valueField:te}=e;return(ie,le)=>{if(!le)return!1;const ge=le[O];if(typeof ge=="string")return Hn(ie,ge);const pe=le[te];return typeof pe=="string"?Hn(ie,pe):typeof pe=="number"?Hn(ie,String(pe)):!1}}),b=R(()=>{if(e.remote)return h.value;{const{value:w}=f,{value:O}=u;return!O.length||!e.filterable?w:fl(w,p.value,O,e.childrenField)}}),m=R(()=>{const{valueField:w,childrenField:O}=e,te=xr(w,O);return io(b.value,te)}),y=R(()=>hl(f.value,e.valueField,e.childrenField)),C=D(!1),T=bt(se(e,"show"),C),F=D(null),z=D(null),N=D(null),{localeRef:X}=rn("Select"),_=R(()=>{var w;return(w=e.placeholder)!==null&&w!==void 0?w:X.value.placeholder}),A=[],Z=D(new Map),B=R(()=>{const{fallbackOption:w}=e;if(w===void 0){const{labelField:O,valueField:te}=e;return ie=>({[O]:String(ie),[te]:ie})}return w===!1?!1:O=>Object.assign(w(O),{value:O})});function P(w){const O=e.remote,{value:te}=Z,{value:ie}=y,{value:le}=B,ge=[];return w.forEach(pe=>{if(ie.has(pe))ge.push(ie.get(pe));else if(O&&te.has(pe))ge.push(te.get(pe));else if(le){const Fe=le(pe);Fe&&ge.push(Fe)}}),ge}const $=R(()=>{if(e.multiple){const{value:w}=d;return Array.isArray(w)?P(w):[]}return null}),V=R(()=>{const{value:w}=d;return!e.multiple&&!Array.isArray(w)?w===null?null:P([w])[0]||null:null}),K=Ut(e),{mergedSizeRef:G,mergedDisabledRef:Y,mergedStatusRef:oe}=K;function Q(w,O){const{onChange:te,"onUpdate:value":ie,onUpdateValue:le}=e,{nTriggerFormChange:ge,nTriggerFormInput:pe}=K;te&&J(te,w,O),le&&J(le,w,O),ie&&J(ie,w,O),l.value=w,ge(),pe()}function I(w){const{onBlur:O}=e,{nTriggerFormBlur:te}=K;O&&J(O,w),te()}function S(){const{onClear:w}=e;w&&J(w)}function M(w){const{onFocus:O,showOnFocus:te}=e,{nTriggerFormFocus:ie}=K;O&&J(O,w),ie(),te&&me()}function j(w){const{onSearch:O}=e;O&&J(O,w)}function ee(w){const{onScroll:O}=e;O&&J(O,w)}function be(){var w;const{remote:O,multiple:te}=e;if(O){const{value:ie}=Z;if(te){const{valueField:le}=e;(w=$.value)===null||w===void 0||w.forEach(ge=>{ie.set(ge[le],g
|
|||
|
|
background: var(--n-item-color-hover);
|
|||
|
|
color: var(--n-item-text-color-hover);
|
|||
|
|
border: var(--n-item-border-hover);
|
|||
|
|
`,Eo=[W("button",`
|
|||
|
|
background: var(--n-button-color-hover);
|
|||
|
|
border: var(--n-button-border-hover);
|
|||
|
|
color: var(--n-button-icon-color-hover);
|
|||
|
|
`)],_l=k("pagination",`
|
|||
|
|
display: flex;
|
|||
|
|
vertical-align: middle;
|
|||
|
|
font-size: var(--n-item-font-size);
|
|||
|
|
flex-wrap: nowrap;
|
|||
|
|
`,[k("pagination-prefix",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
margin: var(--n-prefix-margin);
|
|||
|
|
`),k("pagination-suffix",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
margin: var(--n-suffix-margin);
|
|||
|
|
`),q("> *:not(:first-child)",`
|
|||
|
|
margin: var(--n-item-margin);
|
|||
|
|
`),k("select",`
|
|||
|
|
width: var(--n-select-width);
|
|||
|
|
`),q("&.transition-disabled",[k("pagination-item","transition: none!important;")]),k("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);
|
|||
|
|
`,[k("input",`
|
|||
|
|
margin: var(--n-input-margin);
|
|||
|
|
width: var(--n-input-width);
|
|||
|
|
`)]),k("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);
|
|||
|
|
`,[W("button",`
|
|||
|
|
background: var(--n-button-color);
|
|||
|
|
color: var(--n-button-icon-color);
|
|||
|
|
border: var(--n-button-border);
|
|||
|
|
padding: 0;
|
|||
|
|
`,[k("base-icon",`
|
|||
|
|
font-size: var(--n-button-icon-size);
|
|||
|
|
`)]),Ye("disabled",[W("hover",Ao,Eo),q("&:hover",Ao,Eo),q("&:active",`
|
|||
|
|
background: var(--n-item-color-pressed);
|
|||
|
|
color: var(--n-item-text-color-pressed);
|
|||
|
|
border: var(--n-item-border-pressed);
|
|||
|
|
`,[W("button",`
|
|||
|
|
background: var(--n-button-color-pressed);
|
|||
|
|
border: var(--n-button-border-pressed);
|
|||
|
|
color: var(--n-button-icon-color-pressed);
|
|||
|
|
`)]),W("active",`
|
|||
|
|
background: var(--n-item-color-active);
|
|||
|
|
color: var(--n-item-text-color-active);
|
|||
|
|
border: var(--n-item-border-active);
|
|||
|
|
`,[q("&:hover",`
|
|||
|
|
background: var(--n-item-color-active-hover);
|
|||
|
|
`)])]),W("disabled",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
color: var(--n-item-text-color-disabled);
|
|||
|
|
`,[W("active, button",`
|
|||
|
|
background-color: var(--n-item-color-disabled);
|
|||
|
|
border: var(--n-item-border-disabled);
|
|||
|
|
`)])]),W("disabled",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
`,[k("pagination-quick-jumper",`
|
|||
|
|
color: var(--n-jumper-text-color-disabled);
|
|||
|
|
`)]),W("simple",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
flex-wrap: nowrap;
|
|||
|
|
`,[k("pagination-quick-jumper",[k("input",`
|
|||
|
|
margin: 0;
|
|||
|
|
`)])])]);function Rr(e){var t;if(!e)return 10;const{defaultPageSize:n}=e;if(n!==void 0)return n;const o=(t=e.pageSizes)===null||t===void 0?void 0:t[0];return typeof o=="number"?o:(o==null?void 0:o.value)||10}function Il(e,t,n,o){let r=!1,a=!1,l=1,i=t;if(t===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:i,fastBackwardTo:l,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(t===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:i,fastBackwardTo:l,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=t;let u=e,h=e;const v=(n-5)/2;h+=Math.ceil(v),h=Math.min(Math.max(h,d+n-3),c-2),u-=Math.floor(v),u=Math.max(Math.min(u,c-n+3),d+2);let g=!1,f=!1;u>d+2&&(g=!0),h<c-2&&(f=!0);const p=[];p.push({type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}),g?(r=!0,l=u-1,p.push({type:"fast-backward",active:!1,label:void 0,options:o?Lo(d+1,u-1):null})):c>=d+1&&p.push({type:"page",label:d+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===d+1});for(let b=u;b<=h;++b)p.push({type:"page",label:b,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===b});return f?(a=!0,i=h+1,p.push({type:"fast-forward",active:!1,label:void 0,options:o?Lo(h+1,c-1):null})):h===c-2&&p[p.length-1].label!==c-1&&p.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:c-1,active:e===c-1}),p[p.length-1].label!==c&&p.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:c,active:e===c}),{hasFastBackward:r,hasFastForward:a,fastBackwardTo:l,fastForwardTo:i,items:p}}function Lo(e,t){const n=[];for(let o=e;o<=t;++o)n.push({label:`${o}`,value:o});return n}const Bl=Object.assign(Object.assign({},Te.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:pn.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]}),Al=ve({name:"Pagination",props:Bl,slots:Object,setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:n,inlineThemeDisabled:o,mergedRtlRef:r}=Ge(e),a=Te("Pagination","-pagination",_l,kr,e,n),{localeRef:l}=rn("Pagination"),i=D(null),d=D(e.defaultPage),c=D(Rr(e)),u=bt(se(e,"page"),d),h=bt(se(e,"pageSize"),c),v=R(()=>{const{itemCount:E}=e;if(E!==void 0)return Math.max(1,Math.ceil(E/h.value));const{pageCount:ne}=e;return ne!==void 0?Math.max(ne,1):1}),g=D("");Tt(()=>{e.simple,g.value=String(u.value)});const f=D(!1),p=D(!1),b=D(!1),m=D(!1),y=()=>{e.disabled||(f.value=!0,V())},C=()=>{e.disabled||(f.value=!1,V())},T=()=>{p.value=!0,V()},F=()=>{p.value=!1,V()},z=E=>{K(E)},N=R(()=>Il(u.value,v.value,e.pageSlot,e.showQuickJumpDropdown));Tt(()=>{N.value.hasFastBackward?N.value.hasFastForward||(f.value=!1,b.value=!1):(p.value=!1,m.value=!1)});const X=R(()=>{const E=l.value.selectionSuffix;return e.pageSizes.map(ne=>typeof ne=="number"?{label:`${ne} / ${E}`,value:ne}:ne)}),_=R(()=>{var E,ne;return((ne=(E=t==null?void 0:t.value)===null||E===void 0?void 0:E.Pagination)===null||ne===void 0?void 0:ne.inputSize)||Ro(e.size)}),A=R(()=>{var E,ne;return((ne=(E=t==null?void 0:t.value)===null||E===void 0?void 0:E.Pagination)===null||ne===void 0?void 0:ne.selectSize)||Ro(e.size)}),Z=R(()=>(u.value-1)*h.value),B=R(()=>{const E=u.value*h.value-1,{itemCount:ne}=e;return ne!==void 0&&E>ne-1?ne-1:E}),P=R(()=>{const{itemCount:E}=e;return E!==void 0?E:(e.pageCount||1)*h.value}),$=kt("Pagination",r,n);fu
|
|||
|
|
`)}const Zl=ve({name:"DataTableBodyCheckbox",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,mergedInderminateRowKeySetRef:n}=Ae(wt);return()=>{const{rowKey:o}=e;return s(uo,{privateInsideTable:!0,disabled:e.disabled,indeterminate:n.value.has(o),checked:t.value.has(o),onUpdateChecked:e.onUpdateChecked})}}}),Jl=k("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;
|
|||
|
|
`,[W("checked",[H("dot",`
|
|||
|
|
background-color: var(--n-color-active);
|
|||
|
|
`)]),H("dot-wrapper",`
|
|||
|
|
position: relative;
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
flex-grow: 0;
|
|||
|
|
width: var(--n-radio-size);
|
|||
|
|
`),k("radio-input",`
|
|||
|
|
position: absolute;
|
|||
|
|
border: 0;
|
|||
|
|
border-radius: inherit;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
opacity: 0;
|
|||
|
|
z-index: 1;
|
|||
|
|
cursor: pointer;
|
|||
|
|
`),H("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);
|
|||
|
|
`,[q("&::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);
|
|||
|
|
`),W("checked",{boxShadow:"var(--n-box-shadow-active)"},[q("&::before",`
|
|||
|
|
opacity: 1;
|
|||
|
|
transform: scale(1);
|
|||
|
|
`)])]),H("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);
|
|||
|
|
`),Ye("disabled",`
|
|||
|
|
cursor: pointer;
|
|||
|
|
`,[q("&:hover",[H("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),W("focus",[q("&:not(:active)",[H("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),W("disabled",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
`,[H("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[q("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),W("checked",`
|
|||
|
|
opacity: 1;
|
|||
|
|
`)]),H("label",{color:"var(--n-text-color-disabled)"}),k("radio-input",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
`)])]),Ql={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}},$r=$t("n-radio-group");function es(e){const t=Ae($r,null),n=Ut(e,{mergedSize(y){const{size:C}=e;if(C!==void 0)return C;if(t){const{mergedSizeRef:{value:T}}=t;if(T!==void 0)return T}return y?y.mergedSize.value:"medium"},mergedDisabled(y){return!!(e.disabled||t!=null&&t.disabledRef.value||y!=null&&y.disabled.value)}}),{mergedSizeRef:o,mergedDisabledRef:r}=n,a=D(null),l=D(null),i=D(e.defaultChecked),d=se(e,"checked"),c=bt(d,i),u=Ze(()=>t?t.valueRef.value===e.value:c.value),h=Ze(()=>{const{name:y}=e;if(y!==void 0)return y;if(t)return t.nameRef.value}),v=D(!1);function g(){if(t){const{doUpdateValue:y}=t,{value:C}=e;J(y,C)}else{const{onUpdateChecked:y,"onUpdate:checked":C}=e,{nTriggerFormInput:T,nTriggerFormChange:F}=n;y&&J(y,!0),C&&J(C,!0),T(),F(),i.value=!0}}function f(){r.value||u.value||g()}function p(){f(),a.value&&(a.value.checked=u.value)}function b(){v.value=!1}function m(){v.value=!0}return{mergedClsPrefix:t?t.mergedClsPrefixRef:Ge(e).mergedClsPrefixRef,inputRef:a,labelRef:l,mergedName:h,mergedDisabled:r,renderSafeChecked:u,focus:v,mergedSize:o,handleRadioInputChange:p,handleRadioInputBlur:b,handleRadioInputFocus:m}}const ts=Object.assign(Object.assign({},Te.props),Ql),Or=ve({name:"Radio",props:ts,setup(e){const t=es(e),n=Te("Radio","-radio",Jl,vo,e,t.mergedClsPrefix),o=R(()=>{const{mergedSize:{value:c}}=t,{common:{cubicBezierEaseInOut:u},self:{boxShadow:h,boxShadowActive:v,boxShadowDisabled:g,boxShadowFocus:f,boxShadowHover:p,color:b,colorDisabled:m,colorActive:y,textColor:C,textColorDisabled:T,dotColorActive:F,dotColorDisabled:z,labelPadding:N,labelLineHeight:X,labelFontWeight:_,[fe("fontSize",c)]:A,[fe("radioSize",c)]:Z}}=n.value;return{"--n-bezier":u,"--n-label-line-height":X,"--n-label-font-weight":_,"--n-box-shadow":h,"--n-box-shadow-active":v,"--n-box-shadow-disabled":g,"--n-box-shadow-focus":f,"--n-box-shadow-hover":p,"--n-color":b,"--n-color-active":y,"--n-color-disabled":m,"--n-dot-color-active":F,"--n-dot-color-disabled":z,"--n-font-size":A,"--n-radio-size":Z,"--n-text-color":C,"--n-text-color-disabled":T,"--n-label-padding":N}}),{inlineThemeDisabled:r,mergedClsPrefixRef:a,mergedRtlRef:l}=Ge(e),i=kt("Radio",l,a),d=r?ft("radio",R(()=>t.mergedSize.value[0]),o,e):void 0;return Object.assign(t,{rtlEnabled:i,cssVars:r?void 0:o,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender})},render(){const{$slots:e,mergedClsPrefix:t,onRender:n,label:o}=this;return n==null||n(),s("label",{class:[`${t}-radio`,this.themeClass,this.rtlEnabled&&`${t}-radio--rtl`,this.mergedDisabled&&`${t}-radio--disabled`,this.renderSafeChecked&&`${t}-radio--checked`,this.focus&&`${t}-radio--focus`],style:this.cssVars},s("input",{ref:"inputRef",type:"radio",class:`${t}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),s("div",{class:`${t}-radio__dot-wrapper`}," ",s("div",{class:[`${t}-radio__dot`,this.renderSafeChecked&&`${t}-radio__dot--checked`]})),yt(e.default,r=>!r&&!o?null:s("div",{ref:"labelRef",class:`${t}-radio__label`},r||o)))}}),ns=k("radio-group",`
|
|||
|
|
display: inline-block;
|
|||
|
|
font-size: var(--n-font-size);
|
|||
|
|
`,[H("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);
|
|||
|
|
`,[W("checked",{backgroundColor:"var(--n-button-border-color-active)"}),W("disabled",{opacity:"var(--n-opacity-disabled)"})]),W("button-group",`
|
|||
|
|
white-space: nowrap;
|
|||
|
|
height: var(--n-height);
|
|||
|
|
line-height: var(--n-height);
|
|||
|
|
`,[k("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),H("splitor",{height:"var(--n-height)"})]),k("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);
|
|||
|
|
`,[k("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;
|
|||
|
|
`),H("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;
|
|||
|
|
`),q("&: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);
|
|||
|
|
`,[H("state-border",`
|
|||
|
|
border-top-left-radius: var(--n-button-border-radius);
|
|||
|
|
border-bottom-left-radius: var(--n-button-border-radius);
|
|||
|
|
`)]),q("&: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);
|
|||
|
|
`,[H("state-border",`
|
|||
|
|
border-top-right-radius: var(--n-button-border-radius);
|
|||
|
|
border-bottom-right-radius: var(--n-button-border-radius);
|
|||
|
|
`)]),Ye("disabled",`
|
|||
|
|
cursor: pointer;
|
|||
|
|
`,[q("&:hover",[H("state-border",`
|
|||
|
|
transition: box-shadow .3s var(--n-bezier);
|
|||
|
|
box-shadow: var(--n-button-box-shadow-hover);
|
|||
|
|
`),Ye("checked",{color:"var(--n-button-text-color-hover)"})]),W("focus",[q("&:not(:active)",[H("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),W("checked",`
|
|||
|
|
background: var(--n-button-color-active);
|
|||
|
|
color: var(--n-button-text-color-active);
|
|||
|
|
border-color: var(--n-button-border-color-active);
|
|||
|
|
`),W("disabled",`
|
|||
|
|
cursor: not-allowed;
|
|||
|
|
opacity: var(--n-opacity-disabled);
|
|||
|
|
`)])]);function os(e,t,n){var o;const r=[];let a=!1;for(let l=0;l<e.length;++l){const i=e[l],d=(o=i.type)===null||o===void 0?void 0:o.name;d==="RadioButton"&&(a=!0);const c=i.props;if(d!=="RadioButton"){r.push(i);continue}if(l===0)r.push(i);else{const u=r[r.length-1].props,h=t===u.value,v=u.disabled,g=t===c.value,f=c.disabled,p=(h?2:0)+(v?0:1),b=(g?2:0)+(f?0:1),m={[`${n}-radio-group__splitor--disabled`]:v,[`${n}-radio-group__splitor--checked`]:h},y={[`${n}-radio-group__splitor--disabled`]:f,[`${n}-radio-group__splitor--checked`]:g},C=p<b?y:m;r.push(s("div",{class:[`${n}-radio-group__splitor`,C]}),i)}}return{children:r,isButtonGroup:a}}const rs=Object.assign(Object.assign({},Te.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]}),as=ve({name:"RadioGroup",props:rs,setup(e){const t=D(null),{mergedSizeRef:n,mergedDisabledRef:o,nTriggerFormChange:r,nTriggerFormInput:a,nTriggerFormBlur:l,nTriggerFormFocus:i}=Ut(e),{mergedClsPrefixRef:d,inlineThemeDisabled:c,mergedRtlRef:u}=Ge(e),h=Te("Radio","-radio-group",ns,vo,e,d),v=D(e.defaultValue),g=se(e,"value"),f=bt(g,v);function p(F){const{onUpdateValue:z,"onUpdate:value":N}=e;z&&J(z,F),N&&J(N,F),v.value=F,r(),a()}function b(F){const{value:z}=t;z&&(z.contains(F.relatedTarget)||i())}function m(F){const{value:z}=t;z&&(z.contains(F.relatedTarget)||l())}pt($r,{mergedClsPrefixRef:d,nameRef:se(e,"name"),valueRef:f,disabledRef:o,mergedSizeRef:n,doUpdateValue:p});const y=kt("Radio",u,d),C=R(()=>{const{value:F}=n,{common:{cubicBezierEaseInOut:z},self:{buttonBorderColor:N,buttonBorderColorActive:X,buttonBorderRadius:_,buttonBoxShadow:A,buttonBoxShadowFocus:Z,buttonBoxShadowHover:B,buttonColor:P,buttonColorActive:$,buttonTextColor:V,buttonTextColorActive:K,buttonTextColorHover:G,opacityDisabled:Y,[fe("buttonHeight",F)]:oe,[fe("fontSize",F)]:Q}}=h.value;return{"--n-font-size":Q,"--n-bezier":z,"--n-button-border-color":N,"--n-button-border-color-active":X,"--n-button-border-radius":_,"--n-button-box-shadow":A,"--n-button-box-shadow-focus":Z,"--n-button-box-shadow-hover":B,"--n-button-color":P,"--n-button-color-active":$,"--n-button-text-color":V,"--n-button-text-color-hover":G,"--n-button-text-color-active":K,"--n-height":oe,"--n-opacity-disabled":Y}}),T=c?ft("radio-group",R(()=>n.value[0]),C,e):void 0;return{selfElRef:t,rtlEnabled:y,mergedClsPrefix:d,mergedValue:f,handleFocusout:m,handleFocusin:b,cssVars:c?void 0:C,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){var e;const{mergedValue:t,mergedClsPrefix:n,handleFocusin:o,handleFocusout:r}=this,{children:a,isButtonGroup:l}=os(_a(Ga(this)),t,n);return(e=this.onRender)===null||e===void 0||e.call(this),s("div",{onFocusin:o,onFocusout:r,ref:"selfElRef",class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,l&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),is=ve({name:"DataTableBodyRadio",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,componentId:n}=Ae(wt);return()=>{const{rowKey:o}=e;return s(Or,{name:n,disabled:e.disabled,checked:t.value.has(o),onUpdateChecked:e.onUpdateChecked})}}}),_r=k("ellipsis",{overflow:"hidden"},[Ye("line-clamp",`
|
|||
|
|
white-space: nowrap;
|
|||
|
|
display: inline-block;
|
|||
|
|
vertical-align: bottom;
|
|||
|
|
max-width: 100%;
|
|||
|
|
`),W("line-clamp",`
|
|||
|
|
display: -webkit-inline-box;
|
|||
|
|
-webkit-box-orient: vertical;
|
|||
|
|
`),W("cursor-pointer",`
|
|||
|
|
cursor: pointer;
|
|||
|
|
`)]);function qn(e){return`${e}-ellipsis--line-clamp`}function Xn(e,t){return`${e}-ellipsis--cursor-${t}`}const Ir=Object.assign(Object.assign({},Te.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),go=ve({name:"Ellipsis",inheritAttrs:!1,props:Ir,slots:Object,setup(e,{slots:t,attrs:n}){const o=ir(),r=Te("Ellipsis","-ellipsis",_r,Pr,e,o),a=D(null),l=D(null),i=D(null),d=D(!1),c=R(()=>{const{lineClamp:b}=e,{value:m}=d;return b!==void 0?{textOverflow:"","-webkit-line-clamp":m?"":b}:{textOverflow:m?"":"ellipsis","-webkit-line-clamp":""}});function u(){let b=!1;const{value:m}=d;if(m)return!0;const{value:y}=a;if(y){const{lineClamp:C}=e;if(g(y),C!==void 0)b=y.scrollHeight<=y.offsetHeight;else{const{value:T}=l;T&&(b=T.getBoundingClientRect().width<=y.getBoundingClientRect().width)}f(y,b)}return b}const h=R(()=>e.expandTrigger==="click"?()=>{var b;const{value:m}=d;m&&((b=i.value)===null||b===void 0||b.setShow(!1)),d.value=!m}:void 0);er(()=>{var b;e.tooltip&&((b=i.value)===null||b===void 0||b.setShow(!1))});const v=()=>s("span",Object.assign({},hn(n,{class:[`${o.value}-ellipsis`,e.lineClamp!==void 0?qn(o.value):void 0,e.expandTrigger==="click"?Xn(o.value,"pointer"):void 0],style:c.value}),{ref:"triggerRef",onClick:h.value,onMouseenter:e.expandTrigger==="click"?u:void 0}),e.lineClamp?t:s("span",{ref:"triggerInnerRef"},t));function g(b){if(!b)return;const m=c.value,y=qn(o.value);e.lineClamp!==void 0?p(b,y,"add"):p(b,y,"remove");for(const C in m)b.style[C]!==m[C]&&(b.style[C]=m[C])}function f(b,m){const y=Xn(o.value,"pointer");e.expandTrigger==="click"&&!m?p(b,y,"add"):p(b,y,"remove")}function p(b,m,y){y==="add"?b.classList.contains(m)||b.classList.add(m):b.classList.contains(m)&&b.classList.remove(m)}return{mergedTheme:r,triggerRef:a,triggerInnerRef:l,tooltipRef:i,handleClick:h,renderTrigger:v,getTooltipDisabled:u}},render(){var e;const{tooltip:t,renderTrigger:n,$slots:o}=this;if(t){const{mergedTheme:r}=this;return s(Ia,Object.assign({ref:"tooltipRef",placement:"top"},t,{getDisabled:this.getTooltipDisabled,theme:r.peers.Tooltip,themeOverrides:r.peerOverrides.Tooltip}),{trigger:n,default:(e=o.tooltip)!==null&&e!==void 0?e:o.default})}else return n()}}),ls=ve({name:"PerformantEllipsis",props:Ir,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){const o=D(!1),r=ir();return to("-ellipsis",_r,r),{mouseEntered:o,renderTrigger:()=>{const{lineClamp:l}=e,i=r.value;return s("span",Object.assign({},hn(t,{class:[`${i}-ellipsis`,l!==void 0?qn(i):void 0,e.expandTrigger==="click"?Xn(i,"pointer"):void 0],style:l===void 0?{textOverflow:"ellipsis"}:{"-webkit-line-clamp":l}}),{onMouseenter:()=>{o.value=!0}}),l?n:s("span",null,n))}}},render(){return this.mouseEntered?s(go,hn({},this.$attrs,this.$props),this.$slots):this.renderTrigger()}}),ss=ve({name:"DataTableCell",props:{clsPrefix:{type:String,required:!0},row:{type:Object,required:!0},index:{type:Number,required:!0},column:{type:Object,required:!0},isSummary:Boolean,mergedTheme:{type:Object,required:!0},renderCell:Function},render(){var e;const{isSummary:t,column:n,row:o,renderCell:r}=this;let a;const{render:l,key:i,ellipsis:d}=n;if(l&&!t?a=l(o,this.index):t?a=(e=o[i])===null||e===void 0?void 0:e.value:a=r?r(bn(o,i),o,n):bn(o,i),d)if(typeof d=="object"){const{mergedTheme:c}=this;return n.ellipsisComponent==="performant-ellipsis"?s(ls,Object.assign({},d,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a}):s(go,Object.assign({},d,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a})}else return s("span",{class:`${this.clsPrefix}-data-table-td__ellipsis`},a);return a}}),Vo=ve({name:"DataTableExpandTrigger",props:{clsPrefix:{type:String,required:!0},expanded:Boolean,loading:Boolean,onClick:{type:Function,required:!0},renderExpandIcon:{type:Function},rowData:{type:Object,required:!0}},render(){const{clsPrefix:e}=this;return s("div",{class:[`${e}-data-table-expand-trigger`,this.expanded&&`${e}-data-table-expand-trigger--expanded`],onClick:this.onClick,onMousedown:t=>{t.preventDefault()}},s(eo,null,{defau
|
|||
|
|
width: 100%;
|
|||
|
|
font-size: var(--n-font-size);
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
position: relative;
|
|||
|
|
--n-merged-th-color: var(--n-th-color);
|
|||
|
|
--n-merged-td-color: var(--n-td-color);
|
|||
|
|
--n-merged-border-color: var(--n-border-color);
|
|||
|
|
--n-merged-th-color-sorting: var(--n-th-color-sorting);
|
|||
|
|
--n-merged-td-color-hover: var(--n-td-color-hover);
|
|||
|
|
--n-merged-td-color-sorting: var(--n-td-color-sorting);
|
|||
|
|
--n-merged-td-color-striped: var(--n-td-color-striped);
|
|||
|
|
`,[k("data-table-wrapper",`
|
|||
|
|
flex-grow: 1;
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
`),W("flex-height",[q(">",[k("data-table-wrapper",[q(">",[k("data-table-base-table",`
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
flex-grow: 1;
|
|||
|
|
`,[q(">",[k("data-table-base-table-body","flex-basis: 0;",[q("&:last-child","flex-grow: 1;")])])])])])])]),q(">",[k("data-table-loading-wrapper",`
|
|||
|
|
color: var(--n-loading-color);
|
|||
|
|
font-size: var(--n-loading-size);
|
|||
|
|
position: absolute;
|
|||
|
|
left: 50%;
|
|||
|
|
top: 50%;
|
|||
|
|
transform: translateX(-50%) translateY(-50%);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
`,[oo({originalTransform:"translateX(-50%) translateY(-50%)"})])]),k("data-table-expand-placeholder",`
|
|||
|
|
margin-right: 8px;
|
|||
|
|
display: inline-block;
|
|||
|
|
width: 16px;
|
|||
|
|
height: 1px;
|
|||
|
|
`),k("data-table-indent",`
|
|||
|
|
display: inline-block;
|
|||
|
|
height: 1px;
|
|||
|
|
`),k("data-table-expand-trigger",`
|
|||
|
|
display: inline-flex;
|
|||
|
|
margin-right: 8px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
font-size: 16px;
|
|||
|
|
vertical-align: -0.2em;
|
|||
|
|
position: relative;
|
|||
|
|
width: 16px;
|
|||
|
|
height: 16px;
|
|||
|
|
color: var(--n-td-text-color);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
`,[W("expanded",[k("icon","transform: rotate(90deg);",[_t({originalTransform:"rotate(90deg)"})]),k("base-icon","transform: rotate(90deg);",[_t({originalTransform:"rotate(90deg)"})])]),k("base-loading",`
|
|||
|
|
color: var(--n-loading-color);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
position: absolute;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
`,[_t()]),k("icon",`
|
|||
|
|
position: absolute;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
`,[_t()]),k("base-icon",`
|
|||
|
|
position: absolute;
|
|||
|
|
left: 0;
|
|||
|
|
right: 0;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
`,[_t()])]),k("data-table-thead",`
|
|||
|
|
transition: background-color .3s var(--n-bezier);
|
|||
|
|
background-color: var(--n-merged-th-color);
|
|||
|
|
`),k("data-table-tr",`
|
|||
|
|
position: relative;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
background-clip: padding-box;
|
|||
|
|
transition: background-color .3s var(--n-bezier);
|
|||
|
|
`,[k("data-table-expand",`
|
|||
|
|
position: sticky;
|
|||
|
|
left: 0;
|
|||
|
|
overflow: hidden;
|
|||
|
|
margin: calc(var(--n-th-padding) * -1);
|
|||
|
|
padding: var(--n-th-padding);
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
`),W("striped","background-color: var(--n-merged-td-color-striped);",[k("data-table-td","background-color: var(--n-merged-td-color-striped);")]),Ye("summary",[q("&:hover","background-color: var(--n-merged-td-color-hover);",[q(">",[k("data-table-td","background-color: var(--n-merged-td-color-hover);")])])])]),k("data-table-th",`
|
|||
|
|
padding: var(--n-th-padding);
|
|||
|
|
position: relative;
|
|||
|
|
text-align: start;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
background-color: var(--n-merged-th-color);
|
|||
|
|
border-color: var(--n-merged-border-color);
|
|||
|
|
border-bottom: 1px solid var(--n-merged-border-color);
|
|||
|
|
color: var(--n-th-text-color);
|
|||
|
|
transition:
|
|||
|
|
border-color .3s var(--n-bezier),
|
|||
|
|
color .3s var(--n-bezier),
|
|||
|
|
background-color .3s var(--n-bezier);
|
|||
|
|
font-weight: var(--n-th-font-weight);
|
|||
|
|
`,[W("filterable",`
|
|||
|
|
padding-right: 36px;
|
|||
|
|
`,[W("sortable",`
|
|||
|
|
padding-right: calc(var(--n-th-padding) + 36px);
|
|||
|
|
`)]),Wo,W("selection",`
|
|||
|
|
padding: 0;
|
|||
|
|
text-align: center;
|
|||
|
|
line-height: 0;
|
|||
|
|
z-index: 3;
|
|||
|
|
`),H("title-wrapper",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
flex-wrap: nowrap;
|
|||
|
|
max-width: 100%;
|
|||
|
|
`,[H("title",`
|
|||
|
|
flex: 1;
|
|||
|
|
min-width: 0;
|
|||
|
|
`)]),H("ellipsis",`
|
|||
|
|
display: inline-block;
|
|||
|
|
vertical-align: bottom;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
overflow: hidden;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
max-width: 100%;
|
|||
|
|
`),W("hover",`
|
|||
|
|
background-color: var(--n-merged-th-color-hover);
|
|||
|
|
`),W("sorting",`
|
|||
|
|
background-color: var(--n-merged-th-color-sorting);
|
|||
|
|
`),W("sortable",`
|
|||
|
|
cursor: pointer;
|
|||
|
|
`,[H("ellipsis",`
|
|||
|
|
max-width: calc(100% - 18px);
|
|||
|
|
`),q("&:hover",`
|
|||
|
|
background-color: var(--n-merged-th-color-hover);
|
|||
|
|
`)]),k("data-table-sorter",`
|
|||
|
|
height: var(--n-sorter-size);
|
|||
|
|
width: var(--n-sorter-size);
|
|||
|
|
margin-left: 4px;
|
|||
|
|
position: relative;
|
|||
|
|
display: inline-flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
vertical-align: -0.2em;
|
|||
|
|
color: var(--n-th-icon-color);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
`,[k("base-icon","transition: transform .3s var(--n-bezier)"),W("desc",[k("base-icon",`
|
|||
|
|
transform: rotate(0deg);
|
|||
|
|
`)]),W("asc",[k("base-icon",`
|
|||
|
|
transform: rotate(-180deg);
|
|||
|
|
`)]),W("asc, desc",`
|
|||
|
|
color: var(--n-th-icon-color-active);
|
|||
|
|
`)]),k("data-table-resize-button",`
|
|||
|
|
width: var(--n-resizable-container-size);
|
|||
|
|
position: absolute;
|
|||
|
|
top: 0;
|
|||
|
|
right: calc(var(--n-resizable-container-size) / 2);
|
|||
|
|
bottom: 0;
|
|||
|
|
cursor: col-resize;
|
|||
|
|
user-select: none;
|
|||
|
|
`,[q("&::after",`
|
|||
|
|
width: var(--n-resizable-size);
|
|||
|
|
height: 50%;
|
|||
|
|
position: absolute;
|
|||
|
|
top: 50%;
|
|||
|
|
left: calc(var(--n-resizable-container-size) / 2);
|
|||
|
|
bottom: 0;
|
|||
|
|
background-color: var(--n-merged-border-color);
|
|||
|
|
transform: translateY(-50%);
|
|||
|
|
transition: background-color .3s var(--n-bezier);
|
|||
|
|
z-index: 1;
|
|||
|
|
content: '';
|
|||
|
|
`),W("active",[q("&::after",`
|
|||
|
|
background-color: var(--n-th-icon-color-active);
|
|||
|
|
`)]),q("&:hover::after",`
|
|||
|
|
background-color: var(--n-th-icon-color-active);
|
|||
|
|
`)]),k("data-table-filter",`
|
|||
|
|
position: absolute;
|
|||
|
|
z-index: auto;
|
|||
|
|
right: 0;
|
|||
|
|
width: 36px;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: 0;
|
|||
|
|
cursor: pointer;
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: center;
|
|||
|
|
align-items: center;
|
|||
|
|
transition:
|
|||
|
|
background-color .3s var(--n-bezier),
|
|||
|
|
color .3s var(--n-bezier);
|
|||
|
|
font-size: var(--n-filter-size);
|
|||
|
|
color: var(--n-th-icon-color);
|
|||
|
|
`,[q("&:hover",`
|
|||
|
|
background-color: var(--n-th-button-color-hover);
|
|||
|
|
`),W("show",`
|
|||
|
|
background-color: var(--n-th-button-color-hover);
|
|||
|
|
`),W("active",`
|
|||
|
|
background-color: var(--n-th-button-color-hover);
|
|||
|
|
color: var(--n-th-icon-color-active);
|
|||
|
|
`)])]),k("data-table-td",`
|
|||
|
|
padding: var(--n-td-padding);
|
|||
|
|
text-align: start;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
border: none;
|
|||
|
|
background-color: var(--n-merged-td-color);
|
|||
|
|
color: var(--n-td-text-color);
|
|||
|
|
border-bottom: 1px solid var(--n-merged-border-color);
|
|||
|
|
transition:
|
|||
|
|
box-shadow .3s var(--n-bezier),
|
|||
|
|
background-color .3s var(--n-bezier),
|
|||
|
|
border-color .3s var(--n-bezier),
|
|||
|
|
color .3s var(--n-bezier);
|
|||
|
|
`,[W("expand",[k("data-table-expand-trigger",`
|
|||
|
|
margin-right: 0;
|
|||
|
|
`)]),W("last-row",`
|
|||
|
|
border-bottom: 0 solid var(--n-merged-border-color);
|
|||
|
|
`,[q("&::after",`
|
|||
|
|
bottom: 0 !important;
|
|||
|
|
`),q("&::before",`
|
|||
|
|
bottom: 0 !important;
|
|||
|
|
`)]),W("summary",`
|
|||
|
|
background-color: var(--n-merged-th-color);
|
|||
|
|
`),W("hover",`
|
|||
|
|
background-color: var(--n-merged-td-color-hover);
|
|||
|
|
`),W("sorting",`
|
|||
|
|
background-color: var(--n-merged-td-color-sorting);
|
|||
|
|
`),H("ellipsis",`
|
|||
|
|
display: inline-block;
|
|||
|
|
text-overflow: ellipsis;
|
|||
|
|
overflow: hidden;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
max-width: 100%;
|
|||
|
|
vertical-align: bottom;
|
|||
|
|
max-width: calc(100% - var(--indent-offset, -1.5) * 16px - 24px);
|
|||
|
|
`),W("selection, expand",`
|
|||
|
|
text-align: center;
|
|||
|
|
padding: 0;
|
|||
|
|
line-height: 0;
|
|||
|
|
`),Wo]),k("data-table-empty",`
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
padding: var(--n-empty-padding);
|
|||
|
|
flex-grow: 1;
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
opacity: 1;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
transition: opacity .3s var(--n-bezier);
|
|||
|
|
`,[W("hide",`
|
|||
|
|
opacity: 0;
|
|||
|
|
`)]),H("pagination",`
|
|||
|
|
margin: var(--n-pagination-margin);
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: flex-end;
|
|||
|
|
`),k("data-table-wrapper",`
|
|||
|
|
position: relative;
|
|||
|
|
opacity: 1;
|
|||
|
|
transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier);
|
|||
|
|
border-top-left-radius: var(--n-border-radius);
|
|||
|
|
border-top-right-radius: var(--n-border-radius);
|
|||
|
|
line-height: var(--n-line-height);
|
|||
|
|
`),W("loading",[k("data-table-wrapper",`
|
|||
|
|
opacity: var(--n-opacity-loading);
|
|||
|
|
pointer-events: none;
|
|||
|
|
`)]),W("single-column",[k("data-table-td",`
|
|||
|
|
border-bottom: 0 solid var(--n-merged-border-color);
|
|||
|
|
`,[q("&::after, &::before",`
|
|||
|
|
bottom: 0 !important;
|
|||
|
|
`)])]),Ye("single-line",[k("data-table-th",`
|
|||
|
|
border-right: 1px solid var(--n-merged-border-color);
|
|||
|
|
`,[W("last",`
|
|||
|
|
border-right: 0 solid var(--n-merged-border-color);
|
|||
|
|
`)]),k("data-table-td",`
|
|||
|
|
border-right: 1px solid var(--n-merged-border-color);
|
|||
|
|
`,[W("last-col",`
|
|||
|
|
border-right: 0 solid var(--n-merged-border-color);
|
|||
|
|
`)])]),W("bordered",[k("data-table-wrapper",`
|
|||
|
|
border: 1px solid var(--n-merged-border-color);
|
|||
|
|
border-bottom-left-radius: var(--n-border-radius);
|
|||
|
|
border-bottom-right-radius: var(--n-border-radius);
|
|||
|
|
overflow: hidden;
|
|||
|
|
`)]),k("data-table-base-table",[W("transition-disabled",[k("data-table-th",[q("&::after, &::before","transition: none;")]),k("data-table-td",[q("&::after, &::before","transition: none;")])])]),W("bottom-bordered",[k("data-table-td",[W("last-row",`
|
|||
|
|
border-bottom: 1px solid var(--n-merged-border-color);
|
|||
|
|
`)])]),k("data-table-table",`
|
|||
|
|
font-variant-numeric: tabular-nums;
|
|||
|
|
width: 100%;
|
|||
|
|
word-break: break-word;
|
|||
|
|
transition: background-color .3s var(--n-bezier);
|
|||
|
|
border-collapse: separate;
|
|||
|
|
border-spacing: 0;
|
|||
|
|
background-color: var(--n-merged-td-color);
|
|||
|
|
`),k("data-table-base-table-header",`
|
|||
|
|
border-top-left-radius: calc(var(--n-border-radius) - 1px);
|
|||
|
|
border-top-right-radius: calc(var(--n-border-radius) - 1px);
|
|||
|
|
z-index: 3;
|
|||
|
|
overflow: scroll;
|
|||
|
|
flex-shrink: 0;
|
|||
|
|
transition: border-color .3s var(--n-bezier);
|
|||
|
|
scrollbar-width: none;
|
|||
|
|
`,[q("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
|
|||
|
|
display: none;
|
|||
|
|
width: 0;
|
|||
|
|
height: 0;
|
|||
|
|
`)]),k("data-table-check-extra",`
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
color: var(--n-th-icon-color);
|
|||
|
|
position: absolute;
|
|||
|
|
font-size: 14px;
|
|||
|
|
right: -4px;
|
|||
|
|
top: 50%;
|
|||
|
|
transform: translateY(-50%);
|
|||
|
|
z-index: 1;
|
|||
|
|
`)]),k("data-table-filter-menu",[k("scrollbar",`
|
|||
|
|
max-height: 240px;
|
|||
|
|
`),H("group",`
|
|||
|
|
display: flex;
|
|||
|
|
flex-direction: column;
|
|||
|
|
padding: 12px 12px 0 12px;
|
|||
|
|
`,[k("checkbox",`
|
|||
|
|
margin-bottom: 12px;
|
|||
|
|
margin-right: 0;
|
|||
|
|
`),k("radio",`
|
|||
|
|
margin-bottom: 12px;
|
|||
|
|
margin-right: 0;
|
|||
|
|
`)]),H("action",`
|
|||
|
|
padding: var(--n-action-padding);
|
|||
|
|
display: flex;
|
|||
|
|
flex-wrap: nowrap;
|
|||
|
|
justify-content: space-evenly;
|
|||
|
|
border-top: 1px solid var(--n-action-divider-color);
|
|||
|
|
`,[k("button",[q("&:not(:last-child)",`
|
|||
|
|
margin: var(--n-action-button-margin);
|
|||
|
|
`),q("&:last-child",`
|
|||
|
|
margin-right: 0;
|
|||
|
|
`)])]),k("divider",`
|
|||
|
|
margin: 0 !important;
|
|||
|
|
`)]),or(k("data-table",`
|
|||
|
|
--n-merged-th-color: var(--n-th-color-modal);
|
|||
|
|
--n-merged-td-color: var(--n-td-color-modal);
|
|||
|
|
--n-merged-border-color: var(--n-border-color-modal);
|
|||
|
|
--n-merged-th-color-hover: var(--n-th-color-hover-modal);
|
|||
|
|
--n-merged-td-color-hover: var(--n-td-color-hover-modal);
|
|||
|
|
--n-merged-th-color-sorting: var(--n-th-color-hover-modal);
|
|||
|
|
--n-merged-td-color-sorting: var(--n-td-color-hover-modal);
|
|||
|
|
--n-merged-td-color-striped: var(--n-td-color-striped-modal);
|
|||
|
|
`)),rr(k("data-table",`
|
|||
|
|
--n-merged-th-color: var(--n-th-color-popover);
|
|||
|
|
--n-merged-td-color: var(--n-td-color-popover);
|
|||
|
|
--n-merged-border-color: var(--n-border-color-popover);
|
|||
|
|
--n-merged-th-color-hover: var(--n-th-color-hover-popover);
|
|||
|
|
--n-merged-td-color-hover: var(--n-td-color-hover-popover);
|
|||
|
|
--n-merged-th-color-sorting: var(--n-th-color-hover-popover);
|
|||
|
|
--n-merged-td-color-sorting: var(--n-td-color-hover-popover);
|
|||
|
|
--n-merged-td-color-striped: var(--n-td-color-striped-popover);
|
|||
|
|
`))]);function Rs(){return[W("fixed-left",`
|
|||
|
|
left: 0;
|
|||
|
|
position: sticky;
|
|||
|
|
z-index: 2;
|
|||
|
|
`,[q("&::after",`
|
|||
|
|
pointer-events: none;
|
|||
|
|
content: "";
|
|||
|
|
width: 36px;
|
|||
|
|
display: inline-block;
|
|||
|
|
position: absolute;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: -1px;
|
|||
|
|
transition: box-shadow .2s var(--n-bezier);
|
|||
|
|
right: -36px;
|
|||
|
|
`)]),W("fixed-right",`
|
|||
|
|
right: 0;
|
|||
|
|
position: sticky;
|
|||
|
|
z-index: 1;
|
|||
|
|
`,[q("&::before",`
|
|||
|
|
pointer-events: none;
|
|||
|
|
content: "";
|
|||
|
|
width: 36px;
|
|||
|
|
display: inline-block;
|
|||
|
|
position: absolute;
|
|||
|
|
top: 0;
|
|||
|
|
bottom: -1px;
|
|||
|
|
transition: box-shadow .2s var(--n-bezier);
|
|||
|
|
left: -36px;
|
|||
|
|
`)])]}function Ps(e,t){const{paginatedDataRef:n,treeMateRef:o,selectionColumnRef:r}=t,a=D(e.defaultCheckedRowKeys),l=R(()=>{var F;const{checkedRowKeys:z}=e,N=z===void 0?a.value:z;return((F=r.value)===null||F===void 0?void 0:F.multiple)===!1?{checkedKeys:N.slice(0,1),indeterminateKeys:[]}:o.value.getCheckedKeys(N,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})}),i=R(()=>l.value.checkedKeys),d=R(()=>l.value.indeterminateKeys),c=R(()=>new Set(i.value)),u=R(()=>new Set(d.value)),h=R(()=>{const{value:F}=c;return n.value.reduce((z,N)=>{const{key:X,disabled:_}=N;return z+(!_&&F.has(X)?1:0)},0)}),v=R(()=>n.value.filter(F=>F.disabled).length),g=R(()=>{const{length:F}=n.value,{value:z}=u;return h.value>0&&h.value<F-v.value||n.value.some(N=>z.has(N.key))}),f=R(()=>{const{length:F}=n.value;return h.value!==0&&h.value===F-v.value}),p=R(()=>n.value.length===0);function b(F,z,N){const{"onUpdate:checkedRowKeys":X,onUpdateCheckedRowKeys:_,onCheckedRowKeysChange:A}=e,Z=[],{value:{getNode:B}}=o;F.forEach(P=>{var $;const V=($=B(P))===null||$===void 0?void 0:$.rawNode;Z.push(V)}),X&&J(X,F,Z,{row:z,action:N}),_&&J(_,F,Z,{row:z,action:N}),A&&J(A,F,Z,{row:z,action:N}),a.value=F}function m(F,z=!1,N){if(!e.loading){if(z){b(Array.isArray(F)?F.slice(0,1):[F],N,"check");return}b(o.value.check(F,i.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,N,"check")}}function y(F,z){e.loading||b(o.value.uncheck(F,i.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,z,"uncheck")}function C(F=!1){const{value:z}=r;if(!z||e.loading)return;const N=[];(F?o.value.treeNodes:n.value).forEach(X=>{X.disabled||N.push(X.key)}),b(o.value.check(N,i.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"checkAll")}function T(F=!1){const{value:z}=r;if(!z||e.loading)return;const N=[];(F?o.value.treeNodes:n.value).forEach(X=>{X.disabled||N.push(X.key)}),b(o.value.uncheck(N,i.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"uncheckAll")}return{mergedCheckedRowKeySetRef:c,mergedCheckedRowKeysRef:i,mergedInderminateRowKeySetRef:u,someRowsCheckedRef:g,allRowsCheckedRef:f,headerCheckboxDisabledRef:p,doUpdateCheckedRowKeys:b,doCheckAll:C,doUncheckAll:T,doCheck:m,doUncheck:y}}function zs(e,t){const n=Ze(()=>{for(const c of e.columns)if(c.type==="expand")return c.renderExpand}),o=Ze(()=>{let c;for(const u of e.columns)if(u.type==="expand"){c=u.expandable;break}return c}),r=D(e.defaultExpandAll?n!=null&&n.value?(()=>{const c=[];return t.value.treeNodes.forEach(u=>{var h;!((h=o.value)===null||h===void 0)&&h.call(o,u.rawNode)&&c.push(u.key)}),c})():t.value.getNonLeafKeys():e.defaultExpandedRowKeys),a=se(e,"expandedRowKeys"),l=se(e,"stickyExpandedRows"),i=bt(a,r);function d(c){const{onUpdateExpandedRowKeys:u,"onUpdate:expandedRowKeys":h}=e;u&&J(u,c),h&&J(h,c),r.value=c}return{stickyExpandedRowsRef:l,mergedExpandedRowKeysRef:i,renderExpandRef:n,expandableRef:o,doUpdateExpandedRowKeys:d}}function Fs(e,t){const n=[],o=[],r=[],a=new WeakMap;let l=-1,i=0,d=!1,c=0;function u(v,g){g>l&&(n[g]=[],l=g),v.forEach(f=>{if("children"in f)u(f.children,g+1);else{const p="key"in f?f.key:void 0;o.push({key:xt(f),style:Kl(f,p!==void 0?ot(t(p)):void 0),column:f,index:c++,width:f.width===void 0?128:Number(f.width)}),i+=1,d||(d=!!f.ellipsis),r.push(f)}})}u(e,0),c=0;function h(v,g){let f=0;v.forEach(p=>{var b;if("children"in p){const m=c,y={column:p,colIndex:c,colSpan:0,rowSpan:1,isLast:!1};h(p.children,g+1),p.children.forEach(C=>{var T,F;y.colSpan+=(F=(T=a.get(C))===null||T===void 0?void 0:T.colSpan)!==null&&F!==void 0?F:0}),m+y.colSpan===i&&(y.isLast=!0),a.set(p,y),n[g].push(y)}else{if(c<f){c+=1;return}let m=1;"titleColSpan"in p&&(m=(b=p.titleColSpan)!==null&&b!==void 0?b:1),m>1&&(f=c+m);const y=c+m===i,C={column:p,colSpan:m,colIndex:c,rowSpan:l-g+1,isLast:y};a.set(p,C),n[g].push(C),c+=1}})}return h(e,0),{hasEllipsis:d,rows:n,cols:o,dataRelatedCols:r}}function Ms(e,t){const n=R(()=>Fs(e.columns,t));return{rowsRef:R(()=>n.value.rows),colsRef:R(()=>n.value.cols),hasEllipsisRef:R(()=>n.v
|
|||
|
|
width: 100%;
|
|||
|
|
display: inline-flex;
|
|||
|
|
align-items: flex-start;
|
|||
|
|
align-content: space-around;
|
|||
|
|
`,[k("form-item",{width:"auto",marginRight:"18px"},[q("&:last-child",{marginRight:0})])])]);var Ds=function(e,t,n,o){function r(a){return a instanceof n?a:new n(function(l){l(a)})}return new(n||(n=Promise))(function(a,l){function i(u){try{c(o.next(u))}catch(h){l(h)}}function d(u){try{c(o.throw(u))}catch(h){l(h)}}function c(u){u.done?a(u.value):r(u.value).then(i,d)}c((o=o.apply(e,t||[])).next())})};const Hs=Object.assign(Object.assign({},Te.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}),Fd=ve({name:"Form",props:Hs,setup(e){const{mergedClsPrefixRef:t}=Ge(e);Te("Form","-form",Ls,Lr,e,t);const n={},o=D(void 0),r=d=>{const c=o.value;(c===void 0||d>=c)&&(o.value=d)};function a(d){return Ds(this,arguments,void 0,function*(c,u=()=>!0){return yield new Promise((h,v)=>{const g=[];for(const f of gn(n)){const p=n[f];for(const b of p)b.path&&g.push(b.internalValidate(null,u))}Promise.all(g).then(f=>{const p=f.some(y=>!y.valid),b=[],m=[];f.forEach(y=>{var C,T;!((C=y.errors)===null||C===void 0)&&C.length&&b.push(y.errors),!((T=y.warnings)===null||T===void 0)&&T.length&&m.push(y.warnings)}),c&&c(b.length?b:void 0,{warnings:m.length?m:void 0}),p?v(b.length?b:void 0):h({warnings:m.length?m:void 0})})})})}function l(){for(const d of gn(n)){const c=n[d];for(const u of c)u.restoreValidation()}}return pt(an,{props:e,maxChildLabelWidthRef:o,deriveMaxChildLabelWidth:r}),pt(Dr,{formItems:n}),Object.assign({validate:a,restoreValidation:l},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return s("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},It.apply(this,arguments)}function js(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,on(e,t)}function Gn(e){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gn(e)}function on(e,t){return on=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},on(e,t)}function Ns(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function un(e,t,n){return Ns()?un=Reflect.construct.bind():un=function(r,a,l){var i=[null];i.push.apply(i,a);var d=Function.bind.apply(r,i),c=new d;return l&&on(c,l.prototype),c},un.apply(null,arguments)}function Vs(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Yn(e){var t=typeof Map=="function"?new Map:void 0;return Yn=function(o){if(o===null||!Vs(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(o))return t.get(o);t.set(o,r)}function r(){return un(o,arguments,Gn(this).constructor)}return r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),on(r,o)},Yn(e)}var Ws=/%[sdj%]/g,Us=function(){};function Zn(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var o=n.field;t[o]=t[o]||[],t[o].push(n)}),t}function ct(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=0,a=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var l=e.replace(Ws,function(i){if(i==="%%")return"%";if(r>=a)return i;switch(i){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}break;
|
|||
|
|
(?:
|
|||
|
|
(?:`+o+":){7}(?:"+o+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|||
|
|
(?:`+o+":){6}(?:"+n+"|:"+o+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|||
|
|
(?:`+o+":){5}(?::"+n+"|(?::"+o+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
|
|||
|
|
(?:`+o+":){4}(?:(?::"+o+"){0,1}:"+n+"|(?::"+o+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
|
|||
|
|
(?:`+o+":){3}(?:(?::"+o+"){0,2}:"+n+"|(?::"+o+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
|
|||
|
|
(?:`+o+":){2}(?:(?::"+o+"){0,3}:"+n+"|(?::"+o+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
|
|||
|
|
(?:`+o+":){1}(?:(?::"+o+"){0,4}:"+n+"|(?::"+o+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|||
|
|
(?::(?:(?::`+o+"){0,5}:"+n+"|(?::"+o+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|||
|
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|||
|
|
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+n+"$)|(?:^"+r+"$)"),l=new RegExp("^"+n+"$"),i=new RegExp("^"+r+"$"),d=function(T){return T&&T.exact?a:new RegExp("(?:"+t(T)+n+t(T)+")|(?:"+t(T)+r+t(T)+")","g")};d.v4=function(C){return C&&C.exact?l:new RegExp(""+t(C)+n+t(C),"g")},d.v6=function(C){return C&&C.exact?i:new RegExp(""+t(C)+r+t(C),"g")};var c="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",h=d.v4().source,v=d.v6().source,g="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",f="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",p="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",b="(?::\\d{2,5})?",m='(?:[/?#][^\\s"]*)?',y="(?:"+c+"|www\\.)"+u+"(?:localhost|"+h+"|"+v+"|"+g+f+p+")"+b+m;return cn=new RegExp("(?:^"+y+"$)","i"),cn},Go={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Qt={integer:function(t){return Qt.number(t)&&parseInt(t,10)===t},float:function(t){return Qt.number(t)&&!Qt.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Qt.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(Go.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(Qs())},hex:function(t){return typeof t=="string"&&!!t.match(Go.hex)}},ed=function(t,n,o,r,a){if(t.required&&n===void 0){Hr(t,n,o,r,a);return}var l=["integer","float","array","regexp","object","method","email","number","date","url","hex"],i=t.type;l.indexOf(i)>-1?Qt[i](n)||r.push(ct(a.messages.types[i],t.fullField,t.type)):i&&typeof n!==t.type&&r.push(ct(a.messages.types[i],t.fullField,t.type))},td=function(t,n,o,r,a){var l=typeof t.len=="number",i=typeof t.min=="number",d=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=n,h=null,v=typeof n=="number",g=typeof n=="string",f=Array.isArray(n);if(v?h="number":g?h="string":f&&(h="array"),!h)return!1;f&&(u=n.length),g&&(u=n.replace(c,"_").length),l?u!==t.len&&r.push(ct(a.messages[h].len,t.fullField,t.len)):i&&!d&&u<t.min?r.push(ct(a.messages[h].min,t.fullField,t.min)):d&&!i&&u>t.max?r.push(ct(a.messages[h].max,t.fullField,t.max)):i&&d&&(u<t.min||u>t.max)&&r.push(ct(a.messages[h].range,t.fullField,t.min,t.max))},Dt="enum",nd=function(t,n,o,r,a){t[Dt]=Array.isArray(t[Dt])?t[Dt]:[],t[Dt].indexOf(n)===-1&&r.push(ct(a.messages[Dt],t.fullField,t[Dt].join(", ")))},od=function(t,n,o,r,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||r.push(ct(a.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var l=new RegExp(t.pattern);l.test(n)||r.push(ct(a.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},ze={required:Hr,whitespace:Js,type:ed,range:td,enum:nd,pattern:od},rd=function(t,n,o,r,a){var l=[],i=t.required||!t.required&&r.hasOwnProperty(t.field);if(i){if(Je(n,"string")&&!t.required)return o();ze.required(t,n,r,l,a,"string"),Je(n,"string")||(ze.type(t,n,r,l,a),ze.range(t,n,r,l,a),ze.pattern(t,n,r,l,a),t.whitespace===!0&&ze.whitespace(t,n,r,l,a))}o(l)},ad=function(t,n,o,r,a){var l=[],i=t.required||!t.required&&r.hasOwnProperty(t.field);if(i){if(Je(n)&&!t.required)return o();ze.required(t,n,r,l,a),n!==void 0&&ze.type(t,n,r,l,a)}o(l)},id=function(t,n,o,r,a){var l=[],i=t.required||!t.required&&r.hasOwnProperty(t.field);if(i){if(n===""&&(n=void 0),Je(n)&&!t.required)return o();ze.required(t,n,r,l,a),n!==void 0&&(ze.type(t,n,r,l,a),ze.range(t,n,r,l,a))}o(l)},ld=function(t,n,o,r,a){var l=[],i=t.required||!t.required&&r.hasOwnProperty(t.field);if(i){if(Je(n)&&!t.requir
|
|||
|
|
display: grid;
|
|||
|
|
line-height: var(--n-line-height);
|
|||
|
|
`,[k("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);
|
|||
|
|
`,[H("asterisk",`
|
|||
|
|
white-space: nowrap;
|
|||
|
|
user-select: none;
|
|||
|
|
-webkit-user-select: none;
|
|||
|
|
color: var(--n-asterisk-color);
|
|||
|
|
transition: color .3s var(--n-bezier);
|
|||
|
|
`),H("asterisk-placeholder",`
|
|||
|
|
grid-area: mark;
|
|||
|
|
user-select: none;
|
|||
|
|
-webkit-user-select: none;
|
|||
|
|
visibility: hidden;
|
|||
|
|
`)]),k("form-item-blank",`
|
|||
|
|
grid-area: blank;
|
|||
|
|
min-height: var(--n-blank-height);
|
|||
|
|
`),W("auto-label-width",[k("form-item-label","white-space: nowrap;")]),W("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;
|
|||
|
|
`,[k("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;
|
|||
|
|
`,[W("reverse-columns-space",`
|
|||
|
|
grid-template-columns: auto 1fr;
|
|||
|
|
`),W("left-mark",`
|
|||
|
|
grid-template-areas:
|
|||
|
|
"mark text"
|
|||
|
|
". text";
|
|||
|
|
`),W("right-mark",`
|
|||
|
|
grid-template-areas:
|
|||
|
|
"text mark"
|
|||
|
|
"text .";
|
|||
|
|
`),W("right-hanging-mark",`
|
|||
|
|
grid-template-areas:
|
|||
|
|
"text mark"
|
|||
|
|
"text .";
|
|||
|
|
`),H("text",`
|
|||
|
|
grid-area: text;
|
|||
|
|
`),H("asterisk",`
|
|||
|
|
grid-area: mark;
|
|||
|
|
align-self: end;
|
|||
|
|
`)])]),W("top-labelled",`
|
|||
|
|
grid-template-areas:
|
|||
|
|
"label"
|
|||
|
|
"blank"
|
|||
|
|
"feedback";
|
|||
|
|
grid-template-rows: minmax(var(--n-label-height), auto) 1fr;
|
|||
|
|
grid-template-columns: minmax(0, 100%);
|
|||
|
|
`,[W("no-label",`
|
|||
|
|
grid-template-areas:
|
|||
|
|
"blank"
|
|||
|
|
"feedback";
|
|||
|
|
grid-template-rows: 1fr;
|
|||
|
|
`),k("form-item-label",`
|
|||
|
|
display: flex;
|
|||
|
|
align-items: flex-start;
|
|||
|
|
justify-content: var(--n-label-text-align);
|
|||
|
|
`)]),k("form-item-blank",`
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
position: relative;
|
|||
|
|
`),k("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;
|
|||
|
|
`,[q("&:not(:empty)",`
|
|||
|
|
padding: var(--n-feedback-padding);
|
|||
|
|
`),k("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[W("warning",{color:"var(--n-feedback-text-color-warning)"}),W("error",{color:"var(--n-feedback-text-color-error)"}),xd({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);function wd(e){const t=Ae(an,null);return{mergedSize:R(()=>e.size!==void 0?e.size:(t==null?void 0:t.props.size)!==void 0?t.props.size:"medium")}}function Cd(e){const t=Ae(an,null),n=R(()=>{const{labelPlacement:f}=e;return f!==void 0?f:t!=null&&t.props.labelPlacement?t.props.labelPlacement:"top"}),o=R(()=>n.value==="left"&&(e.labelWidth==="auto"||(t==null?void 0:t.props.labelWidth)==="auto")),r=R(()=>{if(n.value==="top")return;const{labelWidth:f}=e;if(f!==void 0&&f!=="auto")return ot(f);if(o.value){const p=t==null?void 0:t.maxChildLabelWidthRef.value;return p!==void 0?ot(p):void 0}if((t==null?void 0:t.props.labelWidth)!==void 0)return ot(t.props.labelWidth)}),a=R(()=>{const{labelAlign:f}=e;if(f)return f;if(t!=null&&t.props.labelAlign)return t.props.labelAlign}),l=R(()=>{var f;return[(f=e.labelProps)===null||f===void 0?void 0:f.style,e.labelStyle,{width:r.value}]}),i=R(()=>{const{showRequireMark:f}=e;return f!==void 0?f:t==null?void 0:t.props.showRequireMark}),d=R(()=>{const{requireMarkPlacement:f}=e;return f!==void 0?f:(t==null?void 0:t.props.requireMarkPlacement)||"right"}),c=D(!1),u=D(!1),h=R(()=>{const{validationStatus:f}=e;if(f!==void 0)return f;if(c.value)return"error";if(u.value)return"warning"}),v=R(()=>{const{showFeedback:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showFeedback)!==void 0?t.props.showFeedback:!0}),g=R(()=>{const{showLabel:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showLabel)!==void 0?t.props.showLabel:!0});return{validationErrored:c,validationWarned:u,mergedLabelStyle:l,mergedLabelPlacement:n,mergedLabelAlign:a,mergedShowRequireMark:i,mergedRequireMarkPlacement:d,mergedValidationStatus:h,mergedShowFeedback:v,mergedShowLabel:g,isAutoLabelWidth:o}}function Sd(e){const t=Ae(an,null),n=R(()=>{const{rulePath:l}=e;if(l!==void 0)return l;const{path:i}=e;if(i!==void 0)return i}),o=R(()=>{const l=[],{rule:i}=e;if(i!==void 0&&(Array.isArray(i)?l.push(...i):l.push(i)),t){const{rules:d}=t.props,{value:c}=n;if(d!==void 0&&c!==void 0){const u=bn(d,c);u!==void 0&&(Array.isArray(u)?l.push(...u):l.push(u))}}return l}),r=R(()=>o.value.some(l=>l.required)),a=R(()=>r.value||e.required);return{mergedRules:o,mergedRequired:a}}var Zo=function(e,t,n,o){function r(a){return a instanceof n?a:new n(function(l){l(a)})}return new(n||(n=Promise))(function(a,l){function i(u){try{c(o.next(u))}catch(h){l(h)}}function d(u){try{c(o.throw(u))}catch(h){l(h)}}function c(u){u.done?a(u.value):r(u.value).then(i,d)}c((o=o.apply(e,t||[])).next())})};const jr=Object.assign(Object.assign({},Te.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object}),Md=gn(jr);function Jo(e,t){return(...n)=>{try{const o=e(...n);return!t&&(typeof o=="boolean"||o instanceof Error||Array.isArray(o))||o!=null&&o.then?o:(o===void 0||mn("form-item/validate",`You return a ${typeof o} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(o){mn("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(o);return}}}const Td=ve({name:"FormItem",props:jr,setup(e){Wa(Dr,"formItems",se(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=Ge(e),o=Ae(an,null),r=wd(e),a=Cd(e),{validation
|