hermes-web-ui 0.1.3 → 0.1.5
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 +19 -2
- package/dist/assets/ChatView-Cwa-sap0.js +18 -0
- package/dist/assets/ChatView-Dio4HD6Y.css +1 -0
- package/dist/assets/Dropdown-8pId5Qsj.js +125 -0
- package/dist/assets/Input-BZKSQ403.js +234 -0
- package/dist/assets/JobsView-CQf4Y7Mw.js +123 -0
- package/dist/assets/LogsView-CKyL3UT5.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-BBwqM3vf.js +5 -0
- package/dist/assets/MemoryView-CK0PemlP.css +1 -0
- package/dist/assets/Modal-BtRuxNI4.js +232 -0
- package/dist/assets/Popover-C2CJscsj.js +161 -0
- package/dist/assets/Select-CithN5ti.js +410 -0
- package/dist/assets/SettingsView-BzBMKaLz.css +1 -0
- package/dist/assets/SettingsView-D1hOGA0Z.js +1005 -0
- package/dist/assets/SkillsView-86Z-HE_X.css +1 -0
- package/dist/assets/SkillsView-BfnrX5TQ.js +1 -0
- package/dist/assets/Spin-7g8GCzi5.js +43 -0
- package/dist/assets/Suffix-DI9irQ4f.js +101 -0
- package/dist/assets/Tooltip-BdrvORgU.js +1 -0
- package/dist/assets/_plugin-vue_export-helper-BrYOyDjU.js +47 -0
- package/dist/assets/app-JRkV5-Ft.js +1 -0
- package/dist/assets/chat-Cgdof9SF.js +6 -0
- package/dist/assets/context-DW8F1iIn.js +109 -0
- package/dist/assets/index-DwVgwUIX.css +1 -0
- package/dist/assets/index-JHg9WTzt.js +307 -0
- package/dist/assets/jobs-DJ8ETzok.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-CkDtgKB5.js +1 -0
- package/dist/assets/use-message-Btr-O4Ih.js +1 -0
- package/dist/index.html +17 -8
- package/dist/server/index.js +2 -0
- package/dist/server/routes/filesystem.d.ts +2 -0
- package/dist/server/routes/filesystem.js +427 -0
- package/dist/server/routes/sessions.js +16 -0
- package/dist/server/services/hermes-cli.d.ts +4 -0
- package/dist/server/services/hermes-cli.js +25 -1
- package/package.json +1 -1
- package/dist/assets/ChatView-BBqtEbUW.js +0 -38
- package/dist/assets/ChatView-DC6_7Uwg.css +0 -1
- package/dist/assets/JobsView-sQ8sqrxF.js +0 -356
- package/dist/assets/LogsView-DukKyFJt.js +0 -1
- package/dist/assets/Modal-oIDM0xXN.js +0 -232
- package/dist/assets/Spin-zWt--szS.js +0 -476
- package/dist/assets/Tooltip-BGvPCNBt.js +0 -1
- package/dist/assets/Warning-B9_T2nKK.js +0 -1
- package/dist/assets/_plugin-vue_export-helper-V8xgnEJh.js +0 -231
- package/dist/assets/chat-CGF6ipPC.js +0 -5
- package/dist/assets/fade-in-scale-up.cssr-DQYNrBys.js +0 -45
- package/dist/assets/index-BsLYVWlc.js +0 -307
- package/dist/assets/index-DDAe8BhJ.css +0 -1
- package/dist/assets/jobs-QHXENDTQ.js +0 -1
- package/dist/assets/use-message-42wmA96q.js +0 -117
- /package/dist/assets/{client-ZYGCrm9m.js → client-kwQ0ijpp.js} +0 -0
package/README.md
CHANGED
|
@@ -72,6 +72,7 @@ hermes-web-ui/
|
|
|
72
72
|
│ │ ├── proxy.ts # API proxy to Hermes (/api/*, /v1/*)
|
|
73
73
|
│ │ ├── upload.ts # File upload (POST /upload)
|
|
74
74
|
│ │ ├── sessions.ts # Session management via Hermes CLI
|
|
75
|
+
│ │ ├── filesystem.ts # Skills, memory, config model management
|
|
75
76
|
│ │ ├── webhook.ts # Webhook receiver
|
|
76
77
|
│ │ └── logs.ts # Log file listing and reading
|
|
77
78
|
│ └── services/
|
|
@@ -80,13 +81,16 @@ hermes-web-ui/
|
|
|
80
81
|
│ ├── api/ # Frontend API layer
|
|
81
82
|
│ ├── stores/ # Pinia state management
|
|
82
83
|
│ ├── components/
|
|
83
|
-
│ │ ├── layout/
|
|
84
|
+
│ │ ├── layout/
|
|
85
|
+
│ │ │ ├── AppSidebar.vue # Sidebar navigation
|
|
86
|
+
│ │ │ └── ModelSelector.vue # Global model selector
|
|
84
87
|
│ │ ├── chat/ # Chat components
|
|
85
88
|
│ │ └── jobs/ # Job components
|
|
86
89
|
│ ├── views/
|
|
87
90
|
│ │ ├── ChatView.vue # Chat page
|
|
88
91
|
│ │ ├── JobsView.vue # Jobs page
|
|
89
|
-
│ │
|
|
92
|
+
│ │ ├── LogsView.vue # Logs page
|
|
93
|
+
│ │ └── SettingsView.vue # Settings (model management)
|
|
90
94
|
│ └── router/index.ts # Router configuration
|
|
91
95
|
└── dist/ # Build output (published to npm)
|
|
92
96
|
├── server/index.js # Compiled BFF
|
|
@@ -102,6 +106,16 @@ hermes-web-ui/
|
|
|
102
106
|
- Multi-session switching with message history
|
|
103
107
|
- Markdown rendering with syntax highlighting and code copy
|
|
104
108
|
- File upload support (saved to temp, path passed to API)
|
|
109
|
+
- Model selector — automatically discovers available models from `~/.hermes/auth.json` credential pool
|
|
110
|
+
- Global model switching (updates `~/.hermes/config.yaml`)
|
|
111
|
+
- Per-session model display (badge in chat header and session list)
|
|
112
|
+
|
|
113
|
+
### Model Management
|
|
114
|
+
- Automatically reads credential pool from `~/.hermes/auth.json`
|
|
115
|
+
- Fetches available models from each provider endpoint (`/v1/models`)
|
|
116
|
+
- Groups models by provider (e.g. zai, subrouter.ai)
|
|
117
|
+
- Switching model updates `model.provider` in config.yaml to bypass env auto-detection
|
|
118
|
+
- Error handling: parallel fetching, per-provider timeout, fallback to config.yaml parsing
|
|
105
119
|
|
|
106
120
|
### Scheduled Jobs
|
|
107
121
|
- Job list view (including paused/disabled jobs)
|
|
@@ -133,6 +147,9 @@ The BFF layer handles:
|
|
|
133
147
|
- SSE streaming passthrough
|
|
134
148
|
- File upload to temp directory
|
|
135
149
|
- Session CRUD via Hermes CLI
|
|
150
|
+
- Model discovery from `~/.hermes/auth.json` credential pool
|
|
151
|
+
- Config.yaml model switching (reads/writes `~/.hermes/config.yaml`)
|
|
152
|
+
- Skills, memory, and custom provider management
|
|
136
153
|
- Log file reading and parsing
|
|
137
154
|
- Static file serving (SPA fallback)
|
|
138
155
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{t as e}from"./MarkdownRenderer-DNP-kPA8.js";import{C as t,Ct as n,E as r,F as i,G as a,I as o,K as s,L as c,M as l,U as u,_ as d,at as f,d as p,f as m,g as h,i as g,l as _,p as v,st as y,tt as b,u as x,v as S,wt as C,x as w}from"./runtime-core.esm-bundler-yNW65ghW.js";import{H as T,St as E,Tt as D,V as O,X as k,Y as A,c as j,ct as M,dt as N,l as P,lt as F,q as I,r as L,t as R,tt as z,wt as ee}from"./_plugin-vue_export-helper-BrYOyDjU.js";import{c as B,t as te}from"./Modal-BtRuxNI4.js";import{d as V,i as H,n as U,t as W}from"./Popover-C2CJscsj.js";import{l as G,u as K}from"./Suffix-DI9irQ4f.js";import{t as ne}from"./Dropdown-8pId5Qsj.js";import{a as re,r as q}from"./context-DW8F1iIn.js";import{t as ie}from"./keysOf-Dvq9k1rv.js";import{t as ae}from"./omit-QZj0aLfU.js";import{t as oe}from"./Input-BZKSQ403.js";import{t as J}from"./Tooltip-BdrvORgU.js";import{t as se}from"./use-message-Btr-O4Ih.js";import{n as ce,r as le,t as Y}from"./chat-Cgdof9SF.js";import{n as ue}from"./app-JRkV5-Ft.js";var de={iconSize:`22px`};function fe(e){let{fontSize:t,warningColor:n}=e;return Object.assign(Object.assign({},de),{fontSize:t,iconColor:n})}var pe=j({name:`Popconfirm`,common:L,peers:{Button:re,Popover:H},self:fe}),X=z(`n-popconfirm`),Z={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Q=ie(Z),me=S({name:`NPopconfirmPanel`,props:Z,setup(e){let{localeRef:n}=K(`Popconfirm`),{inlineThemeDisabled:r}=T(),{mergedClsPrefixRef:i,mergedThemeRef:a,props:o}=t(X),s=_(()=>{let{common:{cubicBezierEaseInOut:e},self:{fontSize:t,iconSize:n,iconColor:r}}=a.value;return{"--n-bezier":e,"--n-font-size":t,"--n-icon-size":n,"--n-icon-color":r}}),c=r?O(`popconfirm-panel`,void 0,s,o):void 0;return Object.assign(Object.assign({},K(`Popconfirm`)),{mergedClsPrefix:i,cssVars:r?void 0:s,localizedPositiveText:_(()=>e.positiveText||n.value.positiveText),localizedNegativeText:_(()=>e.negativeText||n.value.negativeText),positiveButtonProps:f(o,`positiveButtonProps`),negativeButtonProps:f(o,`negativeButtonProps`),handlePositiveClick(t){e.onPositiveClick(t)},handleNegativeClick(t){e.onNegativeClick(t)},themeClass:c?.themeClass,onRender:c?.onRender})},render(){var e;let{mergedClsPrefix:t,showIcon:n,$slots:r}=this,i=I(r.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&w(q,Object.assign({size:`small`,onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&w(q,Object.assign({size:`small`,type:`primary`,onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)==null||e.call(this),w(`div`,{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},A(r.default,e=>n||e?w(`div`,{class:`${t}-popconfirm__body`},n?w(`div`,{class:`${t}-popconfirm__icon`},I(r.icon,()=>[w(G,{clsPrefix:t},{default:()=>w(B,null)})])):null,e):null),i?w(`div`,{class:[`${t}-popconfirm__action`]},i):null)}}),he=F(`popconfirm`,[N(`body`,`
|
|
2
|
+
font-size: var(--n-font-size);
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
position: relative;
|
|
7
|
+
`,[N(`icon`,`
|
|
8
|
+
display: flex;
|
|
9
|
+
font-size: var(--n-icon-size);
|
|
10
|
+
color: var(--n-icon-color);
|
|
11
|
+
transition: color .3s var(--n-bezier);
|
|
12
|
+
margin: 0 8px 0 0;
|
|
13
|
+
`)]),N(`action`,`
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: flex-end;
|
|
16
|
+
`,[M(`&:not(:first-child)`,`margin-top: 8px`),F(`button`,[M(`&:not(:last-child)`,`margin-right: 8px;`)])])]),ge=S({name:`Popconfirm`,props:Object.assign(Object.assign(Object.assign({},P.props),U),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:`click`},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),slots:Object,__popover__:!0,setup(e){let{mergedClsPrefixRef:t}=T(),n=P(`Popconfirm`,`-popconfirm`,he,pe,e,t),r=b(null);function i(t){if(!r.value?.getMergedShow())return;let{onPositiveClick:n,"onUpdate:show":i}=e;Promise.resolve(n?n(t):!0).then(e=>{var t;e!==!1&&((t=r.value)==null||t.setShow(!1),i&&k(i,!1))})}function a(t){if(!r.value?.getMergedShow())return;let{onNegativeClick:n,"onUpdate:show":i}=e;Promise.resolve(n?n(t):!0).then(e=>{var t;e!==!1&&((t=r.value)==null||t.setShow(!1),i&&k(i,!1))})}return o(X,{mergedThemeRef:n,mergedClsPrefixRef:t,props:e}),{setShow(e){var t;(t=r.value)==null||t.setShow(e)},syncPosition(){var e;(e=r.value)==null||e.syncPosition()},mergedTheme:n,popoverInstRef:r,handlePositiveClick:i,handleNegativeClick:a}},render(){let{$slots:e,$props:t,mergedTheme:n}=this;return w(W,Object.assign({},ae(t,Q),{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:[`popconfirm`],ref:`popoverInstRef`}),{trigger:e.trigger,default:()=>{let n=V(t,Q);return w(me,Object.assign({},n,{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),_e={class:`chat-input-area`},ve={key:0,class:`attachment-previews`},ye=[`src`,`alt`],be={key:1,class:`attachment-file`},xe={class:`file-name`},Se={class:`file-size`},Ce=[`onClick`],we={class:`input-actions`},Te=R(S({__name:`ChatInput`,setup(e){let t=Y(),r=b(``),o=b(),l=b(),u=b([]),f=b(!1),S=b(0),w=_(()=>r.value.trim()||u.value.length>0);function T(e){if(u.value.find(t=>t.name===e.name))return;let t=Date.now().toString(36)+Math.random().toString(36).slice(2,8),n=URL.createObjectURL(e);u.value.push({id:t,name:e.name,type:e.type,size:e.size,url:n,file:e})}function D(){l.value?.click()}function O(e){let t=e.target;if(t.files){for(let e of t.files)T(e);t.value=``}}function k(e){let t=Array.from(e.clipboardData?.items||[]).filter(e=>e.type.startsWith(`image/`));if(t.length){e.preventDefault();for(let e of t){let t=e.getAsFile();if(!t)continue;let n=e.type.split(`/`)[1]||`png`;T(new File([t],`pasted-${Date.now()}.${n}`,{type:e.type}))}}}function A(e){e.preventDefault()}function j(e){e.preventDefault(),e.dataTransfer?.types.includes(`Files`)&&(S.value++,f.value=!0)}function M(){S.value--,S.value<=0&&(S.value=0,f.value=!1)}function N(e){e.preventDefault(),S.value=0,f.value=!1;let t=Array.from(e.dataTransfer?.files||[]);if(t.length){for(let e of t)T(e);o.value?.focus()}}function P(){let e=r.value.trim();!e&&u.value.length===0||(t.sendMessage(e,u.value.length>0?u.value:void 0),r.value=``,u.value=[],o.value&&(o.value.style.height=`auto`))}function F(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),P())}function I(e){let t=e.target;t.style.height=`auto`,t.style.height=Math.min(t.scrollHeight,100)+`px`}function L(e){let t=u.value.findIndex(t=>t.id===e);t!==-1&&(URL.revokeObjectURL(u.value[t].url),u.value.splice(t,1))}function R(e){return e<1024?e+` B`:e<1024*1024?(e/1024).toFixed(1)+` KB`:(e/(1024*1024)).toFixed(1)+` MB`}function z(e){return e.startsWith(`image/`)}return(e,_)=>(i(),v(`div`,_e,[u.value.length>0?(i(),v(`div`,ve,[(i(!0),v(g,null,c(u.value,e=>(i(),v(`div`,{key:e.id,class:n([`attachment-preview`,{image:z(e.type)}])},[z(e.type)?(i(),v(`img`,{key:0,src:e.url,alt:e.name,class:`attachment-thumb`},null,8,ye)):(i(),v(`div`,be,[_[2]||=x(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[x(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),x(`polyline`,{points:`14 2 14 8 20 8`})],-1),x(`span`,xe,C(e.name),1),x(`span`,Se,C(R(e.size)),1)])),x(`button`,{class:`attachment-remove`,onClick:t=>L(e.id)},[..._[3]||=[x(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[x(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),x(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,Ce)],2))),128))])):m(``,!0),x(`div`,{class:n([`input-wrapper`,{"drag-over":f.value}]),onDragover:A,onDragenter:j,onDragleave:M,onDrop:N},[x(`input`,{ref_key:`fileInputRef`,ref:l,type:`file`,multiple:``,class:`file-input-hidden`,onChange:O},null,544),s(x(`textarea`,{ref_key:`textareaRef`,ref:o,"onUpdate:modelValue":_[0]||=e=>r.value=e,class:`input-textarea`,placeholder:`Type a message... (Enter to send, Shift+Enter for new line)`,rows:`1`,onKeydown:F,onInput:I,onPaste:k},null,544),[[E,r.value]]),x(`div`,we,[d(y(J),{trigger:`hover`},{trigger:a(()=>[d(y(q),{quaternary:``,size:`small`,onClick:D,circle:``},{icon:a(()=>[..._[4]||=[x(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[x(`path`,{d:`M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48`})],-1)]]),_:1})]),default:a(()=>[_[5]||=h(` Attach files `,-1)]),_:1}),y(t).isStreaming?(i(),p(y(q),{key:0,size:`small`,type:`error`,onClick:_[1]||=e=>y(t).stopStreaming()},{default:a(()=>[..._[6]||=[h(` Stop `,-1)]]),_:1})):m(``,!0),d(y(q),{size:`small`,type:`primary`,disabled:!w.value||y(t).isStreaming,onClick:P},{icon:a(()=>[..._[7]||=[x(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[x(`line`,{x1:`22`,y1:`2`,x2:`11`,y2:`13`}),x(`polygon`,{points:`22 2 15 22 11 13 2 9 22 2`})],-1)]]),default:a(()=>[_[8]||=h(` Send `,-1)]),_:1},8,[`disabled`])])],34)]))}}),[[`__scopeId`,`data-v-38a3b8f9`]]),Ee={key:1,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,class:`tool-icon`},De={class:`tool-name`},Oe={key:2,class:`tool-preview`},ke={key:3,class:`tool-spinner`},Ae={key:4,class:`tool-error-badge`},je={key:0,class:`tool-details`},Me={key:0,class:`tool-detail-section`},Ne={class:`tool-detail-code`},Pe={key:1,class:`tool-detail-section`},Fe={class:`tool-detail-code`},Ie={key:1,class:`msg-body`},Le={key:0,src:le,alt:`Hermes`,class:`msg-avatar`},Re={key:0,class:`msg-attachments`},ze=[`src`,`alt`],Be={key:1,class:`msg-attachment-file`},Ve={class:`att-name`},He={class:`att-size`},Ue={key:2,class:`streaming-cursor`},We={key:3,class:`streaming-dots`},Ge={class:`message-time`},Ke=R(S({__name:`MessageItem`,props:{message:{}},setup(t){let r=t,a=_(()=>r.message.role===`system`),o=b(!1),s=_(()=>new Date(r.message.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}));function l(e){return e.startsWith(`image/`)}function u(e){return e<1024?e+` B`:e<1024*1024?(e/1024).toFixed(1)+` KB`:(e/(1024*1024)).toFixed(1)+` MB`}let d=_(()=>(r.message.attachments?.length??0)>0),f=_(()=>!!(r.message.toolArgs||r.message.toolResult)),h=_(()=>{if(!r.message.toolArgs)return``;try{return JSON.stringify(JSON.parse(r.message.toolArgs),null,2)}catch{return r.message.toolArgs}}),y=_(()=>{if(!r.message.toolResult)return``;try{let e=JSON.parse(r.message.toolResult),t=JSON.stringify(e,null,2);return t.length>2e3?t.slice(0,2e3)+`
|
|
17
|
+
... (truncated)`:t}catch{let e=r.message.toolResult;return e.length>2e3?e.slice(0,2e3)+`
|
|
18
|
+
... (truncated)`:e}});return(r,_)=>(i(),v(`div`,{class:n([`message`,[t.message.role]])},[t.message.role===`tool`?(i(),v(g,{key:0},[x(`div`,{class:n([`tool-line`,{expandable:f.value}]),onClick:_[0]||=e=>f.value&&(o.value=!o.value)},[f.value?(i(),v(`svg`,{key:0,width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,class:n([`tool-chevron`,{rotated:o.value}])},[..._[1]||=[x(`polyline`,{points:`9 18 15 12 9 6`},null,-1)]],2)):(i(),v(`svg`,Ee,[..._[2]||=[x(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`},null,-1)]])),x(`span`,De,C(t.message.toolName),1),t.message.toolPreview&&!o.value?(i(),v(`span`,Oe,C(t.message.toolPreview),1)):m(``,!0),t.message.toolStatus===`running`?(i(),v(`span`,ke)):m(``,!0),t.message.toolStatus===`error`?(i(),v(`span`,Ae,`error`)):m(``,!0)],2),o.value&&f.value?(i(),v(`div`,je,[h.value?(i(),v(`div`,Me,[_[3]||=x(`div`,{class:`tool-detail-label`},`Arguments`,-1),x(`pre`,Ne,C(h.value),1)])):m(``,!0),y.value?(i(),v(`div`,Pe,[_[4]||=x(`div`,{class:`tool-detail-label`},`Result`,-1),x(`pre`,Fe,C(y.value),1)])):m(``,!0)])):m(``,!0)],64)):(i(),v(`div`,Ie,[t.message.role===`assistant`?(i(),v(`img`,Le)):m(``,!0),x(`div`,{class:n([`msg-content`,t.message.role])},[x(`div`,{class:n([`message-bubble`,{system:a.value}])},[d.value?(i(),v(`div`,Re,[(i(!0),v(g,null,c(t.message.attachments,e=>(i(),v(`div`,{key:e.id,class:n([`msg-attachment`,{image:l(e.type)}])},[l(e.type)&&e.url?(i(),v(`img`,{key:0,src:e.url,alt:e.name,class:`msg-attachment-thumb`},null,8,ze)):(i(),v(`div`,Be,[_[5]||=x(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[x(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),x(`polyline`,{points:`14 2 14 8 20 8`})],-1),x(`span`,Ve,C(e.name),1),x(`span`,He,C(u(e.size)),1)]))],2))),128))])):m(``,!0),t.message.content?(i(),p(e,{key:1,content:t.message.content},null,8,[`content`])):m(``,!0),t.message.isStreaming?(i(),v(`span`,Ue)):m(``,!0),t.message.isStreaming&&!t.message.content?(i(),v(`div`,We,[..._[6]||=[x(`span`,null,null,-1),x(`span`,null,null,-1),x(`span`,null,null,-1)]])):m(``,!0)],2),x(`div`,Ge,C(s.value),1)],2)]))],2))}}),[[`__scopeId`,`data-v-f138bbda`]]),qe={key:0,class:`empty-state`},Je={key:1,class:`streaming-indicator`},Ye=R(S({__name:`MessageList`,setup(e){let t=Y(),n=b();function a(){r(()=>{n.value&&(n.value.scrollTop=n.value.scrollHeight)})}return u(()=>t.messages.length,a),u(()=>t.messages[t.messages.length-1]?.content,a),u(()=>t.isStreaming,e=>{e&&a()}),(e,r)=>(i(),v(`div`,{ref_key:`listRef`,ref:n,class:`message-list`},[y(t).messages.length===0?(i(),v(`div`,qe,[...r[0]||=[x(`img`,{src:`/assets/logo-BAarh-tH.png`,alt:`Hermes`,class:`empty-logo`},null,-1),x(`p`,null,`Start a conversation with Hermes Agent`,-1)]])):m(``,!0),(i(!0),v(g,null,c(y(t).messages,e=>(i(),p(Ke,{key:e.id,message:e},null,8,[`message`]))),128)),y(t).isStreaming?(i(),v(`div`,Je,[...r[1]||=[x(`span`,null,null,-1),x(`span`,null,null,-1),x(`span`,null,null,-1)]])):m(``,!0)],512))}}),[[`__scopeId`,`data-v-c48f8f02`]]),Xe={class:`chat-panel`},Ze={class:`session-list-header`},Qe={key:0,class:`session-list-title`},$e={key:0,class:`session-items`},et={key:0,class:`session-loading`},tt={key:1,class:`session-empty`},$=[`onClick`],nt={class:`session-group-label`},rt={class:`session-group-count`},it=[`onClick`,`onContextmenu`],at={class:`session-item-content`},ot={class:`session-item-title`},st={class:`session-item-meta`},ct={key:0,class:`session-item-model`},lt={class:`session-item-time`},ut={class:`chat-main`},dt={class:`chat-header`},ft={class:`header-left`},pt={class:`header-session-title`},mt={key:0,class:`source-badge`},ht={class:`header-actions`},gt=R(S({__name:`ChatPanel`,setup(e){let t=Y(),o=se(),s=b(!0),l=b(!1),f=b(``),S=b(null),w=b(null),T=b(new Set);function E(e){return e===`api_server`?-1:e===`cron`?999:0}let O=_(()=>{let e=[...t.sessions].sort((e,t)=>t.createdAt-e.createdAt),n=new Map;for(let t of e){let e=t.source||``;n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.keys()].sort((e,t)=>{let n=E(e),r=E(t);return n===r?e.localeCompare(t):n-r}).map(e=>({source:e,label:e?N(e):`Other`,sessions:n.get(e)}))});function k(e){if(!T.value.has(e))T.value=new Set([...T.value,e]);else{T.value=new Set(O.value.map(e=>e.source).filter(t=>t!==e));let n=O.value.find(t=>t.source===e);n?.sessions.length&&t.switchSession(n.sessions[0].id)}}u(O,e=>{T.value.size>0||(T.value=new Set(e.map(e=>e.source)))},{once:!0});let A=_(()=>t.activeSession?.title||`New Chat`),j=_(()=>t.activeSession?.source||``),M={telegram:`Telegram`,api_server:`API Server`,cli:`CLI`,discord:`Discord`,slack:`Slack`,matrix:`Matrix`,whatsapp:`WhatsApp`,signal:`Signal`,email:`Email`,sms:`SMS`,dingtalk:`DingTalk`,feishu:`Feishu`,wecom:`WeCom`,weixin:`WeChat`,bluebubbles:`iMessage`,mattermost:`Mattermost`,cron:`Cron`};function N(e){return e?M[e]||e:``}function P(){t.newChat()}function F(e){let n=e||t.activeSessionId;n&&(navigator.clipboard.writeText(n),o.success(`Copied`))}function I(e){t.deleteSession(e),o.success(`Session deleted`)}function L(e){let t=new Date(e),n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):t.toLocaleDateString([],{month:`short`,day:`numeric`})}let R=[{label:`Rename`,key:`rename`},{label:`Copy Session ID`,key:`copy-id`}],z=b(null);function B(e,t){e.preventDefault(),z.value=t,V.value=!0,H.value=e.clientX,U.value=e.clientY}let V=b(!1),H=b(0),U=b(0);function W(e){if(V.value=!1,z.value){if(e===`copy-id`)F(z.value);else if(e===`rename`){let e=t.sessions.find(e=>e.id===z.value);S.value=z.value,f.value=e?.title||``,l.value=!0,r(()=>{w.value?.focus()})}}}function G(){V.value=!1}async function K(){if(!(!S.value||!f.value.trim())){if(await ce(S.value,f.value.trim())){let e=t.sessions.find(e=>e.id===S.value);e&&(e.title=f.value.trim()),t.activeSession?.id===S.value&&(t.activeSession.title=f.value.trim()),o.success(`Renamed`)}else o.error(`Rename failed`);l.value=!1}}return(e,r)=>(i(),v(`div`,Xe,[x(`aside`,{class:n([`session-list`,{collapsed:!s.value}])},[x(`div`,Ze,[s.value?(i(),v(`span`,Qe,`Sessions`)):m(``,!0),d(y(q),{quaternary:``,size:`tiny`,onClick:P,circle:``},{icon:a(()=>[...r[5]||=[x(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[x(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),x(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),_:1})]),s.value?(i(),v(`div`,$e,[y(t).isLoadingSessions&&y(t).sessions.length===0?(i(),v(`div`,et,`Loading...`)):y(t).sessions.length===0?(i(),v(`div`,tt,`No sessions`)):m(``,!0),(i(!0),v(g,null,c(O.value,e=>(i(),v(g,{key:e.source},[x(`div`,{class:`session-group-header`,onClick:t=>k(e.source)},[(i(),v(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,class:n([`group-chevron`,{collapsed:T.value.has(e.source)}])},[...r[6]||=[x(`polyline`,{points:`9 18 15 12 9 6`},null,-1)]],2)),x(`span`,nt,C(e.label),1),x(`span`,rt,C(e.sessions.length),1)],8,$),T.value.has(e.source)?m(``,!0):(i(!0),v(g,{key:0},c(e.sessions,e=>(i(),v(`button`,{key:e.id,class:n([`session-item`,{active:e.id===y(t).activeSessionId}]),onClick:n=>y(t).switchSession(e.id),onContextmenu:t=>B(t,e.id)},[x(`div`,at,[x(`span`,ot,C(e.title),1),x(`span`,st,[e.model?(i(),v(`span`,ct,C(e.model),1)):m(``,!0),x(`span`,lt,C(L(e.createdAt)),1)])]),e.id!==y(t).activeSessionId||y(t).sessions.length>1?(i(),p(y(ge),{key:0,onPositiveClick:t=>I(e.id)},{trigger:a(()=>[x(`button`,{class:`session-item-delete`,onClick:r[0]||=D(()=>{},[`stop`])},[...r[7]||=[x(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[x(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),x(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]])]),default:a(()=>[r[8]||=h(` Delete this session? `,-1)]),_:1},8,[`onPositiveClick`])):m(``,!0)],42,it))),128))],64))),128))])):m(``,!0)],2),d(y(ne),{placement:`bottom-start`,trigger:`manual`,x:H.value,y:U.value,options:R,show:V.value,onSelect:W,onClickoutside:G},null,8,[`x`,`y`,`show`]),d(y(te),{show:l.value,"onUpdate:show":r[2]||=e=>l.value=e,preset:`dialog`,title:`Rename Session`,"positive-text":`OK`,"negative-text":`Cancel`,onPositiveClick:K},{default:a(()=>[d(y(oe),{ref_key:`renameInputRef`,ref:w,value:f.value,"onUpdate:value":r[1]||=e=>f.value=e,placeholder:`Enter new title`,onKeydown:ee(K,[`enter`])},null,8,[`value`])]),_:1},8,[`show`]),x(`div`,ut,[x(`header`,dt,[x(`div`,ft,[d(y(q),{quaternary:``,size:`small`,onClick:r[3]||=e=>s.value=!s.value,circle:``},{icon:a(()=>[...r[9]||=[x(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[x(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`}),x(`rect`,{x:`14`,y:`3`,width:`7`,height:`7`}),x(`rect`,{x:`3`,y:`14`,width:`7`,height:`7`}),x(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`})],-1)]]),_:1}),x(`span`,pt,C(A.value),1),j.value?(i(),v(`span`,mt,C(N(j.value)),1)):m(``,!0)]),x(`div`,ht,[d(y(J),{trigger:`hover`},{trigger:a(()=>[d(y(q),{quaternary:``,size:`small`,onClick:r[4]||=e=>F(),circle:``},{icon:a(()=>[...r[10]||=[x(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`},[x(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),x(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1)]]),_:1})]),default:a(()=>[r[11]||=h(` Copy Session ID `,-1)]),_:1}),d(y(q),{size:`small`,onClick:P},{icon:a(()=>[...r[12]||=[x(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[x(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),x(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:a(()=>[r[13]||=h(` New Chat `,-1)]),_:1})])]),d(Ye),d(Te)])]))}}),[[`__scopeId`,`data-v-d72165ce`]]),_t={class:`chat-view`},vt=R(S({__name:`ChatView`,setup(e){let t=ue(),n=Y();return l(()=>{t.loadModels(),n.loadSessions()}),(e,t)=>(i(),v(`div`,_t,[d(gt)]))}}),[[`__scopeId`,`data-v-d35d4d9c`]]);export{vt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.chat-input-area[data-v-38a3b8f9]{border-top:1px solid #e0e0e0;flex-shrink:0;padding:12px 20px 16px}.attachment-previews[data-v-38a3b8f9]{flex-wrap:wrap;gap:8px;padding:0 0 10px;display:flex}.attachment-preview[data-v-38a3b8f9]{background-color:#f0f0f0;border:1px solid #e0e0e0;border-radius:6px;position:relative;overflow:hidden}.attachment-preview.image[data-v-38a3b8f9]{width:64px;height:64px}.attachment-thumb[data-v-38a3b8f9]{object-fit:cover;width:100%;height:100%}.attachment-file[data-v-38a3b8f9]{color:#666;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:80px;max-width:140px;padding:8px 12px;display:flex}.attachment-file .file-name[data-v-38a3b8f9]{white-space:nowrap;text-overflow:ellipsis;max-width:100%;font-size:11px;overflow:hidden}.attachment-file .file-size[data-v-38a3b8f9]{color:#999;font-size:10px}.attachment-remove[data-v-38a3b8f9]{color:#fff;cursor:pointer;opacity:0;background:#00000080;border:none;border-radius:50%;justify-content:center;align-items:center;width:18px;height:18px;transition:opacity .15s;display:flex;position:absolute;top:2px;right:2px}.attachment-preview:hover .attachment-remove[data-v-38a3b8f9]{opacity:1}.file-input-hidden[data-v-38a3b8f9]{display:none}.input-wrapper[data-v-38a3b8f9]{background-color:#fff;border:1px solid #e0e0e0;border-radius:10px;align-items:center;gap:10px;padding:10px 12px;transition:border-color .15s;display:flex}.input-wrapper[data-v-38a3b8f9]:focus-within{border-color:#333}.input-textarea[data-v-38a3b8f9]{color:#1a1a1a;resize:none;background:0 0;border:none;outline:none;flex:1;min-height:20px;max-height:100px;font-family:Inter,system-ui,-apple-system,sans-serif;font-size:14px;line-height:1.5;overflow-y:auto}.input-textarea[data-v-38a3b8f9]::placeholder{color:#999}.input-actions[data-v-38a3b8f9]{flex-shrink:0;align-items:center;gap:6px;display:flex}.input-wrapper.drag-over[data-v-38a3b8f9]{background-color:#4a90d90a;border-style:dashed;border-color:#4a90d9}.message[data-v-f138bbda]{flex-direction:column;display:flex}.message.user[data-v-f138bbda]{align-items:flex-end}.message.user .msg-body[data-v-f138bbda]{max-width:75%}.message.user .msg-content.user[data-v-f138bbda]{align-items:flex-end}.message.user .message-bubble[data-v-f138bbda]{background-color:#e8e8e8;border-radius:10px 10px 4px}.message.assistant[data-v-f138bbda]{flex-direction:row;align-items:flex-start;gap:8px}.message.assistant .msg-body[data-v-f138bbda]{max-width:80%}.message.assistant .msg-avatar[data-v-f138bbda]{border-radius:4px;flex-shrink:0;width:28px;height:28px;margin-top:2px}.message.assistant .message-bubble[data-v-f138bbda]{background-color:#f5f5f5;border-radius:10px 10px 10px 4px}.message.tool[data-v-f138bbda],.message.system[data-v-f138bbda]{align-items:flex-start}.message.system .message-bubble.system[data-v-f138bbda]{background-color:#f57f170f;border-left:3px solid #f57f17;border-radius:6px;max-width:80%}.msg-body[data-v-f138bbda]{align-items:flex-start;gap:8px;max-width:85%;display:flex}.msg-content[data-v-f138bbda]{flex-direction:column;min-width:0;display:flex}.message-bubble[data-v-f138bbda]{word-break:break-word;padding:10px 14px;font-size:14px;line-height:1.65}.msg-attachments[data-v-f138bbda]{flex-wrap:wrap;gap:8px;margin-bottom:8px;display:flex}.msg-attachment[data-v-f138bbda]{background-color:#0000000a;border:1px solid #ebebeb;border-radius:6px;overflow:hidden}.msg-attachment.image[data-v-f138bbda]{max-width:200px}.msg-attachment-thumb[data-v-f138bbda]{object-fit:contain;max-width:200px;max-height:160px;display:block}.msg-attachment-file[data-v-f138bbda]{color:#666;align-items:center;gap:6px;padding:6px 10px;font-size:12px;display:flex}.msg-attachment-file .att-name[data-v-f138bbda]{white-space:nowrap;text-overflow:ellipsis;max-width:160px;overflow:hidden}.msg-attachment-file .att-size[data-v-f138bbda]{color:#999;flex-shrink:0;font-size:11px}.message-time[data-v-f138bbda]{color:#999;margin-top:4px;padding:0 4px;font-size:11px}.tool-line[data-v-f138bbda]{color:#999;border-radius:6px;align-items:center;gap:6px;padding:2px 4px;font-size:11px;display:flex}.tool-line.expandable[data-v-f138bbda]{cursor:pointer}.tool-line.expandable[data-v-f138bbda]:hover{background:#00000008}.tool-line .tool-name[data-v-f138bbda]{flex-shrink:0;font-family:JetBrains Mono,Fira Code,Consolas,monospace}.tool-line .tool-preview[data-v-f138bbda]{text-overflow:ellipsis;white-space:nowrap;max-width:400px;overflow:hidden}.tool-chevron[data-v-f138bbda]{flex-shrink:0;transition:transform .15s}.tool-chevron.rotated[data-v-f138bbda]{transform:rotate(90deg)}.tool-spinner[data-v-f138bbda]{border:1.5px solid #999;border-top-color:#0000;border-radius:50%;flex-shrink:0;width:10px;height:10px;animation:.6s linear infinite spin-f138bbda}.tool-error-badge[data-v-f138bbda]{color:#c62828;background:#c6282814;border-radius:3px;padding:0 4px;font-size:9px;line-height:14px}.tool-details[data-v-f138bbda]{border-left:2px solid #ebebeb;margin-top:2px;margin-left:16px;padding-left:10px}.tool-detail-section[data-v-f138bbda]{margin-bottom:6px}.tool-detail-label[data-v-f138bbda]{color:#999;text-transform:uppercase;letter-spacing:.3px;margin-bottom:2px;font-size:10px;font-weight:600}.tool-detail-code[data-v-f138bbda]{color:#666;white-space:pre-wrap;word-break:break-all;background:#f4f4f4;border-radius:6px;max-height:300px;margin:0;padding:6px 8px;font-family:JetBrains Mono,Fira Code,Consolas,monospace;font-size:11px;line-height:1.5;overflow:auto}@keyframes spin-f138bbda{to{transform:rotate(360deg)}}.streaming-cursor[data-v-f138bbda]{vertical-align:text-bottom;background-color:#999;width:2px;height:1em;margin-left:2px;animation:.8s infinite blink-f138bbda;display:inline-block}.streaming-dots[data-v-f138bbda]{gap:4px;padding:4px 0;display:flex}.streaming-dots span[data-v-f138bbda]{background-color:#999;border-radius:50%;width:6px;height:6px;animation:1.4s ease-in-out infinite pulse-f138bbda}.streaming-dots span[data-v-f138bbda]:nth-child(2){animation-delay:.2s}.streaming-dots span[data-v-f138bbda]:nth-child(3){animation-delay:.4s}@keyframes blink-f138bbda{0%,50%{opacity:1}51%,to{opacity:0}}@keyframes pulse-f138bbda{0%,80%,to{opacity:.3;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}.message-list[data-v-c48f8f02]{flex-direction:column;flex:1;gap:16px;padding:20px;display:flex;overflow-y:auto}.empty-state[data-v-c48f8f02]{color:#999;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:12px;display:flex}.empty-state .empty-logo[data-v-c48f8f02]{opacity:.25;width:48px;height:48px}.empty-state p[data-v-c48f8f02]{font-size:14px}.streaming-indicator[data-v-c48f8f02]{color:#999;align-items:center;gap:4px;padding:4px;display:flex}.streaming-indicator span[data-v-c48f8f02]{background-color:#999;border-radius:50%;width:5px;height:5px;animation:1.4s ease-in-out infinite stream-pulse-c48f8f02}.streaming-indicator span[data-v-c48f8f02]:nth-child(2){animation-delay:.2s}.streaming-indicator span[data-v-c48f8f02]:nth-child(3){animation-delay:.4s}@keyframes stream-pulse-c48f8f02{0%,80%,to{opacity:.2;transform:scale(.8)}40%{opacity:1;transform:scale(1)}}.chat-panel[data-v-d72165ce]{height:100%;display:flex}.session-list[data-v-d72165ce]{border-right:1px solid #e0e0e0;flex-direction:column;flex-shrink:0;width:220px;transition:width .25s,opacity .25s;display:flex;overflow:hidden}.session-list.collapsed[data-v-d72165ce]{opacity:0;pointer-events:none;border-right:none;width:0}.session-list-header[data-v-d72165ce]{flex-shrink:0;justify-content:space-between;align-items:center;padding:12px;display:flex}.session-list-title[data-v-d72165ce]{color:#999;text-transform:uppercase;letter-spacing:.5px;font-size:12px;font-weight:600}.session-group-header[data-v-d72165ce]{cursor:pointer;-webkit-user-select:none;user-select:none;align-items:center;gap:4px;padding:6px 10px 4px;display:flex}.group-chevron[data-v-d72165ce]{flex-shrink:0;transition:transform .15s;transform:rotate(90deg)}.group-chevron.collapsed[data-v-d72165ce]{transform:rotate(0)}.session-group-label[data-v-d72165ce]{color:#999;text-transform:uppercase;letter-spacing:.5px;font-size:10px;font-weight:600}.session-group-count[data-v-d72165ce]{color:#999;font-size:10px;font-weight:400}.session-items[data-v-d72165ce]{flex:1;padding:0 6px 12px;overflow-y:auto}.session-loading[data-v-d72165ce],.session-empty[data-v-d72165ce]{color:#999;text-align:center;padding:16px 10px;font-size:12px}.session-item[data-v-d72165ce]{cursor:pointer;text-align:left;color:#666;background:0 0;border:none;border-radius:6px;justify-content:space-between;align-items:center;width:100%;margin-bottom:2px;padding:8px 10px;transition:all .15s;display:flex}.session-item[data-v-d72165ce]:hover{color:#1a1a1a;background:#3333330f}.session-item:hover .session-item-delete[data-v-d72165ce]{opacity:1}.session-item.active[data-v-d72165ce]{color:#1a1a1a;background:#3333331a;font-weight:500}.session-item-content[data-v-d72165ce]{flex:1;overflow:hidden}.session-item-title[data-v-d72165ce]{white-space:nowrap;text-overflow:ellipsis;font-size:13px;display:block;overflow:hidden}.session-item-time[data-v-d72165ce]{color:#999;font-size:11px}.session-item-meta[data-v-d72165ce]{align-items:center;gap:6px;margin-top:2px;display:flex}.session-item-model[data-v-d72165ce]{color:#333;text-overflow:ellipsis;white-space:nowrap;background:#33333314;border-radius:3px;flex-shrink:0;max-width:100px;padding:0 5px;font-size:10px;line-height:16px;overflow:hidden}.session-item-delete[data-v-d72165ce]{opacity:0;color:#999;cursor:pointer;background:0 0;border:none;border-radius:3px;flex-shrink:0;padding:2px;transition:all .15s}.session-item-delete[data-v-d72165ce]:hover{color:#c62828;background:#c628281a}.chat-main[data-v-d72165ce]{flex-direction:column;flex:1;min-width:0;display:flex;overflow:hidden}.chat-header[data-v-d72165ce]{border-bottom:1px solid #e0e0e0;flex-shrink:0;justify-content:space-between;align-items:center;padding:12px 16px;display:flex}.header-left[data-v-d72165ce]{flex:1;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.header-session-title[data-v-d72165ce]{color:#1a1a1a;white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:500;overflow:hidden}.source-badge[data-v-d72165ce]{color:#999;white-space:nowrap;background:#9999991f;border-radius:8px;flex-shrink:0;padding:1px 7px;font-size:10px;line-height:16px}.header-actions[data-v-d72165ce]{flex-shrink:0;align-items:center;gap:4px;display:flex}.chat-view[data-v-d35d4d9c]{flex-direction:column;height:100vh;display:flex}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import{$ as e,C as t,I as n,O as r,T as i,U as a,at as o,et as s,i as c,k as l,l as u,tt as d,v as f,x as p}from"./runtime-core.esm-bundler-yNW65ghW.js";import{H as m,Q as h,V as g,X as _,c as v,ct as y,dt as b,ft as x,it as S,l as C,lt as w,mt as T,pt as E,r as D,rt as O,tt as k,yt as A}from"./_plugin-vue_export-helper-BrYOyDjU.js";import{D as j,F as M,O as N,T as P,a as F,d as I,g as L,i as R,j as z,n as B,o as ee,r as te,t as ne,u as V,v as re,w as ie,z as H}from"./Popover-C2CJscsj.js";import{_ as ae,r as oe,v as U,y as W}from"./Suffix-DI9irQ4f.js";function se(t={},n){let i=e({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:o,keyup:c}=t,u=e=>{switch(e.key){case`Control`:i.ctrl=!0;break;case`Meta`:i.command=!0,i.win=!0;break;case`Shift`:i.shift=!0;break;case`Tab`:i.tab=!0;break}o!==void 0&&Object.keys(o).forEach(t=>{if(t!==e.key)return;let n=o[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)}})},d=e=>{switch(e.key){case`Control`:i.ctrl=!1;break;case`Meta`:i.command=!1,i.win=!1;break;case`Shift`:i.shift=!1;break;case`Tab`:i.tab=!1;break}c!==void 0&&Object.keys(c).forEach(t=>{if(t!==e.key)return;let n=c[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)}})},f=()=>{(n===void 0||n.value)&&(W(`keydown`,document,u),W(`keyup`,document,d)),n!==void 0&&a(n,e=>{e?(W(`keydown`,document,u),W(`keyup`,document,d)):(U(`keydown`,document,u),U(`keyup`,document,d))})};return M()?(r(f),l(()=>{(n===void 0||n.value)&&(U(`keydown`,document,u),U(`keyup`,document,d))})):f(),s(i)}function ce(e,t,n){if(!t)return e;let r=d(e.value),i=null;return a(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 G(e){return t=>{t?e.value=t.$el:e.value=null}}var K=f({name:`ChevronRight`,render(){return p(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},p(`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`}))}}),le={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 ue(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({},le),{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:S(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 q=v({name:`Dropdown`,common:D,peers:{Popover:R},self:ue}),J=k(`n-dropdown-menu`),Y=k(`n-dropdown`),X=k(`n-dropdown-option`),Z=f({name:`DropdownDivider`,props:{clsPrefix:{type:String,required:!0}},render(){return p(`div`,{class:`${this.clsPrefix}-dropdown-divider`})}}),de=f({name:`DropdownGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{showIconRef:e,hasSubmenuRef:n}=t(J),{renderLabelRef:r,labelFieldRef:i,nodePropsRef:a,renderOptionRef:o}=t(Y);return{labelField:i,showIcon:e,hasSubmenu:n,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=p(`div`,Object.assign({class:`${e}-dropdown-option`},r?.(o)),p(`div`,{class:`${e}-dropdown-option-body ${e}-dropdown-option-body--group`},p(`div`,{"data-dropdown-option":!0,class:[`${e}-dropdown-option-body__prefix`,n&&`${e}-dropdown-option-body__prefix--show-icon`]},V(o.icon)),p(`div`,{class:`${e}-dropdown-option-body__label`,"data-dropdown-option":!0},i?i(o):V(o.title??o[this.labelField])),p(`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 fe(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 pe={name:`Icon`,common:D,self:fe},me=w(`icon`,`
|
|
2
|
+
height: 1em;
|
|
3
|
+
width: 1em;
|
|
4
|
+
line-height: 1em;
|
|
5
|
+
text-align: center;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
position: relative;
|
|
8
|
+
fill: currentColor;
|
|
9
|
+
`,[x(`color-transition`,{transition:`color .3s var(--n-bezier)`}),x(`depth`,{color:`var(--n-color)`},[y(`svg`,{opacity:`var(--n-opacity)`,transition:`opacity .3s var(--n-bezier)`})]),y(`svg`,{height:`1em`,width:`1em`})]),he=f({_n_icon__:!0,name:`Icon`,inheritAttrs:!1,props:Object.assign(Object.assign({},C.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=m(e),r=C(`Icon`,`-icon`,me,pe,e,t),i=u(()=>{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?g(`icon`,u(()=>`${e.depth||`d`}`),i,e):void 0;return{mergedClsPrefix:t,mergedStyle:u(()=>{let{size:t,color:n}=e;return{fontSize:L(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:a,themeClass:o}=this;return e?.$options?._n_icon__&&h(`icon`,"don't wrap `n-icon` inside `n-icon`"),a?.(),p(`i`,i(this.$attrs,{role:`img`,class:[`${n}-icon`,o,{[`${n}-icon--depth`]:t,[`${n}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),r?p(r):this.$slots)}});function Q(e,t){return e.type===`submenu`||e.type===void 0&&e[t]!==void 0}function ge(e){return e.type===`group`}function $(e){return e.type===`divider`}function _e(e){return e.type===`render`}var ve=f({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 r=t(Y),{hoverKeyRef:i,keyboardKeyRef:a,lastToggledSubmenuKeyRef:o,pendingKeyPathRef:s,activeKeyPathRef:c,animatedRef:l,mergedShowRef:f,renderLabelRef:p,renderIconRef:m,labelFieldRef:h,childrenFieldRef:g,renderOptionRef:_,nodePropsRef:v,menuPropsRef:y}=r,b=t(X,null),x=t(J),S=t(j),C=u(()=>e.tmNode.rawNode),w=u(()=>{let{value:t}=g;return Q(e.tmNode.rawNode,t)}),T=u(()=>{let{disabled:t}=e.tmNode;return t}),E=ce(u(()=>{if(!w.value)return!1;let{key:t,disabled:n}=e.tmNode;if(n)return!1;let{value:r}=i,{value:c}=a,{value:l}=o,{value:u}=s;return r===null?c===null?l===null?!1:u.includes(t):u.includes(t)&&u[u.length-1]!==t:u.includes(t)}),300,u(()=>a.value===null&&!l.value)),D=u(()=>!!b?.enteringSubmenuRef.value),k=d(!1);n(X,{enteringSubmenuRef:k});function A(){k.value=!0}function M(){k.value=!1}function N(){let{parentKey:t,tmNode:n}=e;n.disabled||f.value&&(o.value=t,a.value=null,i.value=n.key)}function P(){let{tmNode:t}=e;t.disabled||f.value&&i.value!==t.key&&N()}function F(t){if(e.tmNode.disabled||!f.value)return;let{relatedTarget:n}=t;n&&!H({target:n},`dropdownOption`)&&!H({target:n},`scrollbarRail`)&&(i.value=null)}function I(){let{value:t}=w,{tmNode:n}=e;f.value&&!t&&!n.disabled&&(r.doSelect(n.key,n.rawNode),r.doUpdateShow(!1))}return{labelField:h,renderLabel:p,renderIcon:m,siblingHasIcon:x.showIconRef,siblingHasSubmenu:x.hasSubmenuRef,menuProps:y,popoverBody:S,animated:l,mergedShowSubmenu:u(()=>E.value&&!D.value),rawNode:C,hasSubmenu:w,pending:O(()=>{let{value:t}=s,{key:n}=e.tmNode;return t.includes(n)}),childActive:O(()=>{let{value:t}=c,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r===-1?!1:r<t.length-1}),active:O(()=>{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:_,nodeProps:v,handleClick:I,handleMouseMove:P,handleMouseEnter:N,handleMouseLeave:F,handleSubmenuBeforeEnter:A,handleSubmenuAfterEnter:M}},render(){let{animated:e,rawNode:t,mergedShowSubmenu:n,clsPrefix:r,siblingHasIcon:a,siblingHasSubmenu:o,renderLabel:s,renderIcon:c,renderOption:l,nodeProps:u,props:d,scrollable:f}=this,m=null;if(n){let e=this.menuProps?.call(this,t,t.children);m=p(xe,Object.assign({},e,{clsPrefix:r,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}let h={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},g=u?.(t),_=p(`div`,Object.assign({class:[`${r}-dropdown-option`,g?.class],"data-dropdown-option":!0},g),p(`div`,i(h,d),[p(`div`,{class:[`${r}-dropdown-option-body__prefix`,a&&`${r}-dropdown-option-body__prefix--show-icon`]},[c?c(t):V(t.icon)]),p(`div`,{"data-dropdown-option":!0,class:`${r}-dropdown-option-body__label`},s?s(t):V(t[this.labelField]??t.title)),p(`div`,{"data-dropdown-option":!0,class:[`${r}-dropdown-option-body__suffix`,o&&`${r}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?p(he,null,{default:()=>p(K,null)}):null)]),this.hasSubmenu?p(P,null,{default:()=>[p(ie,null,{default:()=>p(`div`,{class:`${r}-dropdown-offset-container`},p(re,{show:this.mergedShowSubmenu,placement:this.placement,to:f&&this.popoverBody||void 0,teleportDisabled:!f},{default:()=>p(`div`,{class:`${r}-dropdown-menu-wrapper`},e?p(A,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:`fade-in-scale-up-transition`,appear:!0},{default:()=>m}):m)}))})]}):null);return l?l({node:_,option:t}):_}}),ye=f({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 p(c,null,p(de,{clsPrefix:n,tmNode:e,key:e.key}),r?.map(e=>{let{rawNode:r}=e;return r.show===!1?null:$(r)?p(Z,{clsPrefix:n,key:e.key}):e.isGroup?(h(`dropdown`,"`group` node is not allowed to be put in `group` node."),null):p(ve,{clsPrefix:n,tmNode:e,parentKey:t,key:e.key})}))}}),be=f({name:`DropdownRenderOption`,props:{tmNode:{type:Object,required:!0}},render(){let{rawNode:{render:e,props:t}}=this.tmNode;return p(`div`,t,[e?.()])}}),xe=f({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:r,childrenFieldRef:i}=t(Y);n(J,{showIconRef:u(()=>{let t=r.value;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>t?t(e):e.icon);let{rawNode:n}=e;return t?t(n):n.icon})}),hasSubmenuRef:u(()=>{let{value:t}=i;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>Q(e,t));let{rawNode:n}=e;return Q(n,t)})})});let a=d(null);return n(N,null),n(z,null),n(j,a),{bodyRef:a}},render(){let{parentKey:e,clsPrefix:t,scrollable:n}=this,r=this.tmNodes.map(r=>{let{rawNode:i}=r;return i.show===!1?null:_e(i)?p(be,{tmNode:r,key:r.key}):$(i)?p(Z,{clsPrefix:t,key:r.key}):ge(i)?p(ye,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key}):p(ve,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key,props:i.props,scrollable:n})});return p(`div`,{class:[`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`],ref:`bodyRef`},n?p(oe,{contentClass:`${t}-dropdown-menu__content`},{default:()=>r}):r,this.showArrow?te({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),Se=w(`dropdown-menu`,`
|
|
10
|
+
transform-origin: var(--v-transform-origin);
|
|
11
|
+
background-color: var(--n-color);
|
|
12
|
+
border-radius: var(--n-border-radius);
|
|
13
|
+
box-shadow: var(--n-box-shadow);
|
|
14
|
+
position: relative;
|
|
15
|
+
transition:
|
|
16
|
+
background-color .3s var(--n-bezier),
|
|
17
|
+
box-shadow .3s var(--n-bezier);
|
|
18
|
+
`,[F(),w(`dropdown-option`,`
|
|
19
|
+
position: relative;
|
|
20
|
+
`,[y(`a`,`
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
color: inherit;
|
|
23
|
+
outline: none;
|
|
24
|
+
`,[y(`&::before`,`
|
|
25
|
+
content: "";
|
|
26
|
+
position: absolute;
|
|
27
|
+
left: 0;
|
|
28
|
+
right: 0;
|
|
29
|
+
top: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
`)]),w(`dropdown-option-body`,`
|
|
32
|
+
display: flex;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
position: relative;
|
|
35
|
+
height: var(--n-option-height);
|
|
36
|
+
line-height: var(--n-option-height);
|
|
37
|
+
font-size: var(--n-font-size);
|
|
38
|
+
color: var(--n-option-text-color);
|
|
39
|
+
transition: color .3s var(--n-bezier);
|
|
40
|
+
`,[y(`&::before`,`
|
|
41
|
+
content: "";
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 4px;
|
|
46
|
+
right: 4px;
|
|
47
|
+
transition: background-color .3s var(--n-bezier);
|
|
48
|
+
border-radius: var(--n-border-radius);
|
|
49
|
+
`),E(`disabled`,[x(`pending`,`
|
|
50
|
+
color: var(--n-option-text-color-hover);
|
|
51
|
+
`,[b(`prefix, suffix`,`
|
|
52
|
+
color: var(--n-option-text-color-hover);
|
|
53
|
+
`),y(`&::before`,`background-color: var(--n-option-color-hover);`)]),x(`active`,`
|
|
54
|
+
color: var(--n-option-text-color-active);
|
|
55
|
+
`,[b(`prefix, suffix`,`
|
|
56
|
+
color: var(--n-option-text-color-active);
|
|
57
|
+
`),y(`&::before`,`background-color: var(--n-option-color-active);`)]),x(`child-active`,`
|
|
58
|
+
color: var(--n-option-text-color-child-active);
|
|
59
|
+
`,[b(`prefix, suffix`,`
|
|
60
|
+
color: var(--n-option-text-color-child-active);
|
|
61
|
+
`)])]),x(`disabled`,`
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
opacity: var(--n-option-opacity-disabled);
|
|
64
|
+
`),x(`group`,`
|
|
65
|
+
font-size: calc(var(--n-font-size) - 1px);
|
|
66
|
+
color: var(--n-group-header-text-color);
|
|
67
|
+
`,[b(`prefix`,`
|
|
68
|
+
width: calc(var(--n-option-prefix-width) / 2);
|
|
69
|
+
`,[x(`show-icon`,`
|
|
70
|
+
width: calc(var(--n-option-icon-prefix-width) / 2);
|
|
71
|
+
`)])]),b(`prefix`,`
|
|
72
|
+
width: var(--n-option-prefix-width);
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
color: var(--n-prefix-color);
|
|
77
|
+
transition: color .3s var(--n-bezier);
|
|
78
|
+
z-index: 1;
|
|
79
|
+
`,[x(`show-icon`,`
|
|
80
|
+
width: var(--n-option-icon-prefix-width);
|
|
81
|
+
`),w(`icon`,`
|
|
82
|
+
font-size: var(--n-option-icon-size);
|
|
83
|
+
`)]),b(`label`,`
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
flex: 1;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
`),b(`suffix`,`
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
flex-grow: 0;
|
|
90
|
+
flex-shrink: 0;
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: flex-end;
|
|
93
|
+
align-items: center;
|
|
94
|
+
min-width: var(--n-option-suffix-width);
|
|
95
|
+
padding: 0 8px;
|
|
96
|
+
transition: color .3s var(--n-bezier);
|
|
97
|
+
color: var(--n-suffix-color);
|
|
98
|
+
z-index: 1;
|
|
99
|
+
`,[x(`has-submenu`,`
|
|
100
|
+
width: var(--n-option-icon-suffix-width);
|
|
101
|
+
`),w(`icon`,`
|
|
102
|
+
font-size: var(--n-option-icon-size);
|
|
103
|
+
`)]),w(`dropdown-menu`,`pointer-events: all;`)]),w(`dropdown-offset-container`,`
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
position: absolute;
|
|
106
|
+
left: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
top: -4px;
|
|
109
|
+
bottom: -4px;
|
|
110
|
+
`)]),w(`dropdown-divider`,`
|
|
111
|
+
transition: background-color .3s var(--n-bezier);
|
|
112
|
+
background-color: var(--n-divider-color);
|
|
113
|
+
height: 1px;
|
|
114
|
+
margin: 4px 0;
|
|
115
|
+
`),w(`dropdown-menu-wrapper`,`
|
|
116
|
+
transform-origin: var(--v-transform-origin);
|
|
117
|
+
width: fit-content;
|
|
118
|
+
`),y(`>`,[w(`scrollbar`,`
|
|
119
|
+
height: inherit;
|
|
120
|
+
max-height: inherit;
|
|
121
|
+
`)]),E(`scrollable`,`
|
|
122
|
+
padding: var(--n-padding);
|
|
123
|
+
`),x(`scrollable`,[b(`content`,`
|
|
124
|
+
padding: var(--n-padding);
|
|
125
|
+
`)])]),Ce={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]},we=Object.keys(B),Te=f({name:`Dropdown`,inheritAttrs:!1,props:Object.assign(Object.assign(Object.assign({},B),Ce),C.props),setup(e){let t=d(!1),r=ae(o(e,`show`),t),i=u(()=>{let{keyField:t,childrenField:n}=e;return ee(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]}})}),s=u(()=>i.value.treeNodes),c=d(null),l=d(null),f=d(null),p=u(()=>c.value??l.value??f.value??null),h=u(()=>i.value.getPath(p.value).keyPath),v=u(()=>i.value.getPath(e.value).keyPath),y=O(()=>e.keyboard&&r.value);se({keydown:{ArrowUp:{prevent:!0,handler:P},ArrowRight:{prevent:!0,handler:N},ArrowDown:{prevent:!0,handler:F},ArrowLeft:{prevent:!0,handler:M},Enter:{prevent:!0,handler:I},Escape:j}},y);let{mergedClsPrefixRef:b,inlineThemeDisabled:x,mergedComponentPropsRef:S}=m(e),w=u(()=>e.size||S?.value?.Dropdown?.size||`medium`),E=C(`Dropdown`,`-dropdown`,Se,q,e,b);n(Y,{labelFieldRef:o(e,`labelField`),childrenFieldRef:o(e,`childrenField`),renderLabelRef:o(e,`renderLabel`),renderIconRef:o(e,`renderIcon`),hoverKeyRef:c,keyboardKeyRef:l,lastToggledSubmenuKeyRef:f,pendingKeyPathRef:h,activeKeyPathRef:v,animatedRef:o(e,`animated`),mergedShowRef:r,nodePropsRef:o(e,`nodeProps`),renderOptionRef:o(e,`renderOption`),menuPropsRef:o(e,`menuProps`),doSelect:D,doUpdateShow:k}),a(r,t=>{!e.animated&&!t&&A()});function D(t,n){let{onSelect:r}=e;r&&_(r,t,n)}function k(n){let{"onUpdate:show":r,onUpdateShow:i}=e;r&&_(r,n),i&&_(i,n),t.value=n}function A(){c.value=null,l.value=null,f.value=null}function j(){k(!1)}function M(){R(`left`)}function N(){R(`right`)}function P(){R(`up`)}function F(){R(`down`)}function I(){let e=L();e?.isLeaf&&r.value&&(D(e.key,e.rawNode),k(!1))}function L(){let{value:e}=i,{value:t}=p;return!e||t===null?null:e.getNode(t)??null}function R(e){let{value:t}=p,{value:{getFirstAvailableNode:n}}=i,r=null;if(t===null){let e=n();e!==null&&(r=e.key)}else{let t=L();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&&(r=n.key)}}r!==null&&(c.value=null,l.value=r)}let z=u(()=>{let{inverted:t}=e,n=w.value,{common:{cubicBezierEaseInOut:r},self:i}=E.value,{padding:a,dividerColor:o,borderRadius:s,optionOpacityDisabled:c,[T(`optionIconSuffixWidth`,n)]:l,[T(`optionSuffixWidth`,n)]:u,[T(`optionIconPrefixWidth`,n)]:d,[T(`optionPrefixWidth`,n)]:f,[T(`fontSize`,n)]:p,[T(`optionHeight`,n)]:m,[T(`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}),B=x?g(`dropdown`,u(()=>`${w.value[0]}${e.inverted?`i`:``}`),z,e):void 0;return{mergedClsPrefix:b,mergedTheme:E,mergedSize:w,tmNodes:s,mergedShow:r,handleAfterLeave:()=>{e.animated&&A()},doUpdateShow:k,cssVars:x?void 0:z,themeClass:B?.themeClass,onRender:B?.onRender}},render(){let e=(e,t,n,r,a)=>{var o;let{mergedClsPrefix:s,menuProps:c}=this;(o=this.onRender)==null||o.call(this);let l=c?.(void 0,this.tmNodes.map(e=>e.rawNode))||{},u={ref:G(t),class:[e,`${s}-dropdown`,`${s}-dropdown--${this.mergedSize}-size`,this.themeClass],clsPrefix:s,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:r,onMouseleave:a};return p(xe,i(this.$attrs,u,l))},{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 p(ne,Object.assign({},I(this.$props,we),n),{trigger:()=>{var e;return(e=this.$slots).default?.call(e)}})}});export{G as i,q as n,K as r,Te as t};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import{C as e,E as t,I as n,M as r,U as i,W as a,at as o,i as s,l as c,tt as l,v as u,x as d,y as f}from"./runtime-core.esm-bundler-yNW65ghW.js";import{B as ee,H as p,J as m,V as te,X as h,Y as g,c as _,ct as v,dt as y,f as ne,ft as b,it as x,l as S,lt as C,mt as w,n as T,pt as E,q as D,r as O,rt as k,tt as A,u as re}from"./_plugin-vue_export-helper-BrYOyDjU.js";import{_ as ie,h as j,i as M,l as N,n as P,o as F,t as I,u as ae,v as L,x as oe,y as se}from"./Suffix-DI9irQ4f.js";var ce=u({name:`Eye`,render(){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},d(`path`,{d:`M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`}),d(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),R=u({name:`EyeOff`,render(){return d(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},d(`path`,{d:`M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z`,fill:`currentColor`}),d(`path`,{d:`M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z`,fill:`currentColor`}),d(`path`,{d:`M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z`,fill:`currentColor`}),d(`path`,{d:`M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z`,fill:`currentColor`}),d(`path`,{d:`M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z`,fill:`currentColor`}))}}),z={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`};function B(e){let{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:i,primaryColorHover:a,inputColor:o,inputColorDisabled:s,borderColor:c,warningColor:l,warningColorHover:u,errorColor:d,errorColorHover:f,borderRadius:ee,lineHeight:p,fontSizeTiny:m,fontSizeSmall:te,fontSizeMedium:h,fontSizeLarge:g,heightTiny:_,heightSmall:v,heightMedium:y,heightLarge:ne,actionColor:b,clearColor:S,clearColorHover:C,clearColorPressed:w,placeholderColor:T,placeholderColorDisabled:E,iconColor:D,iconColorDisabled:O,iconColorHover:k,iconColorPressed:A,fontWeight:re}=e;return Object.assign(Object.assign({},z),{fontWeight:re,countTextColorDisabled:r,countTextColor:n,heightTiny:_,heightSmall:v,heightMedium:y,heightLarge:ne,fontSizeTiny:m,fontSizeSmall:te,fontSizeMedium:h,fontSizeLarge:g,lineHeight:p,lineHeightTextarea:p,borderRadius:ee,iconSize:`16px`,groupLabelColor:b,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:T,placeholderColorDisabled:E,color:o,colorDisabled:s,colorFocus:o,groupLabelBorder:`1px solid ${c}`,border:`1px solid ${c}`,borderHover:`1px solid ${a}`,borderDisabled:`1px solid ${c}`,borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 0 2px ${x(i,{alpha:.2})}`,loadingColor:i,loadingColorWarning:l,borderWarning:`1px solid ${l}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:o,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${x(l,{alpha:.2})}`,caretColorWarning:l,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${f}`,colorFocusError:o,borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 0 2px ${x(d,{alpha:.2})}`,caretColorError:d,clearColor:S,clearColorHover:C,clearColorPressed:w,iconColor:D,iconColorDisabled:O,iconColorHover:k,iconColorPressed:A,suffixTextColor:t})}var V=_({name:`Input`,common:O,peers:{Scrollbar:M},self:B}),H=A(`n-input`),le=C(`input`,`
|
|
2
|
+
max-width: 100%;
|
|
3
|
+
cursor: text;
|
|
4
|
+
line-height: 1.5;
|
|
5
|
+
z-index: auto;
|
|
6
|
+
outline: none;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
position: relative;
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
border-radius: var(--n-border-radius);
|
|
11
|
+
background-color: var(--n-color);
|
|
12
|
+
transition: background-color .3s var(--n-bezier);
|
|
13
|
+
font-size: var(--n-font-size);
|
|
14
|
+
font-weight: var(--n-font-weight);
|
|
15
|
+
--n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);
|
|
16
|
+
`,[y(`input, textarea`,`
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
flex-grow: 1;
|
|
19
|
+
position: relative;
|
|
20
|
+
`),y(`input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder`,`
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
font-size: inherit;
|
|
23
|
+
line-height: 1.5;
|
|
24
|
+
font-family: inherit;
|
|
25
|
+
border: none;
|
|
26
|
+
outline: none;
|
|
27
|
+
background-color: #0000;
|
|
28
|
+
text-align: inherit;
|
|
29
|
+
transition:
|
|
30
|
+
-webkit-text-fill-color .3s var(--n-bezier),
|
|
31
|
+
caret-color .3s var(--n-bezier),
|
|
32
|
+
color .3s var(--n-bezier),
|
|
33
|
+
text-decoration-color .3s var(--n-bezier);
|
|
34
|
+
`),y(`input-el, textarea-el`,`
|
|
35
|
+
-webkit-appearance: none;
|
|
36
|
+
scrollbar-width: none;
|
|
37
|
+
width: 100%;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
text-decoration-color: var(--n-text-decoration-color);
|
|
40
|
+
color: var(--n-text-color);
|
|
41
|
+
caret-color: var(--n-caret-color);
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
`,[v(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
44
|
+
width: 0;
|
|
45
|
+
height: 0;
|
|
46
|
+
display: none;
|
|
47
|
+
`),v(`&::placeholder`,`
|
|
48
|
+
color: #0000;
|
|
49
|
+
-webkit-text-fill-color: transparent !important;
|
|
50
|
+
`),v(`&:-webkit-autofill ~`,[y(`placeholder`,`display: none;`)])]),b(`round`,[E(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),y(`placeholder`,`
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
position: absolute;
|
|
53
|
+
left: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
top: 0;
|
|
56
|
+
bottom: 0;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
color: var(--n-placeholder-color);
|
|
59
|
+
`,[v(`span`,`
|
|
60
|
+
width: 100%;
|
|
61
|
+
display: inline-block;
|
|
62
|
+
`)]),b(`textarea`,[y(`placeholder`,`overflow: visible;`)]),E(`autosize`,`width: 100%;`),b(`autosize`,[y(`textarea-el, input-el`,`
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
height: 100%;
|
|
67
|
+
`)]),C(`input-wrapper`,`
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
flex-grow: 1;
|
|
71
|
+
position: relative;
|
|
72
|
+
padding-left: var(--n-padding-left);
|
|
73
|
+
padding-right: var(--n-padding-right);
|
|
74
|
+
`),y(`input-mirror`,`
|
|
75
|
+
padding: 0;
|
|
76
|
+
height: var(--n-height);
|
|
77
|
+
line-height: var(--n-height);
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
visibility: hidden;
|
|
80
|
+
position: static;
|
|
81
|
+
white-space: pre;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
`),y(`input-el`,`
|
|
84
|
+
padding: 0;
|
|
85
|
+
height: var(--n-height);
|
|
86
|
+
line-height: var(--n-height);
|
|
87
|
+
`,[v(`&[type=password]::-ms-reveal`,`display: none;`),v(`+`,[y(`placeholder`,`
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
`)])]),E(`textarea`,[y(`placeholder`,`white-space: nowrap;`)]),y(`eye`,`
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
transition: color .3s var(--n-bezier);
|
|
95
|
+
`),b(`textarea`,`width: 100%;`,[C(`input-word-count`,`
|
|
96
|
+
position: absolute;
|
|
97
|
+
right: var(--n-padding-right);
|
|
98
|
+
bottom: var(--n-padding-vertical);
|
|
99
|
+
`),b(`resizable`,[C(`input-wrapper`,`
|
|
100
|
+
resize: vertical;
|
|
101
|
+
min-height: var(--n-height);
|
|
102
|
+
`)]),y(`textarea-el, textarea-mirror, placeholder`,`
|
|
103
|
+
height: 100%;
|
|
104
|
+
padding-left: 0;
|
|
105
|
+
padding-right: 0;
|
|
106
|
+
padding-top: var(--n-padding-vertical);
|
|
107
|
+
padding-bottom: var(--n-padding-vertical);
|
|
108
|
+
word-break: break-word;
|
|
109
|
+
display: inline-block;
|
|
110
|
+
vertical-align: bottom;
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
line-height: var(--n-line-height-textarea);
|
|
113
|
+
margin: 0;
|
|
114
|
+
resize: none;
|
|
115
|
+
white-space: pre-wrap;
|
|
116
|
+
scroll-padding-block-end: var(--n-padding-vertical);
|
|
117
|
+
`),y(`textarea-mirror`,`
|
|
118
|
+
width: 100%;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
visibility: hidden;
|
|
122
|
+
position: static;
|
|
123
|
+
white-space: pre-wrap;
|
|
124
|
+
overflow-wrap: break-word;
|
|
125
|
+
`)]),b(`pair`,[y(`input-el, placeholder`,`text-align: center;`),y(`separator`,`
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
transition: color .3s var(--n-bezier);
|
|
129
|
+
color: var(--n-text-color);
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
`,[C(`icon`,`
|
|
132
|
+
color: var(--n-icon-color);
|
|
133
|
+
`),C(`base-icon`,`
|
|
134
|
+
color: var(--n-icon-color);
|
|
135
|
+
`)])]),b(`disabled`,`
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
background-color: var(--n-color-disabled);
|
|
138
|
+
`,[y(`border`,`border: var(--n-border-disabled);`),y(`input-el, textarea-el`,`
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
color: var(--n-text-color-disabled);
|
|
141
|
+
text-decoration-color: var(--n-text-color-disabled);
|
|
142
|
+
`),y(`placeholder`,`color: var(--n-placeholder-color-disabled);`),y(`separator`,`color: var(--n-text-color-disabled);`,[C(`icon`,`
|
|
143
|
+
color: var(--n-icon-color-disabled);
|
|
144
|
+
`),C(`base-icon`,`
|
|
145
|
+
color: var(--n-icon-color-disabled);
|
|
146
|
+
`)]),C(`input-word-count`,`
|
|
147
|
+
color: var(--n-count-text-color-disabled);
|
|
148
|
+
`),y(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[C(`icon`,`
|
|
149
|
+
color: var(--n-icon-color-disabled);
|
|
150
|
+
`),C(`internal-icon`,`
|
|
151
|
+
color: var(--n-icon-color-disabled);
|
|
152
|
+
`)])]),E(`disabled`,[y(`eye`,`
|
|
153
|
+
color: var(--n-icon-color);
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
`,[v(`&:hover`,`
|
|
156
|
+
color: var(--n-icon-color-hover);
|
|
157
|
+
`),v(`&:active`,`
|
|
158
|
+
color: var(--n-icon-color-pressed);
|
|
159
|
+
`)]),v(`&:hover`,[y(`state-border`,`border: var(--n-border-hover);`)]),b(`focus`,`background-color: var(--n-color-focus);`,[y(`state-border`,`
|
|
160
|
+
border: var(--n-border-focus);
|
|
161
|
+
box-shadow: var(--n-box-shadow-focus);
|
|
162
|
+
`)])]),y(`border, state-border`,`
|
|
163
|
+
box-sizing: border-box;
|
|
164
|
+
position: absolute;
|
|
165
|
+
left: 0;
|
|
166
|
+
right: 0;
|
|
167
|
+
top: 0;
|
|
168
|
+
bottom: 0;
|
|
169
|
+
pointer-events: none;
|
|
170
|
+
border-radius: inherit;
|
|
171
|
+
border: var(--n-border);
|
|
172
|
+
transition:
|
|
173
|
+
box-shadow .3s var(--n-bezier),
|
|
174
|
+
border-color .3s var(--n-bezier);
|
|
175
|
+
`),y(`state-border`,`
|
|
176
|
+
border-color: #0000;
|
|
177
|
+
z-index: 1;
|
|
178
|
+
`),y(`prefix`,`margin-right: 4px;`),y(`suffix`,`
|
|
179
|
+
margin-left: 4px;
|
|
180
|
+
`),y(`suffix, prefix`,`
|
|
181
|
+
transition: color .3s var(--n-bezier);
|
|
182
|
+
flex-wrap: nowrap;
|
|
183
|
+
flex-shrink: 0;
|
|
184
|
+
line-height: var(--n-height);
|
|
185
|
+
white-space: nowrap;
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
color: var(--n-suffix-text-color);
|
|
190
|
+
`,[C(`base-loading`,`
|
|
191
|
+
font-size: var(--n-icon-size);
|
|
192
|
+
margin: 0 2px;
|
|
193
|
+
color: var(--n-loading-color);
|
|
194
|
+
`),C(`base-clear`,`
|
|
195
|
+
font-size: var(--n-icon-size);
|
|
196
|
+
`,[y(`placeholder`,[C(`base-icon`,`
|
|
197
|
+
transition: color .3s var(--n-bezier);
|
|
198
|
+
color: var(--n-icon-color);
|
|
199
|
+
font-size: var(--n-icon-size);
|
|
200
|
+
`)])]),v(`>`,[C(`icon`,`
|
|
201
|
+
transition: color .3s var(--n-bezier);
|
|
202
|
+
color: var(--n-icon-color);
|
|
203
|
+
font-size: var(--n-icon-size);
|
|
204
|
+
`)]),C(`base-icon`,`
|
|
205
|
+
font-size: var(--n-icon-size);
|
|
206
|
+
`)]),C(`input-word-count`,`
|
|
207
|
+
pointer-events: none;
|
|
208
|
+
line-height: 1.5;
|
|
209
|
+
font-size: .85em;
|
|
210
|
+
color: var(--n-count-text-color);
|
|
211
|
+
transition: color .3s var(--n-bezier);
|
|
212
|
+
margin-left: 4px;
|
|
213
|
+
font-variant: tabular-nums;
|
|
214
|
+
`),[`warning`,`error`].map(e=>b(`${e}-status`,[E(`disabled`,[C(`base-loading`,`
|
|
215
|
+
color: var(--n-loading-color-${e})
|
|
216
|
+
`),y(`input-el, textarea-el`,`
|
|
217
|
+
caret-color: var(--n-caret-color-${e});
|
|
218
|
+
`),y(`state-border`,`
|
|
219
|
+
border: var(--n-border-${e});
|
|
220
|
+
`),v(`&:hover`,[y(`state-border`,`
|
|
221
|
+
border: var(--n-border-hover-${e});
|
|
222
|
+
`)]),v(`&:focus`,`
|
|
223
|
+
background-color: var(--n-color-focus-${e});
|
|
224
|
+
`,[y(`state-border`,`
|
|
225
|
+
box-shadow: var(--n-box-shadow-focus-${e});
|
|
226
|
+
border: var(--n-border-focus-${e});
|
|
227
|
+
`)]),b(`focus`,`
|
|
228
|
+
background-color: var(--n-color-focus-${e});
|
|
229
|
+
`,[y(`state-border`,`
|
|
230
|
+
box-shadow: var(--n-box-shadow-focus-${e});
|
|
231
|
+
border: var(--n-border-focus-${e});
|
|
232
|
+
`)])])]))]),ue=C(`input`,[b(`disabled`,[y(`input-el, textarea-el`,`
|
|
233
|
+
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|
234
|
+
`)])]);function U(e){let t=0;for(let n of e)t++;return t}function W(e){return e===``||e==null}function de(e){let t=l(null);function n(){let{value:n}=e;if(!n?.focus){a();return}let{selectionStart:r,selectionEnd:i,value:o}=n;if(r==null||i==null){a();return}t.value={start:r,end:i,beforeText:o.slice(0,r),afterText:o.slice(i)}}function r(){var n;let{value:r}=t,{value:i}=e;if(!r||!i)return;let{value:a}=i,{start:o,beforeText:s,afterText:c}=r,l=a.length;if(a.endsWith(c))l=a.length-c.length;else if(a.startsWith(s))l=s.length;else{let e=s[o-1],t=a.indexOf(e,o-1);t!==-1&&(l=t+1)}(n=i.setSelectionRange)==null||n.call(i,l,l)}function a(){t.value=null}return i(e,a),{recordCursor:n,restoreCursor:r}}var G=u({name:`InputWordCount`,setup(t,{slots:n}){let{mergedValueRef:r,maxlengthRef:i,mergedClsPrefixRef:a,countGraphemesRef:o}=e(H),s=c(()=>{let{value:e}=r;return e===null||Array.isArray(e)?0:(o.value||U)(e)});return()=>{let{value:e}=i,{value:t}=r;return d(`span`,{class:`${a.value}-input-word-count`},m(n.default,{value:t===null||Array.isArray(t)?``:t},()=>[e===void 0?s.value:`${s.value} / ${e}`]))}}}),K=u({name:`Input`,props:Object.assign(Object.assign({},S.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:`text`},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),slots:Object,setup(e){let{mergedClsPrefixRef:s,mergedBorderedRef:u,inlineThemeDisabled:d,mergedRtlRef:m,mergedComponentPropsRef:g}=p(e),_=S(`Input`,`-input`,le,V,e,s);T&&re(`-input-safari`,ue,s);let v=l(null),y=l(null),b=l(null),x=l(null),C=l(null),E=l(null),D=l(null),O=de(D),A=l(null),{localeRef:j}=ae(`Input`),M=l(e.defaultValue),N=ie(o(e,`value`),M),P=ee(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:g?.value?.Input?.size||`medium`}}),{mergedSizeRef:F,mergedDisabledRef:I,mergedStatusRef:ce}=P,R=l(!1),z=l(!1),B=l(!1),U=l(!1),G=null,K=c(()=>{let{placeholder:t,pair:n}=e;return n?Array.isArray(t)?t:t===void 0?[``,``]:[t,t]:t===void 0?[j.value.placeholder]:[t]}),fe=c(()=>{let{value:e}=B,{value:t}=N,{value:n}=K;return!e&&(W(t)||Array.isArray(t)&&W(t[0]))&&n[0]}),pe=c(()=>{let{value:e}=B,{value:t}=N,{value:n}=K;return!e&&n[1]&&(W(t)||Array.isArray(t)&&W(t[1]))}),q=k(()=>e.internalForceFocus||R.value),me=k(()=>{if(I.value||e.readonly||!e.clearable||!q.value&&!z.value)return!1;let{value:t}=N,{value:n}=q;return e.pair?!!(Array.isArray(t)&&(t[0]||t[1]))&&(z.value||n):!!t&&(z.value||n)}),J=c(()=>{let{showPasswordOn:t}=e;if(t)return t;if(e.showPasswordToggle)return`click`}),Y=l(!1),he=c(()=>{let{textDecoration:t}=e;return t?Array.isArray(t)?t.map(e=>({textDecoration:e})):[{textDecoration:t}]:[``,``]}),ge=l(void 0),_e=()=>{if(e.type===`textarea`){let{autosize:t}=e;if(t&&(ge.value=A.value?.$el?.offsetWidth),!y.value||typeof t==`boolean`)return;let{paddingTop:n,paddingBottom:r,lineHeight:i}=window.getComputedStyle(y.value),a=Number(n.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:c}=b;if(!c)return;if(t.minRows){let e=Math.max(t.minRows,1),n=`${a+o+s*e}px`;c.style.minHeight=n}if(t.maxRows){let e=`${a+o+s*t.maxRows}px`;c.style.maxHeight=e}}},ve=c(()=>{let{maxlength:t}=e;return t===void 0?void 0:Number(t)});r(()=>{let{value:e}=N;Array.isArray(e)||nt(e)});let ye=f().proxy;function X(t,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=e,{nTriggerFormInput:o}=P;r&&h(r,t,n),i&&h(i,t,n),a&&h(a,t,n),M.value=t,o()}function Z(t,n){let{onChange:r}=e,{nTriggerFormChange:i}=P;r&&h(r,t,n),M.value=t,i()}function be(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=P;n&&h(n,t),r()}function xe(t){let{onFocus:n}=e,{nTriggerFormFocus:r}=P;n&&h(n,t),r()}function Se(t){let{onClear:n}=e;n&&h(n,t)}function Ce(t){let{onInputBlur:n}=e;n&&h(n,t)}function we(t){let{onInputFocus:n}=e;n&&h(n,t)}function Te(){let{onDeactivate:t}=e;t&&h(t)}function Ee(){let{onActivate:t}=e;t&&h(t)}function De(t){let{onClick:n}=e;n&&h(n,t)}function Oe(t){let{onWrapperFocus:n}=e;n&&h(n,t)}function ke(t){let{onWrapperBlur:n}=e;n&&h(n,t)}function Ae(){B.value=!0}function je(e){B.value=!1,e.target===E.value?Q(e,1):Q(e,0)}function Q(n,r=0,i=`input`){let a=n.target.value;if(nt(a),n instanceof InputEvent&&!n.isComposing&&(B.value=!1),e.type===`textarea`){let{value:e}=A;e&&e.syncUnifiedContainer()}if(G=a,B.value)return;O.recordCursor();let o=Me(a);if(o)if(!e.pair)i===`input`?X(a,{source:r}):Z(a,{source:r});else{let{value:e}=N;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[r]=a,i===`input`?X(e,{source:r}):Z(e,{source:r})}ye.$forceUpdate(),o||t(O.restoreCursor)}function Me(t){let{countGraphemes:n,maxlength:r,minlength:i}=e;if(n){let e;if(r!==void 0&&(e===void 0&&(e=n(t)),e>Number(r))||i!==void 0&&(e===void 0&&(e=n(t)),e<Number(r)))return!1}let{allowInput:a}=e;return typeof a==`function`?a(t):!0}function Ne(e){Ce(e),e.relatedTarget===v.value&&Te(),e.relatedTarget!==null&&(e.relatedTarget===C.value||e.relatedTarget===E.value||e.relatedTarget===y.value)||(U.value=!1),$(e,`blur`),D.value=null}function Pe(e,t){we(e),R.value=!0,U.value=!0,Ee(),$(e,`focus`),t===0?D.value=C.value:t===1?D.value=E.value:t===2&&(D.value=y.value)}function Fe(t){e.passivelyActivated&&(ke(t),$(t,`blur`))}function Ie(t){e.passivelyActivated&&(R.value=!0,Oe(t),$(t,`focus`))}function $(e,t){e.relatedTarget!==null&&(e.relatedTarget===C.value||e.relatedTarget===E.value||e.relatedTarget===y.value||e.relatedTarget===v.value)||(t===`focus`?(xe(e),R.value=!0):t===`blur`&&(be(e),R.value=!1))}function Le(e,t){Q(e,t,`change`)}function Re(e){De(e)}function ze(e){Se(e),Be()}function Be(){e.pair?(X([``,``],{source:`clear`}),Z([``,``],{source:`clear`})):(X(``,{source:`clear`}),Z(``,{source:`clear`}))}function Ve(t){let{onMousedown:n}=e;n&&n(t);let{tagName:r}=t.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(e.resizable){let{value:e}=v;if(e){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();if(n+i-14<t.clientX&&t.clientX<n+i&&r+a-14<t.clientY&&t.clientY<r+a)return}}t.preventDefault(),R.value||Xe()}}function He(){var t;z.value=!0,e.type===`textarea`&&((t=A.value)==null||t.handleMouseEnterWrapper())}function Ue(){var t;z.value=!1,e.type===`textarea`&&((t=A.value)==null||t.handleMouseLeaveWrapper())}function We(){I.value||J.value===`click`&&(Y.value=!Y.value)}function Ge(e){if(I.value)return;e.preventDefault();let t=e=>{e.preventDefault(),L(`mouseup`,document,t)};if(se(`mouseup`,document,t),J.value!==`mousedown`)return;Y.value=!0;let n=()=>{Y.value=!1,L(`mouseup`,document,n)};se(`mouseup`,document,n)}function Ke(t){e.onKeyup&&h(e.onKeyup,t)}function qe(t){switch(e.onKeydown&&h(e.onKeydown,t),t.key){case`Escape`:Ye();break;case`Enter`:Je(t);break}}function Je(t){var n,r;if(e.passivelyActivated){let{value:i}=U;if(i){e.internalDeactivateOnEnter&&Ye();return}t.preventDefault(),e.type===`textarea`?(n=y.value)==null||n.focus():(r=C.value)==null||r.focus()}}function Ye(){e.passivelyActivated&&(U.value=!1,t(()=>{var e;(e=v.value)==null||e.focus()}))}function Xe(){var t,n,r;I.value||(e.passivelyActivated?(t=v.value)==null||t.focus():((n=y.value)==null||n.focus(),(r=C.value)==null||r.focus()))}function Ze(){v.value?.contains(document.activeElement)&&document.activeElement.blur()}function Qe(){var e,t;(e=y.value)==null||e.select(),(t=C.value)==null||t.select()}function $e(){I.value||(y.value?y.value.focus():C.value&&C.value.focus())}function et(){let{value:e}=v;e?.contains(document.activeElement)&&e!==document.activeElement&&Ye()}function tt(t){if(e.type===`textarea`){let{value:e}=y;e?.scrollTo(t)}else{let{value:e}=C;e?.scrollTo(t)}}function nt(t){let{type:n,pair:r,autosize:i}=e;if(!r&&i)if(n===`textarea`){let{value:e}=b;e&&(e.textContent=`${t??``}\r\n`)}else{let{value:e}=x;e&&(t?e.textContent=t:e.innerHTML=` `)}}function rt(){_e()}let it=l({top:`0`});function at(e){var t;let{scrollTop:n}=e.target;it.value.top=`${-n}px`,(t=A.value)==null||t.syncUnifiedContainer()}let ot=null;a(()=>{let{autosize:t,type:n}=e;t&&n===`textarea`?ot=i(N,e=>{!Array.isArray(e)&&e!==G&&nt(e)}):ot?.()});let st=null;a(()=>{e.type===`textarea`?st=i(N,e=>{var t;!Array.isArray(e)&&e!==G&&((t=A.value)==null||t.syncUnifiedContainer())}):st?.()}),n(H,{mergedValueRef:N,maxlengthRef:ve,mergedClsPrefixRef:s,countGraphemesRef:o(e,`countGraphemes`)});let ct={wrapperElRef:v,inputElRef:C,textareaElRef:y,isCompositing:B,clear:Be,focus:Xe,blur:Ze,select:Qe,deactivate:et,activate:$e,scrollTo:tt},lt=ne(`Input`,m,s),ut=c(()=>{let{value:e}=F,{common:{cubicBezierEaseInOut:t},self:{color:n,borderRadius:r,textColor:i,caretColor:a,caretColorError:o,caretColorWarning:s,textDecorationColor:c,border:l,borderDisabled:u,borderHover:d,borderFocus:f,placeholderColor:ee,placeholderColorDisabled:p,lineHeightTextarea:m,colorDisabled:te,colorFocus:h,textColorDisabled:g,boxShadowFocus:v,iconSize:y,colorFocusWarning:ne,boxShadowFocusWarning:b,borderWarning:x,borderFocusWarning:S,borderHoverWarning:C,colorFocusError:T,boxShadowFocusError:E,borderError:D,borderFocusError:O,borderHoverError:k,clearSize:A,clearColor:re,clearColorHover:ie,clearColorPressed:j,iconColor:M,iconColorDisabled:N,suffixTextColor:P,countTextColor:I,countTextColorDisabled:ae,iconColorHover:L,iconColorPressed:se,loadingColor:ce,loadingColorError:R,loadingColorWarning:z,fontWeight:B,[w(`padding`,e)]:V,[w(`fontSize`,e)]:H,[w(`height`,e)]:le}}=_.value,{left:ue,right:U}=oe(V);return{"--n-bezier":t,"--n-count-text-color":I,"--n-count-text-color-disabled":ae,"--n-color":n,"--n-font-size":H,"--n-font-weight":B,"--n-border-radius":r,"--n-height":le,"--n-padding-left":ue,"--n-padding-right":U,"--n-text-color":i,"--n-caret-color":a,"--n-text-decoration-color":c,"--n-border":l,"--n-border-disabled":u,"--n-border-hover":d,"--n-border-focus":f,"--n-placeholder-color":ee,"--n-placeholder-color-disabled":p,"--n-icon-size":y,"--n-line-height-textarea":m,"--n-color-disabled":te,"--n-color-focus":h,"--n-text-color-disabled":g,"--n-box-shadow-focus":v,"--n-loading-color":ce,"--n-caret-color-warning":s,"--n-color-focus-warning":ne,"--n-box-shadow-focus-warning":b,"--n-border-warning":x,"--n-border-focus-warning":S,"--n-border-hover-warning":C,"--n-loading-color-warning":z,"--n-caret-color-error":o,"--n-color-focus-error":T,"--n-box-shadow-focus-error":E,"--n-border-error":D,"--n-border-focus-error":O,"--n-border-hover-error":k,"--n-loading-color-error":R,"--n-clear-color":re,"--n-clear-size":A,"--n-clear-color-hover":ie,"--n-clear-color-pressed":j,"--n-icon-color":M,"--n-icon-color-hover":L,"--n-icon-color-pressed":se,"--n-icon-color-disabled":N,"--n-suffix-text-color":P}}),dt=d?te(`input`,c(()=>{let{value:e}=F;return e[0]}),ut,e):void 0;return Object.assign(Object.assign({},ct),{wrapperElRef:v,inputElRef:C,inputMirrorElRef:x,inputEl2Ref:E,textareaElRef:y,textareaMirrorElRef:b,textareaScrollbarInstRef:A,rtlEnabled:lt,uncontrolledValue:M,mergedValue:N,passwordVisible:Y,mergedPlaceholder:K,showPlaceholder1:fe,showPlaceholder2:pe,mergedFocus:q,isComposing:B,activated:U,showClearButton:me,mergedSize:F,mergedDisabled:I,textDecorationStyle:he,mergedClsPrefix:s,mergedBordered:u,mergedShowPasswordOn:J,placeholderStyle:it,mergedStatus:ce,textAreaScrollContainerWidth:ge,handleTextAreaScroll:at,handleCompositionStart:Ae,handleCompositionEnd:je,handleInput:Q,handleInputBlur:Ne,handleInputFocus:Pe,handleWrapperBlur:Fe,handleWrapperFocus:Ie,handleMouseEnter:He,handleMouseLeave:Ue,handleMouseDown:Ve,handleChange:Le,handleClick:Re,handleClear:ze,handlePasswordToggleClick:We,handlePasswordToggleMousedown:Ge,handleWrapperKeydown:qe,handleWrapperKeyup:Ke,handleTextAreaMirrorResize:rt,getTextareaScrollContainer:()=>y.value,mergedTheme:_,cssVars:d?void 0:ut,themeClass:dt?.themeClass,onRender:dt?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:r,countGraphemes:i,onRender:a}=this,o=this.$slots;return a?.(),d(`div`,{ref:`wrapperElRef`,class:[`${e}-input`,`${e}-input--${this.mergedSize}-size`,n,t&&`${e}-input--${t}-status`,{[`${e}-input--rtl`]:this.rtlEnabled,[`${e}-input--disabled`]:this.mergedDisabled,[`${e}-input--textarea`]:r===`textarea`,[`${e}-input--resizable`]:this.resizable&&!this.autosize,[`${e}-input--autosize`]:this.autosize,[`${e}-input--round`]:this.round&&r!==`textarea`,[`${e}-input--pair`]:this.pair,[`${e}-input--focus`]:this.mergedFocus,[`${e}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},d(`div`,{class:`${e}-input-wrapper`},g(o.prefix,t=>t&&d(`div`,{class:`${e}-input__prefix`},t)),r===`textarea`?d(P,{ref:`textareaScrollbarInstRef`,class:`${e}-input__textarea`,container:this.getTextareaScrollContainer,theme:this.theme?.peers?.Scrollbar,themeOverrides:this.themeOverrides?.peers?.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{let{textAreaScrollContainerWidth:t}=this,n={width:this.autosize&&t&&`${t}px`};return d(s,null,d(`textarea`,Object.assign({},this.inputProps,{ref:`textareaElRef`,class:[`${e}-input__textarea-el`,this.inputProps?.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],this.inputProps?.style,n],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?d(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?d(j,{onResize:this.handleTextAreaMirrorResize},{default:()=>d(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):d(`div`,{class:`${e}-input__input`},d(`input`,Object.assign({type:r===`password`&&this.mergedShowPasswordOn&&this.passwordVisible?`text`:r},this.inputProps,{ref:`inputElRef`,class:[`${e}-input__input-el`,this.inputProps?.class],style:[this.textDecorationStyle[0],this.inputProps?.style],tabindex:this.passivelyActivated&&!this.activated?-1:this.inputProps?.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}})),this.showPlaceholder1?d(`div`,{class:`${e}-input__placeholder`},d(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?d(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&g(o.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?d(`div`,{class:`${e}-input__suffix`},[g(o[`clear-icon-placeholder`],t=>(this.clearable||t)&&d(F,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>{var e;return(e=this.$slots)[`clear-icon`]?.call(e)}})),this.internalLoadingBeforeSuffix?null:t,this.loading===void 0?null:d(I,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?d(G,null,{default:e=>{let{renderCount:t}=this;return t?t(e):o.count?.call(o,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?d(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?D(o[`password-visible-icon`],()=>[d(N,{clsPrefix:e},{default:()=>d(ce,null)})]):D(o[`password-invisible-icon`],()=>[d(N,{clsPrefix:e},{default:()=>d(R,null)})])):null]):null)),this.pair?d(`span`,{class:`${e}-input__separator`},D(o.separator,()=>[this.separator])):null,this.pair?d(`div`,{class:`${e}-input-wrapper`},d(`div`,{class:`${e}-input__input`},d(`input`,{ref:`inputEl2Ref`,type:this.type,class:`${e}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}}),this.showPlaceholder2?d(`div`,{class:`${e}-input__placeholder`},d(`span`,null,this.mergedPlaceholder[1])):null),g(o.suffix,t=>(this.clearable||t)&&d(`div`,{class:`${e}-input__suffix`},[this.clearable&&d(F,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>o[`clear-icon`]?.call(o),placeholder:()=>o[`clear-icon-placeholder`]?.call(o)}),t]))):null,this.mergedBordered?d(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?d(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&r===`textarea`?d(G,null,{default:e=>{let{renderCount:t}=this;return t?t(e):o.count?.call(o,e)}}):null)}});export{V as n,K as t};
|