物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

409 lines
66 KiB

  1. import{d as fe,s as E,v as qe,Q as ct,G as d,M as rn,S as St,i as dt,c as D,T as Ot,O as Q,t as Pe,P as lt,E as ln,F as an,y as sn,z as cn}from"./index-bVOhw2NF.js";import{E as dn,c as I,a as T,b as ee,u as Ee,f as ue,g as H,h as Ne,d as U,e as Se}from"./light-Cua7cqmF.js";import{f as Rt}from"./fade-in-scale-up.cssr-CTZmXn_X.js";import{e as un,i as fn,a as hn,s as vn}from"./light-CE5Kvs_2.js";import{u as vt}from"./use-merged-state-CzrzZJbg.js";import{u as gn}from"./use-compitable-DMmt6sIs.js";import{u as Pt}from"./use-locale-CFjRjALw.js";import{u as bn}from"./use-form-item-CNgNT5jP.js";import{i as pn}from"./use-is-mounted-wlrzLfZo.js";import{i as ut,c as mn,u as at,B as yn,V as Cn,a as wn}from"./Follower-DJGS5Fnl.js";import{u as ft}from"./use-rtl-CRyak7TN.js";import{r as Re}from"./render-BxFg9-7m.js";import{d as xn,g as Fe}from"./index-C-nsH7mf.js";import{a as kn}from"./Suffix-BqBRFVnL.js";import{S as Sn,W as On}from"./Scrollbar-DVK2lT9w.js";import{t as Rn}from"./light-BOD3MGQo.js";import{c as gt}from"./color-to-class-B0iQgAn2.js";import{r as He,a as Pn}from"./resolve-slot-Dzko3qih.js";import{N as Fn}from"./Close-D6FODkWY.js";import{a as zn,c as Tn}from"./context-KbjOeZY_.js";import{c as se}from"./call-f2ri57Kd.js";import{c as Mn,a as _n}from"./cssr-CS9sbUmO.js";import{N as In}from"./Popover-DLIip8wF.js";import{r as bt}from"./VResizeObserver-Tzd5ds8d.js";import{c as pt}from"./clickoutside-CCtiUDaG.js";import{F as Bn,V as An}from"./FocusDetector-DcygY9Tk.js";import{u as Xe}from"./use-memo-BgHp9YyU.js";import{N as Ft}from"./Icon-Ck7Ij_E6.js";import{N as $n}from"./Loading-CByrJVhO.js";import{h as $e}from"./happens-in-CM8LO42l.js";import{g as En}from"./get-precise-event-target-DhO46Lpt.js";import{m as Nn}from"./index-DsSU6HIH.js";function mt(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function et(e){const n=e.filter(t=>t!==void 0);if(n.length!==0)return n.length===1?n[0]:t=>{e.forEach(r=>{r&&r(t)})}}const ge="v-hidden",Ln=_n("[v-hidden]",{display:"none!important"}),yt=fe({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:n}){const t=E(null),r=E(null);function i(a){const{value:l}=t,{getCounter:C,getTail:b}=e;let c;if(C!==void 0?c=C():c=r.value,!l||!c)return;c.hasAttribute(ge)&&c.removeAttribute(ge);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const S of h)S.hasAttribute(ge)&&S.removeAttribute(ge);const k=l.offsetWidth,m=[],v=n.tail?b==null?void 0:b():null;let P=v?v.offsetWidth:0,B=!1;const O=l.children.length-(n.tail?1:0);for(let S=0;S<O-1;++S){if(S<0)continue;const g=h[S];if(B){g.hasAttribute(ge)||g.setAttribute(ge,"");continue}else g.hasAttribute(ge)&&g.removeAttribute(ge);const y=g.offsetWidth;if(P+=y,m[S]=y,P>k){const{updateCounter:N}=e;for(let L=S;L>=0;--L){const K=O-1-L;N!==void 0?N(K):c.textContent=`${K}`;const W=c.offsetWidth;if(P-=m[L],P+W<=k||L===0){B=!0,S=L-1,v&&(S===-1?(v.style.maxWidth=`${k-W}px`,v.style.boxSizing="border-box"):v.style.maxWidth="");const{onUpdateCount:A}=e;A&&A(K);break}}}}const{onUpdateOverflow:F}=e;B?F!==void 0&&F(!0):(F!==void 0&&F(!1),c.setAttribute(ge,""))}const s=dn();return Ln.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Mn,ssr:s}),qe(()=>i({showAllItemsBeforeCalculate:!1})),{selfRef:t,counterRef:r,sync:i}},render(){const{$slots:e}=this;return ct(()=>this.sync({showAllItemsBeforeCalculate:!1})),d("div",{class:"v-overflow",ref:"selfRef"},[rn(e,"default"),e.counter?e.counter():d("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function zt(e,n){n&&(qe(()=>{const{value:t}=e;t&&bt.registerHandler(t,n)}),St(()=>{const{value:t}=e;t&&bt.unregisterHandler(t)}))}const Dn=fe({name:"Checkmark",render(){return d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},d("g",{fill:"none"},d("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),Kn=fe({name:"Emp
  2. display: flex;
  3. flex-direction: column;
  4. align-items: center;
  5. font-size: var(--n-font-size);
  6. `,[T("icon",`
  7. width: var(--n-icon-size);
  8. height: var(--n-icon-size);
  9. font-size: var(--n-icon-size);
  10. line-height: var(--n-icon-size);
  11. color: var(--n-icon-color);
  12. transition:
  13. color .3s var(--n-bezier);
  14. `,[ee("+",[T("description",`
  15. margin-top: 8px;
  16. `)])]),T("description",`
  17. transition: color .3s var(--n-bezier);
  18. color: var(--n-text-color);
  19. `),T("extra",`
  20. text-align: center;
  21. transition: color .3s var(--n-bezier);
  22. margin-top: 12px;
  23. color: var(--n-extra-text-color);
  24. `)]),go=Object.assign(Object.assign({},ue.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),bo=fe({name:"Empty",props:go,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:t}=Ee(e),r=ue("Empty","-empty",vo,un,e,n),{localeRef:i}=Pt("Empty"),s=dt(zn,null),a=D(()=>{var c,h,k;return(c=e.description)!==null&&c!==void 0?c:(k=(h=s==null?void 0:s.mergedComponentPropsRef.value)===null||h===void 0?void 0:h.Empty)===null||k===void 0?void 0:k.description}),l=D(()=>{var c,h;return((h=(c=s==null?void 0:s.mergedComponentPropsRef.value)===null||c===void 0?void 0:c.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>d(Kn,null))}),C=D(()=>{const{size:c}=e,{common:{cubicBezierEaseInOut:h},self:{[H("iconSize",c)]:k,[H("fontSize",c)]:m,textColor:v,iconColor:P,extraTextColor:B}}=r.value;return{"--n-icon-size":k,"--n-font-size":m,"--n-bezier":h,"--n-text-color":v,"--n-icon-color":P,"--n-extra-text-color":B}}),b=t?Ne("empty",D(()=>{let c="";const{size:h}=e;return c+=h[0],c}),C,e):void 0;return{mergedClsPrefix:n,mergedRenderIcon:l,localizedDescription:D(()=>a.value||i.value.description),cssVars:t?void 0:C,themeClass:b==null?void 0:b.themeClass,onRender:b==null?void 0:b.onRender}},render(){const{$slots:e,mergedClsPrefix:n,onRender:t}=this;return t==null||t(),d("div",{class:[`${n}-empty`,this.themeClass],style:this.cssVars},this.showIcon?d("div",{class:`${n}-empty__icon`},e.icon?e.icon():d(Ft,{clsPrefix:n},{default:this.mergedRenderIcon})):null,this.showDescription?d("div",{class:`${n}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?d("div",{class:`${n}-empty__extra`},e.extra()):null)}});function po(e,n){return d(Ot,{name:"fade-in-scale-up-transition"},{default:()=>e?d(Ft,{clsPrefix:n,class:`${n}-base-select-option__check`},{default:()=>d(Dn)}):null})}const xt=fe({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:n,pendingTmNodeRef:t,multipleRef:r,valueSetRef:i,renderLabelRef:s,renderOptionRef:a,labelFieldRef:l,valueFieldRef:C,showCheckmarkRef:b,nodePropsRef:c,handleOptionClick:h,handleOptionMouseEnter:k}=dt(ut),m=Xe(()=>{const{value:O}=t;return O?e.tmNode.key===O.key:!1});function v(O){const{tmNode:F}=e;F.disabled||h(O,F)}function P(O){const{tmNode:F}=e;F.disabled||k(O,F)}function B(O){const{tmNode:F}=e,{value:S}=m;F.disabled||S||k(O,F)}return{multiple:r,isGrouped:Xe(()=>{const{tmNode:O}=e,{parent:F}=O;return F&&F.rawNode.type==="group"}),showCheckmark:b,nodeProps:c,isPending:m,isSelected:Xe(()=>{const{value:O}=n,{value:F}=r;if(O===null)return!1;const S=e.tmNode.rawNode[C.value];if(F){const{value:g}=i;return g.has(S)}else return O===S}),labelField:l,renderLabel:s,renderOption:a,handleMouseMove:B,handleMouseEnter:P,handleClick:v}},render(){const{clsPrefix:e,tmNode:{rawNode:n},isSelected:t,isPending:r,isGrouped:i,showCheckmark:s,nodeProps:a,renderOption:l,renderLabel:C,handleClick:b,handleMouseEnter:c,handleMouseMove:h}=this,k=po(t,e),m=C?[C(n,t),s&&k]:[Re(n[this.labelField],n,t),s&&k],v=a==null?void 0:a(n),P=d("div",Object.assign({},v,{class:[`${e}-base-select-option`,n.class,v==null?void 0:v.class,{[`${e}-base-select-option--disabled`]:n.disabled,[`${e}-base-select-option--selected`]:t,[`${e}-base-select-option--grouped`]:i,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:s}],style:[(v==null?void 0:v.style)||"",n.style||""],onClick:et([b,v==null?void 0:v.onClick]),onMouseenter:et([c,v==null?void 0:v.onMouseenter]),onMousemove:et([h,v==null?void 0:v.onMousemove])}),d("div",{class:`${e}-base-select-option__content`},m));return n.render?n.render({node:P,option:n,selected:t}):l?l({node:P,option:n,selected:t}):P}}),kt=fe({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:n,labelFieldRef:t,nodePropsRef:r}=dt(ut);return{labelField:t,nodeProps:r,renderLabel:e,renderOption:n}},render(){const{c
  25. line-height: 1.5;
  26. outline: none;
  27. z-index: 0;
  28. position: relative;
  29. border-radius: var(--n-border-radius);
  30. transition:
  31. background-color .3s var(--n-bezier),
  32. box-shadow .3s var(--n-bezier);
  33. background-color: var(--n-color);
  34. `,[I("scrollbar",`
  35. max-height: var(--n-height);
  36. `),I("virtual-list",`
  37. max-height: var(--n-height);
  38. `),I("base-select-option",`
  39. min-height: var(--n-option-height);
  40. font-size: var(--n-option-font-size);
  41. display: flex;
  42. align-items: center;
  43. `,[T("content",`
  44. z-index: 1;
  45. white-space: nowrap;
  46. text-overflow: ellipsis;
  47. overflow: hidden;
  48. `)]),I("base-select-group-header",`
  49. min-height: var(--n-option-height);
  50. font-size: .93em;
  51. display: flex;
  52. align-items: center;
  53. `),I("base-select-menu-option-wrapper",`
  54. position: relative;
  55. width: 100%;
  56. `),T("loading, empty",`
  57. display: flex;
  58. padding: 12px 32px;
  59. flex: 1;
  60. justify-content: center;
  61. `),T("loading",`
  62. color: var(--n-loading-color);
  63. font-size: var(--n-loading-size);
  64. `),T("header",`
  65. padding: 8px var(--n-option-padding-left);
  66. font-size: var(--n-option-font-size);
  67. transition:
  68. color .3s var(--n-bezier),
  69. border-color .3s var(--n-bezier);
  70. border-bottom: 1px solid var(--n-action-divider-color);
  71. color: var(--n-action-text-color);
  72. `),T("action",`
  73. padding: 8px var(--n-option-padding-left);
  74. font-size: var(--n-option-font-size);
  75. transition:
  76. color .3s var(--n-bezier),
  77. border-color .3s var(--n-bezier);
  78. border-top: 1px solid var(--n-action-divider-color);
  79. color: var(--n-action-text-color);
  80. `),I("base-select-group-header",`
  81. position: relative;
  82. cursor: default;
  83. padding: var(--n-option-padding);
  84. color: var(--n-group-header-text-color);
  85. `),I("base-select-option",`
  86. cursor: pointer;
  87. position: relative;
  88. padding: var(--n-option-padding);
  89. transition:
  90. color .3s var(--n-bezier),
  91. opacity .3s var(--n-bezier);
  92. box-sizing: border-box;
  93. color: var(--n-option-text-color);
  94. opacity: 1;
  95. `,[U("show-checkmark",`
  96. padding-right: calc(var(--n-option-padding-right) + 20px);
  97. `),ee("&::before",`
  98. content: "";
  99. position: absolute;
  100. left: 4px;
  101. right: 4px;
  102. top: 0;
  103. bottom: 0;
  104. border-radius: var(--n-border-radius);
  105. transition: background-color .3s var(--n-bezier);
  106. `),ee("&:active",`
  107. color: var(--n-option-text-color-pressed);
  108. `),U("grouped",`
  109. padding-left: calc(var(--n-option-padding-left) * 1.5);
  110. `),U("pending",[ee("&::before",`
  111. background-color: var(--n-option-color-pending);
  112. `)]),U("selected",`
  113. color: var(--n-option-text-color-active);
  114. `,[ee("&::before",`
  115. background-color: var(--n-option-color-active);
  116. `),U("pending",[ee("&::before",`
  117. background-color: var(--n-option-color-active-pending);
  118. `)])]),U("disabled",`
  119. cursor: not-allowed;
  120. `,[Se("selected",`
  121. color: var(--n-option-text-color-disabled);
  122. `),U("selected",`
  123. opacity: var(--n-option-opacity-disabled);
  124. `)]),T("check",`
  125. font-size: 16px;
  126. position: absolute;
  127. right: calc(var(--n-option-padding-right) - 4px);
  128. top: calc(50% - 7px);
  129. color: var(--n-option-check-color);
  130. transition: color .3s var(--n-bezier);
  131. `,[Rt({enterScale:"0.5"})])])]),yo=fe({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ue.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:n,mergedRtlRef:t}=Ee(e),r=ft("InternalSelectMenu",t,n),i=ue("InternalSelectMenu","-internal-select-menu",mo,fn,e,Q(e,"clsPrefix")),s=E(null),a=E(null),l=E(null),C=D(()=>e.treeMate.getFlattenedNodes()),b=D(()=>Xn(C.value)),c=E(null);function h(){const{treeMate:f}=e;let w=null;const{value:j}=e;j===null?w=f.getFirstAvailableNode():(e.multiple?w=f.getNode((j||[])[(j||[]).length-1]):w=f.getNode(j),(!w||w.disabled)&&(w=f.getFirstAvailableNode())),ne(w||null)}function k(){const{value:f}=c;f&&!e.treeMate.getNode(f.key)&&(c.value=null)}let m;Pe(()=>e.show,f=>{f?m=Pe(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?h():k(),ct(he)):k()},{immediate:!0}):m==null||m()},{immediate:!0}),St(()=>{m==null||m()});const v=D(()=>xn(i.value.self[H("optionHeight",e.size)])),P=D(()=>Fe(i.value.self[H("padding",e.size)])),B=D(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),O=D(()=>{const f=C.value;return f&&f.length===0});function F(f){const{onToggle:w}=e;w&&w(f)}function S(f){const{onScroll:w}=e;w&&w(f)}function g(f){var w;(w=l.value)===null||w===void 0||w.sync(),S(f)}function y(){var f;(f=l.value)===null||f===void 0||f.sync()}function N(){const{value:f}=c;return f||null}function L(f,w){w.disabled||ne(w,!1)}function K(f,w){w.disabled||F(w)}function W(f){var w;$e(f,"action")||(w=e.onKeyup)===null||w===void 0||w.call(e,f)}function A(f){var w;$e(f,"action")||(w=e.onKeydown)===null||w===void 0||w.call(e,f)}function Y(f){var w;(w=e.onMousedown)===null||w===void 0||w.call(e,f),!e.focusable&&f.preventDefault()}function re(){const{value:f}=c;f&&ne(f.getNext({loop:!0}),!0)}function V(){const{value:f}=c;f&&ne(f.getPrev({loop:!0}),!0)}function ne(f,w=!1){c.value=f,w&&he()}function he(){var f,w;const j=c.value;if(!j)return;const le=b.value(j.key);le!==null&&(e.virtualScroll?(f=a.value)===null||f===void 0||f.scrollTo({index:le}):(w=l.value)===null||w===void 0||w.scrollTo({index:le,elSize:v.value}))}function ce(f){var w,j;!((w=s.value)===null||w===void 0)&&w.contains(f.target)&&((j=e.onFocus)===null||j===void 0||j.call(e,f))}function Ce(f){var w,j;!((w=s.value)===null||w===void 0)&&w.contains(f.relatedTarget)||(j=e.onBlur)===null||j===void 0||j.call(e,f)}lt(ut,{handleOptionMouseEnter:L,handleOptionClick:K,valueSetRef:B,pendingTmNodeRef:c,nodePropsRef:Q(e,"nodeProps"),showCheckmarkRef:Q(e,"showCheckmark"),multipleRef:Q(e,"multiple"),valueRef:Q(e,"value"),renderLabelRef:Q(e,"renderLabel"),renderOptionRef:Q(e,"renderOption"),labelFieldRef:Q(e,"labelField"),valueFieldRef:Q(e,"valueField")}),lt(mn,s),qe(()=>{const{value:f}=l;f&&f.sync()});const ie=D(()=>{const{size:f}=e,{common:{cubicBezierEaseInOut:w},self:{height:j,borderRadius:le,color:ve,groupHeaderTextColor:pe,actionDividerColor:ae,optionTextColorPressed:J,optionTextColor:me,optionTextColorDisabled:te,optionTextColorActive:ze,optionOpacityDisabled:Te,optionCheckColor:Me,actionTextColor:_e,optionColorPending:we,optionColorActive:xe,loadingColor:Ie,loadingSize:Be,optionColorActivePending:Ae,[H("optionFontSize",f)]:Oe,[H("optionHeight",f)]:ke,[H("optionPadding",f)]:X}}=i.value;return{"--n-height":j,"--n-action-divider-color":ae,"--n-action-text-co
  132. --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
  133. white-space: nowrap;
  134. position: relative;
  135. box-sizing: border-box;
  136. cursor: default;
  137. display: inline-flex;
  138. align-items: center;
  139. flex-wrap: nowrap;
  140. padding: var(--n-padding);
  141. border-radius: var(--n-border-radius);
  142. color: var(--n-text-color);
  143. background-color: var(--n-color);
  144. transition:
  145. border-color .3s var(--n-bezier),
  146. background-color .3s var(--n-bezier),
  147. color .3s var(--n-bezier),
  148. box-shadow .3s var(--n-bezier),
  149. opacity .3s var(--n-bezier);
  150. line-height: 1;
  151. height: var(--n-height);
  152. font-size: var(--n-font-size);
  153. `,[U("strong",`
  154. font-weight: var(--n-font-weight-strong);
  155. `),T("border",`
  156. pointer-events: none;
  157. position: absolute;
  158. left: 0;
  159. right: 0;
  160. top: 0;
  161. bottom: 0;
  162. border-radius: inherit;
  163. border: var(--n-border);
  164. transition: border-color .3s var(--n-bezier);
  165. `),T("icon",`
  166. display: flex;
  167. margin: 0 4px 0 0;
  168. color: var(--n-text-color);
  169. transition: color .3s var(--n-bezier);
  170. font-size: var(--n-avatar-size-override);
  171. `),T("avatar",`
  172. display: flex;
  173. margin: 0 6px 0 0;
  174. `),T("close",`
  175. margin: var(--n-close-margin);
  176. transition:
  177. background-color .3s var(--n-bezier),
  178. color .3s var(--n-bezier);
  179. `),U("round",`
  180. padding: 0 calc(var(--n-height) / 3);
  181. border-radius: calc(var(--n-height) / 2);
  182. `,[T("icon",`
  183. margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
  184. `),T("avatar",`
  185. margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
  186. `),U("closable",`
  187. padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
  188. `)]),U("icon, avatar",[U("round",`
  189. padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
  190. `)]),U("disabled",`
  191. cursor: not-allowed !important;
  192. opacity: var(--n-opacity-disabled);
  193. `),U("checkable",`
  194. cursor: pointer;
  195. box-shadow: none;
  196. color: var(--n-text-color-checkable);
  197. background-color: var(--n-color-checkable);
  198. `,[Se("disabled",[ee("&:hover","background-color: var(--n-color-hover-checkable);",[Se("checked","color: var(--n-text-color-hover-checkable);")]),ee("&:active","background-color: var(--n-color-pressed-checkable);",[Se("checked","color: var(--n-text-color-pressed-checkable);")])]),U("checked",`
  199. color: var(--n-text-color-checked);
  200. background-color: var(--n-color-checked);
  201. `,[Se("disabled",[ee("&:hover","background-color: var(--n-color-checked-hover);"),ee("&:active","background-color: var(--n-color-checked-pressed);")])])])]),xo=Object.assign(Object.assign(Object.assign({},ue.props),Co),{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}),ko=Tn("n-tag"),rt=fe({name:"Tag",props:xo,setup(e){const n=E(null),{mergedBorderedRef:t,mergedClsPrefixRef:r,inlineThemeDisabled:i,mergedRtlRef:s}=Ee(e),a=ue("Tag","-tag",wo,Rn,e,r);lt(ko,{roundRef:Q(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:m,onCheckedChange:v,onUpdateChecked:P,"onUpdate:checked":B}=e;P&&P(!m),B&&B(!m),v&&v(!m)}}function C(m){if(e.triggerClickOnClose||m.stopPropagation(),!e.disabled){const{onClose:v}=e;v&&se(v,m)}}const b={setTextContent(m){const{value:v}=n;v&&(v.textContent=m)}},c=ft("Tag",s,r),h=D(()=>{const{type:m,size:v,color:{color:P,textColor:B}={}}=e,{common:{cubicBezierEaseInOut:O},self:{padding:F,closeMargin:S,borderRadius:g,opacityDisabled:y,textColorCheckable:N,textColorHoverCheckable:L,textColorPressedCheckable:K,textColorChecked:W,colorCheckable:A,colorHoverCheckable:Y,colorPressedCheckable:re,colorChecked:V,colorCheckedHover:ne,colorCheckedPressed:he,closeBorderRadius:ce,fontWeightStrong:Ce,[H("colorBordered",m)]:ie,[H("closeSize",v)]:be,[H("closeIconSize",v)]:Z,[H("fontSize",v)]:oe,[H("height",v)]:f,[H("color",m)]:w,[H("textColor",m)]:j,[H("border",m)]:le,[H("closeIconColor",m)]:ve,[H("closeIconColorHover",m)]:pe,[H("closeIconColorPressed",m)]:ae,[H("closeColorHover",m)]:J,[H("closeColorPressed",m)]:me}}=a.value,te=Fe(S);return{"--n-font-weight-strong":Ce,"--n-avatar-size-override":`calc(${f} - 8px)`,"--n-bezier":O,"--n-border-radius":g,"--n-border":le,"--n-close-icon-size":Z,"--n-close-color-pressed":me,"--n-close-color-hover":J,"--n-close-border-radius":ce,"--n-close-icon-color":ve,"--n-close-icon-color-hover":pe,"--n-close-icon-color-pressed":ae,"--n-close-icon-color-disabled":ve,"--n-close-margin-top":te.top,"--n-close-margin-right":te.right,"--n-close-margin-bottom":te.bottom,"--n-close-margin-left":te.left,"--n-close-size":be,"--n-color":P||(t.value?ie:w),"--n-color-checkable":A,"--n-color-checked":V,"--n-color-checked-hover":ne,"--n-color-checked-pressed":he,"--n-color-hover-checkable":Y,"--n-color-pressed-checkable":re,"--n-font-size":oe,"--n-height":f,"--n-opacity-disabled":y,"--n-padding":F,"--n-text-color":B||j,"--n-text-color-checkable":N,"--n-text-color-checked":W,"--n-text-color-hover-checkable":L,"--n-text-color-pressed-checkable":K}}),k=i?Ne("tag",D(()=>{let m="";const{type:v,size:P,color:{color:B,textColor:O}={}}=e;return m+=v[0],m+=P[0],B&&(m+=`a${gt(B)}`),O&&(m+=`b${gt(O)}`),t.value&&(m+="c"),m}),h,e):void 0;return Object.assign(Object.assign({},b),{rtlEnabled:c,mergedClsPrefix:r,contentRef:n,mergedBordered:t,handleClick:l,handleCloseClick:C,cssVars:i?void 0:h,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender})},render(){var e,n;const{mergedClsPrefix:t,rtlEnabled:r,closable:i,color:{borderColor:s}={},round:a,onRender:l,$slots:C}=this;l==null||l();const b=He(C.avatar,h=>h&&d("div",{class:`${t}-tag__avatar`},h)),c=He(C.icon,h=>h&&d("div",{class:`${t}-tag__icon`},h));return d("div",{class:[`${t}-tag`,this.themeClass,{[`${t}-tag--rtl`]:r,[`${t}-tag--strong`]:this.strong,[`${t}-tag--disabled`]:this.disabled,[`${t}-tag--checkable`]:this.checkable,[`${t}-tag--checked`]:this.checkable&&this.checked,[`${t}-tag--round`]:a,[`${t}-tag--avatar`]:b,[`${t}-tag--icon`]:c,[`${t}-tag--closable`]:i}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},c||b,d("span",{class:`${t}-tag__content`,ref:"contentRef"},(n=(e=this.$slots).default)===null||n===void 0?void 0:n.call(e)),!this.checkable&&i?d(Fn,{clsPrefix:t
  202. --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
  203. --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
  204. position: relative;
  205. z-index: auto;
  206. box-shadow: none;
  207. width: 100%;
  208. max-width: 100%;
  209. display: inline-block;
  210. vertical-align: bottom;
  211. border-radius: var(--n-border-radius);
  212. min-height: var(--n-height);
  213. line-height: 1.5;
  214. font-size: var(--n-font-size);
  215. `,[I("base-loading",`
  216. color: var(--n-loading-color);
  217. `),I("base-selection-tags","min-height: var(--n-height);"),T("border, state-border",`
  218. position: absolute;
  219. left: 0;
  220. right: 0;
  221. top: 0;
  222. bottom: 0;
  223. pointer-events: none;
  224. border: var(--n-border);
  225. border-radius: inherit;
  226. transition:
  227. box-shadow .3s var(--n-bezier),
  228. border-color .3s var(--n-bezier);
  229. `),T("state-border",`
  230. z-index: 1;
  231. border-color: #0000;
  232. `),I("base-suffix",`
  233. cursor: pointer;
  234. position: absolute;
  235. top: 50%;
  236. transform: translateY(-50%);
  237. right: 10px;
  238. `,[T("arrow",`
  239. font-size: var(--n-arrow-size);
  240. color: var(--n-arrow-color);
  241. transition: color .3s var(--n-bezier);
  242. `)]),I("base-selection-overlay",`
  243. display: flex;
  244. align-items: center;
  245. white-space: nowrap;
  246. pointer-events: none;
  247. position: absolute;
  248. top: 0;
  249. right: 0;
  250. bottom: 0;
  251. left: 0;
  252. padding: var(--n-padding-single);
  253. transition: color .3s var(--n-bezier);
  254. `,[T("wrapper",`
  255. flex-basis: 0;
  256. flex-grow: 1;
  257. overflow: hidden;
  258. text-overflow: ellipsis;
  259. `)]),I("base-selection-placeholder",`
  260. color: var(--n-placeholder-color);
  261. `,[T("inner",`
  262. max-width: 100%;
  263. overflow: hidden;
  264. `)]),I("base-selection-tags",`
  265. cursor: pointer;
  266. outline: none;
  267. box-sizing: border-box;
  268. position: relative;
  269. z-index: auto;
  270. display: flex;
  271. padding: var(--n-padding-multiple);
  272. flex-wrap: wrap;
  273. align-items: center;
  274. width: 100%;
  275. vertical-align: bottom;
  276. background-color: var(--n-color);
  277. border-radius: inherit;
  278. transition:
  279. color .3s var(--n-bezier),
  280. box-shadow .3s var(--n-bezier),
  281. background-color .3s var(--n-bezier);
  282. `),I("base-selection-label",`
  283. height: var(--n-height);
  284. display: inline-flex;
  285. width: 100%;
  286. vertical-align: bottom;
  287. cursor: pointer;
  288. outline: none;
  289. z-index: auto;
  290. box-sizing: border-box;
  291. position: relative;
  292. transition:
  293. color .3s var(--n-bezier),
  294. box-shadow .3s var(--n-bezier),
  295. background-color .3s var(--n-bezier);
  296. border-radius: inherit;
  297. background-color: var(--n-color);
  298. align-items: center;
  299. `,[I("base-selection-input",`
  300. font-size: inherit;
  301. line-height: inherit;
  302. outline: none;
  303. cursor: pointer;
  304. box-sizing: border-box;
  305. border:none;
  306. width: 100%;
  307. padding: var(--n-padding-single);
  308. background-color: #0000;
  309. color: var(--n-text-color);
  310. transition: color .3s var(--n-bezier);
  311. caret-color: var(--n-caret-color);
  312. `,[T("content",`
  313. text-overflow: ellipsis;
  314. overflow: hidden;
  315. white-space: nowrap;
  316. `)]),T("render-label",`
  317. color: var(--n-text-color);
  318. `)]),Se("disabled",[ee("&:hover",[T("state-border",`
  319. box-shadow: var(--n-box-shadow-hover);
  320. border: var(--n-border-hover);
  321. `)]),U("focus",[T("state-border",`
  322. box-shadow: var(--n-box-shadow-focus);
  323. border: var(--n-border-focus);
  324. `)]),U("active",[T("state-border",`
  325. box-shadow: var(--n-box-shadow-active);
  326. border: var(--n-border-active);
  327. `),I("base-selection-label","background-color: var(--n-color-active);"),I("base-selection-tags","background-color: var(--n-color-active);")])]),U("disabled","cursor: not-allowed;",[T("arrow",`
  328. color: var(--n-arrow-color-disabled);
  329. `),I("base-selection-label",`
  330. cursor: not-allowed;
  331. background-color: var(--n-color-disabled);
  332. `,[I("base-selection-input",`
  333. cursor: not-allowed;
  334. color: var(--n-text-color-disabled);
  335. `),T("render-label",`
  336. color: var(--n-text-color-disabled);
  337. `)]),I("base-selection-tags",`
  338. cursor: not-allowed;
  339. background-color: var(--n-color-disabled);
  340. `),I("base-selection-placeholder",`
  341. cursor: not-allowed;
  342. color: var(--n-placeholder-color-disabled);
  343. `)]),I("base-selection-input-tag",`
  344. height: calc(var(--n-height) - 6px);
  345. line-height: calc(var(--n-height) - 6px);
  346. outline: none;
  347. display: none;
  348. position: relative;
  349. margin-bottom: 3px;
  350. max-width: 100%;
  351. vertical-align: bottom;
  352. `,[T("input",`
  353. font-size: inherit;
  354. font-family: inherit;
  355. min-width: 1px;
  356. padding: 0;
  357. background-color: #0000;
  358. outline: none;
  359. border: none;
  360. max-width: 100%;
  361. overflow: hidden;
  362. width: 1em;
  363. line-height: inherit;
  364. cursor: pointer;
  365. color: var(--n-text-color);
  366. caret-color: var(--n-caret-color);
  367. `),T("mirror",`
  368. position: absolute;
  369. left: 0;
  370. top: 0;
  371. white-space: pre;
  372. visibility: hidden;
  373. user-select: none;
  374. -webkit-user-select: none;
  375. opacity: 0;
  376. `)]),["warning","error"].map(e=>U(`${e}-status`,[T("state-border",`border: var(--n-border-${e});`),Se("disabled",[ee("&:hover",[T("state-border",`
  377. box-shadow: var(--n-box-shadow-hover-${e});
  378. border: var(--n-border-hover-${e});
  379. `)]),U("active",[T("state-border",`
  380. box-shadow: var(--n-box-shadow-active-${e});
  381. border: var(--n-border-active-${e});
  382. `),I("base-selection-label",`background-color: var(--n-color-active-${e});`),I("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),U("focus",[T("state-border",`
  383. box-shadow: var(--n-box-shadow-focus-${e});
  384. border: var(--n-border-focus-${e});
  385. `)])])]))]),I("base-selection-popover",`
  386. margin-bottom: -3px;
  387. display: flex;
  388. flex-wrap: wrap;
  389. margin-right: -8px;
  390. `),I("base-selection-tag-wrapper",`
  391. max-width: 100%;
  392. display: inline-flex;
  393. padding: 0 7px 3px 0;
  394. `,[ee("&:last-child","padding-right: 0;"),I("tag",`
  395. font-size: 14px;
  396. max-width: 100%;
  397. `,[T("content",`
  398. line-height: 1.25;
  399. text-overflow: ellipsis;
  400. overflow: hidden;
  401. `)])])]),Oo=fe({name:"InternalSelection",props:Object.assign(Object.assign({},ue.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:n,mergedRtlRef:t}=Ee(e),r=ft("InternalSelection",t,n),i=E(null),s=E(null),a=E(null),l=E(null),C=E(null),b=E(null),c=E(null),h=E(null),k=E(null),m=E(null),v=E(!1),P=E(!1),B=E(!1),O=ue("InternalSelection","-internal-selection",So,hn,e,Q(e,"clsPrefix")),F=D(()=>e.clearable&&!e.disabled&&(B.value||e.active)),S=D(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Re(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),g=D(()=>{const u=e.selectedOption;if(u)return u[e.labelField]}),y=D(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function N(){var u;const{value:x}=i;if(x){const{value:G}=s;G&&(G.style.width=`${x.offsetWidth}px`,e.maxTagCount!=="responsive"&&((u=k.value)===null||u===void 0||u.sync({showAllItemsBeforeCalculate:!1})))}}function L(){const{value:u}=m;u&&(u.style.display="none")}function K(){const{value:u}=m;u&&(u.style.display="inline-block")}Pe(Q(e,"active"),u=>{u||L()}),Pe(Q(e,"pattern"),()=>{e.multiple&&ct(N)});function W(u){const{onFocus:x}=e;x&&x(u)}function A(u){const{onBlur:x}=e;x&&x(u)}function Y(u){const{onDeleteOption:x}=e;x&&x(u)}function re(u){const{onClear:x}=e;x&&x(u)}function V(u){const{onPatternInput:x}=e;x&&x(u)}function ne(u){var x;(!u.relatedTarget||!(!((x=a.value)===null||x===void 0)&&x.contains(u.relatedTarget)))&&W(u)}function he(u){var x;!((x=a.value)===null||x===void 0)&&x.contains(u.relatedTarget)||A(u)}function ce(u){re(u)}function Ce(){B.value=!0}function ie(){B.value=!1}function be(u){!e.active||!e.filterable||u.target!==s.value&&u.preventDefault()}function Z(u){Y(u)}const oe=E(!1);function f(u){if(u.key==="Backspace"&&!oe.value&&!e.pattern.length){const{selectedOptions:x}=e;x!=null&&x.length&&Z(x[x.length-1])}}let w=null;function j(u){const{value:x}=i;if(x){const G=u.target.value;x.textContent=G,N()}e.ignoreComposition&&oe.value?w=u:V(u)}function le(){oe.value=!0}function ve(){oe.value=!1,e.ignoreComposition&&V(w),w=null}function pe(u){var x;P.value=!0,(x=e.onPatternFocus)===null||x===void 0||x.call(e,u)}function ae(u){var x;P.value=!1,(x=e.onPatternBlur)===null||x===void 0||x.call(e,u)}function J(){var u,x;if(e.filterable)P.value=!1,(u=b.value)===null||u===void 0||u.blur(),(x=s.value)===null||x===void 0||x.blur();else if(e.multiple){const{value:G}=l;G==null||G.blur()}else{const{value:G}=C;G==null||G.blur()}}function me(){var u,x,G;e.filterable?(P.value=!1,(u=b.value)===null||u===void 0||u.focus()):e.multiple?(x=l.value)===null||x===void 0||x.focus():(G=C.value)===null||G===void 0||G.focus()}function te(){const{value:u}=s;u&&(K(),u.focus())}function ze(){const{value:u}=s;u&&u.blur()}function Te(u){const{value:x}=c;x&&x.setTextContent(`+${u}`)}function Me(){const{value:u}=h;return u}function _e(){return s.value}let we=null;function xe(){we!==null&&window.clearTimeout(we)}function Ie(){e.active||(xe(),we=window.setTimeout(()=>{y.value&&(v.value=!0)},100))}function Be(){xe()}function Ae(u){u||(xe(),v.value=!1)}Pe(y,u=>{u||(
  402. z-index: auto;
  403. outline: none;
  404. width: 100%;
  405. position: relative;
  406. `),I("select-menu",`
  407. margin: 4px 0;
  408. box-shadow: var(--n-menu-box-shadow);
  409. `,[Rt({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),To=Object.assign(Object.assign({},ue.props),{to:at.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),cr=fe({name:"Select",props:To,setup(e){const{mergedClsPrefixRef:n,mergedBorderedRef:t,namespaceRef:r,inlineThemeDisabled:i}=Ee(e),s=ue("Select","-select",zo,vn,e,n),a=E(e.defaultValue),l=Q(e,"value"),C=vt(l,a),b=E(!1),c=E(""),h=gn(e,["items","options"]),k=E([]),m=E([]),v=D(()=>m.value.concat(k.value).concat(h.value)),P=D(()=>{const{filter:o}=e;if(o)return o;const{labelField:p,valueField:R}=e;return($,M)=>{if(!M)return!1;const z=M[p];if(typeof z=="string")return it($,z);const _=M[R];return typeof _=="string"?it($,_):typeof _=="number"?it($,String(_)):!1}}),B=D(()=>{if(e.remote)return h.value;{const{value:o}=v,{value:p}=c;return!p.length||!e.filterable?o:Po(o,P.value,p,e.childrenField)}}),O=D(()=>{const{valueField:o,childrenField:p}=e,R=Ro(o,p);return ho(B.value,R)}),F=D(()=>Fo(v.value,e.valueField,e.childrenField)),S=E(!1),g=vt(Q(e,"show"),S),y=E(null),N=E(null),L=E(null),{localeRef:K}=Pt("Select"),W=D(()=>{var o;return(o=e.placeholder)!==null&&o!==void 0?o:K.value.placeholder}),A=[],Y=E(new Map),re=D(()=>{const{fallbackOption:o}=e;if(o===void 0){const{labelField:p,valueField:R}=e;return $=>({[p]:String($),[R]:$})}return o===!1?!1:p=>Object.assign(o(p),{value:p})});function V(o){const p=e.remote,{value:R}=Y,{value:$}=F,{value:M}=re,z=[];return o.forEach(_=>{if($.has(_))z.push($.get(_));else if(p&&R.has(_))z.push(R.get(_));else if(M){const q=M(_);q&&z.push(q)}}),z}const ne=D(()=>{if(e.multiple){const{value:o}=C;return Array.isArray(o)?V(o):[]}return null}),he=D(()=>{const{value:o}=C;return!e.multiple&&!Array.isArray(o)?o===null?null:V([o])[0]||null:null}),ce=bn(e),{mergedSizeRef:Ce,mergedDisabledRef:ie,mergedStatusRef:be}=ce;function Z(o,p){const{onChange:R,"onUpdate:value":$,onUpdateValue:M}=e,{nTriggerFormChange:z,nTriggerFormInput:_}=ce;R&&se(R,o,p),M&&se(M,o,p),$&&se($,o,p),a.value=o,z(),_()}function oe(o){const{onBlur:p}=e,{nTriggerFormBlur:R}=ce;p&&se(p,o),R()}function f(){const{onClear:o}=e;o&&se(o)}function w(o){const{onFocus:p,showOnFocus:R}=e,{nTriggerFormFocus:$}=ce;p&&se(p,o),$(),R&&ae()}function j(o){const{onSearch:p}=e;p&&se(p,o)}function le(o){const{onScroll:p}=e;p&&se(p,o)}function ve(){var o;const{remote:p,multiple:R}=e;if(p){const{value:$}=Y;if(R){const{valueField:M}=e;(o=ne.value)===null||o===void 0||o.forEach(z=>{$.set(z[M],z)})}else{const M=he.value;M&&$.set(M[e.valueField],M)}}}function pe(o){const{onUpdateShow:p,