hermes-web-ui 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -408
- package/bin/hermes-web-ui.mjs +111 -97
- package/dist/assets/ChatView-BCcUaLWg.css +1 -0
- package/dist/assets/ChatView-gu2Y-jpZ.js +16 -0
- package/dist/assets/Input-yD_s5hp8.js +234 -0
- package/dist/assets/JobsView-C1YU-sgU.js +123 -0
- package/dist/assets/LogsView-BN_TkDPi.css +1 -0
- package/dist/assets/LogsView-BSNn4Rmi.js +1 -0
- package/dist/assets/MarkdownRenderer-CrMwC_5d.css +1 -0
- package/dist/assets/MarkdownRenderer-DNP-kPA8.js +23 -0
- package/dist/assets/MemoryView-BsGBmN7h.js +5 -0
- package/dist/assets/MemoryView-CK0PemlP.css +1 -0
- package/dist/assets/Modal-CSHJclVU.js +232 -0
- package/dist/assets/Popover-blRIsd-8.js +117 -0
- package/dist/assets/Scrollbar-CYtpM7mc.js +77 -0
- package/dist/assets/Select-DTG-wtu5.js +454 -0
- package/dist/assets/SettingsView-BzBMKaLz.css +1 -0
- package/dist/assets/SettingsView-CppuSCZA.js +1129 -0
- package/dist/assets/SkillsView-86Z-HE_X.css +1 -0
- package/dist/assets/SkillsView-CciuH5wp.js +1 -0
- package/dist/assets/Spin-DWreY5m0.js +43 -0
- package/dist/assets/Suffix-B828Aenx.js +25 -0
- package/dist/assets/Tooltip-BCHslENT.js +1 -0
- package/dist/assets/Warning-Ba-wYRRB.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-CV9qMihF.js +47 -0
- package/dist/assets/app-4gFjNUoo.js +1 -0
- package/dist/assets/chat-P2QaPvpZ.js +6 -0
- package/dist/assets/context-B74FvHiJ.js +109 -0
- package/dist/assets/index-Cx8mFF2D.js +307 -0
- package/dist/assets/index-DwVgwUIX.css +1 -0
- package/dist/assets/jobs-DVxci1LY.js +1 -0
- package/dist/assets/keysOf-Dvq9k1rv.js +1 -0
- package/dist/assets/omit-QZj0aLfU.js +1 -0
- package/dist/assets/pinia-tE0RcsDr.js +1 -0
- package/dist/assets/runtime-core.esm-bundler-yNW65ghW.js +1 -0
- package/dist/assets/skills-DgbQAgoB.js +1 -0
- package/dist/assets/use-message-Dz_GbH5h.js +1 -0
- package/dist/index.html +19 -6
- package/dist/server/config.d.ts +7 -0
- package/dist/server/config.js +12 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +156 -0
- package/dist/server/routes/filesystem.d.ts +2 -0
- package/dist/server/routes/filesystem.js +427 -0
- package/dist/server/routes/logs.d.ts +2 -0
- package/dist/server/routes/logs.js +87 -0
- package/dist/server/routes/proxy-handler.d.ts +2 -0
- package/dist/server/routes/proxy-handler.js +82 -0
- package/dist/server/routes/proxy.d.ts +2 -0
- package/dist/server/routes/proxy.js +12 -0
- package/dist/server/routes/sessions.d.ts +2 -0
- package/dist/server/routes/sessions.js +69 -0
- package/dist/server/routes/upload.d.ts +2 -0
- package/dist/server/routes/upload.js +50 -0
- package/dist/server/routes/webhook.d.ts +2 -0
- package/dist/server/routes/webhook.js +33 -0
- package/dist/server/services/hermes-cli.d.ts +50 -0
- package/dist/server/services/hermes-cli.js +185 -0
- package/dist/server/services/hermes.d.ts +40 -0
- package/dist/server/services/hermes.js +118 -0
- package/package.json +19 -4
- package/dist/assets/ChatView-DrzZz5ex.css +0 -1
- package/dist/assets/ChatView-WnNeYrS7.js +0 -38
- package/dist/assets/JobsView-BF9wWdwU.js +0 -831
- package/dist/assets/Modal-CQVLL_Oc.js +0 -276
- package/dist/assets/_plugin-vue_export-helper-D5N3Hfca.js +0 -231
- package/dist/assets/chat-640V6r6N.js +0 -1
- package/dist/assets/index-4iFlrAYJ.js +0 -307
- package/dist/assets/index-CMJKLUKk.css +0 -1
- package/dist/assets/jobs-Cuol6Mqb.js +0 -1
- package/dist/assets/use-message-B8ClBznx.js +0 -117
- /package/dist/assets/{client-BxIiwrqC.js → client-BKiVmpru.js} +0 -0
|
@@ -0,0 +1,1129 @@
|
|
|
1
|
+
import{$ as e,A as t,C as n,Ct as r,E as i,F as a,G as o,I as s,N as c,O as l,T as u,U as d,W as f,_ as p,at as m,et as h,f as g,g as _,i as v,j as y,k as b,l as x,p as S,st as C,tt as w,u as T,v as E,wt as D,x as O}from"./runtime-core.esm-bundler-yNW65ghW.js";import{B as k,H as A,K as j,Q as M,U as N,V as P,W as F,X as I,Y as L,at as R,c as z,ct as B,dt as V,f as H,ft as U,gt as W,ht as G,i as ee,it as te,l as K,lt as q,mt as J,nt as ne,o as re,p as ie,pt as Y,q as ae,r as X,rt as Z,s as oe,t as se,tt as Q,u as ce,yt as le}from"./_plugin-vue_export-helper-CV9qMihF.js";import{A as ue,M as de,O as fe,_ as pe,a as me,b as he,c as ge,d as _e,i as ve,j as ye,l as be,n as xe,o as Se,r as Ce,t as we,v as Te,w as Ee,x as De,y as Oe}from"./Popover-blRIsd-8.js";import{a as ke,c as Ae,d as je,f as Me,h as Ne,i as Pe,l as Fe,m as Ie,n as Le,o as Re,r as ze,s as Be,t as Ve}from"./Select-DTG-wtu5.js";import{_ as He,f as Ue,g as We,h as Ge,m as Ke,n as qe,o as Je,r as Ye,s as Xe,t as Ze,y as $}from"./Scrollbar-CYtpM7mc.js";import{a as Qe,r as $e}from"./context-B74FvHiJ.js";import{t as et}from"./keysOf-Dvq9k1rv.js";import{t as tt}from"./omit-QZj0aLfU.js";import{r as nt}from"./Suffix-B828Aenx.js";import{n as rt,t as it}from"./Input-yD_s5hp8.js";import{n as at,t as ot}from"./Tooltip-BCHslENT.js";import{t as st}from"./use-message-Dz_GbH5h.js";import{n as ct}from"./app-4gFjNUoo.js";function lt(t={},n){let r=e({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:i,keyup:a}=t,o=e=>{switch(e.key){case`Control`:r.ctrl=!0;break;case`Meta`:r.command=!0,r.win=!0;break;case`Shift`:r.shift=!0;break;case`Tab`:r.tab=!0;break}i!==void 0&&Object.keys(i).forEach(t=>{if(t!==e.key)return;let n=i[t];if(typeof n==`function`)n(e);else{let{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},s=e=>{switch(e.key){case`Control`:r.ctrl=!1;break;case`Meta`:r.command=!1,r.win=!1;break;case`Shift`:r.shift=!1;break;case`Tab`:r.tab=!1;break}a!==void 0&&Object.keys(a).forEach(t=>{if(t!==e.key)return;let n=a[t];if(typeof n==`function`)n(e);else{let{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},c=()=>{(n===void 0||n.value)&&(We(`keydown`,document,o),We(`keyup`,document,s)),n!==void 0&&d(n,e=>{e?(We(`keydown`,document,o),We(`keyup`,document,s)):(Ge(`keydown`,document,o),Ge(`keyup`,document,s))})};return fe()?(l(c),b(()=>{(n===void 0||n.value)&&(Ge(`keydown`,document,o),Ge(`keyup`,document,s))})):c(),h(r)}function ut(e,t,n){if(!t)return e;let r=w(e.value),i=null;return d(e,e=>{i!==null&&window.clearTimeout(i),e===!0?n&&!n.value?r.value=!0:i=window.setTimeout(()=>{r.value=!0},t):r.value=!1}),r}function dt(e,t){if(!e)return;let n=document.createElement(`a`);n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}var ft={tiny:`mini`,small:`tiny`,medium:`small`,large:`medium`,huge:`large`};function pt(e){let t=ft[e];if(t===void 0)throw Error(`${e} has no smaller size.`);return t}function mt(e){return t=>{t?e.value=t.$el:e.value=null}}function ht(e,t=`default`,n=[]){let r=e.$slots[t];return r===void 0?n:r()}var gt=E({name:`ArrowDown`,render(){return O(`svg`,{viewBox:`0 0 28 28`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},O(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},O(`g`,{"fill-rule":`nonzero`},O(`path`,{d:`M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z`}))))}}),_t=E({name:`Backward`,render(){return O(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},O(`path`,{d:`M12.2674 15.793C11.9675 16.0787 11.4927 16.0672 11.2071 15.7673L6.20572 10.5168C5.9298 10.2271 5.9298 9.7719 6.20572 9.48223L11.2071 4.23177C11.4927 3.93184 11.9675 3.92031 12.2674 4.206C12.5673 4.49169 12.5789 4.96642 12.2932 5.26634L7.78458 9.99952L12.2932 14.7327C12.5789 15.0326 12.5673 15.5074 12.2674 15.793Z`,fill:`currentColor`}))}}),vt=E({name:`ChevronRight`,render(){return O(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},O(`path`,{d:`M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z`,fill:`currentColor`}))}}),yt=E({name:`FastBackward`,render(){return O(`svg`,{viewBox:`0 0 20 20`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},O(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},O(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},O(`path`,{d:`M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z`}))))}}),bt=E({name:`FastForward`,render(){return O(`svg`,{viewBox:`0 0 20 20`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},O(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},O(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},O(`path`,{d:`M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z`}))))}}),xt=E({name:`Filter`,render(){return O(`svg`,{viewBox:`0 0 28 28`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},O(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},O(`g`,{"fill-rule":`nonzero`},O(`path`,{d:`M17,19 C17.5522847,19 18,19.4477153 18,20 C18,20.5522847 17.5522847,21 17,21 L11,21 C10.4477153,21 10,20.5522847 10,20 C10,19.4477153 10.4477153,19 11,19 L17,19 Z M21,13 C21.5522847,13 22,13.4477153 22,14 C22,14.5522847 21.5522847,15 21,15 L7,15 C6.44771525,15 6,14.5522847 6,14 C6,13.4477153 6.44771525,13 7,13 L21,13 Z M24,7 C24.5522847,7 25,7.44771525 25,8 C25,8.55228475 24.5522847,9 24,9 L4,9 C3.44771525,9 3,8.55228475 3,8 C3,7.44771525 3.44771525,7 4,7 L24,7 Z`}))))}}),St=E({name:`Forward`,render(){return O(`svg`,{viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},O(`path`,{d:`M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z`,fill:`currentColor`}))}}),Ct=E({name:`More`,render(){return O(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},O(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},O(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},O(`path`,{d:`M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z`}))))}}),wt={sizeSmall:`14px`,sizeMedium:`16px`,sizeLarge:`18px`,labelPadding:`0 8px`,labelFontWeight:`400`};function Tt(e){let{baseColor:t,inputColorDisabled:n,cardColor:r,modalColor:i,popoverColor:a,textColorDisabled:o,borderColor:s,primaryColor:c,textColor2:l,fontSizeSmall:u,fontSizeMedium:d,fontSizeLarge:f,borderRadiusSmall:p,lineHeight:m}=e;return Object.assign(Object.assign({},wt),{labelLineHeight:m,fontSizeSmall:u,fontSizeMedium:d,fontSizeLarge:f,borderRadius:p,color:t,colorChecked:c,colorDisabled:n,colorDisabledChecked:n,colorTableHeader:r,colorTableHeaderModal:i,colorTableHeaderPopover:a,checkMarkColor:t,checkMarkColorDisabled:o,checkMarkColorDisabledChecked:o,border:`1px solid ${s}`,borderDisabled:`1px solid ${s}`,borderDisabledChecked:`1px solid ${s}`,borderChecked:`1px solid ${c}`,borderFocus:`1px solid ${c}`,boxShadowFocus:`0 0 0 2px ${te(c,{alpha:.3})}`,textColor:l,textColorDisabled:o})}var Et={name:`Checkbox`,common:X,self:Tt},Dt=Q(`n-checkbox-group`),Ot=E({name:`CheckboxGroup`,props:{min:Number,max:Number,size:String,value:Array,defaultValue:{type:Array,default:null},disabled:{type:Boolean,default:void 0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onChange:[Function,Array]},setup(e){let{mergedClsPrefixRef:t}=A(e),n=k(e),{mergedSizeRef:r,mergedDisabledRef:i}=n,a=w(e.defaultValue),o=Ke(x(()=>e.value),a),c=x(()=>o.value?.length||0),l=x(()=>Array.isArray(o.value)?new Set(o.value):new Set);function u(t,r){let{nTriggerFormInput:i,nTriggerFormChange:s}=n,{onChange:c,"onUpdate:value":l,onUpdateValue:u}=e;if(Array.isArray(o.value)){let e=Array.from(o.value),n=e.findIndex(e=>e===r);t?~n||(e.push(r),u&&I(u,e,{actionType:`check`,value:r}),l&&I(l,e,{actionType:`check`,value:r}),i(),s(),a.value=e,c&&I(c,e)):~n&&(e.splice(n,1),u&&I(u,e,{actionType:`uncheck`,value:r}),l&&I(l,e,{actionType:`uncheck`,value:r}),c&&I(c,e),a.value=e,i(),s())}else t?(u&&I(u,[r],{actionType:`check`,value:r}),l&&I(l,[r],{actionType:`check`,value:r}),c&&I(c,[r]),a.value=[r],i(),s()):(u&&I(u,[],{actionType:`uncheck`,value:r}),l&&I(l,[],{actionType:`uncheck`,value:r}),c&&I(c,[]),a.value=[],i(),s())}return s(Dt,{checkedCountRef:c,maxRef:m(e,`max`),minRef:m(e,`min`),valueSetRef:l,disabledRef:i,mergedSizeRef:r,toggleCheckbox:u}),{mergedClsPrefix:t}},render(){return O(`div`,{class:`${this.mergedClsPrefix}-checkbox-group`,role:`group`},this.$slots)}}),kt=()=>O(`svg`,{viewBox:`0 0 64 64`,class:`check-icon`},O(`path`,{d:`M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z`})),At=()=>O(`svg`,{viewBox:`0 0 100 100`,class:`line-icon`},O(`path`,{d:`M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z`})),jt=B([q(`checkbox`,`
|
|
2
|
+
font-size: var(--n-font-size);
|
|
3
|
+
outline: none;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
flex-wrap: nowrap;
|
|
7
|
+
align-items: flex-start;
|
|
8
|
+
word-break: break-word;
|
|
9
|
+
line-height: var(--n-size);
|
|
10
|
+
--n-merged-color-table: var(--n-color-table);
|
|
11
|
+
`,[U(`show-label`,`line-height: var(--n-label-line-height);`),B(`&:hover`,[q(`checkbox-box`,[V(`border`,`border: var(--n-border-checked);`)])]),B(`&:focus:not(:active)`,[q(`checkbox-box`,[V(`border`,`
|
|
12
|
+
border: var(--n-border-focus);
|
|
13
|
+
box-shadow: var(--n-box-shadow-focus);
|
|
14
|
+
`)])]),U(`inside-table`,[q(`checkbox-box`,`
|
|
15
|
+
background-color: var(--n-merged-color-table);
|
|
16
|
+
`)]),U(`checked`,[q(`checkbox-box`,`
|
|
17
|
+
background-color: var(--n-color-checked);
|
|
18
|
+
`,[q(`checkbox-icon`,[B(`.check-icon`,`
|
|
19
|
+
opacity: 1;
|
|
20
|
+
transform: scale(1);
|
|
21
|
+
`)])])]),U(`indeterminate`,[q(`checkbox-box`,[q(`checkbox-icon`,[B(`.check-icon`,`
|
|
22
|
+
opacity: 0;
|
|
23
|
+
transform: scale(.5);
|
|
24
|
+
`),B(`.line-icon`,`
|
|
25
|
+
opacity: 1;
|
|
26
|
+
transform: scale(1);
|
|
27
|
+
`)])])]),U(`checked, indeterminate`,[B(`&:focus:not(:active)`,[q(`checkbox-box`,[V(`border`,`
|
|
28
|
+
border: var(--n-border-checked);
|
|
29
|
+
box-shadow: var(--n-box-shadow-focus);
|
|
30
|
+
`)])]),q(`checkbox-box`,`
|
|
31
|
+
background-color: var(--n-color-checked);
|
|
32
|
+
border-left: 0;
|
|
33
|
+
border-top: 0;
|
|
34
|
+
`,[V(`border`,{border:`var(--n-border-checked)`})])]),U(`disabled`,{cursor:`not-allowed`},[U(`checked`,[q(`checkbox-box`,`
|
|
35
|
+
background-color: var(--n-color-disabled-checked);
|
|
36
|
+
`,[V(`border`,{border:`var(--n-border-disabled-checked)`}),q(`checkbox-icon`,[B(`.check-icon, .line-icon`,{fill:`var(--n-check-mark-color-disabled-checked)`})])])]),q(`checkbox-box`,`
|
|
37
|
+
background-color: var(--n-color-disabled);
|
|
38
|
+
`,[V(`border`,`
|
|
39
|
+
border: var(--n-border-disabled);
|
|
40
|
+
`),q(`checkbox-icon`,[B(`.check-icon, .line-icon`,`
|
|
41
|
+
fill: var(--n-check-mark-color-disabled);
|
|
42
|
+
`)])]),V(`label`,`
|
|
43
|
+
color: var(--n-text-color-disabled);
|
|
44
|
+
`)]),q(`checkbox-box-wrapper`,`
|
|
45
|
+
position: relative;
|
|
46
|
+
width: var(--n-size);
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
flex-grow: 0;
|
|
49
|
+
user-select: none;
|
|
50
|
+
-webkit-user-select: none;
|
|
51
|
+
`),q(`checkbox-box`,`
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 0;
|
|
54
|
+
top: 50%;
|
|
55
|
+
transform: translateY(-50%);
|
|
56
|
+
height: var(--n-size);
|
|
57
|
+
width: var(--n-size);
|
|
58
|
+
display: inline-block;
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
border-radius: var(--n-border-radius);
|
|
61
|
+
background-color: var(--n-color);
|
|
62
|
+
transition: background-color 0.3s var(--n-bezier);
|
|
63
|
+
`,[V(`border`,`
|
|
64
|
+
transition:
|
|
65
|
+
border-color .3s var(--n-bezier),
|
|
66
|
+
box-shadow .3s var(--n-bezier);
|
|
67
|
+
border-radius: inherit;
|
|
68
|
+
position: absolute;
|
|
69
|
+
left: 0;
|
|
70
|
+
right: 0;
|
|
71
|
+
top: 0;
|
|
72
|
+
bottom: 0;
|
|
73
|
+
border: var(--n-border);
|
|
74
|
+
`),q(`checkbox-icon`,`
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
position: absolute;
|
|
79
|
+
left: 1px;
|
|
80
|
+
right: 1px;
|
|
81
|
+
top: 1px;
|
|
82
|
+
bottom: 1px;
|
|
83
|
+
`,[B(`.check-icon, .line-icon`,`
|
|
84
|
+
width: 100%;
|
|
85
|
+
fill: var(--n-check-mark-color);
|
|
86
|
+
opacity: 0;
|
|
87
|
+
transform: scale(0.5);
|
|
88
|
+
transform-origin: center;
|
|
89
|
+
transition:
|
|
90
|
+
fill 0.3s var(--n-bezier),
|
|
91
|
+
transform 0.3s var(--n-bezier),
|
|
92
|
+
opacity 0.3s var(--n-bezier),
|
|
93
|
+
border-color 0.3s var(--n-bezier);
|
|
94
|
+
`),re({left:`1px`,top:`1px`})])]),V(`label`,`
|
|
95
|
+
color: var(--n-text-color);
|
|
96
|
+
transition: color .3s var(--n-bezier);
|
|
97
|
+
user-select: none;
|
|
98
|
+
-webkit-user-select: none;
|
|
99
|
+
padding: var(--n-label-padding);
|
|
100
|
+
font-weight: var(--n-label-font-weight);
|
|
101
|
+
`,[B(`&:empty`,{display:`none`})])]),G(q(`checkbox`,`
|
|
102
|
+
--n-merged-color-table: var(--n-color-table-modal);
|
|
103
|
+
`)),W(q(`checkbox`,`
|
|
104
|
+
--n-merged-color-table: var(--n-color-table-popover);
|
|
105
|
+
`))]),Mt=E({name:`Checkbox`,props:Object.assign(Object.assign({},K.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]}),setup(e){let t=n(Dt,null),r=w(null),{mergedClsPrefixRef:i,inlineThemeDisabled:a,mergedRtlRef:o,mergedComponentPropsRef:s}=A(e),c=w(e.defaultChecked),l=Ke(m(e,`checked`),c),u=Z(()=>{if(t){let n=t.valueSetRef.value;return n&&e.value!==void 0?n.has(e.value):!1}else return l.value===e.checkedValue}),d=k(e,{mergedSize(n){let{size:r}=e;if(r!==void 0)return r;if(t){let{value:e}=t.mergedSizeRef;if(e!==void 0)return e}if(n){let{mergedSize:e}=n;if(e!==void 0)return e.value}return s?.value?.Checkbox?.size||`medium`},mergedDisabled(n){let{disabled:r}=e;if(r!==void 0)return r;if(t){if(t.disabledRef.value)return!0;let{maxRef:{value:e},checkedCountRef:n}=t;if(e!==void 0&&n.value>=e&&!u.value)return!0;let{minRef:{value:r}}=t;if(r!==void 0&&n.value<=r&&u.value)return!0}return n?n.disabled.value:!1}}),{mergedDisabledRef:f,mergedSizeRef:p}=d,h=K(`Checkbox`,`-checkbox`,jt,Et,e,i);function g(n){if(t&&e.value!==void 0)t.toggleCheckbox(!u.value,e.value);else{let{onChange:t,"onUpdate:checked":r,onUpdateChecked:i}=e,{nTriggerFormInput:a,nTriggerFormChange:o}=d,s=u.value?e.uncheckedValue:e.checkedValue;r&&I(r,s,n),i&&I(i,s,n),t&&I(t,s,n),a(),o(),c.value=s}}function _(e){f.value||g(e)}function v(e){if(!f.value)switch(e.key){case` `:case`Enter`:g(e)}}function y(e){switch(e.key){case` `:e.preventDefault()}}let b={focus:()=>{var e;(e=r.value)==null||e.focus()},blur:()=>{var e;(e=r.value)==null||e.blur()}},S=H(`Checkbox`,o,i),C=x(()=>{let{value:e}=p,{common:{cubicBezierEaseInOut:t},self:{borderRadius:n,color:r,colorChecked:i,colorDisabled:a,colorTableHeader:o,colorTableHeaderModal:s,colorTableHeaderPopover:c,checkMarkColor:l,checkMarkColorDisabled:u,border:d,borderFocus:f,borderDisabled:m,borderChecked:g,boxShadowFocus:_,textColor:v,textColorDisabled:y,checkMarkColorDisabledChecked:b,colorDisabledChecked:x,borderDisabledChecked:S,labelPadding:C,labelLineHeight:w,labelFontWeight:T,[J(`fontSize`,e)]:E,[J(`size`,e)]:D}}=h.value;return{"--n-label-line-height":w,"--n-label-font-weight":T,"--n-size":D,"--n-bezier":t,"--n-border-radius":n,"--n-border":d,"--n-border-checked":g,"--n-border-focus":f,"--n-border-disabled":m,"--n-border-disabled-checked":S,"--n-box-shadow-focus":_,"--n-color":r,"--n-color-checked":i,"--n-color-table":o,"--n-color-table-modal":s,"--n-color-table-popover":c,"--n-color-disabled":a,"--n-color-disabled-checked":x,"--n-text-color":v,"--n-text-color-disabled":y,"--n-check-mark-color":l,"--n-check-mark-color-disabled":u,"--n-check-mark-color-disabled-checked":b,"--n-font-size":E,"--n-label-padding":C}}),T=a?P(`checkbox`,x(()=>p.value[0]),C,e):void 0;return Object.assign(d,b,{rtlEnabled:S,selfRef:r,mergedClsPrefix:i,mergedDisabled:f,renderedChecked:u,mergedTheme:h,labelId:ue(),handleClick:_,handleKeyUp:v,handleKeyDown:y,cssVars:a?void 0:C,themeClass:T?.themeClass,onRender:T?.onRender})},render(){var e;let{$slots:t,renderedChecked:n,mergedDisabled:r,indeterminate:i,privateInsideTable:a,cssVars:o,labelId:s,label:c,mergedClsPrefix:l,focusable:u,handleKeyUp:d,handleKeyDown:f,handleClick:p}=this;(e=this.onRender)==null||e.call(this);let m=L(t.default,e=>c||e?O(`span`,{class:`${l}-checkbox__label`,id:s},c||e):null);return O(`div`,{ref:`selfRef`,class:[`${l}-checkbox`,this.themeClass,this.rtlEnabled&&`${l}-checkbox--rtl`,n&&`${l}-checkbox--checked`,r&&`${l}-checkbox--disabled`,i&&`${l}-checkbox--indeterminate`,a&&`${l}-checkbox--inside-table`,m&&`${l}-checkbox--show-label`],tabindex:r||!u?void 0:0,role:`checkbox`,"aria-checked":i?`mixed`:n,"aria-labelledby":s,style:o,onKeyup:d,onKeydown:f,onClick:p,onMousedown:()=>{We(`selectstart`,window,e=>{e.preventDefault()},{once:!0})}},O(`div`,{class:`${l}-checkbox-box-wrapper`},`\xA0`,O(`div`,{class:`${l}-checkbox-box`},O(oe,null,{default:()=>this.indeterminate?O(`div`,{key:`indeterminate`,class:`${l}-checkbox-icon`},At()):O(`div`,{key:`check`,class:`${l}-checkbox-icon`},kt())}),O(`div`,{class:`${l}-checkbox-box__border`}))),m)}});function Nt(e){let{boxShadow2:t}=e;return{menuBoxShadow:t}}var Pt=z({name:`Popselect`,common:X,peers:{Popover:ve,InternalSelectMenu:Re},self:Nt}),Ft=Q(`n-popselect`),It=q(`popselect-menu`,`
|
|
106
|
+
box-shadow: var(--n-menu-box-shadow);
|
|
107
|
+
`),Lt={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:String,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]},Rt=et(Lt),zt=E({name:`PopselectPanel`,props:Lt,setup(e){let t=n(Ft),{mergedClsPrefixRef:r,inlineThemeDisabled:a,mergedComponentPropsRef:o}=A(e),s=x(()=>e.size||o?.value?.Popselect?.size||`medium`),c=K(`Popselect`,`-pop-select`,It,Pt,t.props,r),l=x(()=>Fe(e.options,ze(`value`,`children`)));function u(t,n){let{onUpdateValue:r,"onUpdate:value":i,onChange:a}=e;r&&I(r,t,n),i&&I(i,t,n),a&&I(a,t,n)}function f(e){h(e.key)}function p(e){!Ne(e,`action`)&&!Ne(e,`empty`)&&!Ne(e,`header`)&&e.preventDefault()}function h(n){let{value:{getNode:r}}=l;if(e.multiple)if(Array.isArray(e.value)){let t=[],i=[],a=!0;e.value.forEach(e=>{if(e===n){a=!1;return}let o=r(e);o&&(t.push(o.key),i.push(o.rawNode))}),a&&(t.push(n),i.push(r(n).rawNode)),u(t,i)}else{let e=r(n);e&&u([n],[e.rawNode])}else if(e.value===n&&e.cancelable)u(null,null);else{let e=r(n);e&&u(n,e.rawNode);let{"onUpdate:show":i,onUpdateShow:a}=t.props;i&&I(i,!1),a&&I(a,!1),t.setShow(!1)}i(()=>{t.syncPosition()})}d(m(e,`options`),()=>{i(()=>{t.syncPosition()})});let g=x(()=>{let{self:{menuBoxShadow:e}}=c.value;return{"--n-menu-box-shadow":e}}),_=a?P(`select`,void 0,g,t.props):void 0;return{mergedTheme:t.mergedThemeRef,mergedClsPrefix:r,treeMate:l,handleToggle:f,handleMenuMousedown:p,cssVars:a?void 0:g,themeClass:_?.themeClass,onRender:_?.onRender,mergedSize:s,scrollbarProps:t.props.scrollbarProps}},render(){var e;return(e=this.onRender)==null||e.call(this),O(Pe,{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.mergedSize,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,scrollbarProps:this.scrollbarProps,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{header:()=>{var e;return(e=this.$slots).header?.call(e)||[]},action:()=>{var e;return(e=this.$slots).action?.call(e)||[]},empty:()=>{var e;return(e=this.$slots).empty?.call(e)||[]}})}}),Bt=E({name:`Popselect`,props:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},K.props),tt(xe,[`showArrow`,`arrow`])),{placement:Object.assign(Object.assign({},xe.placement),{default:`bottom`}),trigger:{type:String,default:`hover`}}),Lt),{scrollbarProps:Object}),slots:Object,inheritAttrs:!1,__popover__:!0,setup(e){let{mergedClsPrefixRef:t}=A(e),n=K(`Popselect`,`-popselect`,void 0,Pt,e,t),r=w(null);function i(){var e;(e=r.value)==null||e.syncPosition()}function a(e){var t;(t=r.value)==null||t.setShow(e)}return s(Ft,{props:e,mergedThemeRef:n,syncPosition:i,setShow:a}),Object.assign(Object.assign({},{syncPosition:i,setShow:a}),{popoverInstRef:r,mergedTheme:n})},render(){let{mergedTheme:e}=this,t={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:`0`},ref:`popoverInstRef`,internalRenderBody:(e,t,n,r,i)=>{let{$attrs:a}=this;return O(zt,Object.assign({},a,{class:[a.class,e],style:[a.style,...n]},Se(this.$props,Rt),{ref:mt(t),onMouseenter:Me([r,a.onMouseenter]),onMouseleave:Me([i,a.onMouseleave])}),{header:()=>{var e;return(e=this.$slots).header?.call(e)},action:()=>{var e;return(e=this.$slots).action?.call(e)},empty:()=>{var e;return(e=this.$slots).empty?.call(e)}})}};return O(we,Object.assign({},tt(this.$props,Rt),t,{internalDeactivateImmediately:!0}),{trigger:()=>{var e;return(e=this.$slots).default?.call(e)}})}}),Vt={itemPaddingSmall:`0 4px`,itemMarginSmall:`0 0 0 8px`,itemMarginSmallRtl:`0 8px 0 0`,itemPaddingMedium:`0 4px`,itemMarginMedium:`0 0 0 8px`,itemMarginMediumRtl:`0 8px 0 0`,itemPaddingLarge:`0 4px`,itemMarginLarge:`0 0 0 8px`,itemMarginLargeRtl:`0 8px 0 0`,buttonIconSizeSmall:`14px`,buttonIconSizeMedium:`16px`,buttonIconSizeLarge:`18px`,inputWidthSmall:`60px`,selectWidthSmall:`unset`,inputMarginSmall:`0 0 0 8px`,inputMarginSmallRtl:`0 8px 0 0`,selectMarginSmall:`0 0 0 8px`,prefixMarginSmall:`0 8px 0 0`,suffixMarginSmall:`0 0 0 8px`,inputWidthMedium:`60px`,selectWidthMedium:`unset`,inputMarginMedium:`0 0 0 8px`,inputMarginMediumRtl:`0 8px 0 0`,selectMarginMedium:`0 0 0 8px`,prefixMarginMedium:`0 8px 0 0`,suffixMarginMedium:`0 0 0 8px`,inputWidthLarge:`60px`,selectWidthLarge:`unset`,inputMarginLarge:`0 0 0 8px`,inputMarginLargeRtl:`0 8px 0 0`,selectMarginLarge:`0 0 0 8px`,prefixMarginLarge:`0 8px 0 0`,suffixMarginLarge:`0 0 0 8px`};function Ht(e){let{textColor2:t,primaryColor:n,primaryColorHover:r,primaryColorPressed:i,inputColorDisabled:a,textColorDisabled:o,borderColor:s,borderRadius:c,fontSizeTiny:l,fontSizeSmall:u,fontSizeMedium:d,heightTiny:f,heightSmall:p,heightMedium:m}=e;return Object.assign(Object.assign({},Vt),{buttonColor:`#0000`,buttonColorHover:`#0000`,buttonColorPressed:`#0000`,buttonBorder:`1px solid ${s}`,buttonBorderHover:`1px solid ${s}`,buttonBorderPressed:`1px solid ${s}`,buttonIconColor:t,buttonIconColorHover:t,buttonIconColorPressed:t,itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:i,itemTextColorActive:n,itemTextColorDisabled:o,itemColor:`#0000`,itemColorHover:`#0000`,itemColorPressed:`#0000`,itemColorActive:`#0000`,itemColorActiveHover:`#0000`,itemColorDisabled:a,itemBorder:`1px solid #0000`,itemBorderHover:`1px solid #0000`,itemBorderPressed:`1px solid #0000`,itemBorderActive:`1px solid ${n}`,itemBorderDisabled:`1px solid ${s}`,itemBorderRadius:c,itemSizeSmall:f,itemSizeMedium:p,itemSizeLarge:m,itemFontSizeSmall:l,itemFontSizeMedium:u,itemFontSizeLarge:d,jumperFontSizeSmall:l,jumperFontSizeMedium:u,jumperFontSizeLarge:d,jumperTextColor:t,jumperTextColorDisabled:o})}var Ut=z({name:`Pagination`,common:X,peers:{Select:Le,Input:rt,Popselect:Pt},self:Ht}),Wt=`
|
|
108
|
+
background: var(--n-item-color-hover);
|
|
109
|
+
color: var(--n-item-text-color-hover);
|
|
110
|
+
border: var(--n-item-border-hover);
|
|
111
|
+
`,Gt=[U(`button`,`
|
|
112
|
+
background: var(--n-button-color-hover);
|
|
113
|
+
border: var(--n-button-border-hover);
|
|
114
|
+
color: var(--n-button-icon-color-hover);
|
|
115
|
+
`)],Kt=q(`pagination`,`
|
|
116
|
+
display: flex;
|
|
117
|
+
vertical-align: middle;
|
|
118
|
+
font-size: var(--n-item-font-size);
|
|
119
|
+
flex-wrap: nowrap;
|
|
120
|
+
`,[q(`pagination-prefix`,`
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
margin: var(--n-prefix-margin);
|
|
124
|
+
`),q(`pagination-suffix`,`
|
|
125
|
+
display: flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
margin: var(--n-suffix-margin);
|
|
128
|
+
`),B(`> *:not(:first-child)`,`
|
|
129
|
+
margin: var(--n-item-margin);
|
|
130
|
+
`),q(`select`,`
|
|
131
|
+
width: var(--n-select-width);
|
|
132
|
+
`),B(`&.transition-disabled`,[q(`pagination-item`,`transition: none!important;`)]),q(`pagination-quick-jumper`,`
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
display: flex;
|
|
135
|
+
color: var(--n-jumper-text-color);
|
|
136
|
+
transition: color .3s var(--n-bezier);
|
|
137
|
+
align-items: center;
|
|
138
|
+
font-size: var(--n-jumper-font-size);
|
|
139
|
+
`,[q(`input`,`
|
|
140
|
+
margin: var(--n-input-margin);
|
|
141
|
+
width: var(--n-input-width);
|
|
142
|
+
`)]),q(`pagination-item`,`
|
|
143
|
+
position: relative;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
user-select: none;
|
|
146
|
+
-webkit-user-select: none;
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
min-width: var(--n-item-size);
|
|
152
|
+
height: var(--n-item-size);
|
|
153
|
+
padding: var(--n-item-padding);
|
|
154
|
+
background-color: var(--n-item-color);
|
|
155
|
+
color: var(--n-item-text-color);
|
|
156
|
+
border-radius: var(--n-item-border-radius);
|
|
157
|
+
border: var(--n-item-border);
|
|
158
|
+
fill: var(--n-button-icon-color);
|
|
159
|
+
transition:
|
|
160
|
+
color .3s var(--n-bezier),
|
|
161
|
+
border-color .3s var(--n-bezier),
|
|
162
|
+
background-color .3s var(--n-bezier),
|
|
163
|
+
fill .3s var(--n-bezier);
|
|
164
|
+
`,[U(`button`,`
|
|
165
|
+
background: var(--n-button-color);
|
|
166
|
+
color: var(--n-button-icon-color);
|
|
167
|
+
border: var(--n-button-border);
|
|
168
|
+
padding: 0;
|
|
169
|
+
`,[q(`base-icon`,`
|
|
170
|
+
font-size: var(--n-button-icon-size);
|
|
171
|
+
`)]),Y(`disabled`,[U(`hover`,Wt,Gt),B(`&:hover`,Wt,Gt),B(`&:active`,`
|
|
172
|
+
background: var(--n-item-color-pressed);
|
|
173
|
+
color: var(--n-item-text-color-pressed);
|
|
174
|
+
border: var(--n-item-border-pressed);
|
|
175
|
+
`,[U(`button`,`
|
|
176
|
+
background: var(--n-button-color-pressed);
|
|
177
|
+
border: var(--n-button-border-pressed);
|
|
178
|
+
color: var(--n-button-icon-color-pressed);
|
|
179
|
+
`)]),U(`active`,`
|
|
180
|
+
background: var(--n-item-color-active);
|
|
181
|
+
color: var(--n-item-text-color-active);
|
|
182
|
+
border: var(--n-item-border-active);
|
|
183
|
+
`,[B(`&:hover`,`
|
|
184
|
+
background: var(--n-item-color-active-hover);
|
|
185
|
+
`)])]),U(`disabled`,`
|
|
186
|
+
cursor: not-allowed;
|
|
187
|
+
color: var(--n-item-text-color-disabled);
|
|
188
|
+
`,[U(`active, button`,`
|
|
189
|
+
background-color: var(--n-item-color-disabled);
|
|
190
|
+
border: var(--n-item-border-disabled);
|
|
191
|
+
`)])]),U(`disabled`,`
|
|
192
|
+
cursor: not-allowed;
|
|
193
|
+
`,[q(`pagination-quick-jumper`,`
|
|
194
|
+
color: var(--n-jumper-text-color-disabled);
|
|
195
|
+
`)]),U(`simple`,`
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
flex-wrap: nowrap;
|
|
199
|
+
`,[q(`pagination-quick-jumper`,[q(`input`,`
|
|
200
|
+
margin: 0;
|
|
201
|
+
`)])])]);function qt(e){if(!e)return 10;let{defaultPageSize:t}=e;if(t!==void 0)return t;let n=e.pageSizes?.[0];return typeof n==`number`?n:n?.value||10}function Jt(e,t,n,r){let i=!1,a=!1,o=1,s=t;if(t===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:s,fastBackwardTo:o,items:[{type:`page`,label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(t===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:s,fastBackwardTo:o,items:[{type:`page`,label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:`page`,label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};let c=t,l=e,u=e,d=(n-5)/2;u+=Math.ceil(d),u=Math.min(Math.max(u,1+n-3),c-2),l-=Math.floor(d),l=Math.max(Math.min(l,c-n+3),3);let f=!1,p=!1;l>3&&(f=!0),u<c-2&&(p=!0);let m=[];m.push({type:`page`,label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}),f?(i=!0,o=l-1,m.push({type:`fast-backward`,active:!1,label:void 0,options:r?Yt(2,l-1):null})):c>=2&&m.push({type:`page`,label:2,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===2});for(let t=l;t<=u;++t)m.push({type:`page`,label:t,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===t});return p?(a=!0,s=u+1,m.push({type:`fast-forward`,active:!1,label:void 0,options:r?Yt(u+1,c-1):null})):u===c-2&&m[m.length-1].label!==c-1&&m.push({type:`page`,mayBeFastForward:!0,mayBeFastBackward:!1,label:c-1,active:e===c-1}),m[m.length-1].label!==c&&m.push({type:`page`,mayBeFastForward:!1,mayBeFastBackward:!1,label:c,active:e===c}),{hasFastBackward:i,hasFastForward:a,fastBackwardTo:o,fastForwardTo:s,items:m}}function Yt(e,t){let n=[];for(let r=e;r<=t;++r)n.push({label:`${r}`,value:r});return n}var Xt=E({name:`Pagination`,props:Object.assign(Object.assign({},K.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:String,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:Oe.propTo,showQuickJumpDropdown:{type:Boolean,default:!0},scrollbarProps:Object,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),slots:Object,setup(e){let{mergedComponentPropsRef:t,mergedClsPrefixRef:n,inlineThemeDisabled:r,mergedRtlRef:a}=A(e),o=x(()=>e.size||t?.value?.Pagination?.size||`medium`),s=K(`Pagination`,`-pagination`,Kt,Ut,e,n),{localeRef:c}=Xe(`Pagination`),l=w(null),u=w(e.defaultPage),d=w(qt(e)),p=Ke(m(e,`page`),u),h=Ke(m(e,`pageSize`),d),g=x(()=>{let{itemCount:t}=e;if(t!==void 0)return Math.max(1,Math.ceil(t/h.value));let{pageCount:n}=e;return n===void 0?1:Math.max(n,1)}),_=w(``);f(()=>{e.simple,_.value=String(p.value)});let v=w(!1),y=w(!1),b=w(!1),S=w(!1),C=()=>{e.disabled||(v.value=!0,B())},T=()=>{e.disabled||(v.value=!1,B())},E=()=>{y.value=!0,B()},D=()=>{y.value=!1,B()},O=e=>{V(e)},k=x(()=>Jt(p.value,g.value,e.pageSlot,e.showQuickJumpDropdown));f(()=>{k.value.hasFastBackward?k.value.hasFastForward||(v.value=!1,b.value=!1):(y.value=!1,S.value=!1)});let j=x(()=>{let t=c.value.selectionSuffix;return e.pageSizes.map(e=>typeof e==`number`?{label:`${e} / ${t}`,value:e}:e)}),M=x(()=>t?.value?.Pagination?.inputSize||pt(o.value)),N=x(()=>t?.value?.Pagination?.selectSize||pt(o.value)),F=x(()=>(p.value-1)*h.value),L=x(()=>{let t=p.value*h.value-1,{itemCount:n}=e;return n===void 0?t:t>n-1?n-1:t}),R=x(()=>{let{itemCount:t}=e;return t===void 0?(e.pageCount||1)*h.value:t}),z=H(`Pagination`,a,n);function B(){i(()=>{var e;let{value:t}=l;t&&(t.classList.add(`transition-disabled`),(e=l.value)==null||e.offsetWidth,t.classList.remove(`transition-disabled`))})}function V(t){if(t===p.value)return;let{"onUpdate:page":n,onUpdatePage:r,onChange:i,simple:a}=e;n&&I(n,t),r&&I(r,t),i&&I(i,t),u.value=t,a&&(_.value=String(t))}function U(t){if(t===h.value)return;let{"onUpdate:pageSize":n,onUpdatePageSize:r,onPageSizeChange:i}=e;n&&I(n,t),r&&I(r,t),i&&I(i,t),d.value=t,g.value<p.value&&V(g.value)}function W(){e.disabled||V(Math.min(p.value+1,g.value))}function G(){e.disabled||V(Math.max(p.value-1,1))}function ee(){e.disabled||V(Math.min(k.value.fastForwardTo,g.value))}function te(){e.disabled||V(Math.max(k.value.fastBackwardTo,1))}function q(e){U(e)}function ne(){let t=Number.parseInt(_.value);Number.isNaN(t)||(V(Math.max(1,Math.min(t,g.value))),e.simple||(_.value=``))}function re(){ne()}function ie(t){if(!e.disabled)switch(t.type){case`page`:V(t.label);break;case`fast-backward`:te();break;case`fast-forward`:ee();break}}function Y(e){_.value=e.replace(/\D+/g,``)}f(()=>{p.value,h.value,B()});let ae=x(()=>{let e=o.value,{self:{buttonBorder:t,buttonBorderHover:n,buttonBorderPressed:r,buttonIconColor:i,buttonIconColorHover:a,buttonIconColorPressed:c,itemTextColor:l,itemTextColorHover:u,itemTextColorPressed:d,itemTextColorActive:f,itemTextColorDisabled:p,itemColor:m,itemColorHover:h,itemColorPressed:g,itemColorActive:_,itemColorActiveHover:v,itemColorDisabled:y,itemBorder:b,itemBorderHover:x,itemBorderPressed:S,itemBorderActive:C,itemBorderDisabled:w,itemBorderRadius:T,jumperTextColor:E,jumperTextColorDisabled:D,buttonColor:O,buttonColorHover:k,buttonColorPressed:A,[J(`itemPadding`,e)]:j,[J(`itemMargin`,e)]:M,[J(`inputWidth`,e)]:N,[J(`selectWidth`,e)]:P,[J(`inputMargin`,e)]:F,[J(`selectMargin`,e)]:I,[J(`jumperFontSize`,e)]:L,[J(`prefixMargin`,e)]:R,[J(`suffixMargin`,e)]:z,[J(`itemSize`,e)]:B,[J(`buttonIconSize`,e)]:V,[J(`itemFontSize`,e)]:H,[`${J(`itemMargin`,e)}Rtl`]:U,[`${J(`inputMargin`,e)}Rtl`]:W},common:{cubicBezierEaseInOut:G}}=s.value;return{"--n-prefix-margin":R,"--n-suffix-margin":z,"--n-item-font-size":H,"--n-select-width":P,"--n-select-margin":I,"--n-input-width":N,"--n-input-margin":F,"--n-input-margin-rtl":W,"--n-item-size":B,"--n-item-text-color":l,"--n-item-text-color-disabled":p,"--n-item-text-color-hover":u,"--n-item-text-color-active":f,"--n-item-text-color-pressed":d,"--n-item-color":m,"--n-item-color-hover":h,"--n-item-color-disabled":y,"--n-item-color-active":_,"--n-item-color-active-hover":v,"--n-item-color-pressed":g,"--n-item-border":b,"--n-item-border-hover":x,"--n-item-border-disabled":w,"--n-item-border-active":C,"--n-item-border-pressed":S,"--n-item-padding":j,"--n-item-border-radius":T,"--n-bezier":G,"--n-jumper-font-size":L,"--n-jumper-text-color":E,"--n-jumper-text-color-disabled":D,"--n-item-margin":M,"--n-item-margin-rtl":U,"--n-button-icon-size":V,"--n-button-icon-color":i,"--n-button-icon-color-hover":a,"--n-button-icon-color-pressed":c,"--n-button-color-hover":k,"--n-button-color":O,"--n-button-color-pressed":A,"--n-button-border":t,"--n-button-border-hover":n,"--n-button-border-pressed":r}}),X=r?P(`pagination`,x(()=>{let e=``;return e+=o.value[0],e}),ae,e):void 0;return{rtlEnabled:z,mergedClsPrefix:n,locale:c,selfRef:l,mergedPage:p,pageItems:x(()=>k.value.items),mergedItemCount:R,jumperValue:_,pageSizeOptions:j,mergedPageSize:h,inputSize:M,selectSize:N,mergedTheme:s,mergedPageCount:g,startIndex:F,endIndex:L,showFastForwardMenu:b,showFastBackwardMenu:S,fastForwardActive:v,fastBackwardActive:y,handleMenuSelect:O,handleFastForwardMouseenter:C,handleFastForwardMouseleave:T,handleFastBackwardMouseenter:E,handleFastBackwardMouseleave:D,handleJumperInput:Y,handleBackwardClick:G,handleForwardClick:W,handlePageItemClick:ie,handleSizePickerChange:q,handleQuickJumperChange:re,cssVars:r?void 0:ae,themeClass:X?.themeClass,onRender:X?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,disabled:n,cssVars:r,mergedPage:i,mergedPageCount:a,pageItems:o,showSizePicker:s,showQuickJumper:c,mergedTheme:l,locale:u,inputSize:d,selectSize:f,mergedPageSize:p,pageSizeOptions:m,jumperValue:h,simple:g,prev:_,next:y,prefix:b,suffix:x,label:S,goto:C,handleJumperInput:w,handleSizePickerChange:T,handleBackwardClick:E,handlePageItemClick:D,handleForwardClick:k,handleQuickJumperChange:A,onRender:j}=this;j?.();let M=b||e.prefix,N=x||e.suffix,P=_||e.prev,F=y||e.next,I=S||e.label;return O(`div`,{ref:`selfRef`,class:[`${t}-pagination`,this.themeClass,this.rtlEnabled&&`${t}-pagination--rtl`,n&&`${t}-pagination--disabled`,g&&`${t}-pagination--simple`],style:r},M?O(`div`,{class:`${t}-pagination-prefix`},M({page:i,pageSize:p,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(e=>{switch(e){case`pages`:return O(v,null,O(`div`,{class:[`${t}-pagination-item`,!P&&`${t}-pagination-item--button`,(i<=1||i>a||n)&&`${t}-pagination-item--disabled`],onClick:E},P?P({page:i,pageSize:p,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):O(Je,{clsPrefix:t},{default:()=>this.rtlEnabled?O(St,null):O(_t,null)})),g?O(v,null,O(`div`,{class:`${t}-pagination-quick-jumper`},O(it,{value:h,onUpdateValue:w,size:d,placeholder:``,disabled:n,theme:l.peers.Input,themeOverrides:l.peerOverrides.Input,onChange:A})),`\xA0/`,` `,a):o.map((e,r)=>{let i,a,o,{type:s}=e;switch(s){case`page`:let n=e.label;i=I?I({type:`page`,node:n,active:e.active}):n;break;case`fast-forward`:let r=this.fastForwardActive?O(Je,{clsPrefix:t},{default:()=>this.rtlEnabled?O(yt,null):O(bt,null)}):O(Je,{clsPrefix:t},{default:()=>O(Ct,null)});i=I?I({type:`fast-forward`,node:r,active:this.fastForwardActive||this.showFastForwardMenu}):r,a=this.handleFastForwardMouseenter,o=this.handleFastForwardMouseleave;break;case`fast-backward`:let s=this.fastBackwardActive?O(Je,{clsPrefix:t},{default:()=>this.rtlEnabled?O(bt,null):O(yt,null)}):O(Je,{clsPrefix:t},{default:()=>O(Ct,null)});i=I?I({type:`fast-backward`,node:s,active:this.fastBackwardActive||this.showFastBackwardMenu}):s,a=this.handleFastBackwardMouseenter,o=this.handleFastBackwardMouseleave;break}let c=O(`div`,{key:r,class:[`${t}-pagination-item`,e.active&&`${t}-pagination-item--active`,s!==`page`&&(s===`fast-backward`&&this.showFastBackwardMenu||s===`fast-forward`&&this.showFastForwardMenu)&&`${t}-pagination-item--hover`,n&&`${t}-pagination-item--disabled`,s===`page`&&`${t}-pagination-item--clickable`],onClick:()=>{D(e)},onMouseenter:a,onMouseleave:o},i);if(s===`page`&&!e.mayBeFastBackward&&!e.mayBeFastForward)return c;{let t=e.type===`page`?e.mayBeFastBackward?`fast-backward`:`fast-forward`:e.type;return e.type!==`page`&&!e.options?c:O(Bt,{to:this.to,key:t,disabled:n,trigger:`hover`,virtualScroll:!0,style:{width:`60px`},theme:l.peers.Popselect,themeOverrides:l.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:`calc(var(--n-option-height) * 4.6)`}}},nodeProps:()=>({style:{justifyContent:`center`}}),show:s===`page`?!1:s===`fast-backward`?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:e=>{s!==`page`&&(e?s===`fast-backward`?this.showFastBackwardMenu=e:this.showFastForwardMenu=e:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:e.type!==`page`&&e.options?e.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,scrollbarProps:this.scrollbarProps,showCheckmark:!1},{default:()=>c})}}),O(`div`,{class:[`${t}-pagination-item`,!F&&`${t}-pagination-item--button`,{[`${t}-pagination-item--disabled`]:i<1||i>=a||n}],onClick:k},F?F({page:i,pageSize:p,pageCount:a,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):O(Je,{clsPrefix:t},{default:()=>this.rtlEnabled?O(_t,null):O(St,null)})));case`size-picker`:return!g&&s?O(Ve,Object.assign({consistentMenuWidth:!1,placeholder:``,showCheckmark:!1,to:this.to},this.selectProps,{size:f,options:m,value:p,disabled:n,scrollbarProps:this.scrollbarProps,theme:l.peers.Select,themeOverrides:l.peerOverrides.Select,onUpdateValue:T})):null;case`quick-jumper`:return!g&&c?O(`div`,{class:`${t}-pagination-quick-jumper`},C?C():ae(this.$slots.goto,()=>[u.goto]),O(it,{value:h,onUpdateValue:w,size:d,placeholder:``,disabled:n,theme:l.peers.Input,themeOverrides:l.peerOverrides.Input,onChange:A})):null;default:return null}}),N?O(`div`,{class:`${t}-pagination-suffix`},N({page:i,pageSize:p,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}}),Zt={padding:`4px 0`,optionIconSizeSmall:`14px`,optionIconSizeMedium:`16px`,optionIconSizeLarge:`16px`,optionIconSizeHuge:`18px`,optionSuffixWidthSmall:`14px`,optionSuffixWidthMedium:`14px`,optionSuffixWidthLarge:`16px`,optionSuffixWidthHuge:`16px`,optionIconSuffixWidthSmall:`32px`,optionIconSuffixWidthMedium:`32px`,optionIconSuffixWidthLarge:`36px`,optionIconSuffixWidthHuge:`36px`,optionPrefixWidthSmall:`14px`,optionPrefixWidthMedium:`14px`,optionPrefixWidthLarge:`16px`,optionPrefixWidthHuge:`16px`,optionIconPrefixWidthSmall:`36px`,optionIconPrefixWidthMedium:`36px`,optionIconPrefixWidthLarge:`40px`,optionIconPrefixWidthHuge:`40px`};function Qt(e){let{primaryColor:t,textColor2:n,dividerColor:r,hoverColor:i,popoverColor:a,invertedColor:o,borderRadius:s,fontSizeSmall:c,fontSizeMedium:l,fontSizeLarge:u,fontSizeHuge:d,heightSmall:f,heightMedium:p,heightLarge:m,heightHuge:h,textColor3:g,opacityDisabled:_}=e;return Object.assign(Object.assign({},Zt),{optionHeightSmall:f,optionHeightMedium:p,optionHeightLarge:m,optionHeightHuge:h,borderRadius:s,fontSizeSmall:c,fontSizeMedium:l,fontSizeLarge:u,fontSizeHuge:d,optionTextColor:n,optionTextColorHover:n,optionTextColorActive:t,optionTextColorChildActive:t,color:a,dividerColor:r,suffixColor:n,prefixColor:n,optionColorHover:i,optionColorActive:te(t,{alpha:.1}),groupHeaderTextColor:g,optionTextColorInverted:`#BBB`,optionTextColorHoverInverted:`#FFF`,optionTextColorActiveInverted:`#FFF`,optionTextColorChildActiveInverted:`#FFF`,colorInverted:o,dividerColorInverted:`#BBB`,suffixColorInverted:`#BBB`,prefixColorInverted:`#BBB`,optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:`#AAA`,optionOpacityDisabled:_})}var $t=z({name:`Dropdown`,common:X,peers:{Popover:ve},self:Qt}),en=z({name:`Ellipsis`,common:X,peers:{Tooltip:at}}),tn={radioSizeSmall:`14px`,radioSizeMedium:`16px`,radioSizeLarge:`18px`,labelPadding:`0 8px`,labelFontWeight:`400`};function nn(e){let{borderColor:t,primaryColor:n,baseColor:r,textColorDisabled:i,inputColorDisabled:a,textColor2:o,opacityDisabled:s,borderRadius:c,fontSizeSmall:l,fontSizeMedium:u,fontSizeLarge:d,heightSmall:f,heightMedium:p,heightLarge:m,lineHeight:h}=e;return Object.assign(Object.assign({},tn),{labelLineHeight:h,buttonHeightSmall:f,buttonHeightMedium:p,buttonHeightLarge:m,fontSizeSmall:l,fontSizeMedium:u,fontSizeLarge:d,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${n}`,boxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${te(n,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${n}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:r,colorDisabled:a,colorActive:`#0000`,textColor:o,textColorDisabled:i,dotColorActive:n,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:n,buttonBorderColorHover:t,buttonColor:r,buttonColorActive:r,buttonTextColor:o,buttonTextColorActive:n,buttonTextColorHover:n,opacityDisabled:s,buttonBoxShadowFocus:`inset 0 0 0 1px ${n}, 0 0 0 2px ${te(n,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px #0000`,buttonBoxShadow:`inset 0 0 0 1px #0000`,buttonBorderRadius:c})}var rn={name:`Radio`,common:X,self:nn},an={thPaddingSmall:`8px`,thPaddingMedium:`12px`,thPaddingLarge:`12px`,tdPaddingSmall:`8px`,tdPaddingMedium:`12px`,tdPaddingLarge:`12px`,sorterSize:`15px`,resizableContainerSize:`8px`,resizableSize:`2px`,filterSize:`15px`,paginationMargin:`12px 0 0 0`,emptyPadding:`48px 0`,actionPadding:`8px 12px`,actionButtonMargin:`0 8px 0 0`};function on(e){let{cardColor:t,modalColor:n,popoverColor:r,textColor2:i,textColor1:a,tableHeaderColor:o,tableColorHover:s,iconColor:c,primaryColor:l,fontWeightStrong:u,borderRadius:d,lineHeight:f,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:h,dividerColor:g,heightSmall:_,opacityDisabled:v,tableColorStriped:y}=e;return Object.assign(Object.assign({},an),{actionDividerColor:g,lineHeight:f,borderRadius:d,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:h,borderColor:R(t,g),tdColorHover:R(t,s),tdColorSorting:R(t,s),tdColorStriped:R(t,y),thColor:R(t,o),thColorHover:R(R(t,o),s),thColorSorting:R(R(t,o),s),tdColor:t,tdTextColor:i,thTextColor:a,thFontWeight:u,thButtonColorHover:s,thIconColor:c,thIconColorActive:l,borderColorModal:R(n,g),tdColorHoverModal:R(n,s),tdColorSortingModal:R(n,s),tdColorStripedModal:R(n,y),thColorModal:R(n,o),thColorHoverModal:R(R(n,o),s),thColorSortingModal:R(R(n,o),s),tdColorModal:n,borderColorPopover:R(r,g),tdColorHoverPopover:R(r,s),tdColorSortingPopover:R(r,s),tdColorStripedPopover:R(r,y),thColorPopover:R(r,o),thColorHoverPopover:R(R(r,o),s),thColorSortingPopover:R(R(r,o),s),tdColorPopover:r,boxShadowBefore:`inset -12px 0 8px -12px rgba(0, 0, 0, .18)`,boxShadowAfter:`inset 12px 0 8px -12px rgba(0, 0, 0, .18)`,loadingColor:l,loadingSize:_,opacityLoading:v})}var sn=z({name:`DataTable`,common:X,peers:{Button:Qe,Checkbox:Et,Radio:rn,Pagination:Ut,Scrollbar:Ye,Empty:Ae,Popover:ve,Ellipsis:en,Dropdown:$t},self:on}),cn=Object.assign(Object.assign({},K.props),{onUnstableColumnResize:Function,pagination:{type:[Object,Boolean],default:!1},paginateSinglePage:{type:Boolean,default:!0},minHeight:[Number,String],maxHeight:[Number,String],columns:{type:Array,default:()=>[]},rowClassName:[String,Function],rowProps:Function,rowKey:Function,summary:[Function],data:{type:Array,default:()=>[]},loading:Boolean,bordered:{type:Boolean,default:void 0},bottomBordered:{type:Boolean,default:void 0},striped:Boolean,scrollX:[Number,String],defaultCheckedRowKeys:{type:Array,default:()=>[]},checkedRowKeys:Array,singleLine:{type:Boolean,default:!0},singleColumn:Boolean,size:String,remote:Boolean,defaultExpandedRowKeys:{type:Array,default:[]},defaultExpandAll:Boolean,expandedRowKeys:Array,stickyExpandedRows:Boolean,virtualScroll:Boolean,virtualScrollX:Boolean,virtualScrollHeader:Boolean,headerHeight:{type:Number,default:28},heightForRow:Function,minRowHeight:{type:Number,default:28},tableLayout:{type:String,default:`auto`},allowCheckingNotLoaded:Boolean,cascade:{type:Boolean,default:!0},childrenKey:{type:String,default:`children`},indent:{type:Number,default:16},flexHeight:Boolean,summaryPlacement:{type:String,default:`bottom`},paginationBehaviorOnFilter:{type:String,default:`current`},filterIconPopoverProps:Object,scrollbarProps:Object,renderCell:Function,renderExpandIcon:Function,spinProps:Object,getCsvCell:Function,getCsvHeader:Function,onLoad:Function,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],"onUpdate:sorter":[Function,Array],onUpdateSorter:[Function,Array],"onUpdate:filters":[Function,Array],onUpdateFilters:[Function,Array],"onUpdate:checkedRowKeys":[Function,Array],onUpdateCheckedRowKeys:[Function,Array],"onUpdate:expandedRowKeys":[Function,Array],onUpdateExpandedRowKeys:[Function,Array],onScroll:Function,onPageChange:[Function,Array],onPageSizeChange:[Function,Array],onSorterChange:[Function,Array],onFiltersChange:[Function,Array],onCheckedRowKeysChange:[Function,Array]}),ln=Q(`n-data-table`);function un(e){if(e.type===`selection`||e.type===`expand`)return e.width===void 0?40:He(e.width);if(!(`children`in e))return typeof e.width==`string`?He(e.width):e.width}function dn(e){if(e.type===`selection`||e.type===`expand`)return be(e.width??40);if(!(`children`in e))return be(e.width)}function fn(e){return e.type===`selection`?`__n_selection__`:e.type===`expand`?`__n_expand__`:e.key}function pn(e){return e&&(typeof e==`object`?Object.assign({},e):e)}function mn(e){return e===`ascend`?1:e===`descend`?-1:0}function hn(e,t,n){return n!==void 0&&(e=Math.min(e,typeof n==`number`?n:Number.parseFloat(n))),t!==void 0&&(e=Math.max(e,typeof t==`number`?t:Number.parseFloat(t))),e}function gn(e,t){if(t!==void 0)return{width:t,minWidth:t,maxWidth:t};let n=dn(e),{minWidth:r,maxWidth:i}=e;return{width:n,minWidth:be(r)||n,maxWidth:be(i)}}function _n(e,t,n){return typeof n==`function`?n(e,t):n||``}function vn(e){return e.filterOptionValues!==void 0||e.filterOptionValue===void 0&&e.defaultFilterOptionValues!==void 0}function yn(e){return`children`in e?!1:!!e.sorter}function bn(e){return`children`in e&&e.children.length?!1:!!e.resizable}function xn(e){return`children`in e?!1:!!e.filter&&(!!e.filterOptions||!!e.renderFilterMenu)}function Sn(e){return e?e===`descend`?`ascend`:!1:`descend`}function Cn(e,t){if(e.sorter===void 0)return null;let{customNextSortOrder:n}=e;return t===null||t.columnKey!==e.key?{columnKey:e.key,sorter:e.sorter,order:Sn(!1)}:Object.assign(Object.assign({},t),{order:(n||Sn)(t.order)})}function wn(e,t){return t.find(t=>t.columnKey===e.key&&t.order)!==void 0}function Tn(e){return typeof e==`string`?e.replace(/,/g,`\\,`):e==null?``:`${e}`.replace(/,/g,`\\,`)}function En(e,t,n,r){let i=e.filter(e=>e.type!==`expand`&&e.type!==`selection`&&e.allowExport!==!1);return[i.map(e=>r?r(e):e.title).join(`,`),...t.map(e=>i.map(t=>n?n(e[t.key],e,t):Tn(e[t.key])).join(`,`))].join(`
|
|
202
|
+
`)}var Dn=E({name:`DataTableBodyCheckbox`,props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){let{mergedCheckedRowKeySetRef:t,mergedInderminateRowKeySetRef:r}=n(ln);return()=>{let{rowKey:n}=e;return O(Mt,{privateInsideTable:!0,disabled:e.disabled,indeterminate:r.value.has(n),checked:t.value.has(n),onUpdateChecked:e.onUpdateChecked})}}}),On=q(`radio`,`
|
|
203
|
+
line-height: var(--n-label-line-height);
|
|
204
|
+
outline: none;
|
|
205
|
+
position: relative;
|
|
206
|
+
user-select: none;
|
|
207
|
+
-webkit-user-select: none;
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: flex-start;
|
|
210
|
+
flex-wrap: nowrap;
|
|
211
|
+
font-size: var(--n-font-size);
|
|
212
|
+
word-break: break-word;
|
|
213
|
+
`,[U(`checked`,[V(`dot`,`
|
|
214
|
+
background-color: var(--n-color-active);
|
|
215
|
+
`)]),V(`dot-wrapper`,`
|
|
216
|
+
position: relative;
|
|
217
|
+
flex-shrink: 0;
|
|
218
|
+
flex-grow: 0;
|
|
219
|
+
width: var(--n-radio-size);
|
|
220
|
+
`),q(`radio-input`,`
|
|
221
|
+
position: absolute;
|
|
222
|
+
border: 0;
|
|
223
|
+
width: 0;
|
|
224
|
+
height: 0;
|
|
225
|
+
opacity: 0;
|
|
226
|
+
margin: 0;
|
|
227
|
+
`),V(`dot`,`
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 50%;
|
|
230
|
+
left: 0;
|
|
231
|
+
transform: translateY(-50%);
|
|
232
|
+
height: var(--n-radio-size);
|
|
233
|
+
width: var(--n-radio-size);
|
|
234
|
+
background: var(--n-color);
|
|
235
|
+
box-shadow: var(--n-box-shadow);
|
|
236
|
+
border-radius: 50%;
|
|
237
|
+
transition:
|
|
238
|
+
background-color .3s var(--n-bezier),
|
|
239
|
+
box-shadow .3s var(--n-bezier);
|
|
240
|
+
`,[B(`&::before`,`
|
|
241
|
+
content: "";
|
|
242
|
+
opacity: 0;
|
|
243
|
+
position: absolute;
|
|
244
|
+
left: 4px;
|
|
245
|
+
top: 4px;
|
|
246
|
+
height: calc(100% - 8px);
|
|
247
|
+
width: calc(100% - 8px);
|
|
248
|
+
border-radius: 50%;
|
|
249
|
+
transform: scale(.8);
|
|
250
|
+
background: var(--n-dot-color-active);
|
|
251
|
+
transition:
|
|
252
|
+
opacity .3s var(--n-bezier),
|
|
253
|
+
background-color .3s var(--n-bezier),
|
|
254
|
+
transform .3s var(--n-bezier);
|
|
255
|
+
`),U(`checked`,{boxShadow:`var(--n-box-shadow-active)`},[B(`&::before`,`
|
|
256
|
+
opacity: 1;
|
|
257
|
+
transform: scale(1);
|
|
258
|
+
`)])]),V(`label`,`
|
|
259
|
+
color: var(--n-text-color);
|
|
260
|
+
padding: var(--n-label-padding);
|
|
261
|
+
font-weight: var(--n-label-font-weight);
|
|
262
|
+
display: inline-block;
|
|
263
|
+
transition: color .3s var(--n-bezier);
|
|
264
|
+
`),Y(`disabled`,`
|
|
265
|
+
cursor: pointer;
|
|
266
|
+
`,[B(`&:hover`,[V(`dot`,{boxShadow:`var(--n-box-shadow-hover)`})]),U(`focus`,[B(`&:not(:active)`,[V(`dot`,{boxShadow:`var(--n-box-shadow-focus)`})])])]),U(`disabled`,`
|
|
267
|
+
cursor: not-allowed;
|
|
268
|
+
`,[V(`dot`,{boxShadow:`var(--n-box-shadow-disabled)`,backgroundColor:`var(--n-color-disabled)`},[B(`&::before`,{backgroundColor:`var(--n-dot-color-disabled)`}),U(`checked`,`
|
|
269
|
+
opacity: 1;
|
|
270
|
+
`)]),V(`label`,{color:`var(--n-text-color-disabled)`}),q(`radio-input`,`
|
|
271
|
+
cursor: not-allowed;
|
|
272
|
+
`)])]),kn={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}},An=Q(`n-radio-group`);function jn(e){let t=n(An,null),{mergedClsPrefixRef:r,mergedComponentPropsRef:i}=A(e),a=k(e,{mergedSize(n){let{size:r}=e;if(r!==void 0)return r;if(t){let{mergedSizeRef:{value:e}}=t;if(e!==void 0)return e}return n?n.mergedSize.value:i?.value?.Radio?.size||`medium`},mergedDisabled(n){return!!(e.disabled||t?.disabledRef.value||n?.disabled.value)}}),{mergedSizeRef:o,mergedDisabledRef:s}=a,c=w(null),l=w(null),u=w(e.defaultChecked),d=Ke(m(e,`checked`),u),f=Z(()=>t?t.valueRef.value===e.value:d.value),p=Z(()=>{let{name:n}=e;if(n!==void 0)return n;if(t)return t.nameRef.value}),h=w(!1);function g(){if(t){let{doUpdateValue:n}=t,{value:r}=e;I(n,r)}else{let{onUpdateChecked:t,"onUpdate:checked":n}=e,{nTriggerFormInput:r,nTriggerFormChange:i}=a;t&&I(t,!0),n&&I(n,!0),r(),i(),u.value=!0}}function _(){s.value||f.value||g()}function v(){_(),c.value&&(c.value.checked=f.value)}function y(){h.value=!1}function b(){h.value=!0}return{mergedClsPrefix:t?t.mergedClsPrefixRef:r,inputRef:c,labelRef:l,mergedName:p,mergedDisabled:s,renderSafeChecked:f,focus:h,mergedSize:o,handleRadioInputChange:v,handleRadioInputBlur:y,handleRadioInputFocus:b}}var Mn=E({name:`Radio`,props:Object.assign(Object.assign({},K.props),kn),setup(e){let t=jn(e),n=K(`Radio`,`-radio`,On,rn,e,t.mergedClsPrefix),r=x(()=>{let{mergedSize:{value:e}}=t,{common:{cubicBezierEaseInOut:r},self:{boxShadow:i,boxShadowActive:a,boxShadowDisabled:o,boxShadowFocus:s,boxShadowHover:c,color:l,colorDisabled:u,colorActive:d,textColor:f,textColorDisabled:p,dotColorActive:m,dotColorDisabled:h,labelPadding:g,labelLineHeight:_,labelFontWeight:v,[J(`fontSize`,e)]:y,[J(`radioSize`,e)]:b}}=n.value;return{"--n-bezier":r,"--n-label-line-height":_,"--n-label-font-weight":v,"--n-box-shadow":i,"--n-box-shadow-active":a,"--n-box-shadow-disabled":o,"--n-box-shadow-focus":s,"--n-box-shadow-hover":c,"--n-color":l,"--n-color-active":d,"--n-color-disabled":u,"--n-dot-color-active":m,"--n-dot-color-disabled":h,"--n-font-size":y,"--n-radio-size":b,"--n-text-color":f,"--n-text-color-disabled":p,"--n-label-padding":g}}),{inlineThemeDisabled:i,mergedClsPrefixRef:a,mergedRtlRef:o}=A(e),s=H(`Radio`,o,a),c=i?P(`radio`,x(()=>t.mergedSize.value[0]),r,e):void 0;return Object.assign(t,{rtlEnabled:s,cssVars:i?void 0:r,themeClass:c?.themeClass,onRender:c?.onRender})},render(){let{$slots:e,mergedClsPrefix:t,onRender:n,label:r}=this;return n?.(),O(`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},O(`div`,{class:`${t}-radio__dot-wrapper`},`\xA0`,O(`div`,{class:[`${t}-radio__dot`,this.renderSafeChecked&&`${t}-radio__dot--checked`]}),O(`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})),L(e.default,e=>!e&&!r?null:O(`div`,{ref:`labelRef`,class:`${t}-radio__label`},e||r)))}}),Nn=q(`radio-group`,`
|
|
273
|
+
display: inline-block;
|
|
274
|
+
font-size: var(--n-font-size);
|
|
275
|
+
`,[V(`splitor`,`
|
|
276
|
+
display: inline-block;
|
|
277
|
+
vertical-align: bottom;
|
|
278
|
+
width: 1px;
|
|
279
|
+
transition:
|
|
280
|
+
background-color .3s var(--n-bezier),
|
|
281
|
+
opacity .3s var(--n-bezier);
|
|
282
|
+
background: var(--n-button-border-color);
|
|
283
|
+
`,[U(`checked`,{backgroundColor:`var(--n-button-border-color-active)`}),U(`disabled`,{opacity:`var(--n-opacity-disabled)`})]),U(`button-group`,`
|
|
284
|
+
white-space: nowrap;
|
|
285
|
+
height: var(--n-height);
|
|
286
|
+
line-height: var(--n-height);
|
|
287
|
+
`,[q(`radio-button`,{height:`var(--n-height)`,lineHeight:`var(--n-height)`}),V(`splitor`,{height:`var(--n-height)`})]),q(`radio-button`,`
|
|
288
|
+
vertical-align: bottom;
|
|
289
|
+
outline: none;
|
|
290
|
+
position: relative;
|
|
291
|
+
user-select: none;
|
|
292
|
+
-webkit-user-select: none;
|
|
293
|
+
display: inline-block;
|
|
294
|
+
box-sizing: border-box;
|
|
295
|
+
padding-left: 14px;
|
|
296
|
+
padding-right: 14px;
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
transition:
|
|
299
|
+
background-color .3s var(--n-bezier),
|
|
300
|
+
opacity .3s var(--n-bezier),
|
|
301
|
+
border-color .3s var(--n-bezier),
|
|
302
|
+
color .3s var(--n-bezier);
|
|
303
|
+
background: var(--n-button-color);
|
|
304
|
+
color: var(--n-button-text-color);
|
|
305
|
+
border-top: 1px solid var(--n-button-border-color);
|
|
306
|
+
border-bottom: 1px solid var(--n-button-border-color);
|
|
307
|
+
`,[q(`radio-input`,`
|
|
308
|
+
pointer-events: none;
|
|
309
|
+
position: absolute;
|
|
310
|
+
border: 0;
|
|
311
|
+
border-radius: inherit;
|
|
312
|
+
left: 0;
|
|
313
|
+
right: 0;
|
|
314
|
+
top: 0;
|
|
315
|
+
bottom: 0;
|
|
316
|
+
opacity: 0;
|
|
317
|
+
z-index: 1;
|
|
318
|
+
`),V(`state-border`,`
|
|
319
|
+
z-index: 1;
|
|
320
|
+
pointer-events: none;
|
|
321
|
+
position: absolute;
|
|
322
|
+
box-shadow: var(--n-button-box-shadow);
|
|
323
|
+
transition: box-shadow .3s var(--n-bezier);
|
|
324
|
+
left: -1px;
|
|
325
|
+
bottom: -1px;
|
|
326
|
+
right: -1px;
|
|
327
|
+
top: -1px;
|
|
328
|
+
`),B(`&:first-child`,`
|
|
329
|
+
border-top-left-radius: var(--n-button-border-radius);
|
|
330
|
+
border-bottom-left-radius: var(--n-button-border-radius);
|
|
331
|
+
border-left: 1px solid var(--n-button-border-color);
|
|
332
|
+
`,[V(`state-border`,`
|
|
333
|
+
border-top-left-radius: var(--n-button-border-radius);
|
|
334
|
+
border-bottom-left-radius: var(--n-button-border-radius);
|
|
335
|
+
`)]),B(`&:last-child`,`
|
|
336
|
+
border-top-right-radius: var(--n-button-border-radius);
|
|
337
|
+
border-bottom-right-radius: var(--n-button-border-radius);
|
|
338
|
+
border-right: 1px solid var(--n-button-border-color);
|
|
339
|
+
`,[V(`state-border`,`
|
|
340
|
+
border-top-right-radius: var(--n-button-border-radius);
|
|
341
|
+
border-bottom-right-radius: var(--n-button-border-radius);
|
|
342
|
+
`)]),Y(`disabled`,`
|
|
343
|
+
cursor: pointer;
|
|
344
|
+
`,[B(`&:hover`,[V(`state-border`,`
|
|
345
|
+
transition: box-shadow .3s var(--n-bezier);
|
|
346
|
+
box-shadow: var(--n-button-box-shadow-hover);
|
|
347
|
+
`),Y(`checked`,{color:`var(--n-button-text-color-hover)`})]),U(`focus`,[B(`&:not(:active)`,[V(`state-border`,{boxShadow:`var(--n-button-box-shadow-focus)`})])])]),U(`checked`,`
|
|
348
|
+
background: var(--n-button-color-active);
|
|
349
|
+
color: var(--n-button-text-color-active);
|
|
350
|
+
border-color: var(--n-button-border-color-active);
|
|
351
|
+
`),U(`disabled`,`
|
|
352
|
+
cursor: not-allowed;
|
|
353
|
+
opacity: var(--n-opacity-disabled);
|
|
354
|
+
`)])]);function Pn(e,t,n){let r=[],i=!1;for(let a=0;a<e.length;++a){let o=e[a],s=o.type?.name;s===`RadioButton`&&(i=!0);let c=o.props;if(s!==`RadioButton`){r.push(o);continue}if(a===0)r.push(o);else{let e=r[r.length-1].props,i=t===e.value,a=e.disabled,s=t===c.value,l=c.disabled,u=(i?2:0)+ +!a,d=(s?2:0)+ +!l,f={[`${n}-radio-group__splitor--disabled`]:a,[`${n}-radio-group__splitor--checked`]:i},p={[`${n}-radio-group__splitor--disabled`]:l,[`${n}-radio-group__splitor--checked`]:s},m=u<d?p:f;r.push(O(`div`,{class:[`${n}-radio-group__splitor`,m]}),o)}}return{children:r,isButtonGroup:i}}var Fn=E({name:`RadioGroup`,props:Object.assign(Object.assign({},K.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]}),setup(e){let t=w(null),{mergedSizeRef:n,mergedDisabledRef:r,nTriggerFormChange:i,nTriggerFormInput:a,nTriggerFormBlur:o,nTriggerFormFocus:c}=k(e),{mergedClsPrefixRef:l,inlineThemeDisabled:u,mergedRtlRef:d}=A(e),f=K(`Radio`,`-radio-group`,Nn,rn,e,l),p=w(e.defaultValue),h=Ke(m(e,`value`),p);function g(t){let{onUpdateValue:n,"onUpdate:value":r}=e;n&&I(n,t),r&&I(r,t),p.value=t,i(),a()}function _(e){let{value:n}=t;n&&(n.contains(e.relatedTarget)||c())}function v(e){let{value:n}=t;n&&(n.contains(e.relatedTarget)||o())}s(An,{mergedClsPrefixRef:l,nameRef:m(e,`name`),valueRef:h,disabledRef:r,mergedSizeRef:n,doUpdateValue:g});let y=H(`Radio`,d,l),b=x(()=>{let{value:e}=n,{common:{cubicBezierEaseInOut:t},self:{buttonBorderColor:r,buttonBorderColorActive:i,buttonBorderRadius:a,buttonBoxShadow:o,buttonBoxShadowFocus:s,buttonBoxShadowHover:c,buttonColor:l,buttonColorActive:u,buttonTextColor:d,buttonTextColorActive:p,buttonTextColorHover:m,opacityDisabled:h,[J(`buttonHeight`,e)]:g,[J(`fontSize`,e)]:_}}=f.value;return{"--n-font-size":_,"--n-bezier":t,"--n-button-border-color":r,"--n-button-border-color-active":i,"--n-button-border-radius":a,"--n-button-box-shadow":o,"--n-button-box-shadow-focus":s,"--n-button-box-shadow-hover":c,"--n-button-color":l,"--n-button-color-active":u,"--n-button-text-color":d,"--n-button-text-color-hover":m,"--n-button-text-color-active":p,"--n-height":g,"--n-opacity-disabled":h}}),S=u?P(`radio-group`,x(()=>n.value[0]),b,e):void 0;return{selfElRef:t,rtlEnabled:y,mergedClsPrefix:l,mergedValue:h,handleFocusout:v,handleFocusin:_,cssVars:u?void 0:b,themeClass:S?.themeClass,onRender:S?.onRender}},render(){var e;let{mergedValue:t,mergedClsPrefix:n,handleFocusin:r,handleFocusout:i}=this,{children:a,isButtonGroup:o}=Pn(ge(ht(this)),t,n);return(e=this.onRender)==null||e.call(this),O(`div`,{onFocusin:r,onFocusout:i,ref:`selfElRef`,class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,o&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),In=E({name:`DataTableBodyRadio`,props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){let{mergedCheckedRowKeySetRef:t,componentId:r}=n(ln);return()=>{let{rowKey:n}=e;return O(Mn,{name:r,disabled:e.disabled,checked:t.value.has(n),onUpdateChecked:e.onUpdateChecked})}}}),Ln=q(`ellipsis`,{overflow:`hidden`},[Y(`line-clamp`,`
|
|
355
|
+
white-space: nowrap;
|
|
356
|
+
display: inline-block;
|
|
357
|
+
vertical-align: bottom;
|
|
358
|
+
max-width: 100%;
|
|
359
|
+
`),U(`line-clamp`,`
|
|
360
|
+
display: -webkit-inline-box;
|
|
361
|
+
-webkit-box-orient: vertical;
|
|
362
|
+
`),U(`cursor-pointer`,`
|
|
363
|
+
cursor: pointer;
|
|
364
|
+
`)]);function Rn(e){return`${e}-ellipsis--line-clamp`}function zn(e,t){return`${e}-ellipsis--cursor-${t}`}var Bn=Object.assign(Object.assign({},K.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),Vn=E({name:`Ellipsis`,inheritAttrs:!1,props:Bn,slots:Object,setup(e,{slots:t,attrs:n}){let r=N(),i=K(`Ellipsis`,`-ellipsis`,Ln,en,e,r),a=w(null),o=w(null),s=w(null),c=w(!1),l=x(()=>{let{lineClamp:t}=e,{value:n}=c;return t===void 0?{textOverflow:n?``:`ellipsis`,"-webkit-line-clamp":``}:{textOverflow:``,"-webkit-line-clamp":n?``:t}});function d(){let t=!1,{value:n}=c;if(n)return!0;let{value:r}=a;if(r){let{lineClamp:n}=e;if(m(r),n!==void 0)t=r.scrollHeight<=r.offsetHeight;else{let{value:e}=o;e&&(t=e.getBoundingClientRect().width<=r.getBoundingClientRect().width)}h(r,t)}return t}let f=x(()=>e.expandTrigger===`click`?()=>{var e;let{value:t}=c;t&&((e=s.value)==null||e.setShow(!1)),c.value=!t}:void 0);y(()=>{var t;e.tooltip&&((t=s.value)==null||t.setShow(!1))});let p=()=>O(`span`,Object.assign({},u(n,{class:[`${r.value}-ellipsis`,e.lineClamp===void 0?void 0:Rn(r.value),e.expandTrigger===`click`?zn(r.value,`pointer`):void 0],style:l.value}),{ref:`triggerRef`,onClick:f.value,onMouseenter:e.expandTrigger===`click`?d:void 0}),e.lineClamp?t:O(`span`,{ref:`triggerInnerRef`},t));function m(t){if(!t)return;let n=l.value,i=Rn(r.value);e.lineClamp===void 0?g(t,i,`remove`):g(t,i,`add`);for(let e in n)t.style[e]!==n[e]&&(t.style[e]=n[e])}function h(t,n){let i=zn(r.value,`pointer`);e.expandTrigger===`click`&&!n?g(t,i,`add`):g(t,i,`remove`)}function g(e,t,n){n===`add`?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}return{mergedTheme:i,triggerRef:a,triggerInnerRef:o,tooltipRef:s,handleClick:f,renderTrigger:p,getTooltipDisabled:d}},render(){let{tooltip:e,renderTrigger:t,$slots:n}=this;if(e){let{mergedTheme:r}=this;return O(ot,Object.assign({ref:`tooltipRef`,placement:`top`},e,{getDisabled:this.getTooltipDisabled,theme:r.peers.Tooltip,themeOverrides:r.peerOverrides.Tooltip}),{trigger:t,default:n.tooltip??n.default})}else return t()}}),Hn=E({name:`PerformantEllipsis`,props:Bn,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){let r=w(!1),i=N();return ce(`-ellipsis`,Ln,i),{mouseEntered:r,renderTrigger:()=>{let{lineClamp:a}=e,o=i.value;return O(`span`,Object.assign({},u(t,{class:[`${o}-ellipsis`,a===void 0?void 0:Rn(o),e.expandTrigger===`click`?zn(o,`pointer`):void 0],style:a===void 0?{textOverflow:`ellipsis`}:{"-webkit-line-clamp":a}}),{onMouseenter:()=>{r.value=!0}}),a?n:O(`span`,null,n))}}},render(){return this.mouseEntered?O(Vn,u({},this.$attrs,this.$props),this.$slots):this.renderTrigger()}}),Un=E({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(){let{isSummary:e,column:t,row:n,renderCell:r}=this,i,{render:a,key:o,ellipsis:s}=t;if(i=a&&!e?a(n,this.index):e?n[o]?.value:r?r(me(n,o),n,t):me(n,o),s)if(typeof s==`object`){let{mergedTheme:e}=this;return t.ellipsisComponent===`performant-ellipsis`?O(Hn,Object.assign({},s,{theme:e.peers.Ellipsis,themeOverrides:e.peerOverrides.Ellipsis}),{default:()=>i}):O(Vn,Object.assign({},s,{theme:e.peers.Ellipsis,themeOverrides:e.peerOverrides.Ellipsis}),{default:()=>i})}else return O(`span`,{class:`${this.clsPrefix}-data-table-td__ellipsis`},i);return i}}),Wn=E({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(){let{clsPrefix:e}=this;return O(`div`,{class:[`${e}-data-table-expand-trigger`,this.expanded&&`${e}-data-table-expand-trigger--expanded`],onClick:this.onClick,onMousedown:e=>{e.preventDefault()}},O(oe,null,{default:()=>this.loading?O(ee,{key:`loading`,clsPrefix:this.clsPrefix,radius:85,strokeWidth:15,scale:.88}):this.renderExpandIcon?this.renderExpandIcon({expanded:this.expanded,rowData:this.rowData}):O(Je,{clsPrefix:e,key:`base-icon`},{default:()=>O(vt,null)})}))}}),Gn=E({name:`DataTableFilterMenu`,props:{column:{type:Object,required:!0},radioGroupName:{type:String,required:!0},multiple:{type:Boolean,required:!0},value:{type:[Array,String,Number],default:null},options:{type:Array,required:!0},onConfirm:{type:Function,required:!0},onClear:{type:Function,required:!0},onChange:{type:Function,required:!0}},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:r}=A(e),i=H(`DataTable`,r,t),{mergedClsPrefixRef:a,mergedThemeRef:o,localeRef:s}=n(ln),c=w(e.value),l=x(()=>{let{value:e}=c;return Array.isArray(e)?e:null}),u=x(()=>{let{value:t}=c;return vn(e.column)?Array.isArray(t)&&t.length&&t[0]||null:Array.isArray(t)?null:t});function d(t){e.onChange(t)}function f(t){e.multiple&&Array.isArray(t)?c.value=t:vn(e.column)&&!Array.isArray(t)?c.value=[t]:c.value=t}function p(){d(c.value),e.onConfirm()}function m(){e.multiple||vn(e.column)?d([]):d(null),e.onClear()}return{mergedClsPrefix:a,rtlEnabled:i,mergedTheme:o,locale:s,checkboxGroupValue:l,radioGroupValue:u,handleChange:f,handleConfirmClick:p,handleClearClick:m}},render(){let{mergedTheme:e,locale:t,mergedClsPrefix:n}=this;return O(`div`,{class:[`${n}-data-table-filter-menu`,this.rtlEnabled&&`${n}-data-table-filter-menu--rtl`]},O(Ze,null,{default:()=>{let{checkboxGroupValue:t,handleChange:r}=this;return this.multiple?O(Ot,{value:t,class:`${n}-data-table-filter-menu__group`,onUpdateValue:r},{default:()=>this.options.map(t=>O(Mt,{key:t.value,theme:e.peers.Checkbox,themeOverrides:e.peerOverrides.Checkbox,value:t.value},{default:()=>t.label}))}):O(Fn,{name:this.radioGroupName,class:`${n}-data-table-filter-menu__group`,value:this.radioGroupValue,onUpdateValue:this.handleChange},{default:()=>this.options.map(t=>O(Mn,{key:t.value,value:t.value,theme:e.peers.Radio,themeOverrides:e.peerOverrides.Radio},{default:()=>t.label}))})}}),O(`div`,{class:`${n}-data-table-filter-menu__action`},O($e,{size:`tiny`,theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,onClick:this.handleClearClick},{default:()=>t.clear}),O($e,{theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,type:`primary`,size:`tiny`,onClick:this.handleConfirmClick},{default:()=>t.confirm})))}}),Kn=E({name:`DataTableRenderFilter`,props:{render:{type:Function,required:!0},active:{type:Boolean,default:!1},show:{type:Boolean,default:!1}},render(){let{render:e,active:t,show:n}=this;return e({active:t,show:n})}});function qn(e,t,n){let r=Object.assign({},e);return r[t]=n,r}var Jn=E({name:`DataTableFilterButton`,props:{column:{type:Object,required:!0},options:{type:Array,default:()=>[]}},setup(e){let{mergedComponentPropsRef:t}=A(),{mergedThemeRef:r,mergedClsPrefixRef:i,mergedFilterStateRef:a,filterMenuCssVarsRef:o,paginationBehaviorOnFilterRef:s,doUpdatePage:c,doUpdateFilters:l,filterIconPopoverPropsRef:u}=n(ln),d=w(!1),f=a,p=x(()=>e.column.filterMultiple!==!1),m=x(()=>{let t=f.value[e.column.key];if(t===void 0){let{value:e}=p;return e?[]:null}return t}),h=x(()=>{let{value:e}=m;return Array.isArray(e)?e.length>0:e!==null}),g=x(()=>t?.value?.DataTable?.renderFilter||e.column.renderFilter);function _(t){l(qn(f.value,e.column.key,t),e.column),s.value===`first`&&c(1)}function v(){d.value=!1}function y(){d.value=!1}return{mergedTheme:r,mergedClsPrefix:i,active:h,showPopover:d,mergedRenderFilter:g,filterIconPopoverProps:u,filterMultiple:p,mergedFilterValue:m,filterMenuCssVars:o,handleFilterChange:_,handleFilterMenuConfirm:y,handleFilterMenuCancel:v}},render(){let{mergedTheme:e,mergedClsPrefix:t,handleFilterMenuCancel:n,filterIconPopoverProps:r}=this;return O(we,Object.assign({show:this.showPopover,onUpdateShow:e=>this.showPopover=e,trigger:`click`,theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,placement:`bottom`},r,{style:{padding:0}}),{trigger:()=>{let{mergedRenderFilter:e}=this;if(e)return O(Kn,{"data-data-table-filter":!0,render:e,active:this.active,show:this.showPopover});let{renderFilterIcon:n}=this.column;return O(`div`,{"data-data-table-filter":!0,class:[`${t}-data-table-filter`,{[`${t}-data-table-filter--active`]:this.active,[`${t}-data-table-filter--show`]:this.showPopover}]},n?n({active:this.active,show:this.showPopover}):O(Je,{clsPrefix:t},{default:()=>O(xt,null)}))},default:()=>{let{renderFilterMenu:e}=this.column;return e?e({hide:n}):O(Gn,{style:this.filterMenuCssVars,radioGroupName:String(this.column.key),multiple:this.filterMultiple,value:this.mergedFilterValue,options:this.options,column:this.column,onChange:this.handleFilterChange,onClear:this.handleFilterMenuCancel,onConfirm:this.handleFilterMenuConfirm})}})}}),Yn=E({name:`ColumnResizeButton`,props:{onResizeStart:Function,onResize:Function,onResizeEnd:Function},setup(e){let{mergedClsPrefixRef:t}=n(ln),r=w(!1),i=0;function a(e){return e.clientX}function o(t){var n;t.preventDefault();let o=r.value;i=a(t),r.value=!0,o||(We(`mousemove`,window,s),We(`mouseup`,window,c),(n=e.onResizeStart)==null||n.call(e))}function s(t){var n;(n=e.onResize)==null||n.call(e,a(t)-i)}function c(){var t;r.value=!1,(t=e.onResizeEnd)==null||t.call(e),Ge(`mousemove`,window,s),Ge(`mouseup`,window,c)}return b(()=>{Ge(`mousemove`,window,s),Ge(`mouseup`,window,c)}),{mergedClsPrefix:t,active:r,handleMousedown:o}},render(){let{mergedClsPrefix:e}=this;return O(`span`,{"data-data-table-resizable":!0,class:[`${e}-data-table-resize-button`,this.active&&`${e}-data-table-resize-button--active`],onMousedown:this.handleMousedown})}}),Xn=E({name:`DataTableRenderSorter`,props:{render:{type:Function,required:!0},order:{type:[String,Boolean],default:!1}},render(){let{render:e,order:t}=this;return e({order:t})}}),Zn=E({name:`SortIcon`,props:{column:{type:Object,required:!0}},setup(e){let{mergedComponentPropsRef:t}=A(),{mergedSortStateRef:r,mergedClsPrefixRef:i}=n(ln),a=x(()=>r.value.find(t=>t.columnKey===e.column.key)),o=x(()=>a.value!==void 0);return{mergedClsPrefix:i,active:o,mergedSortOrder:x(()=>{let{value:e}=a;return e&&o.value?e.order:!1}),mergedRenderSorter:x(()=>t?.value?.DataTable?.renderSorter||e.column.renderSorter)}},render(){let{mergedRenderSorter:e,mergedSortOrder:t,mergedClsPrefix:n}=this,{renderSorterIcon:r}=this.column;return e?O(Xn,{render:e,order:t}):O(`span`,{class:[`${n}-data-table-sorter`,t===`ascend`&&`${n}-data-table-sorter--asc`,t===`descend`&&`${n}-data-table-sorter--desc`]},r?r({order:t}):O(Je,{clsPrefix:n},{default:()=>O(gt,null)}))}}),Qn=Q(`n-dropdown-menu`),$n=Q(`n-dropdown`),er=Q(`n-dropdown-option`),tr=E({name:`DropdownDivider`,props:{clsPrefix:{type:String,required:!0}},render(){return O(`div`,{class:`${this.clsPrefix}-dropdown-divider`})}}),nr=E({name:`DropdownGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{showIconRef:e,hasSubmenuRef:t}=n(Qn),{renderLabelRef:r,labelFieldRef:i,nodePropsRef:a,renderOptionRef:o}=n($n);return{labelField:i,showIcon:e,hasSubmenu:t,renderLabel:r,nodeProps:a,renderOption:o}},render(){let{clsPrefix:e,hasSubmenu:t,showIcon:n,nodeProps:r,renderLabel:i,renderOption:a}=this,{rawNode:o}=this.tmNode,s=O(`div`,Object.assign({class:`${e}-dropdown-option`},r?.(o)),O(`div`,{class:`${e}-dropdown-option-body ${e}-dropdown-option-body--group`},O(`div`,{"data-dropdown-option":!0,class:[`${e}-dropdown-option-body__prefix`,n&&`${e}-dropdown-option-body__prefix--show-icon`]},je(o.icon)),O(`div`,{class:`${e}-dropdown-option-body__label`,"data-dropdown-option":!0},i?i(o):je(o.title??o[this.labelField])),O(`div`,{class:[`${e}-dropdown-option-body__suffix`,t&&`${e}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return a?a({node:s,option:o}):s}});function rr(e){let{textColorBase:t,opacity1:n,opacity2:r,opacity3:i,opacity4:a,opacity5:o}=e;return{color:t,opacity1Depth:n,opacity2Depth:r,opacity3Depth:i,opacity4Depth:a,opacity5Depth:o}}var ir={name:`Icon`,common:X,self:rr},ar=q(`icon`,`
|
|
365
|
+
height: 1em;
|
|
366
|
+
width: 1em;
|
|
367
|
+
line-height: 1em;
|
|
368
|
+
text-align: center;
|
|
369
|
+
display: inline-block;
|
|
370
|
+
position: relative;
|
|
371
|
+
fill: currentColor;
|
|
372
|
+
`,[U(`color-transition`,{transition:`color .3s var(--n-bezier)`}),U(`depth`,{color:`var(--n-color)`},[B(`svg`,{opacity:`var(--n-opacity)`,transition:`opacity .3s var(--n-bezier)`})]),B(`svg`,{height:`1em`,width:`1em`})]),or=E({_n_icon__:!0,name:`Icon`,inheritAttrs:!1,props:Object.assign(Object.assign({},K.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=A(e),r=K(`Icon`,`-icon`,ar,ir,e,t),i=x(()=>{let{depth:t}=e,{common:{cubicBezierEaseInOut:n},self:i}=r.value;if(t!==void 0){let{color:e,[`opacity${t}Depth`]:r}=i;return{"--n-bezier":n,"--n-color":e,"--n-opacity":r}}return{"--n-bezier":n,"--n-color":``,"--n-opacity":``}}),a=n?P(`icon`,x(()=>`${e.depth||`d`}`),i,e):void 0;return{mergedClsPrefix:t,mergedStyle:x(()=>{let{size:t,color:n}=e;return{fontSize:be(t),color:n}}),cssVars:n?void 0:i,themeClass:a?.themeClass,onRender:a?.onRender}},render(){let{$parent:e,depth:t,mergedClsPrefix:n,component:r,onRender:i,themeClass:a}=this;return e?.$options?._n_icon__&&M(`icon`,"don't wrap `n-icon` inside `n-icon`"),i?.(),O(`i`,u(this.$attrs,{role:`img`,class:[`${n}-icon`,a,{[`${n}-icon--depth`]:t,[`${n}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),r?O(r):this.$slots)}});function sr(e,t){return e.type===`submenu`||e.type===void 0&&e[t]!==void 0}function cr(e){return e.type===`group`}function lr(e){return e.type===`divider`}function ur(e){return e.type===`render`}var dr=E({name:`DropdownOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:`right-start`},props:Object,scrollable:Boolean},setup(e){let t=n($n),{hoverKeyRef:r,keyboardKeyRef:i,lastToggledSubmenuKeyRef:a,pendingKeyPathRef:o,activeKeyPathRef:c,animatedRef:l,mergedShowRef:u,renderLabelRef:d,renderIconRef:f,labelFieldRef:p,childrenFieldRef:m,renderOptionRef:h,nodePropsRef:g,menuPropsRef:_}=t,v=n(er,null),y=n(Qn),b=n(he),S=x(()=>e.tmNode.rawNode),C=x(()=>{let{value:t}=m;return sr(e.tmNode.rawNode,t)}),T=x(()=>{let{disabled:t}=e.tmNode;return t}),E=ut(x(()=>{if(!C.value)return!1;let{key:t,disabled:n}=e.tmNode;if(n)return!1;let{value:s}=r,{value:c}=i,{value:l}=a,{value:u}=o;return s===null?c===null?l===null?!1:u.includes(t):u.includes(t)&&u[u.length-1]!==t:u.includes(t)}),300,x(()=>i.value===null&&!l.value)),D=x(()=>!!v?.enteringSubmenuRef.value),O=w(!1);s(er,{enteringSubmenuRef:O});function k(){O.value=!0}function A(){O.value=!1}function j(){let{parentKey:t,tmNode:n}=e;n.disabled||u.value&&(a.value=t,i.value=null,r.value=n.key)}function M(){let{tmNode:t}=e;t.disabled||u.value&&r.value!==t.key&&j()}function N(t){if(e.tmNode.disabled||!u.value)return;let{relatedTarget:n}=t;n&&!Ne({target:n},`dropdownOption`)&&!Ne({target:n},`scrollbarRail`)&&(r.value=null)}function P(){let{value:n}=C,{tmNode:r}=e;u.value&&!n&&!r.disabled&&(t.doSelect(r.key,r.rawNode),t.doUpdateShow(!1))}return{labelField:p,renderLabel:d,renderIcon:f,siblingHasIcon:y.showIconRef,siblingHasSubmenu:y.hasSubmenuRef,menuProps:_,popoverBody:b,animated:l,mergedShowSubmenu:x(()=>E.value&&!D.value),rawNode:S,hasSubmenu:C,pending:Z(()=>{let{value:t}=o,{key:n}=e.tmNode;return t.includes(n)}),childActive:Z(()=>{let{value:t}=c,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r===-1?!1:r<t.length-1}),active:Z(()=>{let{value:t}=c,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r===-1?!1:r===t.length-1}),mergedDisabled:T,renderOption:h,nodeProps:g,handleClick:P,handleMouseMove:M,handleMouseEnter:j,handleMouseLeave:N,handleSubmenuBeforeEnter:k,handleSubmenuAfterEnter:A}},render(){let{animated:e,rawNode:t,mergedShowSubmenu:n,clsPrefix:r,siblingHasIcon:i,siblingHasSubmenu:a,renderLabel:o,renderIcon:s,renderOption:c,nodeProps:l,props:d,scrollable:f}=this,p=null;if(n){let e=this.menuProps?.call(this,t,t.children);p=O(mr,Object.assign({},e,{clsPrefix:r,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}let m={class:[`${r}-dropdown-option-body`,this.pending&&`${r}-dropdown-option-body--pending`,this.active&&`${r}-dropdown-option-body--active`,this.childActive&&`${r}-dropdown-option-body--child-active`,this.mergedDisabled&&`${r}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},h=l?.(t),g=O(`div`,Object.assign({class:[`${r}-dropdown-option`,h?.class],"data-dropdown-option":!0},h),O(`div`,u(m,d),[O(`div`,{class:[`${r}-dropdown-option-body__prefix`,i&&`${r}-dropdown-option-body__prefix--show-icon`]},[s?s(t):je(t.icon)]),O(`div`,{"data-dropdown-option":!0,class:`${r}-dropdown-option-body__label`},o?o(t):je(t[this.labelField]??t.title)),O(`div`,{"data-dropdown-option":!0,class:[`${r}-dropdown-option-body__suffix`,a&&`${r}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?O(or,null,{default:()=>O(vt,null)}):null)]),this.hasSubmenu?O(Te,null,{default:()=>[O(pe,null,{default:()=>O(`div`,{class:`${r}-dropdown-offset-container`},O(_e,{show:this.mergedShowSubmenu,placement:this.placement,to:f&&this.popoverBody||void 0,teleportDisabled:!f},{default:()=>O(`div`,{class:`${r}-dropdown-menu-wrapper`},e?O(le,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:`fade-in-scale-up-transition`,appear:!0},{default:()=>p}):p)}))})]}):null);return c?c({node:g,option:t}):g}}),fr=E({name:`NDropdownGroup`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){let{tmNode:e,parentKey:t,clsPrefix:n}=this,{children:r}=e;return O(v,null,O(nr,{clsPrefix:n,tmNode:e,key:e.key}),r?.map(e=>{let{rawNode:r}=e;return r.show===!1?null:lr(r)?O(tr,{clsPrefix:n,key:e.key}):e.isGroup?(M(`dropdown`,"`group` node is not allowed to be put in `group` node."),null):O(dr,{clsPrefix:n,tmNode:e,parentKey:t,key:e.key})}))}}),pr=E({name:`DropdownRenderOption`,props:{tmNode:{type:Object,required:!0}},render(){let{rawNode:{render:e,props:t}}=this.tmNode;return O(`div`,t,[e?.()])}}),mr=E({name:`DropdownMenu`,props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){let{renderIconRef:t,childrenFieldRef:r}=n($n);s(Qn,{showIconRef:x(()=>{let n=t.value;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>n?n(e):e.icon);let{rawNode:t}=e;return n?n(t):t.icon})}),hasSubmenuRef:x(()=>{let{value:t}=r;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>sr(e,t));let{rawNode:n}=e;return sr(n,t)})})});let i=w(null);return s(De,null),s(Ee,null),s(he,i),{bodyRef:i}},render(){let{parentKey:e,clsPrefix:t,scrollable:n}=this,r=this.tmNodes.map(r=>{let{rawNode:i}=r;return i.show===!1?null:ur(i)?O(pr,{tmNode:r,key:r.key}):lr(i)?O(tr,{clsPrefix:t,key:r.key}):cr(i)?O(fr,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key}):O(dr,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key,props:i.props,scrollable:n})});return O(`div`,{class:[`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`],ref:`bodyRef`},n?O(qe,{contentClass:`${t}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?Ce({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),hr=q(`dropdown-menu`,`
|
|
373
|
+
transform-origin: var(--v-transform-origin);
|
|
374
|
+
background-color: var(--n-color);
|
|
375
|
+
border-radius: var(--n-border-radius);
|
|
376
|
+
box-shadow: var(--n-box-shadow);
|
|
377
|
+
position: relative;
|
|
378
|
+
transition:
|
|
379
|
+
background-color .3s var(--n-bezier),
|
|
380
|
+
box-shadow .3s var(--n-bezier);
|
|
381
|
+
`,[ke(),q(`dropdown-option`,`
|
|
382
|
+
position: relative;
|
|
383
|
+
`,[B(`a`,`
|
|
384
|
+
text-decoration: none;
|
|
385
|
+
color: inherit;
|
|
386
|
+
outline: none;
|
|
387
|
+
`,[B(`&::before`,`
|
|
388
|
+
content: "";
|
|
389
|
+
position: absolute;
|
|
390
|
+
left: 0;
|
|
391
|
+
right: 0;
|
|
392
|
+
top: 0;
|
|
393
|
+
bottom: 0;
|
|
394
|
+
`)]),q(`dropdown-option-body`,`
|
|
395
|
+
display: flex;
|
|
396
|
+
cursor: pointer;
|
|
397
|
+
position: relative;
|
|
398
|
+
height: var(--n-option-height);
|
|
399
|
+
line-height: var(--n-option-height);
|
|
400
|
+
font-size: var(--n-font-size);
|
|
401
|
+
color: var(--n-option-text-color);
|
|
402
|
+
transition: color .3s var(--n-bezier);
|
|
403
|
+
`,[B(`&::before`,`
|
|
404
|
+
content: "";
|
|
405
|
+
position: absolute;
|
|
406
|
+
top: 0;
|
|
407
|
+
bottom: 0;
|
|
408
|
+
left: 4px;
|
|
409
|
+
right: 4px;
|
|
410
|
+
transition: background-color .3s var(--n-bezier);
|
|
411
|
+
border-radius: var(--n-border-radius);
|
|
412
|
+
`),Y(`disabled`,[U(`pending`,`
|
|
413
|
+
color: var(--n-option-text-color-hover);
|
|
414
|
+
`,[V(`prefix, suffix`,`
|
|
415
|
+
color: var(--n-option-text-color-hover);
|
|
416
|
+
`),B(`&::before`,`background-color: var(--n-option-color-hover);`)]),U(`active`,`
|
|
417
|
+
color: var(--n-option-text-color-active);
|
|
418
|
+
`,[V(`prefix, suffix`,`
|
|
419
|
+
color: var(--n-option-text-color-active);
|
|
420
|
+
`),B(`&::before`,`background-color: var(--n-option-color-active);`)]),U(`child-active`,`
|
|
421
|
+
color: var(--n-option-text-color-child-active);
|
|
422
|
+
`,[V(`prefix, suffix`,`
|
|
423
|
+
color: var(--n-option-text-color-child-active);
|
|
424
|
+
`)])]),U(`disabled`,`
|
|
425
|
+
cursor: not-allowed;
|
|
426
|
+
opacity: var(--n-option-opacity-disabled);
|
|
427
|
+
`),U(`group`,`
|
|
428
|
+
font-size: calc(var(--n-font-size) - 1px);
|
|
429
|
+
color: var(--n-group-header-text-color);
|
|
430
|
+
`,[V(`prefix`,`
|
|
431
|
+
width: calc(var(--n-option-prefix-width) / 2);
|
|
432
|
+
`,[U(`show-icon`,`
|
|
433
|
+
width: calc(var(--n-option-icon-prefix-width) / 2);
|
|
434
|
+
`)])]),V(`prefix`,`
|
|
435
|
+
width: var(--n-option-prefix-width);
|
|
436
|
+
display: flex;
|
|
437
|
+
justify-content: center;
|
|
438
|
+
align-items: center;
|
|
439
|
+
color: var(--n-prefix-color);
|
|
440
|
+
transition: color .3s var(--n-bezier);
|
|
441
|
+
z-index: 1;
|
|
442
|
+
`,[U(`show-icon`,`
|
|
443
|
+
width: var(--n-option-icon-prefix-width);
|
|
444
|
+
`),q(`icon`,`
|
|
445
|
+
font-size: var(--n-option-icon-size);
|
|
446
|
+
`)]),V(`label`,`
|
|
447
|
+
white-space: nowrap;
|
|
448
|
+
flex: 1;
|
|
449
|
+
z-index: 1;
|
|
450
|
+
`),V(`suffix`,`
|
|
451
|
+
box-sizing: border-box;
|
|
452
|
+
flex-grow: 0;
|
|
453
|
+
flex-shrink: 0;
|
|
454
|
+
display: flex;
|
|
455
|
+
justify-content: flex-end;
|
|
456
|
+
align-items: center;
|
|
457
|
+
min-width: var(--n-option-suffix-width);
|
|
458
|
+
padding: 0 8px;
|
|
459
|
+
transition: color .3s var(--n-bezier);
|
|
460
|
+
color: var(--n-suffix-color);
|
|
461
|
+
z-index: 1;
|
|
462
|
+
`,[U(`has-submenu`,`
|
|
463
|
+
width: var(--n-option-icon-suffix-width);
|
|
464
|
+
`),q(`icon`,`
|
|
465
|
+
font-size: var(--n-option-icon-size);
|
|
466
|
+
`)]),q(`dropdown-menu`,`pointer-events: all;`)]),q(`dropdown-offset-container`,`
|
|
467
|
+
pointer-events: none;
|
|
468
|
+
position: absolute;
|
|
469
|
+
left: 0;
|
|
470
|
+
right: 0;
|
|
471
|
+
top: -4px;
|
|
472
|
+
bottom: -4px;
|
|
473
|
+
`)]),q(`dropdown-divider`,`
|
|
474
|
+
transition: background-color .3s var(--n-bezier);
|
|
475
|
+
background-color: var(--n-divider-color);
|
|
476
|
+
height: 1px;
|
|
477
|
+
margin: 4px 0;
|
|
478
|
+
`),q(`dropdown-menu-wrapper`,`
|
|
479
|
+
transform-origin: var(--v-transform-origin);
|
|
480
|
+
width: fit-content;
|
|
481
|
+
`),B(`>`,[q(`scrollbar`,`
|
|
482
|
+
height: inherit;
|
|
483
|
+
max-height: inherit;
|
|
484
|
+
`)]),Y(`scrollable`,`
|
|
485
|
+
padding: var(--n-padding);
|
|
486
|
+
`),U(`scrollable`,[V(`content`,`
|
|
487
|
+
padding: var(--n-padding);
|
|
488
|
+
`)])]),gr={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:String,inverted:Boolean,placement:{type:String,default:`bottom`},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:`label`},keyField:{type:String,default:`key`},childrenField:{type:String,default:`children`},value:[String,Number]},_r=Object.keys(xe),vr=E({name:`Dropdown`,inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},xe),gr),K.props),setup(e){let t=w(!1),n=Ke(m(e,`show`),t),r=x(()=>{let{keyField:t,childrenField:n}=e;return Fe(e.options,{getKey(e){return e[t]},getDisabled(e){return e.disabled===!0},getIgnored(e){return e.type===`divider`||e.type===`render`},getChildren(e){return e[n]}})}),i=x(()=>r.value.treeNodes),a=w(null),o=w(null),c=w(null),l=x(()=>a.value??o.value??c.value??null),u=x(()=>r.value.getPath(l.value).keyPath),f=x(()=>r.value.getPath(e.value).keyPath),p=Z(()=>e.keyboard&&n.value);lt({keydown:{ArrowUp:{prevent:!0,handler:O},ArrowRight:{prevent:!0,handler:D},ArrowDown:{prevent:!0,handler:k},ArrowLeft:{prevent:!0,handler:E},Enter:{prevent:!0,handler:j},Escape:T}},p);let{mergedClsPrefixRef:h,inlineThemeDisabled:g,mergedComponentPropsRef:_}=A(e),v=x(()=>e.size||_?.value?.Dropdown?.size||`medium`),y=K(`Dropdown`,`-dropdown`,hr,$t,e,h);s($n,{labelFieldRef:m(e,`labelField`),childrenFieldRef:m(e,`childrenField`),renderLabelRef:m(e,`renderLabel`),renderIconRef:m(e,`renderIcon`),hoverKeyRef:a,keyboardKeyRef:o,lastToggledSubmenuKeyRef:c,pendingKeyPathRef:u,activeKeyPathRef:f,animatedRef:m(e,`animated`),mergedShowRef:n,nodePropsRef:m(e,`nodeProps`),renderOptionRef:m(e,`renderOption`),menuPropsRef:m(e,`menuProps`),doSelect:b,doUpdateShow:S}),d(n,t=>{!e.animated&&!t&&C()});function b(t,n){let{onSelect:r}=e;r&&I(r,t,n)}function S(n){let{"onUpdate:show":r,onUpdateShow:i}=e;r&&I(r,n),i&&I(i,n),t.value=n}function C(){a.value=null,o.value=null,c.value=null}function T(){S(!1)}function E(){N(`left`)}function D(){N(`right`)}function O(){N(`up`)}function k(){N(`down`)}function j(){let e=M();e?.isLeaf&&n.value&&(b(e.key,e.rawNode),S(!1))}function M(){let{value:e}=r,{value:t}=l;return!e||t===null?null:e.getNode(t)??null}function N(e){let{value:t}=l,{value:{getFirstAvailableNode:n}}=r,i=null;if(t===null){let e=n();e!==null&&(i=e.key)}else{let t=M();if(t){let n;switch(e){case`down`:n=t.getNext();break;case`up`:n=t.getPrev();break;case`right`:n=t.getChild();break;case`left`:n=t.getParent();break}n&&(i=n.key)}}i!==null&&(a.value=null,o.value=i)}let F=x(()=>{let{inverted:t}=e,n=v.value,{common:{cubicBezierEaseInOut:r},self:i}=y.value,{padding:a,dividerColor:o,borderRadius:s,optionOpacityDisabled:c,[J(`optionIconSuffixWidth`,n)]:l,[J(`optionSuffixWidth`,n)]:u,[J(`optionIconPrefixWidth`,n)]:d,[J(`optionPrefixWidth`,n)]:f,[J(`fontSize`,n)]:p,[J(`optionHeight`,n)]:m,[J(`optionIconSize`,n)]:h}=i,g={"--n-bezier":r,"--n-font-size":p,"--n-padding":a,"--n-border-radius":s,"--n-option-height":m,"--n-option-prefix-width":f,"--n-option-icon-prefix-width":d,"--n-option-suffix-width":u,"--n-option-icon-suffix-width":l,"--n-option-icon-size":h,"--n-divider-color":o,"--n-option-opacity-disabled":c};return t?(g[`--n-color`]=i.colorInverted,g[`--n-option-color-hover`]=i.optionColorHoverInverted,g[`--n-option-color-active`]=i.optionColorActiveInverted,g[`--n-option-text-color`]=i.optionTextColorInverted,g[`--n-option-text-color-hover`]=i.optionTextColorHoverInverted,g[`--n-option-text-color-active`]=i.optionTextColorActiveInverted,g[`--n-option-text-color-child-active`]=i.optionTextColorChildActiveInverted,g[`--n-prefix-color`]=i.prefixColorInverted,g[`--n-suffix-color`]=i.suffixColorInverted,g[`--n-group-header-text-color`]=i.groupHeaderTextColorInverted):(g[`--n-color`]=i.color,g[`--n-option-color-hover`]=i.optionColorHover,g[`--n-option-color-active`]=i.optionColorActive,g[`--n-option-text-color`]=i.optionTextColor,g[`--n-option-text-color-hover`]=i.optionTextColorHover,g[`--n-option-text-color-active`]=i.optionTextColorActive,g[`--n-option-text-color-child-active`]=i.optionTextColorChildActive,g[`--n-prefix-color`]=i.prefixColor,g[`--n-suffix-color`]=i.suffixColor,g[`--n-group-header-text-color`]=i.groupHeaderTextColor),g}),L=g?P(`dropdown`,x(()=>`${v.value[0]}${e.inverted?`i`:``}`),F,e):void 0;return{mergedClsPrefix:h,mergedTheme:y,mergedSize:v,tmNodes:i,mergedShow:n,handleAfterLeave:()=>{e.animated&&C()},doUpdateShow:S,cssVars:g?void 0:F,themeClass:L?.themeClass,onRender:L?.onRender}},render(){let e=(e,t,n,r,i)=>{var a;let{mergedClsPrefix:o,menuProps:s}=this;(a=this.onRender)==null||a.call(this);let c=s?.(void 0,this.tmNodes.map(e=>e.rawNode))||{},l={ref:mt(t),class:[e,`${o}-dropdown`,`${o}-dropdown--${this.mergedSize}-size`,this.themeClass],clsPrefix:o,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:r,onMouseleave:i};return O(mr,u(this.$attrs,l,c))},{mergedTheme:t}=this,n={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return O(we,Object.assign({},Se(this.$props,_r),n),{trigger:()=>{var e;return(e=this.$slots).default?.call(e)}})}}),yr=`_n_all__`,br=`_n_none__`;function xr(e,t,n,r){return e?i=>{for(let a of e)switch(i){case yr:n(!0);return;case br:r(!0);return;default:if(typeof a==`object`&&a.key===i){a.onSelect(t.value);return}}}:()=>{}}function Sr(e,t){return e?e.map(e=>{switch(e){case`all`:return{label:t.checkTableAll,key:yr};case`none`:return{label:t.uncheckTableAll,key:br};default:return e}}):[]}var Cr=E({name:`DataTableSelectionMenu`,props:{clsPrefix:{type:String,required:!0}},setup(e){let{props:t,localeRef:r,checkOptionsRef:i,rawPaginatedDataRef:a,doCheckAll:o,doUncheckAll:s}=n(ln),c=x(()=>xr(i.value,a,o,s)),l=x(()=>Sr(i.value,r.value));return()=>{let{clsPrefix:n}=e;return O(vr,{theme:t.theme?.peers?.Dropdown,themeOverrides:t.themeOverrides?.peers?.Dropdown,options:l.value,onSelect:c.value},{default:()=>O(Je,{clsPrefix:n,class:`${n}-data-table-check-extra`},{default:()=>O(nt,null)})})}}});function wr(e){return typeof e.title==`function`?e.title(e):e.title}var Tr=E({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},width:String},render(){let{clsPrefix:e,id:t,cols:n,width:r}=this;return O(`table`,{style:{tableLayout:`fixed`,width:r},class:`${e}-data-table-table`},O(`colgroup`,null,n.map(e=>O(`col`,{key:e.key,style:e.style}))),O(`thead`,{"data-n-id":t,class:`${e}-data-table-thead`},this.$slots))}}),Er=E({name:`DataTableHeader`,props:{discrete:{type:Boolean,default:!0}},setup(){let{mergedClsPrefixRef:e,scrollXRef:t,fixedColumnLeftMapRef:r,fixedColumnRightMapRef:i,mergedCurrentPageRef:a,allRowsCheckedRef:o,someRowsCheckedRef:s,rowsRef:c,colsRef:l,mergedThemeRef:u,checkOptionsRef:d,mergedSortStateRef:f,componentId:p,mergedTableLayoutRef:m,headerCheckboxDisabledRef:h,virtualScrollHeaderRef:g,headerHeightRef:_,onUnstableColumnResize:v,doUpdateResizableWidth:y,handleTableHeaderScroll:b,deriveNextSorter:x,doUncheckAll:S,doCheckAll:C}=n(ln),T=w(),E=w({});function D(e){return E.value[e]?.getBoundingClientRect().width}function O(){o.value?S():C()}function k(e,t){Ne(e,`dataTableFilter`)||Ne(e,`dataTableResizable`)||yn(t)&&x(Cn(t,f.value.find(e=>e.columnKey===t.key)||null))}let A=new Map;function j(e){A.set(e.key,D(e.key))}function M(e,t){let n=A.get(e.key);if(n===void 0)return;let r=n+t,i=hn(r,e.minWidth,e.maxWidth);v(r,i,e,D),y(e,i)}return{cellElsRef:E,componentId:p,mergedSortState:f,mergedClsPrefix:e,scrollX:t,fixedColumnLeftMap:r,fixedColumnRightMap:i,currentPage:a,allRowsChecked:o,someRowsChecked:s,rows:c,cols:l,mergedTheme:u,checkOptions:d,mergedTableLayout:m,headerCheckboxDisabled:h,headerHeight:_,virtualScrollHeader:g,virtualListRef:T,handleCheckboxUpdateChecked:O,handleColHeaderClick:k,handleTableHeaderScroll:b,handleColumnResizeStart:j,handleColumnResize:M}},render(){let{cellElsRef:e,mergedClsPrefix:t,fixedColumnLeftMap:n,fixedColumnRightMap:r,currentPage:i,allRowsChecked:a,someRowsChecked:o,rows:s,cols:c,mergedTheme:l,checkOptions:u,componentId:d,discrete:f,mergedTableLayout:p,headerCheckboxDisabled:m,mergedSortState:h,virtualScrollHeader:g,handleColHeaderClick:_,handleCheckboxUpdateChecked:y,handleColumnResizeStart:b,handleColumnResize:x}=this,S=!1,C=(s,c,d)=>s.map(({column:s,colIndex:f,colSpan:p,rowSpan:g,isLast:C})=>{let w=fn(s),{ellipsis:T}=s;!S&&T&&(S=!0);let E=()=>s.type===`selection`?s.multiple===!1?null:O(v,null,O(Mt,{key:i,privateInsideTable:!0,checked:a,indeterminate:o,disabled:m,onUpdateChecked:y}),u?O(Cr,{clsPrefix:t}):null):O(v,null,O(`div`,{class:`${t}-data-table-th__title-wrapper`},O(`div`,{class:`${t}-data-table-th__title`},T===!0||T&&!T.tooltip?O(`div`,{class:`${t}-data-table-th__ellipsis`},wr(s)):T&&typeof T==`object`?O(Vn,Object.assign({},T,{theme:l.peers.Ellipsis,themeOverrides:l.peerOverrides.Ellipsis}),{default:()=>wr(s)}):wr(s)),yn(s)?O(Zn,{column:s}):null),xn(s)?O(Jn,{column:s,options:s.filterOptions}):null,bn(s)?O(Yn,{onResizeStart:()=>{b(s)},onResize:e=>{x(s,e)}}):null),D=w in n,k=w in r;return O(c&&!s.fixed?`div`:`th`,{ref:t=>e[w]=t,key:w,style:[c&&!s.fixed?{position:`absolute`,left:$(c(f)),top:0,bottom:0}:{left:$(n[w]?.start),right:$(r[w]?.start)},{width:$(s.width),textAlign:s.titleAlign||s.align,height:d}],colspan:p,rowspan:g,"data-col-key":w,class:[`${t}-data-table-th`,(D||k)&&`${t}-data-table-th--fixed-${D?`left`:`right`}`,{[`${t}-data-table-th--sorting`]:wn(s,h),[`${t}-data-table-th--filterable`]:xn(s),[`${t}-data-table-th--sortable`]:yn(s),[`${t}-data-table-th--selection`]:s.type===`selection`,[`${t}-data-table-th--last`]:C},s.className],onClick:s.type!==`selection`&&s.type!==`expand`&&!(`children`in s)?e=>{_(e,s)}:void 0},E())});if(g){let{headerHeight:e}=this,n=0,r=0;return c.forEach(e=>{e.column.fixed===`left`?n++:e.column.fixed===`right`&&r++}),O(Ie,{ref:`virtualListRef`,class:`${t}-data-table-base-table-header`,style:{height:$(e)},onScroll:this.handleTableHeaderScroll,columns:c,itemSize:e,showScrollbar:!1,items:[{}],itemResizable:!1,visibleItemsTag:Tr,visibleItemsProps:{clsPrefix:t,id:d,cols:c,width:be(this.scrollX)},renderItemWithCols:({startColIndex:t,endColIndex:i,getLeft:a})=>{let o=C(c.map((e,t)=>({column:e.column,isLast:t===c.length-1,colIndex:e.index,colSpan:1,rowSpan:1})).filter(({column:e},n)=>!!(t<=n&&n<=i||e.fixed)),a,$(e));return o.splice(n,0,O(`th`,{colspan:c.length-n-r,style:{pointerEvents:`none`,visibility:`hidden`,height:0}})),O(`tr`,{style:{position:`relative`}},o)}},{default:({renderedItemWithCols:e})=>e})}let w=O(`thead`,{class:`${t}-data-table-thead`,"data-n-id":d},s.map(e=>O(`tr`,{class:`${t}-data-table-tr`},C(e,null,void 0))));if(!f)return w;let{handleTableHeaderScroll:T,scrollX:E}=this;return O(`div`,{class:`${t}-data-table-base-table-header`,onScroll:T},O(`table`,{class:`${t}-data-table-table`,style:{minWidth:be(E),tableLayout:p}},O(`colgroup`,null,c.map(e=>O(`col`,{key:e.key,style:e.style}))),w))}});function Dr(e,t){let n=[];function r(e,i){e.forEach(e=>{e.children&&t.has(e.key)?(n.push({tmNode:e,striped:!1,key:e.key,index:i}),r(e.children,i)):n.push({key:e.key,tmNode:e,striped:!1,index:i})})}return e.forEach(e=>{n.push(e);let{children:i}=e.tmNode;i&&t.has(e.key)&&r(i,e.index)}),n}var Or=E({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},onMouseenter:Function,onMouseleave:Function},render(){let{clsPrefix:e,id:t,cols:n,onMouseenter:r,onMouseleave:i}=this;return O(`table`,{style:{tableLayout:`fixed`},class:`${e}-data-table-table`,onMouseenter:r,onMouseleave:i},O(`colgroup`,null,n.map(e=>O(`col`,{key:e.key,style:e.style}))),O(`tbody`,{"data-n-id":t,class:`${e}-data-table-tbody`},this.$slots))}}),kr=E({name:`DataTableBody`,props:{onResize:Function,showHeader:Boolean,flexHeight:Boolean,bodyStyle:Object},setup(e){let{slots:t,bodyWidthRef:r,mergedExpandedRowKeysRef:i,mergedClsPrefixRef:a,mergedThemeRef:o,scrollXRef:s,colsRef:l,paginatedDataRef:u,rawPaginatedDataRef:d,fixedColumnLeftMapRef:p,fixedColumnRightMapRef:m,mergedCurrentPageRef:h,rowClassNameRef:g,leftActiveFixedColKeyRef:_,leftActiveFixedChildrenColKeysRef:v,rightActiveFixedColKeyRef:y,rightActiveFixedChildrenColKeysRef:b,renderExpandRef:S,hoverKeyRef:C,summaryRef:T,mergedSortStateRef:E,virtualScrollRef:D,virtualScrollXRef:O,heightForRowRef:k,minRowHeightRef:A,componentId:j,mergedTableLayoutRef:N,childTriggerColIndexRef:P,indentRef:I,rowPropsRef:L,stripedRef:R,loadingRef:z,onLoadRef:V,loadingKeySetRef:H,expandableRef:U,stickyExpandedRowsRef:W,renderExpandIconRef:G,summaryPlacementRef:ee,treeMateRef:te,scrollbarPropsRef:K,setHeaderScrollLeft:q,doUpdateExpandedRowKeys:J,handleTableBodyScroll:ne,doCheck:re,doUncheck:Y,renderCell:ae,xScrollableRef:X,explicitlyScrollableRef:oe}=n(ln),se=n(F),Q=w(null),ce=w(null),le=w(null),ue=x(()=>se?.mergedComponentPropsRef.value?.DataTable?.renderEmpty),de=Z(()=>u.value.length===0),fe=Z(()=>D.value&&!de.value),pe=``,me=x(()=>new Set(i.value));function he(e){return te.value.getNode(e)?.rawNode}function ge(e,t,n){let r=he(e.key);if(!r){M(`data-table`,`fail to get row data with key ${e.key}`);return}if(n){let n=u.value.findIndex(e=>e.key===pe);if(n!==-1){let i=u.value.findIndex(t=>t.key===e.key),a=Math.min(n,i),o=Math.max(n,i),s=[];u.value.slice(a,o+1).forEach(e=>{e.disabled||s.push(e.key)}),t?re(s,!1,r):Y(s,r),pe=e.key;return}}t?re(e.key,!1,r):Y(e.key,r),pe=e.key}function _e(e){let t=he(e.key);if(!t){M(`data-table`,`fail to get row data with key ${e.key}`);return}re(e.key,!0,t)}function ve(){if(fe.value)return xe();let{value:e}=Q;return e?e.containerRef:null}function ye(e,t){var n;if(H.value.has(e))return;let{value:r}=i,a=r.indexOf(e),o=Array.from(r);~a?(o.splice(a,1),J(o)):t&&!t.isLeaf&&!t.shallowLoaded?(H.value.add(e),(n=V.value)==null||n.call(V,t.rawNode).then(()=>{let{value:t}=i,n=Array.from(t);~n.indexOf(e)||n.push(e),J(n)}).finally(()=>{H.value.delete(e)})):(o.push(e),J(o))}function be(){C.value=null}function xe(){let{value:e}=ce;return e?.listElRef||null}function Se(){let{value:e}=ce;return e?.itemsElRef||null}function Ce(e){var t;ne(e),(t=Q.value)==null||t.sync()}function we(t){var n;let{onResize:r}=e;r&&r(t),(n=Q.value)==null||n.sync()}let Te={getScrollContainer:ve,scrollTo(e,t){var n,r;D.value?(n=ce.value)==null||n.scrollTo(e,t):(r=Q.value)==null||r.scrollTo(e,t)}},Ee=B([({props:e})=>{let t=t=>t===null?null:B(`[data-n-id="${e.componentId}"] [data-col-key="${t}"]::after`,{boxShadow:`var(--n-box-shadow-after)`}),n=t=>t===null?null:B(`[data-n-id="${e.componentId}"] [data-col-key="${t}"]::before`,{boxShadow:`var(--n-box-shadow-before)`});return B([t(e.leftActiveFixedColKey),n(e.rightActiveFixedColKey),e.leftActiveFixedChildrenColKeys.map(e=>t(e)),e.rightActiveFixedChildrenColKeys.map(e=>n(e))])}]),De=!1;return f(()=>{let{value:e}=_,{value:t}=v,{value:n}=y,{value:r}=b;if(!De&&e===null&&n===null)return;let i={leftActiveFixedColKey:e,leftActiveFixedChildrenColKeys:t,rightActiveFixedColKey:n,rightActiveFixedChildrenColKeys:r,componentId:j};Ee.mount({id:`n-${j}`,force:!0,props:i,anchorMetaName:ie,parent:se?.styleMountTarget}),De=!0}),c(()=>{Ee.unmount({id:`n-${j}`,parent:se?.styleMountTarget})}),Object.assign({bodyWidth:r,summaryPlacement:ee,dataTableSlots:t,componentId:j,scrollbarInstRef:Q,virtualListRef:ce,emptyElRef:le,summary:T,mergedClsPrefix:a,mergedTheme:o,mergedRenderEmpty:ue,scrollX:s,cols:l,loading:z,shouldDisplayVirtualList:fe,empty:de,paginatedDataAndInfo:x(()=>{let{value:e}=R,t=!1;return{data:u.value.map(e?(e,n)=>(e.isLeaf||(t=!0),{tmNode:e,key:e.key,striped:n%2==1,index:n}):(e,n)=>(e.isLeaf||(t=!0),{tmNode:e,key:e.key,striped:!1,index:n})),hasChildren:t}}),rawPaginatedData:d,fixedColumnLeftMap:p,fixedColumnRightMap:m,currentPage:h,rowClassName:g,renderExpand:S,mergedExpandedRowKeySet:me,hoverKey:C,mergedSortState:E,virtualScroll:D,virtualScrollX:O,heightForRow:k,minRowHeight:A,mergedTableLayout:N,childTriggerColIndex:P,indent:I,rowProps:L,loadingKeySet:H,expandable:U,stickyExpandedRows:W,renderExpandIcon:G,scrollbarProps:K,setHeaderScrollLeft:q,handleVirtualListScroll:Ce,handleVirtualListResize:we,handleMouseleaveTable:be,virtualListContainer:xe,virtualListContent:Se,handleTableBodyScroll:ne,handleCheckboxUpdateChecked:ge,handleRadioUpdateChecked:_e,handleUpdateExpanded:ye,renderCell:ae,explicitlyScrollable:oe,xScrollable:X},Te)},render(){let{mergedTheme:e,scrollX:t,mergedClsPrefix:n,explicitlyScrollable:r,xScrollable:i,loadingKeySet:a,onResize:o,setHeaderScrollLeft:s,empty:c,shouldDisplayVirtualList:l}=this,u={minWidth:be(t)||`100%`};t&&(u.width=`100%`);let d=()=>O(`div`,{class:[`${n}-data-table-empty`,this.loading&&`${n}-data-table-empty--hide`],style:[this.bodyStyle,i?`position: sticky; left: 0; width: var(--n-scrollbar-current-width);`:void 0],ref:`emptyElRef`},ae(this.dataTableSlots.empty,()=>[this.mergedRenderEmpty?.call(this)||O(Be,{theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})])),f=O(Ze,Object.assign({},this.scrollbarProps,{ref:`scrollbarInstRef`,scrollable:r||i,class:`${n}-data-table-base-table-body`,style:c?`height: initial;`:this.bodyStyle,theme:e.peers.Scrollbar,themeOverrides:e.peerOverrides.Scrollbar,contentStyle:u,container:l?this.virtualListContainer:void 0,content:l?this.virtualListContent:void 0,horizontalRailStyle:{zIndex:3},verticalRailStyle:{zIndex:3},internalExposeWidthCssVar:i&&c,xScrollable:i,onScroll:l?void 0:this.handleTableBodyScroll,internalOnUpdateScrollLeft:s,onResize:o}),{default:()=>{if(this.empty&&!this.showHeader&&(this.explicitlyScrollable||this.xScrollable))return d();let e={},t={},{cols:r,paginatedDataAndInfo:i,mergedTheme:o,fixedColumnLeftMap:s,fixedColumnRightMap:c,currentPage:l,rowClassName:f,mergedSortState:p,mergedExpandedRowKeySet:m,stickyExpandedRows:h,componentId:g,childTriggerColIndex:_,expandable:y,rowProps:b,handleMouseleaveTable:x,renderExpand:S,summary:C,handleCheckboxUpdateChecked:w,handleRadioUpdateChecked:T,handleUpdateExpanded:E,heightForRow:D,minRowHeight:k,virtualScrollX:A}=this,{length:j}=r,M,{data:N,hasChildren:P}=i,F=P?Dr(N,m):N;if(C){let e=C(this.rawPaginatedData);if(Array.isArray(e)){let t=e.map((e,t)=>({isSummaryRow:!0,key:`__n_summary__${t}`,tmNode:{rawNode:e,disabled:!0},index:-1}));M=this.summaryPlacement===`top`?[...t,...F]:[...F,...t]}else{let t={isSummaryRow:!0,key:`__n_summary__`,tmNode:{rawNode:e,disabled:!0},index:-1};M=this.summaryPlacement===`top`?[t,...F]:[...F,t]}}else M=F;let I=P?{width:$(this.indent)}:void 0,L=[];M.forEach(e=>{S&&m.has(e.key)&&(!y||y(e.tmNode.rawNode))?L.push(e,{isExpandedRow:!0,key:`${e.key}-expand`,tmNode:e.tmNode,index:e.index}):L.push(e)});let{length:R}=L,z={};N.forEach(({tmNode:e},t)=>{z[t]=e.key});let B=h?this.bodyWidth:null,V=B===null?void 0:`${B}px`,H=this.virtualScrollX?`div`:`td`,U=0,W=0;A&&r.forEach(e=>{e.column.fixed===`left`?U++:e.column.fixed===`right`&&W++});let G=({rowInfo:i,displayedRowIndex:u,isVirtual:d,isVirtualX:g,startColIndex:v,endColIndex:y,getLeft:x})=>{let{index:C}=i;if(`isExpandedRow`in i){let{tmNode:{key:e,rawNode:t}}=i;return O(`tr`,{class:`${n}-data-table-tr ${n}-data-table-tr--expanded`,key:`${e}__expand`},O(`td`,{class:[`${n}-data-table-td`,`${n}-data-table-td--last-col`,u+1===R&&`${n}-data-table-td--last-row`],colspan:j},h?O(`div`,{class:`${n}-data-table-expand`,style:{width:V}},S(t,C)):S(t,C)))}let A=`isSummaryRow`in i,M=!A&&i.striped,{tmNode:N,key:F}=i,{rawNode:L}=N,B=m.has(F),G=b?b(L,C):void 0,ee=typeof f==`string`?f:_n(L,C,f),te=g?r.filter((e,t)=>!!(v<=t&&t<=y||e.column.fixed)):r,K=g?$(D?.(L,C)||k):void 0,q=te.map(r=>{let f=r.index;if(u in e){let t=e[u],n=t.indexOf(f);if(~n)return t.splice(n,1),null}let{column:m}=r,h=fn(r),{rowSpan:v,colSpan:y}=m,b=A?i.tmNode.rawNode[h]?.colSpan||1:y?y(L,C):1,S=A?i.tmNode.rawNode[h]?.rowSpan||1:v?v(L,C):1,D=f+b===j,k=u+S===R,M=S>1;if(M&&(t[u]={[f]:[]}),b>1||M)for(let n=u;n<u+S;++n){M&&t[u][f].push(z[n]);for(let t=f;t<f+b;++t)n===u&&t===f||(n in e?e[n].push(t):e[n]=[t])}let N=M?this.hoverKey:null,{cellProps:V}=m,U=V?.(L,C),W={"--indent-offset":``};return O(m.fixed?`td`:H,Object.assign({},U,{key:h,style:[{textAlign:m.align||void 0,width:$(m.width)},g&&{height:K},g&&!m.fixed?{position:`absolute`,left:$(x(f)),top:0,bottom:0}:{left:$(s[h]?.start),right:$(c[h]?.start)},W,U?.style||``],colspan:b,rowspan:d?void 0:S,"data-col-key":h,class:[`${n}-data-table-td`,m.className,U?.class,A&&`${n}-data-table-td--summary`,N!==null&&t[u][f].includes(N)&&`${n}-data-table-td--hover`,wn(m,p)&&`${n}-data-table-td--sorting`,m.fixed&&`${n}-data-table-td--fixed-${m.fixed}`,m.align&&`${n}-data-table-td--${m.align}-align`,m.type===`selection`&&`${n}-data-table-td--selection`,m.type===`expand`&&`${n}-data-table-td--expand`,D&&`${n}-data-table-td--last-col`,k&&`${n}-data-table-td--last-row`]}),P&&f===_?[ye(W[`--indent-offset`]=A?0:i.tmNode.level,O(`div`,{class:`${n}-data-table-indent`,style:I})),A||i.tmNode.isLeaf?O(`div`,{class:`${n}-data-table-expand-placeholder`}):O(Wn,{class:`${n}-data-table-expand-trigger`,clsPrefix:n,expanded:B,rowData:L,renderExpandIcon:this.renderExpandIcon,loading:a.has(i.key),onClick:()=>{E(F,i.tmNode)}})]:null,m.type===`selection`?A?null:m.multiple===!1?O(In,{key:l,rowKey:F,disabled:i.tmNode.disabled,onUpdateChecked:()=>{T(i.tmNode)}}):O(Dn,{key:l,rowKey:F,disabled:i.tmNode.disabled,onUpdateChecked:(e,t)=>{w(i.tmNode,e,t.shiftKey)}}):m.type===`expand`?A?null:!m.expandable||m.expandable?.call(m,L)?O(Wn,{clsPrefix:n,rowData:L,expanded:B,renderExpandIcon:this.renderExpandIcon,onClick:()=>{E(F,null)}}):null:O(Un,{clsPrefix:n,index:C,row:L,column:m,isSummary:A,mergedTheme:o,renderCell:this.renderCell}))});return g&&U&&W&&q.splice(U,0,O(`td`,{colspan:r.length-U-W,style:{pointerEvents:`none`,visibility:`hidden`,height:0}})),O(`tr`,Object.assign({},G,{onMouseenter:e=>{var t;this.hoverKey=F,(t=G?.onMouseenter)==null||t.call(G,e)},key:F,class:[`${n}-data-table-tr`,A&&`${n}-data-table-tr--summary`,M&&`${n}-data-table-tr--striped`,B&&`${n}-data-table-tr--expanded`,ee,G?.class],style:[G?.style,g&&{height:K}]}),q)};return this.shouldDisplayVirtualList?O(Ie,{ref:`virtualListRef`,items:L,itemSize:this.minRowHeight,visibleItemsTag:Or,visibleItemsProps:{clsPrefix:n,id:g,cols:r,onMouseleave:x},showScrollbar:!1,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemsStyle:u,itemResizable:!A,columns:r,renderItemWithCols:A?({itemIndex:e,item:t,startColIndex:n,endColIndex:r,getLeft:i})=>G({displayedRowIndex:e,isVirtual:!0,isVirtualX:!0,rowInfo:t,startColIndex:n,endColIndex:r,getLeft:i}):void 0},{default:({item:e,index:t,renderedItemWithCols:n})=>n||G({rowInfo:e,displayedRowIndex:t,isVirtual:!0,isVirtualX:!1,startColIndex:0,endColIndex:0,getLeft(e){return 0}})}):O(v,null,O(`table`,{class:`${n}-data-table-table`,onMouseleave:x,style:{tableLayout:this.mergedTableLayout}},O(`colgroup`,null,r.map(e=>O(`col`,{key:e.key,style:e.style}))),this.showHeader?O(Er,{discrete:!1}):null,this.empty?null:O(`tbody`,{"data-n-id":g,class:`${n}-data-table-tbody`},L.map((e,t)=>G({rowInfo:e,displayedRowIndex:t,isVirtual:!1,isVirtualX:!1,startColIndex:-1,endColIndex:-1,getLeft(e){return-1}})))),this.empty&&this.xScrollable?d():null)}});return this.empty?this.explicitlyScrollable||this.xScrollable?f:O(Ue,{onResize:this.onResize},{default:d}):f}}),Ar=E({name:`MainTable`,setup(){let{mergedClsPrefixRef:e,rightFixedColumnsRef:t,leftFixedColumnsRef:r,bodyWidthRef:i,maxHeightRef:a,minHeightRef:o,flexHeightRef:s,virtualScrollHeaderRef:c,syncScrollState:l,scrollXRef:u}=n(ln),d=w(null),p=w(null),m=w(null),h=w(!(r.value.length||t.value.length)),g=x(()=>({maxHeight:be(a.value),minHeight:be(o.value)}));function _(e){i.value=e.contentRect.width,l(),h.value||=!0}function v(){let{value:e}=d;return e?c.value?e.virtualListRef?.listElRef||null:e.$el:null}function y(){let{value:e}=p;return e?e.getScrollContainer():null}let b={getBodyElement:y,getHeaderElement:v,scrollTo(e,t){var n;(n=p.value)==null||n.scrollTo(e,t)}};return f(()=>{let{value:t}=m;if(!t)return;let n=`${e.value}-data-table-base-table--transition-disabled`;h.value?setTimeout(()=>{t.classList.remove(n)},0):t.classList.add(n)}),Object.assign({maxHeight:a,mergedClsPrefix:e,selfElRef:m,headerInstRef:d,bodyInstRef:p,bodyStyle:g,flexHeight:s,handleBodyResize:_,scrollX:u},b)},render(){let{mergedClsPrefix:e,maxHeight:t,flexHeight:n}=this,r=t===void 0&&!n;return O(`div`,{class:`${e}-data-table-base-table`,ref:`selfElRef`},r?null:O(Er,{ref:`headerInstRef`}),O(kr,{ref:`bodyInstRef`,bodyStyle:this.bodyStyle,showHeader:r,flexHeight:n,onResize:this.handleBodyResize}))}}),jr=Nr(),Mr=B([q(`data-table`,`
|
|
489
|
+
width: 100%;
|
|
490
|
+
font-size: var(--n-font-size);
|
|
491
|
+
display: flex;
|
|
492
|
+
flex-direction: column;
|
|
493
|
+
position: relative;
|
|
494
|
+
--n-merged-th-color: var(--n-th-color);
|
|
495
|
+
--n-merged-td-color: var(--n-td-color);
|
|
496
|
+
--n-merged-border-color: var(--n-border-color);
|
|
497
|
+
--n-merged-th-color-hover: var(--n-th-color-hover);
|
|
498
|
+
--n-merged-th-color-sorting: var(--n-th-color-sorting);
|
|
499
|
+
--n-merged-td-color-hover: var(--n-td-color-hover);
|
|
500
|
+
--n-merged-td-color-sorting: var(--n-td-color-sorting);
|
|
501
|
+
--n-merged-td-color-striped: var(--n-td-color-striped);
|
|
502
|
+
`,[q(`data-table-wrapper`,`
|
|
503
|
+
flex-grow: 1;
|
|
504
|
+
display: flex;
|
|
505
|
+
flex-direction: column;
|
|
506
|
+
`),U(`flex-height`,[B(`>`,[q(`data-table-wrapper`,[B(`>`,[q(`data-table-base-table`,`
|
|
507
|
+
display: flex;
|
|
508
|
+
flex-direction: column;
|
|
509
|
+
flex-grow: 1;
|
|
510
|
+
`,[B(`>`,[q(`data-table-base-table-body`,`flex-basis: 0;`,[B(`&:last-child`,`flex-grow: 1;`)])])])])])])]),B(`>`,[q(`data-table-loading-wrapper`,`
|
|
511
|
+
color: var(--n-loading-color);
|
|
512
|
+
font-size: var(--n-loading-size);
|
|
513
|
+
position: absolute;
|
|
514
|
+
left: 50%;
|
|
515
|
+
top: 50%;
|
|
516
|
+
transform: translateX(-50%) translateY(-50%);
|
|
517
|
+
transition: color .3s var(--n-bezier);
|
|
518
|
+
display: flex;
|
|
519
|
+
align-items: center;
|
|
520
|
+
justify-content: center;
|
|
521
|
+
`,[ke({originalTransform:`translateX(-50%) translateY(-50%)`})])]),q(`data-table-expand-placeholder`,`
|
|
522
|
+
margin-right: 8px;
|
|
523
|
+
display: inline-block;
|
|
524
|
+
width: 16px;
|
|
525
|
+
height: 1px;
|
|
526
|
+
`),q(`data-table-indent`,`
|
|
527
|
+
display: inline-block;
|
|
528
|
+
height: 1px;
|
|
529
|
+
`),q(`data-table-expand-trigger`,`
|
|
530
|
+
display: inline-flex;
|
|
531
|
+
margin-right: 8px;
|
|
532
|
+
cursor: pointer;
|
|
533
|
+
font-size: 16px;
|
|
534
|
+
vertical-align: -0.2em;
|
|
535
|
+
position: relative;
|
|
536
|
+
width: 16px;
|
|
537
|
+
height: 16px;
|
|
538
|
+
color: var(--n-td-text-color);
|
|
539
|
+
transition: color .3s var(--n-bezier);
|
|
540
|
+
`,[U(`expanded`,[q(`icon`,`transform: rotate(90deg);`,[re({originalTransform:`rotate(90deg)`})]),q(`base-icon`,`transform: rotate(90deg);`,[re({originalTransform:`rotate(90deg)`})])]),q(`base-loading`,`
|
|
541
|
+
color: var(--n-loading-color);
|
|
542
|
+
transition: color .3s var(--n-bezier);
|
|
543
|
+
position: absolute;
|
|
544
|
+
left: 0;
|
|
545
|
+
right: 0;
|
|
546
|
+
top: 0;
|
|
547
|
+
bottom: 0;
|
|
548
|
+
`,[re()]),q(`icon`,`
|
|
549
|
+
position: absolute;
|
|
550
|
+
left: 0;
|
|
551
|
+
right: 0;
|
|
552
|
+
top: 0;
|
|
553
|
+
bottom: 0;
|
|
554
|
+
`,[re()]),q(`base-icon`,`
|
|
555
|
+
position: absolute;
|
|
556
|
+
left: 0;
|
|
557
|
+
right: 0;
|
|
558
|
+
top: 0;
|
|
559
|
+
bottom: 0;
|
|
560
|
+
`,[re()])]),q(`data-table-thead`,`
|
|
561
|
+
transition: background-color .3s var(--n-bezier);
|
|
562
|
+
background-color: var(--n-merged-th-color);
|
|
563
|
+
`),q(`data-table-tr`,`
|
|
564
|
+
position: relative;
|
|
565
|
+
box-sizing: border-box;
|
|
566
|
+
background-clip: padding-box;
|
|
567
|
+
transition: background-color .3s var(--n-bezier);
|
|
568
|
+
`,[q(`data-table-expand`,`
|
|
569
|
+
position: sticky;
|
|
570
|
+
left: 0;
|
|
571
|
+
overflow: hidden;
|
|
572
|
+
margin: calc(var(--n-th-padding) * -1);
|
|
573
|
+
padding: var(--n-th-padding);
|
|
574
|
+
box-sizing: border-box;
|
|
575
|
+
`),U(`striped`,`background-color: var(--n-merged-td-color-striped);`,[q(`data-table-td`,`background-color: var(--n-merged-td-color-striped);`)]),Y(`summary`,[B(`&:hover`,`background-color: var(--n-merged-td-color-hover);`,[B(`>`,[q(`data-table-td`,`background-color: var(--n-merged-td-color-hover);`)])])])]),q(`data-table-th`,`
|
|
576
|
+
padding: var(--n-th-padding);
|
|
577
|
+
position: relative;
|
|
578
|
+
text-align: start;
|
|
579
|
+
box-sizing: border-box;
|
|
580
|
+
background-color: var(--n-merged-th-color);
|
|
581
|
+
border-color: var(--n-merged-border-color);
|
|
582
|
+
border-bottom: 1px solid var(--n-merged-border-color);
|
|
583
|
+
color: var(--n-th-text-color);
|
|
584
|
+
transition:
|
|
585
|
+
border-color .3s var(--n-bezier),
|
|
586
|
+
color .3s var(--n-bezier),
|
|
587
|
+
background-color .3s var(--n-bezier);
|
|
588
|
+
font-weight: var(--n-th-font-weight);
|
|
589
|
+
`,[U(`filterable`,`
|
|
590
|
+
padding-right: 36px;
|
|
591
|
+
`,[U(`sortable`,`
|
|
592
|
+
padding-right: calc(var(--n-th-padding) + 36px);
|
|
593
|
+
`)]),jr,U(`selection`,`
|
|
594
|
+
padding: 0;
|
|
595
|
+
text-align: center;
|
|
596
|
+
line-height: 0;
|
|
597
|
+
z-index: 3;
|
|
598
|
+
`),V(`title-wrapper`,`
|
|
599
|
+
display: flex;
|
|
600
|
+
align-items: center;
|
|
601
|
+
flex-wrap: nowrap;
|
|
602
|
+
max-width: 100%;
|
|
603
|
+
`,[V(`title`,`
|
|
604
|
+
flex: 1;
|
|
605
|
+
min-width: 0;
|
|
606
|
+
`)]),V(`ellipsis`,`
|
|
607
|
+
display: inline-block;
|
|
608
|
+
vertical-align: bottom;
|
|
609
|
+
text-overflow: ellipsis;
|
|
610
|
+
overflow: hidden;
|
|
611
|
+
white-space: nowrap;
|
|
612
|
+
max-width: 100%;
|
|
613
|
+
`),U(`hover`,`
|
|
614
|
+
background-color: var(--n-merged-th-color-hover);
|
|
615
|
+
`),U(`sorting`,`
|
|
616
|
+
background-color: var(--n-merged-th-color-sorting);
|
|
617
|
+
`),U(`sortable`,`
|
|
618
|
+
cursor: pointer;
|
|
619
|
+
`,[V(`ellipsis`,`
|
|
620
|
+
max-width: calc(100% - 18px);
|
|
621
|
+
`),B(`&:hover`,`
|
|
622
|
+
background-color: var(--n-merged-th-color-hover);
|
|
623
|
+
`)]),q(`data-table-sorter`,`
|
|
624
|
+
height: var(--n-sorter-size);
|
|
625
|
+
width: var(--n-sorter-size);
|
|
626
|
+
margin-left: 4px;
|
|
627
|
+
position: relative;
|
|
628
|
+
display: inline-flex;
|
|
629
|
+
align-items: center;
|
|
630
|
+
justify-content: center;
|
|
631
|
+
vertical-align: -0.2em;
|
|
632
|
+
color: var(--n-th-icon-color);
|
|
633
|
+
transition: color .3s var(--n-bezier);
|
|
634
|
+
`,[q(`base-icon`,`transition: transform .3s var(--n-bezier)`),U(`desc`,[q(`base-icon`,`
|
|
635
|
+
transform: rotate(0deg);
|
|
636
|
+
`)]),U(`asc`,[q(`base-icon`,`
|
|
637
|
+
transform: rotate(-180deg);
|
|
638
|
+
`)]),U(`asc, desc`,`
|
|
639
|
+
color: var(--n-th-icon-color-active);
|
|
640
|
+
`)]),q(`data-table-resize-button`,`
|
|
641
|
+
width: var(--n-resizable-container-size);
|
|
642
|
+
position: absolute;
|
|
643
|
+
top: 0;
|
|
644
|
+
right: calc(var(--n-resizable-container-size) / 2);
|
|
645
|
+
bottom: 0;
|
|
646
|
+
cursor: col-resize;
|
|
647
|
+
user-select: none;
|
|
648
|
+
`,[B(`&::after`,`
|
|
649
|
+
width: var(--n-resizable-size);
|
|
650
|
+
height: 50%;
|
|
651
|
+
position: absolute;
|
|
652
|
+
top: 50%;
|
|
653
|
+
left: calc(var(--n-resizable-container-size) / 2);
|
|
654
|
+
bottom: 0;
|
|
655
|
+
background-color: var(--n-merged-border-color);
|
|
656
|
+
transform: translateY(-50%);
|
|
657
|
+
transition: background-color .3s var(--n-bezier);
|
|
658
|
+
z-index: 1;
|
|
659
|
+
content: '';
|
|
660
|
+
`),U(`active`,[B(`&::after`,`
|
|
661
|
+
background-color: var(--n-th-icon-color-active);
|
|
662
|
+
`)]),B(`&:hover::after`,`
|
|
663
|
+
background-color: var(--n-th-icon-color-active);
|
|
664
|
+
`)]),q(`data-table-filter`,`
|
|
665
|
+
position: absolute;
|
|
666
|
+
z-index: auto;
|
|
667
|
+
right: 0;
|
|
668
|
+
width: 36px;
|
|
669
|
+
top: 0;
|
|
670
|
+
bottom: 0;
|
|
671
|
+
cursor: pointer;
|
|
672
|
+
display: flex;
|
|
673
|
+
justify-content: center;
|
|
674
|
+
align-items: center;
|
|
675
|
+
transition:
|
|
676
|
+
background-color .3s var(--n-bezier),
|
|
677
|
+
color .3s var(--n-bezier);
|
|
678
|
+
font-size: var(--n-filter-size);
|
|
679
|
+
color: var(--n-th-icon-color);
|
|
680
|
+
`,[B(`&:hover`,`
|
|
681
|
+
background-color: var(--n-th-button-color-hover);
|
|
682
|
+
`),U(`show`,`
|
|
683
|
+
background-color: var(--n-th-button-color-hover);
|
|
684
|
+
`),U(`active`,`
|
|
685
|
+
background-color: var(--n-th-button-color-hover);
|
|
686
|
+
color: var(--n-th-icon-color-active);
|
|
687
|
+
`)])]),q(`data-table-td`,`
|
|
688
|
+
padding: var(--n-td-padding);
|
|
689
|
+
text-align: start;
|
|
690
|
+
box-sizing: border-box;
|
|
691
|
+
border: none;
|
|
692
|
+
background-color: var(--n-merged-td-color);
|
|
693
|
+
color: var(--n-td-text-color);
|
|
694
|
+
border-bottom: 1px solid var(--n-merged-border-color);
|
|
695
|
+
transition:
|
|
696
|
+
box-shadow .3s var(--n-bezier),
|
|
697
|
+
background-color .3s var(--n-bezier),
|
|
698
|
+
border-color .3s var(--n-bezier),
|
|
699
|
+
color .3s var(--n-bezier);
|
|
700
|
+
`,[U(`expand`,[q(`data-table-expand-trigger`,`
|
|
701
|
+
margin-right: 0;
|
|
702
|
+
`)]),U(`last-row`,`
|
|
703
|
+
border-bottom: 0 solid var(--n-merged-border-color);
|
|
704
|
+
`,[B(`&::after`,`
|
|
705
|
+
bottom: 0 !important;
|
|
706
|
+
`),B(`&::before`,`
|
|
707
|
+
bottom: 0 !important;
|
|
708
|
+
`)]),U(`summary`,`
|
|
709
|
+
background-color: var(--n-merged-th-color);
|
|
710
|
+
`),U(`hover`,`
|
|
711
|
+
background-color: var(--n-merged-td-color-hover);
|
|
712
|
+
`),U(`sorting`,`
|
|
713
|
+
background-color: var(--n-merged-td-color-sorting);
|
|
714
|
+
`),V(`ellipsis`,`
|
|
715
|
+
display: inline-block;
|
|
716
|
+
text-overflow: ellipsis;
|
|
717
|
+
overflow: hidden;
|
|
718
|
+
white-space: nowrap;
|
|
719
|
+
max-width: 100%;
|
|
720
|
+
vertical-align: bottom;
|
|
721
|
+
max-width: calc(100% - var(--indent-offset, -1.5) * 16px - 24px);
|
|
722
|
+
`),U(`selection, expand`,`
|
|
723
|
+
text-align: center;
|
|
724
|
+
padding: 0;
|
|
725
|
+
line-height: 0;
|
|
726
|
+
`),jr]),q(`data-table-empty`,`
|
|
727
|
+
box-sizing: border-box;
|
|
728
|
+
padding: var(--n-empty-padding);
|
|
729
|
+
flex-grow: 1;
|
|
730
|
+
flex-shrink: 0;
|
|
731
|
+
opacity: 1;
|
|
732
|
+
display: flex;
|
|
733
|
+
align-items: center;
|
|
734
|
+
justify-content: center;
|
|
735
|
+
transition: opacity .3s var(--n-bezier);
|
|
736
|
+
`,[U(`hide`,`
|
|
737
|
+
opacity: 0;
|
|
738
|
+
`)]),V(`pagination`,`
|
|
739
|
+
margin: var(--n-pagination-margin);
|
|
740
|
+
display: flex;
|
|
741
|
+
justify-content: flex-end;
|
|
742
|
+
`),q(`data-table-wrapper`,`
|
|
743
|
+
position: relative;
|
|
744
|
+
opacity: 1;
|
|
745
|
+
transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier);
|
|
746
|
+
border-top-left-radius: var(--n-border-radius);
|
|
747
|
+
border-top-right-radius: var(--n-border-radius);
|
|
748
|
+
line-height: var(--n-line-height);
|
|
749
|
+
`),U(`loading`,[q(`data-table-wrapper`,`
|
|
750
|
+
opacity: var(--n-opacity-loading);
|
|
751
|
+
pointer-events: none;
|
|
752
|
+
`)]),U(`single-column`,[q(`data-table-td`,`
|
|
753
|
+
border-bottom: 0 solid var(--n-merged-border-color);
|
|
754
|
+
`,[B(`&::after, &::before`,`
|
|
755
|
+
bottom: 0 !important;
|
|
756
|
+
`)])]),Y(`single-line`,[q(`data-table-th`,`
|
|
757
|
+
border-right: 1px solid var(--n-merged-border-color);
|
|
758
|
+
`,[U(`last`,`
|
|
759
|
+
border-right: 0 solid var(--n-merged-border-color);
|
|
760
|
+
`)]),q(`data-table-td`,`
|
|
761
|
+
border-right: 1px solid var(--n-merged-border-color);
|
|
762
|
+
`,[U(`last-col`,`
|
|
763
|
+
border-right: 0 solid var(--n-merged-border-color);
|
|
764
|
+
`)])]),U(`bordered`,[q(`data-table-wrapper`,`
|
|
765
|
+
border: 1px solid var(--n-merged-border-color);
|
|
766
|
+
border-bottom-left-radius: var(--n-border-radius);
|
|
767
|
+
border-bottom-right-radius: var(--n-border-radius);
|
|
768
|
+
overflow: hidden;
|
|
769
|
+
`)]),q(`data-table-base-table`,[U(`transition-disabled`,[q(`data-table-th`,[B(`&::after, &::before`,`transition: none;`)]),q(`data-table-td`,[B(`&::after, &::before`,`transition: none;`)])])]),U(`bottom-bordered`,[q(`data-table-td`,[U(`last-row`,`
|
|
770
|
+
border-bottom: 1px solid var(--n-merged-border-color);
|
|
771
|
+
`)])]),q(`data-table-table`,`
|
|
772
|
+
font-variant-numeric: tabular-nums;
|
|
773
|
+
width: 100%;
|
|
774
|
+
word-break: break-word;
|
|
775
|
+
transition: background-color .3s var(--n-bezier);
|
|
776
|
+
border-collapse: separate;
|
|
777
|
+
border-spacing: 0;
|
|
778
|
+
background-color: var(--n-merged-td-color);
|
|
779
|
+
`),q(`data-table-base-table-header`,`
|
|
780
|
+
border-top-left-radius: calc(var(--n-border-radius) - 1px);
|
|
781
|
+
border-top-right-radius: calc(var(--n-border-radius) - 1px);
|
|
782
|
+
z-index: 3;
|
|
783
|
+
overflow: scroll;
|
|
784
|
+
flex-shrink: 0;
|
|
785
|
+
transition: border-color .3s var(--n-bezier);
|
|
786
|
+
scrollbar-width: none;
|
|
787
|
+
`,[B(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
788
|
+
display: none;
|
|
789
|
+
width: 0;
|
|
790
|
+
height: 0;
|
|
791
|
+
`)]),q(`data-table-check-extra`,`
|
|
792
|
+
transition: color .3s var(--n-bezier);
|
|
793
|
+
color: var(--n-th-icon-color);
|
|
794
|
+
position: absolute;
|
|
795
|
+
font-size: 14px;
|
|
796
|
+
right: -4px;
|
|
797
|
+
top: 50%;
|
|
798
|
+
transform: translateY(-50%);
|
|
799
|
+
z-index: 1;
|
|
800
|
+
`)]),q(`data-table-filter-menu`,[q(`scrollbar`,`
|
|
801
|
+
max-height: 240px;
|
|
802
|
+
`),V(`group`,`
|
|
803
|
+
display: flex;
|
|
804
|
+
flex-direction: column;
|
|
805
|
+
padding: 12px 12px 0 12px;
|
|
806
|
+
`,[q(`checkbox`,`
|
|
807
|
+
margin-bottom: 12px;
|
|
808
|
+
margin-right: 0;
|
|
809
|
+
`),q(`radio`,`
|
|
810
|
+
margin-bottom: 12px;
|
|
811
|
+
margin-right: 0;
|
|
812
|
+
`)]),V(`action`,`
|
|
813
|
+
padding: var(--n-action-padding);
|
|
814
|
+
display: flex;
|
|
815
|
+
flex-wrap: nowrap;
|
|
816
|
+
justify-content: space-evenly;
|
|
817
|
+
border-top: 1px solid var(--n-action-divider-color);
|
|
818
|
+
`,[q(`button`,[B(`&:not(:last-child)`,`
|
|
819
|
+
margin: var(--n-action-button-margin);
|
|
820
|
+
`),B(`&:last-child`,`
|
|
821
|
+
margin-right: 0;
|
|
822
|
+
`)])]),q(`divider`,`
|
|
823
|
+
margin: 0 !important;
|
|
824
|
+
`)]),G(q(`data-table`,`
|
|
825
|
+
--n-merged-th-color: var(--n-th-color-modal);
|
|
826
|
+
--n-merged-td-color: var(--n-td-color-modal);
|
|
827
|
+
--n-merged-border-color: var(--n-border-color-modal);
|
|
828
|
+
--n-merged-th-color-hover: var(--n-th-color-hover-modal);
|
|
829
|
+
--n-merged-td-color-hover: var(--n-td-color-hover-modal);
|
|
830
|
+
--n-merged-th-color-sorting: var(--n-th-color-hover-modal);
|
|
831
|
+
--n-merged-td-color-sorting: var(--n-td-color-hover-modal);
|
|
832
|
+
--n-merged-td-color-striped: var(--n-td-color-striped-modal);
|
|
833
|
+
`)),W(q(`data-table`,`
|
|
834
|
+
--n-merged-th-color: var(--n-th-color-popover);
|
|
835
|
+
--n-merged-td-color: var(--n-td-color-popover);
|
|
836
|
+
--n-merged-border-color: var(--n-border-color-popover);
|
|
837
|
+
--n-merged-th-color-hover: var(--n-th-color-hover-popover);
|
|
838
|
+
--n-merged-td-color-hover: var(--n-td-color-hover-popover);
|
|
839
|
+
--n-merged-th-color-sorting: var(--n-th-color-hover-popover);
|
|
840
|
+
--n-merged-td-color-sorting: var(--n-td-color-hover-popover);
|
|
841
|
+
--n-merged-td-color-striped: var(--n-td-color-striped-popover);
|
|
842
|
+
`))]);function Nr(){return[U(`fixed-left`,`
|
|
843
|
+
left: 0;
|
|
844
|
+
position: sticky;
|
|
845
|
+
z-index: 2;
|
|
846
|
+
`,[B(`&::after`,`
|
|
847
|
+
pointer-events: none;
|
|
848
|
+
content: "";
|
|
849
|
+
width: 36px;
|
|
850
|
+
display: inline-block;
|
|
851
|
+
position: absolute;
|
|
852
|
+
top: 0;
|
|
853
|
+
bottom: -1px;
|
|
854
|
+
transition: box-shadow .2s var(--n-bezier);
|
|
855
|
+
right: -36px;
|
|
856
|
+
`)]),U(`fixed-right`,`
|
|
857
|
+
right: 0;
|
|
858
|
+
position: sticky;
|
|
859
|
+
z-index: 1;
|
|
860
|
+
`,[B(`&::before`,`
|
|
861
|
+
pointer-events: none;
|
|
862
|
+
content: "";
|
|
863
|
+
width: 36px;
|
|
864
|
+
display: inline-block;
|
|
865
|
+
position: absolute;
|
|
866
|
+
top: 0;
|
|
867
|
+
bottom: -1px;
|
|
868
|
+
transition: box-shadow .2s var(--n-bezier);
|
|
869
|
+
left: -36px;
|
|
870
|
+
`)])]}function Pr(e,t){let{paginatedDataRef:n,treeMateRef:r,selectionColumnRef:i}=t,a=w(e.defaultCheckedRowKeys),o=x(()=>{let{checkedRowKeys:t}=e,n=t===void 0?a.value:t;return i.value?.multiple===!1?{checkedKeys:n.slice(0,1),indeterminateKeys:[]}:r.value.getCheckedKeys(n,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})}),s=x(()=>o.value.checkedKeys),c=x(()=>o.value.indeterminateKeys),l=x(()=>new Set(s.value)),u=x(()=>new Set(c.value)),d=x(()=>{let{value:e}=l;return n.value.reduce((t,n)=>{let{key:r,disabled:i}=n;return t+(!i&&e.has(r)?1:0)},0)}),f=x(()=>n.value.filter(e=>e.disabled).length),p=x(()=>{let{length:e}=n.value,{value:t}=u;return d.value>0&&d.value<e-f.value||n.value.some(e=>t.has(e.key))}),m=x(()=>{let{length:e}=n.value;return d.value!==0&&d.value===e-f.value}),h=x(()=>n.value.length===0);function g(t,n,i){let{"onUpdate:checkedRowKeys":o,onUpdateCheckedRowKeys:s,onCheckedRowKeysChange:c}=e,l=[],{value:{getNode:u}}=r;t.forEach(e=>{let t=u(e)?.rawNode;l.push(t)}),o&&I(o,t,l,{row:n,action:i}),s&&I(s,t,l,{row:n,action:i}),c&&I(c,t,l,{row:n,action:i}),a.value=t}function _(t,n=!1,i){if(!e.loading){if(n){g(Array.isArray(t)?t.slice(0,1):[t],i,`check`);return}g(r.value.check(t,s.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,i,`check`)}}function v(t,n){e.loading||g(r.value.uncheck(t,s.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,n,`uncheck`)}function y(t=!1){let{value:a}=i;if(!a||e.loading)return;let o=[];(t?r.value.treeNodes:n.value).forEach(e=>{e.disabled||o.push(e.key)}),g(r.value.check(o,s.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,`checkAll`)}function b(t=!1){let{value:a}=i;if(!a||e.loading)return;let o=[];(t?r.value.treeNodes:n.value).forEach(e=>{e.disabled||o.push(e.key)}),g(r.value.uncheck(o,s.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,`uncheckAll`)}return{mergedCheckedRowKeySetRef:l,mergedCheckedRowKeysRef:s,mergedInderminateRowKeySetRef:u,someRowsCheckedRef:p,allRowsCheckedRef:m,headerCheckboxDisabledRef:h,doUpdateCheckedRowKeys:g,doCheckAll:y,doUncheckAll:b,doCheck:_,doUncheck:v}}function Fr(e,t){let n=Z(()=>{for(let t of e.columns)if(t.type===`expand`)return t.renderExpand}),r=Z(()=>{let t;for(let n of e.columns)if(n.type===`expand`){t=n.expandable;break}return t}),i=w(e.defaultExpandAll?n?.value?(()=>{let e=[];return t.value.treeNodes.forEach(t=>{r.value?.call(r,t.rawNode)&&e.push(t.key)}),e})():t.value.getNonLeafKeys():e.defaultExpandedRowKeys),a=m(e,`expandedRowKeys`),o=m(e,`stickyExpandedRows`),s=Ke(a,i);function c(t){let{onUpdateExpandedRowKeys:n,"onUpdate:expandedRowKeys":r}=e;n&&I(n,t),r&&I(r,t),i.value=t}return{stickyExpandedRowsRef:o,mergedExpandedRowKeysRef:s,renderExpandRef:n,expandableRef:r,doUpdateExpandedRowKeys:c}}function Ir(e,t){let n=[],r=[],i=[],a=new WeakMap,o=-1,s=0,c=!1,l=0;function u(e,a){a>o&&(n[a]=[],o=a),e.forEach(e=>{if(`children`in e)u(e.children,a+1);else{let n=`key`in e?e.key:void 0;r.push({key:fn(e),style:gn(e,n===void 0?void 0:be(t(n))),column:e,index:l++,width:e.width===void 0?128:Number(e.width)}),s+=1,c||=!!e.ellipsis,i.push(e)}})}u(e,0),l=0;function d(e,t){let r=0;e.forEach(e=>{if(`children`in e){let r=l,i={column:e,colIndex:l,colSpan:0,rowSpan:1,isLast:!1};d(e.children,t+1),e.children.forEach(e=>{i.colSpan+=a.get(e)?.colSpan??0}),r+i.colSpan===s&&(i.isLast=!0),a.set(e,i),n[t].push(i)}else{if(l<r){l+=1;return}let i=1;`titleColSpan`in e&&(i=e.titleColSpan??1),i>1&&(r=l+i);let c=l+i===s,u={column:e,colSpan:i,colIndex:l,rowSpan:o-t+1,isLast:c};a.set(e,u),n[t].push(u),l+=1}})}return d(e,0),{hasEllipsis:c,rows:n,cols:r,dataRelatedCols:i}}function Lr(e,t){let n=x(()=>Ir(e.columns,t));return{rowsRef:x(()=>n.value.rows),colsRef:x(()=>n.value.cols),hasEllipsisRef:x(()=>n.value.hasEllipsis),dataRelatedColsRef:x(()=>n.value.dataRelatedCols)}}function Rr(){let e=w({});function t(t){return e.value[t]}function n(t,n){bn(t)&&`key`in t&&(e.value[t.key]=n)}function r(){e.value={}}return{getResizableWidth:t,doUpdateResizableWidth:n,clearResizableWidth:r}}function zr(e,{mainTableInstRef:t,mergedCurrentPageRef:n,bodyWidthRef:r,maxHeightRef:i,mergedTableLayoutRef:a}){let o=x(()=>e.scrollX!==void 0||i.value!==void 0||e.flexHeight),s=x(()=>{let t=!o.value&&a.value===`auto`;return e.scrollX!==void 0||t}),c=0,l=w(),u=w(null),f=w([]),p=w(null),m=w([]),h=x(()=>be(e.scrollX)),g=x(()=>e.columns.filter(e=>e.fixed===`left`)),_=x(()=>e.columns.filter(e=>e.fixed===`right`)),v=x(()=>{let e={},t=0;function n(r){r.forEach(r=>{let i={start:t,end:0};e[fn(r)]=i,`children`in r?(n(r.children),i.end=t):(t+=un(r)||0,i.end=t)})}return n(g.value),e}),y=x(()=>{let e={},t=0;function n(r){for(let i=r.length-1;i>=0;--i){let a=r[i],o={start:t,end:0};e[fn(a)]=o,`children`in a?(n(a.children),o.end=t):(t+=un(a)||0,o.end=t)}}return n(_.value),e});function b(){let{value:e}=g,t=0,{value:n}=v,r=null;for(let i=0;i<e.length;++i){let a=fn(e[i]);if(c>(n[a]?.start||0)-t)r=a,t=n[a]?.end||0;else break}u.value=r}function S(){f.value=[];let t=e.columns.find(e=>fn(e)===u.value);for(;t&&`children`in t;){let e=t.children.length;if(e===0)break;let n=t.children[e-1];f.value.push(fn(n)),t=n}}function C(){let{value:t}=_,n=Number(e.scrollX),{value:i}=r;if(i===null)return;let a=0,o=null,{value:s}=y;for(let e=t.length-1;e>=0;--e){let r=fn(t[e]);if(Math.round(c+(s[r]?.start||0)+i-a)<n)o=r,a=s[r]?.end||0;else break}p.value=o}function T(){m.value=[];let t=e.columns.find(e=>fn(e)===p.value);for(;t&&`children`in t&&t.children.length;){let e=t.children[0];m.value.push(fn(e)),t=e}}function E(){return{header:t.value?t.value.getHeaderElement():null,body:t.value?t.value.getBodyElement():null}}function D(){let{body:e}=E();e&&(e.scrollTop=0)}function O(){l.value===`body`?l.value=void 0:de(A)}function k(t){var n;(n=e.onScroll)==null||n.call(e,t),l.value===`head`?l.value=void 0:de(A)}function A(){let{header:e,body:t}=E();if(!t)return;let{value:n}=r;n!==null&&(e?(l.value=c-e.scrollLeft===0?`body`:`head`,l.value===`head`?(c=e.scrollLeft,t.scrollLeft=c):(c=t.scrollLeft,e.scrollLeft=c)):c=t.scrollLeft,b(),S(),C(),T())}function j(e){let{header:t}=E();t&&(t.scrollLeft=e,A())}return d(n,()=>{D()}),{styleScrollXRef:h,fixedColumnLeftMapRef:v,fixedColumnRightMapRef:y,leftFixedColumnsRef:g,rightFixedColumnsRef:_,leftActiveFixedColKeyRef:u,leftActiveFixedChildrenColKeysRef:f,rightActiveFixedColKeyRef:p,rightActiveFixedChildrenColKeysRef:m,syncScrollState:A,handleTableBodyScroll:k,handleTableHeaderScroll:O,setHeaderScrollLeft:j,explicitlyScrollableRef:o,xScrollableRef:s}}function Br(e){return typeof e==`object`&&typeof e.multiple==`number`?e.multiple:!1}function Vr(e,t){return t&&(e===void 0||e===`default`||typeof e==`object`&&e.compare===`default`)?Hr(t):typeof e==`function`?e:e&&typeof e==`object`&&e.compare&&e.compare!==`default`?e.compare:!1}function Hr(e){return(t,n)=>{let r=t[e],i=n[e];return r==null?i==null?0:-1:i==null?1:typeof r==`number`&&typeof i==`number`?r-i:typeof r==`string`&&typeof i==`string`?r.localeCompare(i):0}}function Ur(e,{dataRelatedColsRef:t,filteredDataRef:n}){let r=[];t.value.forEach(e=>{e.sorter!==void 0&&f(r,{columnKey:e.key,sorter:e.sorter,order:e.defaultSortOrder??!1})});let i=w(r),a=x(()=>{let e=t.value.filter(e=>e.type!==`selection`&&e.sorter!==void 0&&(e.sortOrder===`ascend`||e.sortOrder===`descend`||e.sortOrder===!1)),n=e.filter(e=>e.sortOrder!==!1);if(n.length)return n.map(e=>({columnKey:e.key,order:e.sortOrder,sorter:e.sorter}));if(e.length)return[];let{value:r}=i;return Array.isArray(r)?r:r?[r]:[]}),o=x(()=>{let e=a.value.slice().sort((e,t)=>{let n=Br(e.sorter)||0;return(Br(t.sorter)||0)-n});return e.length?n.value.slice().sort((t,n)=>{let r=0;return e.some(e=>{let{columnKey:i,sorter:a,order:o}=e,s=Vr(a,i);return s&&o&&(r=s(t.rawNode,n.rawNode),r!==0)?(r*=mn(o),!0):!1}),r}):n.value});function s(e){let t=a.value.slice();return e&&Br(e.sorter)!==!1?(t=t.filter(e=>Br(e.sorter)!==!1),f(t,e),t):e||null}function c(e){l(s(e))}function l(t){let{"onUpdate:sorter":n,onUpdateSorter:r,onSorterChange:a}=e;n&&I(n,t),r&&I(r,t),a&&I(a,t),i.value=t}function u(e,n=`ascend`){if(!e)d();else{let r=t.value.find(t=>t.type!==`selection`&&t.type!==`expand`&&t.key===e);if(!r?.sorter)return;let i=r.sorter;c({columnKey:e,sorter:i,order:n})}}function d(){l(null)}function f(e,t){let n=e.findIndex(e=>t?.columnKey&&e.columnKey===t.columnKey);n!==void 0&&n>=0?e[n]=t:e.push(t)}return{clearSorter:d,sort:u,sortedDataRef:o,mergedSortStateRef:a,deriveNextSorter:c}}function Wr(e,{dataRelatedColsRef:t}){let n=x(()=>{let t=e=>{for(let n=0;n<e.length;++n){let r=e[n];if(`children`in r)return t(r.children);if(r.type===`selection`)return r}return null};return t(e.columns)}),r=x(()=>{let{childrenKey:t}=e;return Fe(e.data,{ignoreEmptyChildren:!0,getKey:e.rowKey,getChildren:e=>e[t],getDisabled:e=>{var t;return!!((t=n.value)?.disabled)?.call(t,e)}})}),i=Z(()=>{let{columns:t}=e,{length:n}=t,r=null;for(let e=0;e<n;++e){let n=t[e];if(!n.type&&r===null&&(r=e),`tree`in n&&n.tree)return e}return r||0}),a=w({}),{pagination:o}=e,s=w(o&&o.defaultPage||1),c=w(qt(o)),l=x(()=>{let e=t.value.filter(e=>e.filterOptionValues!==void 0||e.filterOptionValue!==void 0),n={};return e.forEach(e=>{e.type===`selection`||e.type===`expand`||(e.filterOptionValues===void 0?n[e.key]=e.filterOptionValue??null:n[e.key]=e.filterOptionValues)}),Object.assign(pn(a.value),n)}),u=x(()=>{let t=l.value,{columns:n}=e;function i(e){return(t,n)=>!!~String(n[e]).indexOf(String(t))}let{value:{treeNodes:a}}=r,o=[];return n.forEach(e=>{e.type===`selection`||e.type===`expand`||`children`in e||o.push([e.key,e])}),a?a.filter(e=>{let{rawNode:n}=e;for(let[e,r]of o){let a=t[e];if(a==null||(Array.isArray(a)||(a=[a]),!a.length))continue;let o=r.filter===`default`?i(e):r.filter;if(r&&typeof o==`function`)if(r.filterMode===`and`){if(a.some(e=>!o(e,n)))return!1}else if(a.some(e=>o(e,n)))continue;else return!1}return!0}):[]}),{sortedDataRef:d,deriveNextSorter:f,mergedSortStateRef:p,sort:m,clearSorter:h}=Ur(e,{dataRelatedColsRef:t,filteredDataRef:u});t.value.forEach(e=>{if(e.filter){let t=e.defaultFilterOptionValues;e.filterMultiple?a.value[e.key]=t||[]:t===void 0?a.value[e.key]=e.defaultFilterOptionValue??null:a.value[e.key]=t===null?[]:t}});let g=x(()=>{let{pagination:t}=e;if(t!==!1)return t.page}),_=x(()=>{let{pagination:t}=e;if(t!==!1)return t.pageSize}),v=Ke(g,s),y=Ke(_,c),b=Z(()=>{let t=v.value;return e.remote?t:Math.max(1,Math.min(Math.ceil(u.value.length/y.value),t))}),S=x(()=>{let{pagination:t}=e;if(t){let{pageCount:e}=t;if(e!==void 0)return e}}),C=x(()=>{if(e.remote)return r.value.treeNodes;if(!e.pagination)return d.value;let t=y.value,n=(b.value-1)*t;return d.value.slice(n,n+t)}),T=x(()=>C.value.map(e=>e.rawNode));function E(t){let{pagination:n}=e;if(n){let{onChange:e,"onUpdate:page":r,onUpdatePage:i}=n;e&&I(e,t),i&&I(i,t),r&&I(r,t),A(t)}}function D(t){let{pagination:n}=e;if(n){let{onPageSizeChange:e,"onUpdate:pageSize":r,onUpdatePageSize:i}=n;e&&I(e,t),i&&I(i,t),r&&I(r,t),j(t)}}let O=x(()=>{if(e.remote){let{pagination:t}=e;if(t){let{itemCount:e}=t;if(e!==void 0)return e}return}return u.value.length}),k=x(()=>Object.assign(Object.assign({},e.pagination),{onChange:void 0,onUpdatePage:void 0,onUpdatePageSize:void 0,onPageSizeChange:void 0,"onUpdate:page":E,"onUpdate:pageSize":D,page:b.value,pageSize:y.value,pageCount:O.value===void 0?S.value:void 0,itemCount:O.value}));function A(t){let{"onUpdate:page":n,onPageChange:r,onUpdatePage:i}=e;i&&I(i,t),n&&I(n,t),r&&I(r,t),s.value=t}function j(t){let{"onUpdate:pageSize":n,onPageSizeChange:r,onUpdatePageSize:i}=e;r&&I(r,t),i&&I(i,t),n&&I(n,t),c.value=t}function M(t,n){let{onUpdateFilters:r,"onUpdate:filters":i,onFiltersChange:o}=e;r&&I(r,t,n),i&&I(i,t,n),o&&I(o,t,n),a.value=t}function N(t,n,r,i){var a;(a=e.onUnstableColumnResize)==null||a.call(e,t,n,r,i)}function P(e){A(e)}function F(){L()}function L(){R({})}function R(e){z(e)}function z(e){e?e&&(a.value=pn(e)):a.value={}}return{treeMateRef:r,mergedCurrentPageRef:b,mergedPaginationRef:k,paginatedDataRef:C,rawPaginatedDataRef:T,mergedFilterStateRef:l,mergedSortStateRef:p,hoverKeyRef:w(null),selectionColumnRef:n,childTriggerColIndexRef:i,doUpdateFilters:M,deriveNextSorter:f,doUpdatePageSize:j,doUpdatePage:A,onUnstableColumnResize:N,filter:z,filters:R,clearFilter:F,clearFilters:L,clearSorter:h,page:P,sort:m}}var Gr=E({name:`DataTable`,alias:[`AdvancedTable`],props:cn,slots:Object,setup(e,{slots:t}){let{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:i,mergedRtlRef:a,mergedComponentPropsRef:o}=A(e),c=H(`DataTable`,a,r),l=x(()=>e.size||o?.value?.DataTable?.size||`medium`),u=x(()=>{let{bottomBordered:t}=e;return n.value?!1:t===void 0?!0:t}),d=K(`DataTable`,`-data-table`,Mr,sn,e,r),f=w(null),p=w(null),{getResizableWidth:h,clearResizableWidth:g,doUpdateResizableWidth:_}=Rr(),{rowsRef:v,colsRef:y,dataRelatedColsRef:b,hasEllipsisRef:S}=Lr(e,h),{treeMateRef:C,mergedCurrentPageRef:T,paginatedDataRef:E,rawPaginatedDataRef:D,selectionColumnRef:O,hoverKeyRef:k,mergedPaginationRef:j,mergedFilterStateRef:M,mergedSortStateRef:N,childTriggerColIndexRef:F,doUpdatePage:I,doUpdateFilters:L,onUnstableColumnResize:R,deriveNextSorter:z,filter:B,filters:V,clearFilter:U,clearFilters:W,clearSorter:G,page:ee,sort:te}=Wr(e,{dataRelatedColsRef:b}),q=t=>{let{fileName:n=`data.csv`,keepOriginalData:r=!1}=t||{},i=r?e.data:D.value,a=En(e.columns,i,e.getCsvCell,e.getCsvHeader),o=new Blob([a],{type:`text/csv;charset=utf-8`}),s=URL.createObjectURL(o);dt(s,n.endsWith(`.csv`)?n:`${n}.csv`),URL.revokeObjectURL(s)},{doCheckAll:ne,doUncheckAll:re,doCheck:ie,doUncheck:Y,headerCheckboxDisabledRef:ae,someRowsCheckedRef:X,allRowsCheckedRef:Z,mergedCheckedRowKeySetRef:oe,mergedInderminateRowKeySetRef:se}=Pr(e,{selectionColumnRef:O,treeMateRef:C,paginatedDataRef:E}),{stickyExpandedRowsRef:Q,mergedExpandedRowKeysRef:ce,renderExpandRef:le,expandableRef:de,doUpdateExpandedRowKeys:fe}=Fr(e,C),pe=m(e,`maxHeight`),me=x(()=>e.virtualScroll||e.flexHeight||e.maxHeight!==void 0||S.value?`fixed`:e.tableLayout),{handleTableBodyScroll:he,handleTableHeaderScroll:ge,syncScrollState:_e,setHeaderScrollLeft:ve,leftActiveFixedColKeyRef:ye,leftActiveFixedChildrenColKeysRef:be,rightActiveFixedColKeyRef:xe,rightActiveFixedChildrenColKeysRef:Se,leftFixedColumnsRef:Ce,rightFixedColumnsRef:we,fixedColumnLeftMapRef:Te,fixedColumnRightMapRef:Ee,xScrollableRef:De,explicitlyScrollableRef:Oe}=zr(e,{bodyWidthRef:f,mainTableInstRef:p,mergedCurrentPageRef:T,maxHeightRef:pe,mergedTableLayoutRef:me}),{localeRef:ke}=Xe(`DataTable`);s(ln,{xScrollableRef:De,explicitlyScrollableRef:Oe,props:e,treeMateRef:C,renderExpandIconRef:m(e,`renderExpandIcon`),loadingKeySetRef:w(new Set),slots:t,indentRef:m(e,`indent`),childTriggerColIndexRef:F,bodyWidthRef:f,componentId:ue(),hoverKeyRef:k,mergedClsPrefixRef:r,mergedThemeRef:d,scrollXRef:x(()=>e.scrollX),rowsRef:v,colsRef:y,paginatedDataRef:E,leftActiveFixedColKeyRef:ye,leftActiveFixedChildrenColKeysRef:be,rightActiveFixedColKeyRef:xe,rightActiveFixedChildrenColKeysRef:Se,leftFixedColumnsRef:Ce,rightFixedColumnsRef:we,fixedColumnLeftMapRef:Te,fixedColumnRightMapRef:Ee,mergedCurrentPageRef:T,someRowsCheckedRef:X,allRowsCheckedRef:Z,mergedSortStateRef:N,mergedFilterStateRef:M,loadingRef:m(e,`loading`),rowClassNameRef:m(e,`rowClassName`),mergedCheckedRowKeySetRef:oe,mergedExpandedRowKeysRef:ce,mergedInderminateRowKeySetRef:se,localeRef:ke,expandableRef:de,stickyExpandedRowsRef:Q,rowKeyRef:m(e,`rowKey`),renderExpandRef:le,summaryRef:m(e,`summary`),virtualScrollRef:m(e,`virtualScroll`),virtualScrollXRef:m(e,`virtualScrollX`),heightForRowRef:m(e,`heightForRow`),minRowHeightRef:m(e,`minRowHeight`),virtualScrollHeaderRef:m(e,`virtualScrollHeader`),headerHeightRef:m(e,`headerHeight`),rowPropsRef:m(e,`rowProps`),stripedRef:m(e,`striped`),checkOptionsRef:x(()=>{let{value:e}=O;return e?.options}),rawPaginatedDataRef:D,filterMenuCssVarsRef:x(()=>{let{self:{actionDividerColor:e,actionPadding:t,actionButtonMargin:n}}=d.value;return{"--n-action-padding":t,"--n-action-button-margin":n,"--n-action-divider-color":e}}),onLoadRef:m(e,`onLoad`),mergedTableLayoutRef:me,maxHeightRef:pe,minHeightRef:m(e,`minHeight`),flexHeightRef:m(e,`flexHeight`),headerCheckboxDisabledRef:ae,paginationBehaviorOnFilterRef:m(e,`paginationBehaviorOnFilter`),summaryPlacementRef:m(e,`summaryPlacement`),filterIconPopoverPropsRef:m(e,`filterIconPopoverProps`),scrollbarPropsRef:m(e,`scrollbarProps`),syncScrollState:_e,doUpdatePage:I,doUpdateFilters:L,getResizableWidth:h,onUnstableColumnResize:R,clearResizableWidth:g,doUpdateResizableWidth:_,deriveNextSorter:z,doCheck:ie,doUncheck:Y,doCheckAll:ne,doUncheckAll:re,doUpdateExpandedRowKeys:fe,handleTableHeaderScroll:ge,handleTableBodyScroll:he,setHeaderScrollLeft:ve,renderCell:m(e,`renderCell`)});let Ae={filter:B,filters:V,clearFilters:W,clearSorter:G,page:ee,sort:te,clearFilter:U,downloadCsv:q,scrollTo:(e,t)=>{var n;(n=p.value)==null||n.scrollTo(e,t)}},je=x(()=>{let e=l.value,{common:{cubicBezierEaseInOut:t},self:{borderColor:n,tdColorHover:r,tdColorSorting:i,tdColorSortingModal:a,tdColorSortingPopover:o,thColorSorting:s,thColorSortingModal:c,thColorSortingPopover:u,thColor:f,thColorHover:p,tdColor:m,tdTextColor:h,thTextColor:g,thFontWeight:_,thButtonColorHover:v,thIconColor:y,thIconColorActive:b,filterSize:x,borderRadius:S,lineHeight:C,tdColorModal:w,thColorModal:T,borderColorModal:E,thColorHoverModal:D,tdColorHoverModal:O,borderColorPopover:k,thColorPopover:A,tdColorPopover:j,tdColorHoverPopover:M,thColorHoverPopover:N,paginationMargin:P,emptyPadding:F,boxShadowAfter:I,boxShadowBefore:L,sorterSize:R,resizableContainerSize:z,resizableSize:B,loadingColor:V,loadingSize:H,opacityLoading:U,tdColorStriped:W,tdColorStripedModal:G,tdColorStripedPopover:ee,[J(`fontSize`,e)]:te,[J(`thPadding`,e)]:K,[J(`tdPadding`,e)]:q}}=d.value;return{"--n-font-size":te,"--n-th-padding":K,"--n-td-padding":q,"--n-bezier":t,"--n-border-radius":S,"--n-line-height":C,"--n-border-color":n,"--n-border-color-modal":E,"--n-border-color-popover":k,"--n-th-color":f,"--n-th-color-hover":p,"--n-th-color-modal":T,"--n-th-color-hover-modal":D,"--n-th-color-popover":A,"--n-th-color-hover-popover":N,"--n-td-color":m,"--n-td-color-hover":r,"--n-td-color-modal":w,"--n-td-color-hover-modal":O,"--n-td-color-popover":j,"--n-td-color-hover-popover":M,"--n-th-text-color":g,"--n-td-text-color":h,"--n-th-font-weight":_,"--n-th-button-color-hover":v,"--n-th-icon-color":y,"--n-th-icon-color-active":b,"--n-filter-size":x,"--n-pagination-margin":P,"--n-empty-padding":F,"--n-box-shadow-before":L,"--n-box-shadow-after":I,"--n-sorter-size":R,"--n-resizable-container-size":z,"--n-resizable-size":B,"--n-loading-size":H,"--n-loading-color":V,"--n-opacity-loading":U,"--n-td-color-striped":W,"--n-td-color-striped-modal":G,"--n-td-color-striped-popover":ee,"--n-td-color-sorting":i,"--n-td-color-sorting-modal":a,"--n-td-color-sorting-popover":o,"--n-th-color-sorting":s,"--n-th-color-sorting-modal":c,"--n-th-color-sorting-popover":u}}),Me=i?P(`data-table`,x(()=>l.value[0]),je,e):void 0,Ne=x(()=>{if(!e.pagination)return!1;if(e.paginateSinglePage)return!0;let t=j.value,{pageCount:n}=t;return n===void 0?t.itemCount&&t.pageSize&&t.itemCount>t.pageSize:n>1});return Object.assign({mainTableInstRef:p,mergedClsPrefix:r,rtlEnabled:c,mergedTheme:d,paginatedData:E,mergedBordered:n,mergedBottomBordered:u,mergedPagination:j,mergedShowPagination:Ne,cssVars:i?void 0:je,themeClass:Me?.themeClass,onRender:Me?.onRender},Ae)},render(){let{mergedClsPrefix:e,themeClass:t,onRender:n,$slots:r,spinProps:i}=this;return n?.(),O(`div`,{class:[`${e}-data-table`,this.rtlEnabled&&`${e}-data-table--rtl`,t,{[`${e}-data-table--bordered`]:this.mergedBordered,[`${e}-data-table--bottom-bordered`]:this.mergedBottomBordered,[`${e}-data-table--single-line`]:this.singleLine,[`${e}-data-table--single-column`]:this.singleColumn,[`${e}-data-table--loading`]:this.loading,[`${e}-data-table--flex-height`]:this.flexHeight}],style:this.cssVars},O(`div`,{class:`${e}-data-table-wrapper`},O(Ar,{ref:`mainTableInstRef`})),this.mergedShowPagination?O(`div`,{class:`${e}-data-table__pagination`},O(Xt,Object.assign({theme:this.mergedTheme.peers.Pagination,themeOverrides:this.mergedTheme.peerOverrides.Pagination,disabled:this.loading},this.mergedPagination))):null,O(le,{name:`fade-in-scale-up-transition`},{default:()=>this.loading?O(`div`,{class:`${e}-data-table-loading-wrapper`},ae(r.loading,()=>[O(ee,Object.assign({clsPrefix:e,strokeWidth:20},i))])):null}))}}),Kr={railHeight:`4px`,railWidthVertical:`4px`,handleSize:`18px`,dotHeight:`8px`,dotWidth:`8px`,dotBorderRadius:`4px`};function qr(e){let{railColor:t,primaryColor:n,baseColor:r,cardColor:i,modalColor:a,popoverColor:o,borderRadius:s,fontSize:c,opacityDisabled:l}=e;return Object.assign(Object.assign({},Kr),{fontSize:c,markFontSize:c,railColor:t,railColorHover:t,fillColor:n,fillColorHover:n,opacityDisabled:l,handleColor:`#FFF`,dotColor:i,dotColorModal:a,dotColorPopover:o,handleBoxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)`,handleBoxShadowHover:`0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)`,handleBoxShadowActive:`0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)`,handleBoxShadowFocus:`0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)`,indicatorColor:`rgba(0, 0, 0, .85)`,indicatorBoxShadow:`0 2px 8px 0 rgba(0, 0, 0, 0.12)`,indicatorTextColor:r,indicatorBorderRadius:s,dotBorder:`2px solid ${t}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:``})}var Jr={name:`Slider`,common:X,self:qr},Yr={buttonHeightSmall:`14px`,buttonHeightMedium:`18px`,buttonHeightLarge:`22px`,buttonWidthSmall:`14px`,buttonWidthMedium:`18px`,buttonWidthLarge:`22px`,buttonWidthPressedSmall:`20px`,buttonWidthPressedMedium:`24px`,buttonWidthPressedLarge:`28px`,railHeightSmall:`18px`,railHeightMedium:`22px`,railHeightLarge:`26px`,railWidthSmall:`32px`,railWidthMedium:`40px`,railWidthLarge:`48px`};function Xr(e){let{primaryColor:t,opacityDisabled:n,borderRadius:r,textColor3:i}=e;return Object.assign(Object.assign({},Yr),{iconColor:i,textColor:`white`,loadingColor:t,opacityDisabled:n,railColor:`rgba(0, 0, 0, .14)`,railColorActive:t,buttonBoxShadow:`0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)`,buttonColor:`#FFF`,railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 0 2px ${te(t,{alpha:.2})}`})}var Zr={name:`Switch`,common:X,self:Xr},Qr=B([q(`slider`,`
|
|
871
|
+
display: block;
|
|
872
|
+
padding: calc((var(--n-handle-size) - var(--n-rail-height)) / 2) 0;
|
|
873
|
+
position: relative;
|
|
874
|
+
z-index: 0;
|
|
875
|
+
width: 100%;
|
|
876
|
+
cursor: pointer;
|
|
877
|
+
user-select: none;
|
|
878
|
+
-webkit-user-select: none;
|
|
879
|
+
`,[U(`reverse`,[q(`slider-handles`,[q(`slider-handle-wrapper`,`
|
|
880
|
+
transform: translate(50%, -50%);
|
|
881
|
+
`)]),q(`slider-dots`,[q(`slider-dot`,`
|
|
882
|
+
transform: translateX(50%, -50%);
|
|
883
|
+
`)]),U(`vertical`,[q(`slider-handles`,[q(`slider-handle-wrapper`,`
|
|
884
|
+
transform: translate(-50%, -50%);
|
|
885
|
+
`)]),q(`slider-marks`,[q(`slider-mark`,`
|
|
886
|
+
transform: translateY(calc(-50% + var(--n-dot-height) / 2));
|
|
887
|
+
`)]),q(`slider-dots`,[q(`slider-dot`,`
|
|
888
|
+
transform: translateX(-50%) translateY(0);
|
|
889
|
+
`)])])]),U(`vertical`,`
|
|
890
|
+
box-sizing: content-box;
|
|
891
|
+
padding: 0 calc((var(--n-handle-size) - var(--n-rail-height)) / 2);
|
|
892
|
+
width: var(--n-rail-width-vertical);
|
|
893
|
+
height: 100%;
|
|
894
|
+
`,[q(`slider-handles`,`
|
|
895
|
+
top: calc(var(--n-handle-size) / 2);
|
|
896
|
+
right: 0;
|
|
897
|
+
bottom: calc(var(--n-handle-size) / 2);
|
|
898
|
+
left: 0;
|
|
899
|
+
`,[q(`slider-handle-wrapper`,`
|
|
900
|
+
top: unset;
|
|
901
|
+
left: 50%;
|
|
902
|
+
transform: translate(-50%, 50%);
|
|
903
|
+
`)]),q(`slider-rail`,`
|
|
904
|
+
height: 100%;
|
|
905
|
+
`,[V(`fill`,`
|
|
906
|
+
top: unset;
|
|
907
|
+
right: 0;
|
|
908
|
+
bottom: unset;
|
|
909
|
+
left: 0;
|
|
910
|
+
`)]),U(`with-mark`,`
|
|
911
|
+
width: var(--n-rail-width-vertical);
|
|
912
|
+
margin: 0 32px 0 8px;
|
|
913
|
+
`),q(`slider-marks`,`
|
|
914
|
+
top: calc(var(--n-handle-size) / 2);
|
|
915
|
+
right: unset;
|
|
916
|
+
bottom: calc(var(--n-handle-size) / 2);
|
|
917
|
+
left: 22px;
|
|
918
|
+
font-size: var(--n-mark-font-size);
|
|
919
|
+
`,[q(`slider-mark`,`
|
|
920
|
+
transform: translateY(50%);
|
|
921
|
+
white-space: nowrap;
|
|
922
|
+
`)]),q(`slider-dots`,`
|
|
923
|
+
top: calc(var(--n-handle-size) / 2);
|
|
924
|
+
right: unset;
|
|
925
|
+
bottom: calc(var(--n-handle-size) / 2);
|
|
926
|
+
left: 50%;
|
|
927
|
+
`,[q(`slider-dot`,`
|
|
928
|
+
transform: translateX(-50%) translateY(50%);
|
|
929
|
+
`)])]),U(`disabled`,`
|
|
930
|
+
cursor: not-allowed;
|
|
931
|
+
opacity: var(--n-opacity-disabled);
|
|
932
|
+
`,[q(`slider-handle`,`
|
|
933
|
+
cursor: not-allowed;
|
|
934
|
+
`)]),U(`with-mark`,`
|
|
935
|
+
width: 100%;
|
|
936
|
+
margin: 8px 0 32px 0;
|
|
937
|
+
`),B(`&:hover`,[q(`slider-rail`,{backgroundColor:`var(--n-rail-color-hover)`},[V(`fill`,{backgroundColor:`var(--n-fill-color-hover)`})]),q(`slider-handle`,{boxShadow:`var(--n-handle-box-shadow-hover)`})]),U(`active`,[q(`slider-rail`,{backgroundColor:`var(--n-rail-color-hover)`},[V(`fill`,{backgroundColor:`var(--n-fill-color-hover)`})]),q(`slider-handle`,{boxShadow:`var(--n-handle-box-shadow-hover)`})]),q(`slider-marks`,`
|
|
938
|
+
position: absolute;
|
|
939
|
+
top: 18px;
|
|
940
|
+
left: calc(var(--n-handle-size) / 2);
|
|
941
|
+
right: calc(var(--n-handle-size) / 2);
|
|
942
|
+
`,[q(`slider-mark`,`
|
|
943
|
+
position: absolute;
|
|
944
|
+
transform: translateX(-50%);
|
|
945
|
+
white-space: nowrap;
|
|
946
|
+
`)]),q(`slider-rail`,`
|
|
947
|
+
width: 100%;
|
|
948
|
+
position: relative;
|
|
949
|
+
height: var(--n-rail-height);
|
|
950
|
+
background-color: var(--n-rail-color);
|
|
951
|
+
transition: background-color .3s var(--n-bezier);
|
|
952
|
+
border-radius: calc(var(--n-rail-height) / 2);
|
|
953
|
+
`,[V(`fill`,`
|
|
954
|
+
position: absolute;
|
|
955
|
+
top: 0;
|
|
956
|
+
bottom: 0;
|
|
957
|
+
border-radius: calc(var(--n-rail-height) / 2);
|
|
958
|
+
transition: background-color .3s var(--n-bezier);
|
|
959
|
+
background-color: var(--n-fill-color);
|
|
960
|
+
`)]),q(`slider-handles`,`
|
|
961
|
+
position: absolute;
|
|
962
|
+
top: 0;
|
|
963
|
+
right: calc(var(--n-handle-size) / 2);
|
|
964
|
+
bottom: 0;
|
|
965
|
+
left: calc(var(--n-handle-size) / 2);
|
|
966
|
+
`,[q(`slider-handle-wrapper`,`
|
|
967
|
+
outline: none;
|
|
968
|
+
position: absolute;
|
|
969
|
+
top: 50%;
|
|
970
|
+
transform: translate(-50%, -50%);
|
|
971
|
+
cursor: pointer;
|
|
972
|
+
display: flex;
|
|
973
|
+
`,[q(`slider-handle`,`
|
|
974
|
+
height: var(--n-handle-size);
|
|
975
|
+
width: var(--n-handle-size);
|
|
976
|
+
border-radius: 50%;
|
|
977
|
+
overflow: hidden;
|
|
978
|
+
transition: box-shadow .2s var(--n-bezier), background-color .3s var(--n-bezier);
|
|
979
|
+
background-color: var(--n-handle-color);
|
|
980
|
+
box-shadow: var(--n-handle-box-shadow);
|
|
981
|
+
`,[B(`&:hover`,`
|
|
982
|
+
box-shadow: var(--n-handle-box-shadow-hover);
|
|
983
|
+
`)]),B(`&:focus`,[q(`slider-handle`,`
|
|
984
|
+
box-shadow: var(--n-handle-box-shadow-focus);
|
|
985
|
+
`,[B(`&:hover`,`
|
|
986
|
+
box-shadow: var(--n-handle-box-shadow-active);
|
|
987
|
+
`)])])])]),q(`slider-dots`,`
|
|
988
|
+
position: absolute;
|
|
989
|
+
top: 50%;
|
|
990
|
+
left: calc(var(--n-handle-size) / 2);
|
|
991
|
+
right: calc(var(--n-handle-size) / 2);
|
|
992
|
+
`,[U(`transition-disabled`,[q(`slider-dot`,`transition: none;`)]),q(`slider-dot`,`
|
|
993
|
+
transition:
|
|
994
|
+
border-color .3s var(--n-bezier),
|
|
995
|
+
box-shadow .3s var(--n-bezier),
|
|
996
|
+
background-color .3s var(--n-bezier);
|
|
997
|
+
position: absolute;
|
|
998
|
+
transform: translate(-50%, -50%);
|
|
999
|
+
height: var(--n-dot-height);
|
|
1000
|
+
width: var(--n-dot-width);
|
|
1001
|
+
border-radius: var(--n-dot-border-radius);
|
|
1002
|
+
overflow: hidden;
|
|
1003
|
+
box-sizing: border-box;
|
|
1004
|
+
border: var(--n-dot-border);
|
|
1005
|
+
background-color: var(--n-dot-color);
|
|
1006
|
+
`,[U(`active`,`border: var(--n-dot-border-active);`)])])]),q(`slider-handle-indicator`,`
|
|
1007
|
+
font-size: var(--n-font-size);
|
|
1008
|
+
padding: 6px 10px;
|
|
1009
|
+
border-radius: var(--n-indicator-border-radius);
|
|
1010
|
+
color: var(--n-indicator-text-color);
|
|
1011
|
+
background-color: var(--n-indicator-color);
|
|
1012
|
+
box-shadow: var(--n-indicator-box-shadow);
|
|
1013
|
+
`,[ke()]),q(`slider-handle-indicator`,`
|
|
1014
|
+
font-size: var(--n-font-size);
|
|
1015
|
+
padding: 6px 10px;
|
|
1016
|
+
border-radius: var(--n-indicator-border-radius);
|
|
1017
|
+
color: var(--n-indicator-text-color);
|
|
1018
|
+
background-color: var(--n-indicator-color);
|
|
1019
|
+
box-shadow: var(--n-indicator-box-shadow);
|
|
1020
|
+
`,[U(`top`,`
|
|
1021
|
+
margin-bottom: 12px;
|
|
1022
|
+
`),U(`right`,`
|
|
1023
|
+
margin-left: 12px;
|
|
1024
|
+
`),U(`bottom`,`
|
|
1025
|
+
margin-top: 12px;
|
|
1026
|
+
`),U(`left`,`
|
|
1027
|
+
margin-right: 12px;
|
|
1028
|
+
`),ke()]),G(q(`slider`,[q(`slider-dot`,`background-color: var(--n-dot-color-modal);`)])),W(q(`slider`,[q(`slider-dot`,`background-color: var(--n-dot-color-popover);`)]))]);function $r(e){return window.TouchEvent&&e instanceof window.TouchEvent}function ei(){let e=new Map;return t(()=>{e.clear()}),[e,t=>n=>{e.set(t,n)}]}var ti=0,ni=E({name:`Slider`,props:Object.assign(Object.assign({},K.props),{to:Oe.propTo,defaultValue:{type:[Number,Array],default:0},marks:Object,disabled:{type:Boolean,default:void 0},formatTooltip:Function,keyboard:{type:Boolean,default:!0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:[Number,String],default:1},range:Boolean,value:[Number,Array],placement:String,showTooltip:{type:Boolean,default:void 0},tooltip:{type:Boolean,default:!0},vertical:Boolean,reverse:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onDragstart:[Function],onDragend:[Function]}),slots:Object,setup(e){let{mergedClsPrefixRef:t,namespaceRef:n,inlineThemeDisabled:r}=A(e),a=K(`Slider`,`-slider`,Qr,Jr,e,t),o=w(null),[s,c]=ei(),[l,u]=ei(),f=w(new Set),p=k(e),{mergedDisabledRef:h}=p,g=x(()=>{let{step:t}=e;if(Number(t)<=0||t===`mark`)return 0;let n=t.toString(),r=0;return n.includes(`.`)&&(r=n.length-n.indexOf(`.`)-1),r}),_=w(e.defaultValue),v=Ke(m(e,`value`),_),y=x(()=>{let{value:t}=v;return(e.range?t:[t]).map(te)}),S=x(()=>y.value.length>2),C=x(()=>e.placement===void 0?e.vertical?`right`:`top`:e.placement),T=x(()=>{let{marks:t}=e;return t?Object.keys(t).map(Number.parseFloat):null}),E=w(-1),D=w(-1),O=w(-1),j=w(!1),M=w(!1),N=x(()=>{let{vertical:t,reverse:n}=e;return t?n?`top`:`bottom`:n?`right`:`left`}),F=x(()=>{if(S.value)return;let t=y.value,n=q(e.range?Math.min(...t):e.min),r=q(e.range?Math.max(...t):t[0]),{value:i}=N;return e.vertical?{[i]:`${n}%`,height:`${r-n}%`}:{[i]:`${n}%`,width:`${r-n}%`}}),L=x(()=>{let t=[],{marks:n}=e;if(n){let r=y.value.slice();r.sort((e,t)=>e-t);let{value:i}=N,{value:a}=S,{range:o}=e,s=a?()=>!1:e=>o?e>=r[0]&&e<=r[r.length-1]:e<=r[0];for(let e of Object.keys(n)){let r=Number(e);t.push({active:s(r),key:r,label:n[e],style:{[i]:`${q(r)}%`}})}}return t});function R(e,t){let n=q(e),{value:r}=N;return{[r]:`${n}%`,zIndex:+(t===E.value)}}function z(t){return e.showTooltip||O.value===t||E.value===t&&j.value}function B(e){return j.value?!(E.value===e&&D.value===e):!0}function V(e){var t;~e&&(E.value=e,(t=s.get(e))==null||t.focus())}function H(){l.forEach((e,t)=>{z(t)&&e.syncPosition()})}function U(t){let{"onUpdate:value":n,onUpdateValue:r}=e,{nTriggerFormInput:i,nTriggerFormChange:a}=p;r&&I(r,t),n&&I(n,t),_.value=t,i(),a()}function W(t){let{range:n}=e;if(n){if(Array.isArray(t)){let{value:e}=y;t.join()!==e.join()&&U(t)}}else Array.isArray(t)||y.value[0]!==t&&U(t)}function G(t,n){if(e.range){let e=y.value.slice();e.splice(n,1,t),W(e)}else W(t)}function ee(t,n,r){let i=r!==void 0;r||=t-n>0?1:-1;let a=T.value||[],{step:o}=e;if(o===`mark`){let e=ie(t,a.concat(n),i?r:void 0);return e?e.value:n}if(o<=0)return n;let{value:s}=g,c;if(i){let e=Number((n/o).toFixed(s)),t=Math.floor(e),i=e>t?t:t-1,l=e<t?t:t+1;c=ie(n,[Number((i*o).toFixed(s)),Number((l*o).toFixed(s)),...a],r)}else{let e=re(t);c=ie(t,[...a,e])}return c?te(c.value):n}function te(t){return Math.min(e.max,Math.max(e.min,t))}function q(t){let{max:n,min:r}=e;return(t-r)/(n-r)*100}function J(t){let{max:n,min:r}=e;return r+(n-r)*t}function re(t){let{step:n,min:r}=e;if(Number(n)<=0||n===`mark`)return t;let i=Math.round((t-r)/n)*n+r;return Number(i.toFixed(g.value))}function ie(e,t=T.value,n){if(!t?.length)return null;let r=null,i=-1;for(;++i<t.length;){let a=t[i]-e,o=Math.abs(a);(n===void 0||a*n>0)&&(r===null||o<r.distance)&&(r={index:i,distance:o,value:t[i]})}return r}function Y(t){let n=o.value;if(!n)return;let r=$r(t)?t.touches[0]:t,i=n.getBoundingClientRect(),a;return a=e.vertical?(i.bottom-r.clientY)/i.height:(r.clientX-i.left)/i.width,e.reverse&&(a=1-a),J(a)}function ae(t){if(h.value||!e.keyboard)return;let{vertical:n,reverse:r}=e;switch(t.key){case`ArrowUp`:t.preventDefault(),X(n&&r?-1:1);break;case`ArrowRight`:t.preventDefault(),X(!n&&r?-1:1);break;case`ArrowDown`:t.preventDefault(),X(n&&r?1:-1);break;case`ArrowLeft`:t.preventDefault(),X(!n&&r?1:-1);break}}function X(t){let n=E.value;if(n===-1)return;let{step:r}=e,i=y.value[n];G(ee(Number(r)<=0||r===`mark`?i:i+r*t,i,t>0?1:-1),n)}function Z(t){if(h.value||!$r(t)&&t.button!==ti)return;let n=Y(t);if(n===void 0)return;let r=y.value.slice(),i=e.range?ie(n,r)?.index??-1:0;i!==-1&&(t.preventDefault(),V(i),oe(),G(ee(n,y.value[i]),i))}function oe(){j.value||(j.value=!0,e.onDragstart&&I(e.onDragstart),We(`touchend`,document,ce),We(`mouseup`,document,ce),We(`touchmove`,document,Q),We(`mousemove`,document,Q))}function se(){j.value&&(j.value=!1,e.onDragend&&I(e.onDragend),Ge(`touchend`,document,ce),Ge(`mouseup`,document,ce),Ge(`touchmove`,document,Q),Ge(`mousemove`,document,Q))}function Q(e){let{value:t}=E;if(!j.value||t===-1){se();return}let n=Y(e);n!==void 0&&G(ee(n,y.value[t]),t)}function ce(){se()}function le(e){E.value=e,h.value||(O.value=e)}function ue(e){E.value===e&&(E.value=-1,se()),O.value===e&&(O.value=-1)}function de(e){O.value=e}function fe(e){O.value===e&&(O.value=-1)}d(E,(e,t)=>void i(()=>D.value=t)),d(v,()=>{if(e.marks){if(M.value)return;M.value=!0,i(()=>{M.value=!1})}i(H)}),b(()=>{se()});let pe=x(()=>{let{self:{markFontSize:e,railColor:t,railColorHover:n,fillColor:r,fillColorHover:i,handleColor:o,opacityDisabled:s,dotColor:c,dotColorModal:l,handleBoxShadow:u,handleBoxShadowHover:d,handleBoxShadowActive:f,handleBoxShadowFocus:p,dotBorder:m,dotBoxShadow:h,railHeight:g,railWidthVertical:_,handleSize:v,dotHeight:y,dotWidth:b,dotBorderRadius:x,fontSize:S,dotBorderActive:C,dotColorPopover:w},common:{cubicBezierEaseInOut:T}}=a.value;return{"--n-bezier":T,"--n-dot-border":m,"--n-dot-border-active":C,"--n-dot-border-radius":x,"--n-dot-box-shadow":h,"--n-dot-color":c,"--n-dot-color-modal":l,"--n-dot-color-popover":w,"--n-dot-height":y,"--n-dot-width":b,"--n-fill-color":r,"--n-fill-color-hover":i,"--n-font-size":S,"--n-handle-box-shadow":u,"--n-handle-box-shadow-active":f,"--n-handle-box-shadow-focus":p,"--n-handle-box-shadow-hover":d,"--n-handle-color":o,"--n-handle-size":v,"--n-opacity-disabled":s,"--n-rail-color":t,"--n-rail-color-hover":n,"--n-rail-height":g,"--n-rail-width-vertical":_,"--n-mark-font-size":e}}),me=r?P(`slider`,void 0,pe,e):void 0,he=x(()=>{let{self:{fontSize:e,indicatorColor:t,indicatorBoxShadow:n,indicatorTextColor:r,indicatorBorderRadius:i}}=a.value;return{"--n-font-size":e,"--n-indicator-border-radius":i,"--n-indicator-box-shadow":n,"--n-indicator-color":t,"--n-indicator-text-color":r}}),ge=r?P(`slider-indicator`,void 0,he,e):void 0;return{mergedClsPrefix:t,namespace:n,uncontrolledValue:_,mergedValue:v,mergedDisabled:h,mergedPlacement:C,isMounted:ne(),adjustedTo:Oe(e),dotTransitionDisabled:M,markInfos:L,isShowTooltip:z,shouldKeepTooltipTransition:B,handleRailRef:o,setHandleRefs:c,setFollowerRefs:u,fillStyle:F,getHandleStyle:R,activeIndex:E,arrifiedValues:y,followerEnabledIndexSet:f,handleRailMouseDown:Z,handleHandleFocus:le,handleHandleBlur:ue,handleHandleMouseEnter:de,handleHandleMouseLeave:fe,handleRailKeyDown:ae,indicatorCssVars:r?void 0:he,indicatorThemeClass:ge?.themeClass,indicatorOnRender:ge?.onRender,cssVars:r?void 0:pe,themeClass:me?.themeClass,onRender:me?.onRender}},render(){var e;let{mergedClsPrefix:t,themeClass:n,formatTooltip:r}=this;return(e=this.onRender)==null||e.call(this),O(`div`,{class:[`${t}-slider`,n,{[`${t}-slider--disabled`]:this.mergedDisabled,[`${t}-slider--active`]:this.activeIndex!==-1,[`${t}-slider--with-mark`]:this.marks,[`${t}-slider--vertical`]:this.vertical,[`${t}-slider--reverse`]:this.reverse}],style:this.cssVars,onKeydown:this.handleRailKeyDown,onMousedown:this.handleRailMouseDown,onTouchstart:this.handleRailMouseDown},O(`div`,{class:`${t}-slider-rail`},O(`div`,{class:`${t}-slider-rail__fill`,style:this.fillStyle}),this.marks?O(`div`,{class:[`${t}-slider-dots`,this.dotTransitionDisabled&&`${t}-slider-dots--transition-disabled`]},this.markInfos.map(e=>O(`div`,{key:e.key,class:[`${t}-slider-dot`,{[`${t}-slider-dot--active`]:e.active}],style:e.style}))):null,O(`div`,{ref:`handleRailRef`,class:`${t}-slider-handles`},this.arrifiedValues.map((e,n)=>{let i=this.isShowTooltip(n);return O(Te,null,{default:()=>[O(pe,null,{default:()=>O(`div`,{ref:this.setHandleRefs(n),class:`${t}-slider-handle-wrapper`,tabindex:this.mergedDisabled?-1:0,role:`slider`,"aria-valuenow":e,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-orientation":this.vertical?`vertical`:`horizontal`,"aria-disabled":this.disabled,style:this.getHandleStyle(e,n),onFocus:()=>{this.handleHandleFocus(n)},onBlur:()=>{this.handleHandleBlur(n)},onMouseenter:()=>{this.handleHandleMouseEnter(n)},onMouseleave:()=>{this.handleHandleMouseLeave(n)}},ae(this.$slots.thumb,()=>[O(`div`,{class:`${t}-slider-handle`})]))}),this.tooltip&&O(_e,{ref:this.setFollowerRefs(n),show:i,to:this.adjustedTo,enabled:this.showTooltip&&!this.range||this.followerEnabledIndexSet.has(n),teleportDisabled:this.adjustedTo===Oe.tdkey,placement:this.mergedPlacement,containerClass:this.namespace},{default:()=>O(le,{name:`fade-in-scale-up-transition`,appear:this.isMounted,css:this.shouldKeepTooltipTransition(n),onEnter:()=>{this.followerEnabledIndexSet.add(n)},onAfterLeave:()=>{this.followerEnabledIndexSet.delete(n)}},{default:()=>{var n;return i?((n=this.indicatorOnRender)==null||n.call(this),O(`div`,{class:[`${t}-slider-handle-indicator`,this.indicatorThemeClass,`${t}-slider-handle-indicator--${this.mergedPlacement}`],style:this.indicatorCssVars},typeof r==`function`?r(e):e)):null}})})]})})),this.marks?O(`div`,{class:`${t}-slider-marks`},this.markInfos.map(e=>O(`div`,{key:e.key,class:`${t}-slider-mark`,style:e.style},typeof e.label==`function`?e.label():e.label))):null))}}),ri=q(`switch`,`
|
|
1029
|
+
height: var(--n-height);
|
|
1030
|
+
min-width: var(--n-width);
|
|
1031
|
+
vertical-align: middle;
|
|
1032
|
+
user-select: none;
|
|
1033
|
+
-webkit-user-select: none;
|
|
1034
|
+
display: inline-flex;
|
|
1035
|
+
outline: none;
|
|
1036
|
+
justify-content: center;
|
|
1037
|
+
align-items: center;
|
|
1038
|
+
`,[V(`children-placeholder`,`
|
|
1039
|
+
height: var(--n-rail-height);
|
|
1040
|
+
display: flex;
|
|
1041
|
+
flex-direction: column;
|
|
1042
|
+
overflow: hidden;
|
|
1043
|
+
pointer-events: none;
|
|
1044
|
+
visibility: hidden;
|
|
1045
|
+
`),V(`rail-placeholder`,`
|
|
1046
|
+
display: flex;
|
|
1047
|
+
flex-wrap: none;
|
|
1048
|
+
`),V(`button-placeholder`,`
|
|
1049
|
+
width: calc(1.75 * var(--n-rail-height));
|
|
1050
|
+
height: var(--n-rail-height);
|
|
1051
|
+
`),q(`base-loading`,`
|
|
1052
|
+
position: absolute;
|
|
1053
|
+
top: 50%;
|
|
1054
|
+
left: 50%;
|
|
1055
|
+
transform: translateX(-50%) translateY(-50%);
|
|
1056
|
+
font-size: calc(var(--n-button-width) - 4px);
|
|
1057
|
+
color: var(--n-loading-color);
|
|
1058
|
+
transition: color .3s var(--n-bezier);
|
|
1059
|
+
`,[re({left:`50%`,top:`50%`,originalTransform:`translateX(-50%) translateY(-50%)`})]),V(`checked, unchecked`,`
|
|
1060
|
+
transition: color .3s var(--n-bezier);
|
|
1061
|
+
color: var(--n-text-color);
|
|
1062
|
+
box-sizing: border-box;
|
|
1063
|
+
position: absolute;
|
|
1064
|
+
white-space: nowrap;
|
|
1065
|
+
top: 0;
|
|
1066
|
+
bottom: 0;
|
|
1067
|
+
display: flex;
|
|
1068
|
+
align-items: center;
|
|
1069
|
+
line-height: 1;
|
|
1070
|
+
`),V(`checked`,`
|
|
1071
|
+
right: 0;
|
|
1072
|
+
padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
1073
|
+
`),V(`unchecked`,`
|
|
1074
|
+
left: 0;
|
|
1075
|
+
justify-content: flex-end;
|
|
1076
|
+
padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
|
|
1077
|
+
`),B(`&:focus`,[V(`rail`,`
|
|
1078
|
+
box-shadow: var(--n-box-shadow-focus);
|
|
1079
|
+
`)]),U(`round`,[V(`rail`,`border-radius: calc(var(--n-rail-height) / 2);`,[V(`button`,`border-radius: calc(var(--n-button-height) / 2);`)])]),Y(`disabled`,[Y(`icon`,[U(`rubber-band`,[U(`pressed`,[V(`rail`,[V(`button`,`max-width: var(--n-button-width-pressed);`)])]),V(`rail`,[B(`&:active`,[V(`button`,`max-width: var(--n-button-width-pressed);`)])]),U(`active`,[U(`pressed`,[V(`rail`,[V(`button`,`left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));`)])]),V(`rail`,[B(`&:active`,[V(`button`,`left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));`)])])])])])]),U(`active`,[V(`rail`,[V(`button`,`left: calc(100% - var(--n-button-width) - var(--n-offset))`)])]),V(`rail`,`
|
|
1080
|
+
overflow: hidden;
|
|
1081
|
+
height: var(--n-rail-height);
|
|
1082
|
+
min-width: var(--n-rail-width);
|
|
1083
|
+
border-radius: var(--n-rail-border-radius);
|
|
1084
|
+
cursor: pointer;
|
|
1085
|
+
position: relative;
|
|
1086
|
+
transition:
|
|
1087
|
+
opacity .3s var(--n-bezier),
|
|
1088
|
+
background .3s var(--n-bezier),
|
|
1089
|
+
box-shadow .3s var(--n-bezier);
|
|
1090
|
+
background-color: var(--n-rail-color);
|
|
1091
|
+
`,[V(`button-icon`,`
|
|
1092
|
+
color: var(--n-icon-color);
|
|
1093
|
+
transition: color .3s var(--n-bezier);
|
|
1094
|
+
font-size: calc(var(--n-button-height) - 4px);
|
|
1095
|
+
position: absolute;
|
|
1096
|
+
left: 0;
|
|
1097
|
+
right: 0;
|
|
1098
|
+
top: 0;
|
|
1099
|
+
bottom: 0;
|
|
1100
|
+
display: flex;
|
|
1101
|
+
justify-content: center;
|
|
1102
|
+
align-items: center;
|
|
1103
|
+
line-height: 1;
|
|
1104
|
+
`,[re()]),V(`button`,`
|
|
1105
|
+
align-items: center;
|
|
1106
|
+
top: var(--n-offset);
|
|
1107
|
+
left: var(--n-offset);
|
|
1108
|
+
height: var(--n-button-height);
|
|
1109
|
+
width: var(--n-button-width-pressed);
|
|
1110
|
+
max-width: var(--n-button-width);
|
|
1111
|
+
border-radius: var(--n-button-border-radius);
|
|
1112
|
+
background-color: var(--n-button-color);
|
|
1113
|
+
box-shadow: var(--n-button-box-shadow);
|
|
1114
|
+
box-sizing: border-box;
|
|
1115
|
+
cursor: inherit;
|
|
1116
|
+
content: "";
|
|
1117
|
+
position: absolute;
|
|
1118
|
+
transition:
|
|
1119
|
+
background-color .3s var(--n-bezier),
|
|
1120
|
+
left .3s var(--n-bezier),
|
|
1121
|
+
opacity .3s var(--n-bezier),
|
|
1122
|
+
max-width .3s var(--n-bezier),
|
|
1123
|
+
box-shadow .3s var(--n-bezier);
|
|
1124
|
+
`)]),U(`active`,[V(`rail`,`background-color: var(--n-rail-color-active);`)]),U(`loading`,[V(`rail`,`
|
|
1125
|
+
cursor: wait;
|
|
1126
|
+
`)]),U(`disabled`,[V(`rail`,`
|
|
1127
|
+
cursor: not-allowed;
|
|
1128
|
+
opacity: .5;
|
|
1129
|
+
`)])]),ii=Object.assign(Object.assign({},K.props),{size:String,value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},spinProps:Object,onChange:[Function,Array]}),ai,oi=E({name:`Switch`,props:ii,slots:Object,setup(e){ai===void 0&&(ai=typeof CSS<`u`?CSS.supports===void 0?!1:CSS.supports(`width`,`max(1px)`):!0);let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=A(e),i=K(`Switch`,`-switch`,ri,Zr,e,t),a=k(e,{mergedSize(t){return e.size===void 0?t?t.mergedSize.value:r?.value?.Switch?.size||`medium`:e.size}}),{mergedSizeRef:o,mergedDisabledRef:s}=a,c=w(e.defaultValue),l=Ke(m(e,`value`),c),u=x(()=>l.value===e.checkedValue),d=w(!1),f=w(!1),p=x(()=>{let{railStyle:t}=e;if(t)return t({focused:f.value,checked:u.value})});function h(t){let{"onUpdate:value":n,onChange:r,onUpdateValue:i}=e,{nTriggerFormInput:o,nTriggerFormChange:s}=a;n&&I(n,t),i&&I(i,t),r&&I(r,t),c.value=t,o(),s()}function g(){let{nTriggerFormFocus:e}=a;e()}function _(){let{nTriggerFormBlur:e}=a;e()}function v(){e.loading||s.value||(l.value===e.checkedValue?h(e.uncheckedValue):h(e.checkedValue))}function y(){f.value=!0,g()}function b(){f.value=!1,_(),d.value=!1}function S(t){e.loading||s.value||t.key===` `&&(l.value===e.checkedValue?h(e.uncheckedValue):h(e.checkedValue),d.value=!1)}function C(t){e.loading||s.value||t.key===` `&&(t.preventDefault(),d.value=!0)}let T=x(()=>{let{value:e}=o,{self:{opacityDisabled:t,railColor:n,railColorActive:r,buttonBoxShadow:a,buttonColor:s,boxShadowFocus:c,loadingColor:l,textColor:u,iconColor:d,[J(`buttonHeight`,e)]:f,[J(`buttonWidth`,e)]:p,[J(`buttonWidthPressed`,e)]:m,[J(`railHeight`,e)]:h,[J(`railWidth`,e)]:g,[J(`railBorderRadius`,e)]:_,[J(`buttonBorderRadius`,e)]:v},common:{cubicBezierEaseInOut:y}}=i.value,b,x,S;return ai?(b=`calc((${h} - ${f}) / 2)`,x=`max(${h}, ${f})`,S=`max(${g}, calc(${g} + ${f} - ${h}))`):(b=$((He(h)-He(f))/2),x=$(Math.max(He(h),He(f))),S=He(h)>He(f)?g:$(He(g)+He(f)-He(h))),{"--n-bezier":y,"--n-button-border-radius":v,"--n-button-box-shadow":a,"--n-button-color":s,"--n-button-width":p,"--n-button-width-pressed":m,"--n-button-height":f,"--n-height":x,"--n-offset":b,"--n-opacity-disabled":t,"--n-rail-border-radius":_,"--n-rail-color":n,"--n-rail-color-active":r,"--n-rail-height":h,"--n-rail-width":g,"--n-width":S,"--n-box-shadow-focus":c,"--n-loading-color":l,"--n-text-color":u,"--n-icon-color":d}}),E=n?P(`switch`,x(()=>o.value[0]),T,e):void 0;return{handleClick:v,handleBlur:b,handleFocus:y,handleKeyup:S,handleKeydown:C,mergedRailStyle:p,pressed:d,mergedClsPrefix:t,mergedValue:l,checked:u,mergedDisabled:s,cssVars:n?void 0:T,themeClass:E?.themeClass,onRender:E?.onRender}},render(){let{mergedClsPrefix:e,mergedDisabled:t,checked:n,mergedRailStyle:r,onRender:i,$slots:a}=this;i?.();let{checked:o,unchecked:s,icon:c,"checked-icon":l,"unchecked-icon":u}=a,d=!(j(c)&&j(l)&&j(u));return O(`div`,{role:`switch`,"aria-checked":n,class:[`${e}-switch`,this.themeClass,d&&`${e}-switch--icon`,n&&`${e}-switch--active`,t&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},O(`div`,{class:`${e}-switch__rail`,"aria-hidden":`true`,style:r},L(o,t=>L(s,n=>t||n?O(`div`,{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},O(`div`,{class:`${e}-switch__rail-placeholder`},O(`div`,{class:`${e}-switch__button-placeholder`}),t),O(`div`,{class:`${e}-switch__rail-placeholder`},O(`div`,{class:`${e}-switch__button-placeholder`}),n)):null)),O(`div`,{class:`${e}-switch__button`},L(c,t=>L(l,n=>L(u,r=>O(oe,null,{default:()=>this.loading?O(ee,Object.assign({key:`loading`,clsPrefix:e,strokeWidth:20},this.spinProps)):this.checked&&(n||t)?O(`div`,{class:`${e}-switch__button-icon`,key:n?`checked-icon`:`icon`},n||t):!this.checked&&(r||t)?O(`div`,{class:`${e}-switch__button-icon`,key:r?`unchecked-icon`:`icon`},r||t):null})))),L(o,t=>t&&O(`div`,{key:`checked`,class:`${e}-switch__checked`},t)),L(s,t=>t&&O(`div`,{key:`unchecked`,class:`${e}-switch__unchecked`},t)))))}}),si={class:`settings-view`},ci={class:`settings-content`},li={class:`settings-section`},ui={class:`form-group`},di={class:`connection-status`},fi={key:0,class:`version`},pi={class:`settings-section`},mi={class:`form-group`},hi={class:`current-model`},gi={key:0,class:`form-group`},_i={class:`settings-section`},vi={class:`form-group`},yi={class:`form-group`},bi={class:`form-group`},xi={class:`form-label`},Si={class:`settings-section`},Ci={class:`endpoint-table`},wi=se(E({__name:`SettingsView`,setup(e){let t=ct(),n=st(),i=w(!1);async function s(){i.value=!0;try{await t.checkConnection(),t.connected?n.success(`Connected successfully`):n.error(`Connection failed`)}catch(e){n.error(e.message)}finally{i.value=!1}}let c=[{title:`Provider`,key:`provider`},{title:`Models`,key:`models`},{title:`Base URL`,key:`base_url`}],l=[{method:`GET`,endpoint:`/health`,description:`Health Check`},{method:`POST`,endpoint:`/v1/runs`,description:`Start Async Run`},{method:`GET`,endpoint:`/v1/runs/{id}/events`,description:`SSE Event Stream`},{method:`GET`,endpoint:`/api/jobs`,description:`List Jobs`},{method:`POST`,endpoint:`/api/jobs`,description:`Create Job`},{method:`POST`,endpoint:`/api/jobs/{id}/run`,description:`Trigger Job Now`}];return(e,n)=>(a(),S(`div`,si,[n[14]||=T(`header`,{class:`settings-header`},[T(`h2`,{class:`header-title`},`Settings`)],-1),T(`div`,ci,[T(`section`,li,[n[4]||=T(`h3`,{class:`section-title`},`API Configuration`,-1),T(`div`,ui,[T(`div`,di,[T(`span`,{class:r([`status-dot`,{on:C(t).connected,off:!C(t).connected}])},null,2),T(`span`,null,D(C(t).connected?`Connected`:`Disconnected`),1),C(t).serverVersion?(a(),S(`span`,fi,`v`+D(C(t).serverVersion),1)):g(``,!0)]),p(C($e),{type:`primary`,size:`small`,loading:i.value,onClick:s},{default:o(()=>[...n[3]||=[_(` Test Connection `,-1)]]),_:1},8,[`loading`])])]),T(`section`,pi,[n[8]||=T(`h3`,{class:`section-title`},`Model Management`,-1),T(`div`,mi,[n[5]||=T(`label`,{class:`form-label`},`Current Model`,-1),T(`div`,hi,D(C(t).selectedModel||`Not set`),1)]),C(t).modelGroups.length>0?(a(),S(`div`,gi,[n[6]||=T(`label`,{class:`form-label`},`Available Models`,-1),n[7]||=T(`p`,{class:`form-hint`},`Models are discovered from ~/.hermes/auth.json credential pool. Use the sidebar selector to switch.`,-1),p(C(Gr),{columns:c,data:C(t).modelGroups.map(e=>({provider:e.label,models:e.models.join(`, `),base_url:e.base_url})),bordered:!1,size:`small`,"row-props":()=>({style:`cursor: default;`})},null,8,[`data`])])):g(``,!0)]),T(`section`,_i,[n[11]||=T(`h3`,{class:`section-title`},`Chat Settings`,-1),T(`div`,vi,[n[9]||=T(`label`,{class:`form-label`},`Stream Responses`,-1),p(C(oi),{value:C(t).streamEnabled,"onUpdate:value":n[0]||=e=>C(t).streamEnabled=e},null,8,[`value`])]),T(`div`,yi,[n[10]||=T(`label`,{class:`form-label`},`Session Persistence`,-1),p(C(oi),{value:C(t).sessionPersistence,"onUpdate:value":n[1]||=e=>C(t).sessionPersistence=e},null,8,[`value`])]),T(`div`,bi,[T(`label`,xi,`Max Tokens: `+D(C(t).maxTokens),1),p(C(ni),{value:C(t).maxTokens,"onUpdate:value":n[2]||=e=>C(t).maxTokens=e,min:256,max:32768,step:256},null,8,[`value`])])]),T(`section`,Si,[n[12]||=T(`h3`,{class:`section-title`},`About`,-1),n[13]||=T(`p`,{class:`about-text`},[_(` Hermes Agent Web UI `),T(`br`),_(`Version 0.1.3 `)],-1),T(`div`,Ci,[p(C(Gr),{columns:[{title:`Method`,key:`method`,width:80},{title:`Endpoint`,key:`endpoint`},{title:`Description`,key:`description`}],data:l,bordered:!1,size:`small`,"row-props":()=>({style:`cursor: default;`})})])])])]))}}),[[`__scopeId`,`data-v-67e10768`]]);export{wi as default};
|