hermes-web-ui 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/client/assets/Add-C5vmHXvi.js +1 -0
- package/dist/client/assets/{Button-vKfgky-Y.js → Button-BkFCVws1.js} +3 -3
- package/dist/client/assets/{ChannelsView-CHWtzAkF.js → ChannelsView-kmohhCQz.js} +1 -1
- package/dist/client/assets/ChatView-BqERLIKm.js +3 -0
- package/dist/client/assets/{ChatView-b0_L3ucp.css → ChatView-CjCcr65D.css} +1 -1
- package/dist/client/assets/{Close-Brba3ay5.js → Close-BQv4cWxW.js} +2 -2
- package/dist/client/assets/Dropdown-CalW5lgg.js +125 -0
- package/dist/client/assets/Empty-Crwpm9aR.js +24 -0
- package/dist/client/assets/FilesView-BIhdGj93.css +1 -0
- package/dist/client/assets/FilesView-DDqOER0C.js +279 -0
- package/dist/client/assets/{FormItem-kXuCeSKq.js → FormItem-rZXpOEwq.js} +3 -3
- package/dist/client/assets/GatewaysView-CBisX7sg.js +1 -0
- package/dist/client/assets/Input-CACQWEc-.js +234 -0
- package/dist/client/assets/{InputNumber-BXy4reTI.js → InputNumber-BtDJhuZ_.js} +2 -2
- package/dist/client/assets/JobsView-D2rkutWf.js +2 -0
- package/dist/client/assets/LoginView-fbo3JyWY.js +1 -0
- package/dist/client/assets/LogsView-D6S5uWNR.js +1 -0
- package/dist/client/assets/{MarkdownRenderer-B7t0ZEw0.js → MarkdownRenderer-4flsL0HK.js} +17 -17
- package/dist/client/assets/MemoryView-Ct-Xub44.js +7 -0
- package/dist/client/assets/{Modal-6Bv1v4kO.js → Modal-pv2obz6L.js} +4 -4
- package/dist/client/assets/{ModelsView-BStkMmEH.css → ModelsView-DoxebjaU.css} +1 -1
- package/dist/client/assets/ModelsView-NQaSxgAw.js +1 -0
- package/dist/client/assets/Popconfirm-BtGpKlX7.js +16 -0
- package/dist/client/assets/Popover-CrGHm4Ci.js +117 -0
- package/dist/client/assets/ProfilesView-BkxAC36G.js +1 -0
- package/dist/client/assets/Select-D9RT-keZ.js +317 -0
- package/dist/client/assets/SettingRow-Uz-cvlWh.js +1 -0
- package/dist/client/assets/SettingsView-ZqYSPWDq.js +352 -0
- package/dist/client/assets/SkillsView-CynAdT4a.js +1 -0
- package/dist/client/assets/{Spin-DKwUVt1F.js → Spin-Cl861IYY.js} +3 -3
- package/dist/client/assets/Suffix-lZvgRyRJ.js +90 -0
- package/dist/client/assets/{Switch-DG-3EwdR.js → Switch-Cgr6t0l5.js} +2 -2
- package/dist/client/assets/{Tag-BWD1u63m.js → Tag-DTjJYhIj.js} +2 -2
- package/dist/client/assets/{TerminalView-DTR8bNOy.js → TerminalView-B-24Rkd7.js} +6 -6
- package/dist/client/assets/Tooltip-BSRTJcks.js +1 -0
- package/dist/client/assets/Upload-GVPlkKwO.js +440 -0
- package/dist/client/assets/UsageView-MG6jNAat.js +1 -0
- package/dist/client/assets/{Warning-CCZES7el.js → Warning-C_N-vtES.js} +1 -1
- package/dist/client/assets/{_plugin-vue_export-helper-Bl_Pm_OI.js → _plugin-vue_export-helper-BQLp1Z61.js} +2 -2
- package/dist/client/assets/abap-Cj2ZJqTY.js +1 -0
- package/dist/client/assets/apex-DMOzUZZB.js +1 -0
- package/dist/client/assets/app-CawwM3Gr.js +1 -0
- package/dist/client/assets/app-DMdMpEzR.js +1 -0
- package/dist/client/assets/{auth-BPBv1nNQ.js → auth-Bkk8rJhI.js} +1 -1
- package/dist/client/assets/azcli-BJqyCQCD.js +1 -0
- package/dist/client/assets/bat-D9jfAgXL.js +1 -0
- package/dist/client/assets/bicep-IyCF8AHg.js +2 -0
- package/dist/client/assets/browser-C0KKMpa8.js +47 -0
- package/dist/client/assets/cameligo-DqphQ1Vf.js +1 -0
- package/dist/client/assets/chat-BdoAzXti.js +6 -0
- package/dist/client/assets/chunk-DECur_0Z.js +1 -0
- package/dist/client/assets/clipboard-D5ziXDzU.js +1 -0
- package/dist/client/assets/clojure-CqmBZ3SB.js +1 -0
- package/dist/client/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/dist/client/assets/coffee-CD7nYioG.js +1 -0
- package/dist/client/assets/composables-gdfCfHJJ.js +1 -0
- package/dist/client/assets/cpp-CJjcH3OV.js +1 -0
- package/dist/client/assets/{create-5zWq3BEB.js → create-DgSD0xTd.js} +1 -1
- package/dist/client/assets/csharp-Bh3KEkzK.js +1 -0
- package/dist/client/assets/csp-Bwqlbr_S.js +1 -0
- package/dist/client/assets/css-CoIOcuFa.js +3 -0
- package/dist/client/assets/css.worker-DyDu5ynT.js +89 -0
- package/dist/client/assets/cssMode-DEq9g7fF.js +1 -0
- package/dist/client/assets/cypher-BI5xYxDU.js +1 -0
- package/dist/client/assets/dart-C48Nsypx.js +1 -0
- package/dist/client/assets/dockerfile-ueCsFBIO.js +1 -0
- package/dist/client/assets/ecl-bYObu0Am.js +1 -0
- package/dist/client/assets/editor-Br_kD0ds.css +1 -0
- package/dist/client/assets/editor.api2-Be2SWebq.js +872 -0
- package/dist/client/assets/editor.worker-Dpt_xPrs.js +26 -0
- package/dist/client/assets/elixir-C3hRLmcx.js +1 -0
- package/dist/client/assets/fade-in.cssr-D3Wt-ego.js +12 -0
- package/dist/client/assets/flow9-DFj18iNE.js +1 -0
- package/dist/client/assets/freemarker2-DL4Fzu5B.js +3 -0
- package/dist/client/assets/fsharp-AnzNBUww.js +1 -0
- package/dist/client/assets/go-tJ6Rmw6i.js +1 -0
- package/dist/client/assets/graphql-C0hIG8nm.js +1 -0
- package/dist/client/assets/handlebars-BHnMuvUj.js +1 -0
- package/dist/client/assets/hcl-BuyUNygY.js +1 -0
- package/dist/client/assets/html-GXFtBUzj.js +1 -0
- package/dist/client/assets/html.worker-IWNXhnIC.js +502 -0
- package/dist/client/assets/htmlMode-BcCXcf_0.js +1 -0
- package/dist/client/assets/index-8ao2g7sV.js +284 -0
- package/dist/client/assets/{index-BRXOdlZt.css → index-C9EadcMt.css} +1 -1
- package/dist/client/assets/ini-BeJtyijW.js +1 -0
- package/dist/client/assets/java-C2VAgfs1.js +1 -0
- package/dist/client/assets/javascript-U_9WP-aM.js +1 -0
- package/dist/client/assets/jobs-B5TmkmHx.js +1 -0
- package/dist/client/assets/jobs-ByeskmbT.js +1 -0
- package/dist/client/assets/json.worker-c4h5s80L.js +58 -0
- package/dist/client/assets/jsonMode-tONQS06s.js +7 -0
- package/dist/client/assets/julia-L5N2QjZH.js +1 -0
- package/dist/client/assets/kotlin-CoM2kw6K.js +1 -0
- package/dist/client/assets/less-zbg2EZtP.js +2 -0
- package/dist/client/assets/lexon-DYXVK96z.js +1 -0
- package/dist/client/assets/{light-DLz3o2il.js → light-0XEUqxc9.js} +1 -1
- package/dist/client/assets/{light-BNuYwJcs.js → light-5OhOi42N.js} +1 -1
- package/dist/client/assets/light-B2F950-4.js +1 -0
- package/dist/client/assets/{light-DcGe0-g1.js → light-CqEvxEaQ.js} +1 -1
- package/dist/client/assets/{light-DbUQYfY2.js → light-KCWDej_e.js} +1 -1
- package/dist/client/assets/{light-cIgLWDVk.js → light-Q_cJ87-J.js} +1 -1
- package/dist/client/assets/light-m-6OEHOE.js +1 -0
- package/dist/client/assets/liquid-B0bBAmrr.js +1 -0
- package/dist/client/assets/lspLanguageFeatures-CTVvD5p-.js +4 -0
- package/dist/client/assets/lua-BLOIBWLB.js +1 -0
- package/dist/client/assets/m3-cDvqo2bv.js +1 -0
- package/dist/client/assets/markdown-Dl_DNBM2.js +1 -0
- package/dist/client/assets/mdx-RopAvSlP.js +1 -0
- package/dist/client/assets/mips-BzzKjtTI.js +1 -0
- package/dist/client/assets/{models-EKNn3-zC.js → models-B81NGa-M.js} +1 -1
- package/dist/client/assets/monaco.contribution-BEuTYscZ.js +2 -0
- package/dist/client/assets/msdax-sEefJb9Q.js +1 -0
- package/dist/client/assets/mysql-DRV1IKn4.js +1 -0
- package/dist/client/assets/objective-c-DYtfYpNc.js +1 -0
- package/dist/client/assets/pascal-CpR5h_uZ.js +1 -0
- package/dist/client/assets/pascaligo-BI_Gz9Bp.js +1 -0
- package/dist/client/assets/perl-K9wCPr4J.js +1 -0
- package/dist/client/assets/pgsql-NrZG2xAf.js +1 -0
- package/dist/client/assets/php-DT0D5Htf.js +1 -0
- package/dist/client/assets/{pinia-C8BDM-Fc.js → pinia-Bf3FnMGw.js} +1 -1
- package/dist/client/assets/pla-COSVs9tJ.js +1 -0
- package/dist/client/assets/postiats-CpQICSCZ.js +1 -0
- package/dist/client/assets/powerquery-hpQUPY_r.js +1 -0
- package/dist/client/assets/powershell-CXKJShJs.js +1 -0
- package/dist/client/assets/preload-helper-rov5CBGT.js +1 -0
- package/dist/client/assets/profiles-CySy48VW.js +1 -0
- package/dist/client/assets/protobuf-VEer4AfK.js +2 -0
- package/dist/client/assets/pug-CCviz4wy.js +1 -0
- package/dist/client/assets/python-DPgAafol.js +1 -0
- package/dist/client/assets/qsharp-DTveMB6M.js +1 -0
- package/dist/client/assets/r-CnY31RFU.js +1 -0
- package/dist/client/assets/razor-BRbs1kR5.js +1 -0
- package/dist/client/assets/redis-1g6etttg.js +1 -0
- package/dist/client/assets/redshift-BQFehQo7.js +1 -0
- package/dist/client/assets/restructuredtext-CR8m-OPX.js +1 -0
- package/dist/client/assets/router-DSISOBmz.js +4 -0
- package/dist/client/assets/ruby-BljIZnPI.js +1 -0
- package/dist/client/assets/rust-C7icjueR.js +1 -0
- package/dist/client/assets/sb-Cl_sCxp1.js +1 -0
- package/dist/client/assets/scala-CT-TSn-3.js +1 -0
- package/dist/client/assets/scheme-BkJvX1f4.js +1 -0
- package/dist/client/assets/scss-B5N7uefM.js +3 -0
- package/dist/client/assets/{session-browser-prefs-BI-rZu2N.js → session-browser-prefs-LLoiG_YM.js} +1 -1
- package/dist/client/assets/{sessions-CJI89wYu.js → sessions-LymnKAC6.js} +1 -1
- package/dist/client/assets/shell-DGQq63Qg.js +1 -0
- package/dist/client/assets/{skills-DjdZmDZP.js → skills-5sEozVye.js} +1 -1
- package/dist/client/assets/solidity-BGsdM1K-.js +1 -0
- package/dist/client/assets/sophia-2vdPWHk_.js +1 -0
- package/dist/client/assets/sparql-BVtOOc6V.js +1 -0
- package/dist/client/assets/sql-ceGY-xNe.js +1 -0
- package/dist/client/assets/st-DupPN7oj.js +1 -0
- package/dist/client/assets/swift-BVzV3sGw.js +1 -0
- package/dist/client/assets/systemverilog-hp5X8uST.js +1 -0
- package/dist/client/assets/tcl-D56hFaYe.js +1 -0
- package/dist/client/assets/ts.worker-BwM5Ha3L.js +67719 -0
- package/dist/client/assets/tsMode-DGr7-1MY.js +11 -0
- package/dist/client/assets/twig-C2ivmPwo.js +1 -0
- package/dist/client/assets/typescript-yGuzzsRv.js +1 -0
- package/dist/client/assets/typespec-DxADZqov.js +1 -0
- package/dist/client/assets/{use-message-sSsrvqld.js → use-message-DOCgeMXd.js} +1 -1
- package/dist/client/assets/{useTheme-DgQIobZP.js → useTheme-Dm7n8Zfn.js} +1 -1
- package/dist/client/assets/vb-EBCrbQ4-.js +1 -0
- package/dist/client/assets/wgsl-9pwzQzLa.js +298 -0
- package/dist/client/assets/workers-LkP66fNk.js +1 -0
- package/dist/client/assets/xml-Dnyprwt6.js +1 -0
- package/dist/client/assets/yaml-BU-x4ie7.js +1 -0
- package/dist/client/index.html +36 -31
- package/dist/server/index.js +2201 -398
- package/dist/server/index.js.map +4 -4
- package/package.json +18 -4
- package/dist/client/assets/Add-DiTv65Se.js +0 -1
- package/dist/client/assets/ChatView--lvFbW3I.js +0 -127
- package/dist/client/assets/GatewaysView-DUPP1UyD.js +0 -1
- package/dist/client/assets/Input-BS71ZaoJ.js +0 -234
- package/dist/client/assets/JobsView-CXa1h0NF.js +0 -2
- package/dist/client/assets/LoginView-Cpod3SAL.js +0 -1
- package/dist/client/assets/LogsView-CgxeVMn-.js +0 -1
- package/dist/client/assets/MemoryView-BQjYVDJc.js +0 -7
- package/dist/client/assets/ModelsView-CVghPzgk.js +0 -1
- package/dist/client/assets/Popconfirm-Bpz_dC1j.js +0 -16
- package/dist/client/assets/Popover-CXrjClQw.js +0 -117
- package/dist/client/assets/ProfilesView-Brpyzl-Q.js +0 -440
- package/dist/client/assets/Select-Z20Mp4nQ.js +0 -340
- package/dist/client/assets/SettingRow-Cz749k-e.js +0 -1
- package/dist/client/assets/SettingsView-C3HbKb4w.js +0 -352
- package/dist/client/assets/SkillsView-qVZkbI37.js +0 -1
- package/dist/client/assets/Suffix-C1Mw6UwH.js +0 -90
- package/dist/client/assets/Tooltip-Dka1-DNs.js +0 -1
- package/dist/client/assets/UsageView-elTUQCED.js +0 -1
- package/dist/client/assets/app-BMD_VOYs.js +0 -1
- package/dist/client/assets/app-y8cD3FPg.js +0 -1
- package/dist/client/assets/browser-DlPqZ-4M.js +0 -47
- package/dist/client/assets/chat-3-o9JAHE.js +0 -6
- package/dist/client/assets/composables-CoSqDggz.js +0 -1
- package/dist/client/assets/fade-in.cssr-D0suZaLL.js +0 -12
- package/dist/client/assets/index-CeFFa_Wg.js +0 -284
- package/dist/client/assets/jobs-DMiCP2Li.js +0 -1
- package/dist/client/assets/profiles-1vZTTlBc.js +0 -1
- package/dist/client/assets/router-kR4kqS2l.js +0 -4
- /package/dist/client/assets/{_common-D_mHAddk.js → _common-DdtSL-nr.js} +0 -0
- /package/dist/client/assets/{logo-Cd-t_oGE.js → logo-D12u0f1i.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,F as t,K as n,M as r,N as i,U as a,V as o,X as s,ct as c,d as l,dt as u,j as d}from"./router-DSISOBmz.js";import{$ as f,B as p,K as m,L as h,X as g,c as _,ct as v,dt as y,pt as b,st as x,u as S,ut as C,z as ee}from"./browser-C0KKMpa8.js";import{F as te,m as w,s as ne}from"./Popover-CrGHm4Ci.js";import{n as T}from"./Warning-C_N-vtES.js";import{t as re}from"./light-KCWDej_e.js";function ie(e,n,i){let a=t(e,null);if(a===null)return;let c=r()?.proxy;s(i,l),l(i.value),o(()=>{l(void 0,i.value)});function l(e,t){if(!a)return;let r=a[n];t!==void 0&&u(r,t),e!==void 0&&d(r,e)}function u(e,t){e[t]||(e[t]=[]),e[t].splice(e[t].findIndex(e=>e===c),1)}function d(e,t){e[t]||(e[t]=[]),~e[t].findIndex(e=>e===c)||e[t].push(c)}}var E=f(`n-form`),ae=f(`n-form-item-insts`),D=v(`form`,[y(`inline`,`
|
|
2
2
|
width: 100%;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: flex-start;
|
|
5
5
|
align-content: space-around;
|
|
6
|
-
`,[v(`form-item`,{width:`auto`,marginRight:`18px`},[x(`&:last-child`,{marginRight:0})])])]),O=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},oe=
|
|
6
|
+
`,[v(`form-item`,{width:`auto`,marginRight:`18px`},[x(`&:last-child`,{marginRight:0})])])]),O=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},oe=d({name:`Form`,props:Object.assign(Object.assign({},_.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:`top`},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),setup(e){let{mergedClsPrefixRef:t}=p(e);_(`Form`,`-form`,D,re,e,t);let r={},i=c(void 0),a=e=>{let t=i.value;(t===void 0||e>=t)&&(i.value=e)};function o(){var e;for(let t of T(r)){let n=r[t];for(let t of n)(e=t.invalidateLabelWidth)==null||e.call(t)}}function s(e){return O(this,arguments,void 0,function*(e,t=()=>!0){return yield new Promise((n,i)=>{let a=[];for(let e of T(r)){let n=r[e];for(let e of n)e.path&&a.push(e.internalValidate(null,t))}Promise.all(a).then(t=>{let r=t.some(e=>!e.valid),a=[],o=[];t.forEach(e=>{e.errors?.length&&a.push(e.errors),e.warnings?.length&&o.push(e.warnings)}),e&&e(a.length?a:void 0,{warnings:o.length?o:void 0}),r?i(a.length?a:void 0):n({warnings:o.length?o:void 0})})})})}function l(){for(let e of T(r)){let t=r[e];for(let e of t)e.restoreValidation()}}return n(E,{props:e,maxChildLabelWidthRef:i,deriveMaxChildLabelWidth:a}),n(ae,{formItems:r}),Object.assign({validate:s,restoreValidation:l,invalidateLabelWidth:o},{mergedClsPrefix:t})},render(){let{mergedClsPrefix:e}=this;return i(`form`,{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k.apply(this,arguments)}function A(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,M(e,t)}function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function se(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function N(e,t,n){return N=se()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&M(i,n.prototype),i},N.apply(null,arguments)}function ce(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function P(e){var t=typeof Map==`function`?new Map:void 0;return P=function(e){if(e===null||!ce(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return N(e,arguments,j(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),M(n,e)},P(e)}var le=/%[sdj%]/g,ue=function(){};function F(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function I(e){var t=[...arguments].slice(1),n=0,r=t.length;return typeof e==`function`?e.apply(null,t):typeof e==`string`?e.replace(le,function(e){if(e===`%%`)return`%`;if(n>=r)return e;switch(e){case`%s`:return String(t[n++]);case`%d`:return Number(t[n++]);case`%j`:try{return JSON.stringify(t[n++])}catch{return`[Circular]`}break;default:return e}}):e}function de(e){return e===`string`||e===`url`||e===`hex`||e===`email`||e===`date`||e===`pattern`}function L(e,t){return!!(e==null||t===`array`&&Array.isArray(e)&&!e.length||de(t)&&typeof e==`string`&&!e)}function fe(e,t,n){var r=[],i=0,a=e.length;function o(e){r.push.apply(r,e||[]),i++,i===a&&n(r)}e.forEach(function(e){t(e,o)})}function R(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var s=r;r+=1,s<i?t(e[s],a):n([])}a([])}function pe(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n]||[])}),t}var z=function(e){A(t,e);function t(t,n){var r=e.call(this,`Async Validation Error`)||this;return r.errors=t,r.fields=n,r}return t}(P(Error));function me(e,t,n,r,i){if(t.first){var a=new Promise(function(t,a){R(pe(e),n,function(e){return r(e),e.length?a(new z(e,F(e))):t(i)})});return a.catch(function(e){return e}),a}var o=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),c=s.length,l=0,u=[],d=new Promise(function(t,a){var d=function(e){if(u.push.apply(u,e),l++,l===c)return r(u),u.length?a(new z(u,F(u))):t(i)};s.length||(r(u),t(i)),s.forEach(function(t){var r=e[t];o.indexOf(t)===-1?fe(r,n,d):R(r,n,d)})});return d.catch(function(e){return e}),d}function he(e){return!!(e&&e.message!==void 0)}function ge(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function B(e,t){return function(n){var r=e.fullFields?ge(t,e.fullFields):t[n.field||e.fullField];return he(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n==`function`?n():n,fieldValue:r,field:n.field||e.fullField}}}function V(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];typeof r==`object`&&typeof e[n]==`object`?e[n]=k({},e[n],r):e[n]=r}}return e}var H=function(e,t,n,r,i,a){e.required&&(!n.hasOwnProperty(e.field)||L(t,a||e.type))&&r.push(I(i.messages.required,e.fullField))},_e=function(e,t,n,r,i){(/^\s+$/.test(t)||t===``)&&r.push(I(i.messages.whitespace,e.fullField))},U,ve=(function(){if(U)return U;var e=`[a-fA-F\\d:]`,t=function(t){return t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=`+e+`)|(?<=`+e+`)(?=\\s|$))`:``},n=`(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}`,r=`[a-fA-F\\d]{1,4}`,i=(`
|
|
7
7
|
(?:
|
|
8
8
|
(?:`+r+`:){7}(?:`+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
9
9
|
(?:`+r+`:){6}(?:`+n+`|:`+r+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
|
|
@@ -107,4 +107,4 @@ import{H as e,I as t,M as n,N as r,P as i,W as a,Z as o,f as s,ft as c,lt as l,q
|
|
|
107
107
|
transform-origin: top left;
|
|
108
108
|
`,[x(`&:not(:empty)`,`
|
|
109
109
|
padding: var(--n-feedback-padding);
|
|
110
|
-
`),v(`form-item-feedback`,{transition:`color .3s var(--n-bezier)`,color:`var(--n-feedback-text-color)`},[y(`warning`,{color:`var(--n-feedback-text-color-warning)`}),y(`error`,{color:`var(--n-feedback-text-color-error)`}),Ie({fromOffset:`-3px`,enterDuration:`.3s`,leaveDuration:`.2s`})])])]);function Re(e){let n=t(E,null),{mergedComponentPropsRef:r}=p(e);return{mergedSize:d(()=>e.size===void 0?n?.props.size===void 0?r?.value?.Form?.size||`medium`:n.props.size:e.size)}}function ze(e){let n=t(E,null),r=d(()=>{let{labelPlacement:t}=e;return t===void 0?n?.props.labelPlacement?n.props.labelPlacement:`top`:t}),i=d(()=>r.value===`left`&&(e.labelWidth===`auto`||n?.props.labelWidth===`auto`)),a=d(()=>{if(r.value===`top`)return;let{labelWidth:t}=e;if(t!==void 0&&t!==`auto`)return w(t);if(i.value){let e=n?.maxChildLabelWidthRef.value;return e===void 0?void 0:w(e)}if(n?.props.labelWidth!==void 0)return w(n.props.labelWidth)}),o=d(()=>{let{labelAlign:t}=e;if(t)return t;if(n?.props.labelAlign)return n.props.labelAlign}),s=d(()=>[e.labelProps?.style,e.labelStyle,{width:a.value}]),c=d(()=>{let{showRequireMark:t}=e;return t===void 0?n?.props.showRequireMark:t}),u=d(()=>{let{requireMarkPlacement:t}=e;return t===void 0?n?.props.requireMarkPlacement||`right`:t}),f=l(!1),p=l(!1);return{validationErrored:f,validationWarned:p,mergedLabelStyle:s,mergedLabelPlacement:r,mergedLabelAlign:o,mergedShowRequireMark:c,mergedRequireMarkPlacement:u,mergedValidationStatus:d(()=>{let{validationStatus:t}=e;if(t!==void 0)return t;if(f.value)return`error`;if(p.value)return`warning`}),mergedShowFeedback:d(()=>{let{showFeedback:t}=e;return t===void 0?n?.props.showFeedback===void 0?!0:n.props.showFeedback:t}),mergedShowLabel:d(()=>{let{showLabel:t}=e;return t===void 0?n?.props.showLabel===void 0?!0:n.props.showLabel:t}),isAutoLabelWidth:i}}function Be(e){let n=t(E,null),r=d(()=>{let{rulePath:t}=e;if(t!==void 0)return t;let{path:n}=e;if(n!==void 0)return n}),i=d(()=>{let t=[],{rule:i}=e;if(i!==void 0&&(Array.isArray(i)?t.push(...i):t.push(i)),n){let{rules:e}=n.props,{value:i}=r;if(e!==void 0&&i!==void 0){let n=ne(e,i);n!==void 0&&(Array.isArray(n)?t.push(...n):t.push(n))}}return t}),a=d(()=>i.value.some(e=>e.required));return{mergedRules:i,mergedRequired:d(()=>a.value||e.required)}}var Ve=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},He=Object.assign(Object.assign({},_.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object,contentClass:String,contentStyle:[String,Object]});T(He);function $(e,t){return(...n)=>{try{let r=e(...n);return!t&&(typeof r==`boolean`||r instanceof Error||Array.isArray(r))||r?.then?r:(r===void 0||g(`form-item/validate`,`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(e){g(`form-item/validate`,"An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(e);return}}}var Ue=n({name:`FormItem`,props:He,slots:Object,setup(e){ie(ae,`formItems`,c(e,`path`));let{mergedClsPrefixRef:n,inlineThemeDisabled:r}=p(e),i=t(E,null),s=Re(e),f=ze(e),{validationErrored:m,validationWarned:g}=f,{mergedRequired:v,mergedRules:y}=Be(e),{mergedSize:x}=s,{mergedLabelPlacement:S,mergedLabelAlign:C,mergedRequireMarkPlacement:w}=f,T=l([]),D=l(te()),O=l(null),oe=i?c(i.props,`disabled`):l(!1),k=_(`Form`,`-form-item`,Le,re,e,n);o(c(e,`path`),()=>{e.ignorePathChange||j()});function A(){if(!f.isAutoLabelWidth.value)return;let e=O.value;if(e!==null){let t=e.style.whiteSpace;e.style.whiteSpace=`nowrap`,e.style.width=``,i?.deriveMaxChildLabelWidth(Number(getComputedStyle(e).width.slice(0,-2))),e.style.whiteSpace=t}}function j(){T.value=[],m.value=!1,g.value=!1,e.feedback&&(D.value=te())}let M=(...t)=>Ve(this,[...t],void 0,function*(t=null,n=()=>!0,r={suppressWarning:!0}){let{path:a}=e;r?r.first||=e.first:r={};let{value:o}=y,s=i?ne(i.props.model,a||``):void 0,c={},l={},u=(t?o.filter(e=>Array.isArray(e.trigger)?e.trigger.includes(t):e.trigger===t):o).filter(n).map((e,t)=>{let n=Object.assign({},e);if(n.validator&&=$(n.validator,!1),n.asyncValidator&&=$(n.asyncValidator,!0),n.renderMessage){let e=`__renderMessage__${t}`;l[e]=n.message,n.message=e,c[e]=n.renderMessage}return n}),d=u.filter(e=>e.level!==`warning`),f=u.filter(e=>e.level===`warning`),p={valid:!0,errors:void 0,warnings:void 0};if(!u.length)return p;let h=a??`__n_no_path__`,_=new Z({[h]:d}),v=new Z({[h]:f}),{validateMessages:b}=i?.props||{};b&&(_.messages(b),v.messages(b));let x=e=>{T.value=e.map(e=>{let t=e?.message||``;return{key:t,render:()=>t.startsWith(`__renderMessage__`)?c[t]():t}}),e.forEach(e=>{e.message?.startsWith(`__renderMessage__`)&&(e.message=l[e.message])})};if(d.length){let e=yield new Promise(e=>{_.validate({[h]:s},r,e)});e?.length&&(p.valid=!1,p.errors=e,x(e))}if(f.length&&!p.errors){let e=yield new Promise(e=>{v.validate({[h]:s},r,e)});e?.length&&(x(e),p.warnings=e)}return!p.errors&&!p.warnings?j():(m.value=!!p.errors,g.value=!!p.warnings),p});function se(){M(`blur`)}function N(){M(`change`)}function ce(){M(`focus`)}function P(){M(`input`)}function le(e,t){return Ve(this,void 0,void 0,function*(){let n,r,i,a;return typeof e==`string`?(n=e,r=t):typeof e==`object`&&e&&(n=e.trigger,r=e.callback,i=e.shouldRuleBeApplied,a=e.options),yield new Promise((e,t)=>{M(n,i,a).then(({valid:n,errors:i,warnings:a})=>{n?(r&&r(void 0,{warnings:a}),e({warnings:a})):(r&&r(i,{warnings:a}),t(i))})})})}u(h,{path:c(e,`path`),disabled:oe,mergedSize:s.mergedSize,mergedValidationStatus:f.mergedValidationStatus,restoreValidation:j,handleContentBlur:se,handleContentChange:N,handleContentFocus:ce,handleContentInput:P});let ue={validate:le,restoreValidation:j,internalValidate:M,invalidateLabelWidth:A};a(A);let F=d(()=>{let{value:e}=x,{value:t}=S,n=t===`top`?`vertical`:`horizontal`,{common:{cubicBezierEaseInOut:r},self:{labelTextColor:i,asteriskColor:a,lineHeight:o,feedbackTextColor:s,feedbackTextColorWarning:c,feedbackTextColorError:l,feedbackPadding:u,labelFontWeight:d,[b(`labelHeight`,e)]:f,[b(`blankHeight`,e)]:p,[b(`feedbackFontSize`,e)]:m,[b(`feedbackHeight`,e)]:h,[b(`labelPadding`,n)]:g,[b(`labelTextAlign`,n)]:_,[b(b(`labelFontSize`,t),e)]:v}}=k.value,y=C.value??_;return t===`top`&&(y=y===`right`?`flex-end`:`flex-start`),{"--n-bezier":r,"--n-line-height":o,"--n-blank-height":p,"--n-label-font-size":v,"--n-label-text-align":y,"--n-label-height":f,"--n-label-padding":g,"--n-label-font-weight":d,"--n-asterisk-color":a,"--n-label-text-color":i,"--n-feedback-padding":u,"--n-feedback-font-size":m,"--n-feedback-height":h,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":c,"--n-feedback-text-color-error":l}}),I=r?ee(`form-item`,d(()=>`${x.value[0]}${S.value[0]}${C.value?.[0]||``}`),F,e):void 0,de=d(()=>S.value===`left`&&w.value===`left`&&C.value===`left`);return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:O,mergedClsPrefix:n,mergedRequired:v,feedbackId:D,renderExplains:T,reverseColSpace:de},f),s),ue),{cssVars:r?void 0:F,themeClass:I?.themeClass,onRender:I?.onRender})},render(){let{$slots:e,mergedClsPrefix:t,mergedShowLabel:n,mergedShowRequireMark:r,mergedRequireMarkPlacement:a,onRender:o}=this,c=r===void 0?this.mergedRequired:r;return o?.(),i(`div`,{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!n&&`${t}-form-item--no-label`],style:this.cssVars},n&&(()=>{let e=this.$slots.label?this.$slots.label():this.label;if(!e)return null;let n=i(`span`,{class:`${t}-form-item-label__text`},e),r=c?i(`span`,{class:`${t}-form-item-label__asterisk`},a===`left`?`*\xA0`:`\xA0*`):a===`right-hanging`&&i(`span`,{class:`${t}-form-item-label__asterisk-placeholder`},`\xA0*`),{labelProps:o}=this;return i(`label`,Object.assign({},o,{class:[o?.class,`${t}-form-item-label`,`${t}-form-item-label--${a}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:`labelElementRef`}),a===`left`?[r,n]:[n,r])})(),i(`div`,{class:[`${t}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`],style:this.contentStyle},e),this.mergedShowFeedback?i(`div`,{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},i(s,{name:`fade-down-transition`,mode:`out-in`},{default:()=>{let{mergedValidationStatus:n}=this;return m(e.feedback,e=>{let{feedback:r}=this,a=e||r?i(`div`,{key:`__feedback__`,class:`${t}-form-item-feedback__line`},e||r):this.renderExplains.length?this.renderExplains?.map(({key:e,render:n})=>i(`div`,{key:e,class:`${t}-form-item-feedback__line`},n())):null;return a?n===`warning`?i(`div`,{key:`controlled-warning`,class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},a):n===`error`?i(`div`,{key:`controlled-error`,class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},a):n===`success`?i(`div`,{key:`controlled-success`,class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},a):i(`div`,{key:`controlled-default`,class:`${t}-form-item-feedback`},a):null})}})):null)}});export{oe as n,Ue as t};
|
|
110
|
+
`),v(`form-item-feedback`,{transition:`color .3s var(--n-bezier)`,color:`var(--n-feedback-text-color)`},[y(`warning`,{color:`var(--n-feedback-text-color-warning)`}),y(`error`,{color:`var(--n-feedback-text-color-error)`}),Ie({fromOffset:`-3px`,enterDuration:`.3s`,leaveDuration:`.2s`})])])]);function Re(n){let r=t(E,null),{mergedComponentPropsRef:i}=p(n);return{mergedSize:e(()=>n.size===void 0?r?.props.size===void 0?i?.value?.Form?.size||`medium`:r.props.size:n.size)}}function ze(n){let r=t(E,null),i=e(()=>{let{labelPlacement:e}=n;return e===void 0?r?.props.labelPlacement?r.props.labelPlacement:`top`:e}),a=e(()=>i.value===`left`&&(n.labelWidth===`auto`||r?.props.labelWidth===`auto`)),o=e(()=>{if(i.value===`top`)return;let{labelWidth:e}=n;if(e!==void 0&&e!==`auto`)return w(e);if(a.value){let e=r?.maxChildLabelWidthRef.value;return e===void 0?void 0:w(e)}if(r?.props.labelWidth!==void 0)return w(r.props.labelWidth)}),s=e(()=>{let{labelAlign:e}=n;if(e)return e;if(r?.props.labelAlign)return r.props.labelAlign}),l=e(()=>[n.labelProps?.style,n.labelStyle,{width:o.value}]),u=e(()=>{let{showRequireMark:e}=n;return e===void 0?r?.props.showRequireMark:e}),d=e(()=>{let{requireMarkPlacement:e}=n;return e===void 0?r?.props.requireMarkPlacement||`right`:e}),f=c(!1),p=c(!1);return{validationErrored:f,validationWarned:p,mergedLabelStyle:l,mergedLabelPlacement:i,mergedLabelAlign:s,mergedShowRequireMark:u,mergedRequireMarkPlacement:d,mergedValidationStatus:e(()=>{let{validationStatus:e}=n;if(e!==void 0)return e;if(f.value)return`error`;if(p.value)return`warning`}),mergedShowFeedback:e(()=>{let{showFeedback:e}=n;return e===void 0?r?.props.showFeedback===void 0?!0:r.props.showFeedback:e}),mergedShowLabel:e(()=>{let{showLabel:e}=n;return e===void 0?r?.props.showLabel===void 0?!0:r.props.showLabel:e}),isAutoLabelWidth:a}}function Be(n){let r=t(E,null),i=e(()=>{let{rulePath:e}=n;if(e!==void 0)return e;let{path:t}=n;if(t!==void 0)return t}),a=e(()=>{let e=[],{rule:t}=n;if(t!==void 0&&(Array.isArray(t)?e.push(...t):e.push(t)),r){let{rules:t}=r.props,{value:n}=i;if(t!==void 0&&n!==void 0){let r=ne(t,n);r!==void 0&&(Array.isArray(r)?e.push(...r):e.push(r))}}return e}),o=e(()=>a.value.some(e=>e.required));return{mergedRules:a,mergedRequired:e(()=>o.value||n.required)}}var Ve=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},He=Object.assign(Object.assign({},_.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object,contentClass:String,contentStyle:[String,Object]});T(He);function $(e,t){return(...n)=>{try{let r=e(...n);return!t&&(typeof r==`boolean`||r instanceof Error||Array.isArray(r))||r?.then?r:(r===void 0||g(`form-item/validate`,`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(e){g(`form-item/validate`,"An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(e);return}}}var Ue=d({name:`FormItem`,props:He,slots:Object,setup(r){ie(ae,`formItems`,u(r,`path`));let{mergedClsPrefixRef:i,inlineThemeDisabled:o}=p(r),l=t(E,null),d=Re(r),f=ze(r),{validationErrored:m,validationWarned:g}=f,{mergedRequired:v,mergedRules:y}=Be(r),{mergedSize:x}=d,{mergedLabelPlacement:S,mergedLabelAlign:C,mergedRequireMarkPlacement:w}=f,T=c([]),D=c(te()),O=c(null),oe=l?u(l.props,`disabled`):c(!1),k=_(`Form`,`-form-item`,Le,re,r,i);s(u(r,`path`),()=>{r.ignorePathChange||j()});function A(){if(!f.isAutoLabelWidth.value)return;let e=O.value;if(e!==null){let t=e.style.whiteSpace;e.style.whiteSpace=`nowrap`,e.style.width=``,l?.deriveMaxChildLabelWidth(Number(getComputedStyle(e).width.slice(0,-2))),e.style.whiteSpace=t}}function j(){T.value=[],m.value=!1,g.value=!1,r.feedback&&(D.value=te())}let M=(...e)=>Ve(this,[...e],void 0,function*(e=null,t=()=>!0,n={suppressWarning:!0}){let{path:i}=r;n?n.first||=r.first:n={};let{value:a}=y,o=l?ne(l.props.model,i||``):void 0,s={},c={},u=(e?a.filter(t=>Array.isArray(t.trigger)?t.trigger.includes(e):t.trigger===e):a).filter(t).map((e,t)=>{let n=Object.assign({},e);if(n.validator&&=$(n.validator,!1),n.asyncValidator&&=$(n.asyncValidator,!0),n.renderMessage){let e=`__renderMessage__${t}`;c[e]=n.message,n.message=e,s[e]=n.renderMessage}return n}),d=u.filter(e=>e.level!==`warning`),f=u.filter(e=>e.level===`warning`),p={valid:!0,errors:void 0,warnings:void 0};if(!u.length)return p;let h=i??`__n_no_path__`,_=new Z({[h]:d}),v=new Z({[h]:f}),{validateMessages:b}=l?.props||{};b&&(_.messages(b),v.messages(b));let x=e=>{T.value=e.map(e=>{let t=e?.message||``;return{key:t,render:()=>t.startsWith(`__renderMessage__`)?s[t]():t}}),e.forEach(e=>{e.message?.startsWith(`__renderMessage__`)&&(e.message=c[e.message])})};if(d.length){let e=yield new Promise(e=>{_.validate({[h]:o},n,e)});e?.length&&(p.valid=!1,p.errors=e,x(e))}if(f.length&&!p.errors){let e=yield new Promise(e=>{v.validate({[h]:o},n,e)});e?.length&&(x(e),p.warnings=e)}return!p.errors&&!p.warnings?j():(m.value=!!p.errors,g.value=!!p.warnings),p});function se(){M(`blur`)}function N(){M(`change`)}function ce(){M(`focus`)}function P(){M(`input`)}function le(e,t){return Ve(this,void 0,void 0,function*(){let n,r,i,a;return typeof e==`string`?(n=e,r=t):typeof e==`object`&&e&&(n=e.trigger,r=e.callback,i=e.shouldRuleBeApplied,a=e.options),yield new Promise((e,t)=>{M(n,i,a).then(({valid:n,errors:i,warnings:a})=>{n?(r&&r(void 0,{warnings:a}),e({warnings:a})):(r&&r(i,{warnings:a}),t(i))})})})}n(h,{path:u(r,`path`),disabled:oe,mergedSize:d.mergedSize,mergedValidationStatus:f.mergedValidationStatus,restoreValidation:j,handleContentBlur:se,handleContentChange:N,handleContentFocus:ce,handleContentInput:P});let ue={validate:le,restoreValidation:j,internalValidate:M,invalidateLabelWidth:A};a(A);let F=e(()=>{let{value:e}=x,{value:t}=S,n=t===`top`?`vertical`:`horizontal`,{common:{cubicBezierEaseInOut:r},self:{labelTextColor:i,asteriskColor:a,lineHeight:o,feedbackTextColor:s,feedbackTextColorWarning:c,feedbackTextColorError:l,feedbackPadding:u,labelFontWeight:d,[b(`labelHeight`,e)]:f,[b(`blankHeight`,e)]:p,[b(`feedbackFontSize`,e)]:m,[b(`feedbackHeight`,e)]:h,[b(`labelPadding`,n)]:g,[b(`labelTextAlign`,n)]:_,[b(b(`labelFontSize`,t),e)]:v}}=k.value,y=C.value??_;return t===`top`&&(y=y===`right`?`flex-end`:`flex-start`),{"--n-bezier":r,"--n-line-height":o,"--n-blank-height":p,"--n-label-font-size":v,"--n-label-text-align":y,"--n-label-height":f,"--n-label-padding":g,"--n-label-font-weight":d,"--n-asterisk-color":a,"--n-label-text-color":i,"--n-feedback-padding":u,"--n-feedback-font-size":m,"--n-feedback-height":h,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":c,"--n-feedback-text-color-error":l}}),I=o?ee(`form-item`,e(()=>`${x.value[0]}${S.value[0]}${C.value?.[0]||``}`),F,r):void 0,de=e(()=>S.value===`left`&&w.value===`left`&&C.value===`left`);return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:O,mergedClsPrefix:i,mergedRequired:v,feedbackId:D,renderExplains:T,reverseColSpace:de},f),d),ue),{cssVars:o?void 0:F,themeClass:I?.themeClass,onRender:I?.onRender})},render(){let{$slots:e,mergedClsPrefix:t,mergedShowLabel:n,mergedShowRequireMark:r,mergedRequireMarkPlacement:a,onRender:o}=this,s=r===void 0?this.mergedRequired:r;return o?.(),i(`div`,{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!n&&`${t}-form-item--no-label`],style:this.cssVars},n&&(()=>{let e=this.$slots.label?this.$slots.label():this.label;if(!e)return null;let n=i(`span`,{class:`${t}-form-item-label__text`},e),r=s?i(`span`,{class:`${t}-form-item-label__asterisk`},a===`left`?`*\xA0`:`\xA0*`):a===`right-hanging`&&i(`span`,{class:`${t}-form-item-label__asterisk-placeholder`},`\xA0*`),{labelProps:o}=this;return i(`label`,Object.assign({},o,{class:[o?.class,`${t}-form-item-label`,`${t}-form-item-label--${a}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:`labelElementRef`}),a===`left`?[r,n]:[n,r])})(),i(`div`,{class:[`${t}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`],style:this.contentStyle},e),this.mergedShowFeedback?i(`div`,{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},i(l,{name:`fade-down-transition`,mode:`out-in`},{default:()=>{let{mergedValidationStatus:n}=this;return m(e.feedback,e=>{let{feedback:r}=this,a=e||r?i(`div`,{key:`__feedback__`,class:`${t}-form-item-feedback__line`},e||r):this.renderExplains.length?this.renderExplains?.map(({key:e,render:n})=>i(`div`,{key:e,class:`${t}-form-item-feedback__line`},n())):null;return a?n===`warning`?i(`div`,{key:`controlled-warning`,class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},a):n===`error`?i(`div`,{key:`controlled-error`,class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},a):n===`success`?i(`div`,{key:`controlled-success`,class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},a):i(`div`,{key:`controlled-default`,class:`${t}-form-item-feedback`},a):null})}})):null)}});export{oe as n,Ue as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,D as t,E as n,G as r,Q as i,U as a,ct as o,gt as s,j as c,k as l,o as u,pt as d,q as f,w as p,y as m}from"./router-DSISOBmz.js";import{n as h}from"./pinia-Bf3FnMGw.js";import{r as g,t as _}from"./_plugin-vue_export-helper-BQLp1Z61.js";import{t as v}from"./Button-BkFCVws1.js";import{t as y}from"./Tag-DTjJYhIj.js";import{t as b}from"./use-message-DOCgeMXd.js";import{t as x}from"./Spin-Cl861IYY.js";async function S(){return(await u(`/api/hermes/gateways`)).gateways}async function C(e){return(await u(`/api/hermes/gateways/${e}/start`,{method:`POST`})).gateway}async function w(e){await u(`/api/hermes/gateways/${e}/stop`,{method:`POST`})}var T=h(`gateways`,()=>{let e=o([]),t=o(!1);async function n(){t.value=!0;try{let t=await S();e.value=Array.isArray(t)?t:Object.values(t||{})}finally{t.value=!1}}async function r(n){t.value=!0;try{let t=await C(n),r=e.value.findIndex(e=>e.profile===n);r>=0?e.value[r]=t:e.value.push(t)}finally{t.value=!1}}async function i(n){t.value=!0;try{await w(n);let t=e.value.find(e=>e.profile===n);t&&(t.running=!1,t.pid=void 0)}finally{t.value=!1}}return{gateways:e,loading:t,fetchStatus:n,start:r,stop:i}}),E={class:`gateways-view`},D={class:`page-header`},O={class:`header-title`},k={class:`gateways-content`},A={key:0,class:`empty-state`},j={key:1,class:`gateway-list`},M={class:`gateway-info`},N={class:`gateway-name`},P={class:`gateway-meta`},F={class:`meta-item`},I={key:0,class:`meta-item`},L={class:`gateway-actions`},R=_(c({__name:`GatewaysView`,setup(o){let{t:c}=g(),u=b(),h=T();a(()=>{h.fetchStatus()});async function _(e,t){try{t?(await h.stop(e),u.success(`${c(`gateways.stopped`)}: ${e}`)):(await h.start(e),u.success(`${c(`gateways.started`)}: ${e}`))}catch(e){u.error(e.message)}}return(a,o)=>(r(),t(`div`,E,[p(`header`,D,[p(`h2`,O,s(d(c)(`gateways.title`)),1)]),p(`div`,k,[e(d(x),{show:d(h).loading,size:`large`},{default:i(()=>[d(h).gateways.length===0?(r(),t(`div`,A,s(d(c)(`common.noData`)),1)):(r(),t(`div`,j,[(r(!0),t(m,null,f(d(h).gateways,a=>(r(),t(`div`,{key:a.profile,class:`gateway-card`},[p(`div`,M,[p(`div`,N,s(a.profile),1),p(`div`,P,[p(`span`,F,s(a.host)+`:`+s(a.port),1),a.pid?(r(),t(`span`,I,`PID: `+s(a.pid),1)):n(``,!0)])]),p(`div`,L,[e(d(y),{type:a.running?`success`:`default`,size:`small`,round:``},{default:i(()=>[l(s(a.running?d(c)(`gateways.running`):d(c)(`gateways.stopped`)),1)]),_:2},1032,[`type`]),e(d(v),{size:`small`,type:a.running?`warning`:`primary`,round:``,onClick:e=>_(a.profile,a.running)},{default:i(()=>[l(s(a.running?d(c)(`common.stop`):d(c)(`common.start`)),1)]),_:2},1032,[`type`,`onClick`])])]))),128))]))]),_:1},8,[`show`])])]))}}),[[`__scopeId`,`data-v-d70aa8a3`]]);export{R as default};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import{C as e,F as t,K as n,M as r,N as i,R as a,U as o,X as s,Z as c,ct as l,dt as u,j as d,y as f}from"./router-DSISOBmz.js";import{$ as p,B as m,G as h,K as g,R as ee,W as _,c as v,ct as y,d as b,dt as x,ft as S,l as C,n as w,nt as T,pt as E,q as D,s as O,st as k,t as A,tt as j,ut as M,z as te}from"./browser-C0KKMpa8.js";import{d as ne,f as N,i as P,l as F,n as I,o as L,p as re,s as ie,t as R}from"./Suffix-lZvgRyRJ.js";import{l as ae,r as z}from"./fade-in.cssr-D3Wt-ego.js";var B=d({name:`Eye`,render(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},i(`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`}),i(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`}))}}),V=d({name:`EyeOff`,render(){return i(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},i(`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`}),i(`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`}),i(`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`}),i(`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`}),i(`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`}))}}),H={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`};function U(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:p,lineHeight:m,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:ee,fontSizeLarge:_,heightTiny:v,heightSmall:y,heightMedium:b,heightLarge:x,actionColor:S,clearColor:C,clearColorHover:w,clearColorPressed:E,placeholderColor:D,placeholderColorDisabled:O,iconColor:k,iconColorDisabled:A,iconColorHover:j,iconColorPressed:M,fontWeight:te}=e;return Object.assign(Object.assign({},H),{fontWeight:te,countTextColorDisabled:r,countTextColor:n,heightTiny:v,heightSmall:y,heightMedium:b,heightLarge:x,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:ee,fontSizeLarge:_,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:`16px`,groupLabelColor:S,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:D,placeholderColorDisabled:O,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 ${T(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 ${T(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 ${T(d,{alpha:.2})}`,caretColorError:d,clearColor:C,clearColorHover:w,clearColorPressed:E,iconColor:k,iconColorDisabled:A,iconColorHover:j,iconColorPressed:M,suffixTextColor:t})}var oe=O({name:`Input`,common:w,peers:{Scrollbar:P},self:U}),se=p(`n-input`),ce=y(`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
|
+
`,[M(`input, textarea`,`
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
flex-grow: 1;
|
|
19
|
+
position: relative;
|
|
20
|
+
`),M(`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
|
+
`),M(`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
|
+
`,[k(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`
|
|
44
|
+
width: 0;
|
|
45
|
+
height: 0;
|
|
46
|
+
display: none;
|
|
47
|
+
`),k(`&::placeholder`,`
|
|
48
|
+
color: #0000;
|
|
49
|
+
-webkit-text-fill-color: transparent !important;
|
|
50
|
+
`),k(`&:-webkit-autofill ~`,[M(`placeholder`,`display: none;`)])]),x(`round`,[S(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),M(`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
|
+
`,[k(`span`,`
|
|
60
|
+
width: 100%;
|
|
61
|
+
display: inline-block;
|
|
62
|
+
`)]),x(`textarea`,[M(`placeholder`,`overflow: visible;`)]),S(`autosize`,`width: 100%;`),x(`autosize`,[M(`textarea-el, input-el`,`
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
height: 100%;
|
|
67
|
+
`)]),y(`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
|
+
`),M(`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
|
+
`),M(`input-el`,`
|
|
84
|
+
padding: 0;
|
|
85
|
+
height: var(--n-height);
|
|
86
|
+
line-height: var(--n-height);
|
|
87
|
+
`,[k(`&[type=password]::-ms-reveal`,`display: none;`),k(`+`,[M(`placeholder`,`
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
`)])]),S(`textarea`,[M(`placeholder`,`white-space: nowrap;`)]),M(`eye`,`
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
transition: color .3s var(--n-bezier);
|
|
95
|
+
`),x(`textarea`,`width: 100%;`,[y(`input-word-count`,`
|
|
96
|
+
position: absolute;
|
|
97
|
+
right: var(--n-padding-right);
|
|
98
|
+
bottom: var(--n-padding-vertical);
|
|
99
|
+
`),x(`resizable`,[y(`input-wrapper`,`
|
|
100
|
+
resize: vertical;
|
|
101
|
+
min-height: var(--n-height);
|
|
102
|
+
`)]),M(`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
|
+
`),M(`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
|
+
`)]),x(`pair`,[M(`input-el, placeholder`,`text-align: center;`),M(`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
|
+
`,[y(`icon`,`
|
|
132
|
+
color: var(--n-icon-color);
|
|
133
|
+
`),y(`base-icon`,`
|
|
134
|
+
color: var(--n-icon-color);
|
|
135
|
+
`)])]),x(`disabled`,`
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
background-color: var(--n-color-disabled);
|
|
138
|
+
`,[M(`border`,`border: var(--n-border-disabled);`),M(`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
|
+
`),M(`placeholder`,`color: var(--n-placeholder-color-disabled);`),M(`separator`,`color: var(--n-text-color-disabled);`,[y(`icon`,`
|
|
143
|
+
color: var(--n-icon-color-disabled);
|
|
144
|
+
`),y(`base-icon`,`
|
|
145
|
+
color: var(--n-icon-color-disabled);
|
|
146
|
+
`)]),y(`input-word-count`,`
|
|
147
|
+
color: var(--n-count-text-color-disabled);
|
|
148
|
+
`),M(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[y(`icon`,`
|
|
149
|
+
color: var(--n-icon-color-disabled);
|
|
150
|
+
`),y(`internal-icon`,`
|
|
151
|
+
color: var(--n-icon-color-disabled);
|
|
152
|
+
`)])]),S(`disabled`,[M(`eye`,`
|
|
153
|
+
color: var(--n-icon-color);
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
`,[k(`&:hover`,`
|
|
156
|
+
color: var(--n-icon-color-hover);
|
|
157
|
+
`),k(`&:active`,`
|
|
158
|
+
color: var(--n-icon-color-pressed);
|
|
159
|
+
`)]),k(`&:hover`,[M(`state-border`,`border: var(--n-border-hover);`)]),x(`focus`,`background-color: var(--n-color-focus);`,[M(`state-border`,`
|
|
160
|
+
border: var(--n-border-focus);
|
|
161
|
+
box-shadow: var(--n-box-shadow-focus);
|
|
162
|
+
`)])]),M(`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
|
+
`),M(`state-border`,`
|
|
176
|
+
border-color: #0000;
|
|
177
|
+
z-index: 1;
|
|
178
|
+
`),M(`prefix`,`margin-right: 4px;`),M(`suffix`,`
|
|
179
|
+
margin-left: 4px;
|
|
180
|
+
`),M(`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
|
+
`,[y(`base-loading`,`
|
|
191
|
+
font-size: var(--n-icon-size);
|
|
192
|
+
margin: 0 2px;
|
|
193
|
+
color: var(--n-loading-color);
|
|
194
|
+
`),y(`base-clear`,`
|
|
195
|
+
font-size: var(--n-icon-size);
|
|
196
|
+
`,[M(`placeholder`,[y(`base-icon`,`
|
|
197
|
+
transition: color .3s var(--n-bezier);
|
|
198
|
+
color: var(--n-icon-color);
|
|
199
|
+
font-size: var(--n-icon-size);
|
|
200
|
+
`)])]),k(`>`,[y(`icon`,`
|
|
201
|
+
transition: color .3s var(--n-bezier);
|
|
202
|
+
color: var(--n-icon-color);
|
|
203
|
+
font-size: var(--n-icon-size);
|
|
204
|
+
`)]),y(`base-icon`,`
|
|
205
|
+
font-size: var(--n-icon-size);
|
|
206
|
+
`)]),y(`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=>x(`${e}-status`,[S(`disabled`,[y(`base-loading`,`
|
|
215
|
+
color: var(--n-loading-color-${e})
|
|
216
|
+
`),M(`input-el, textarea-el`,`
|
|
217
|
+
caret-color: var(--n-caret-color-${e});
|
|
218
|
+
`),M(`state-border`,`
|
|
219
|
+
border: var(--n-border-${e});
|
|
220
|
+
`),k(`&:hover`,[M(`state-border`,`
|
|
221
|
+
border: var(--n-border-hover-${e});
|
|
222
|
+
`)]),k(`&:focus`,`
|
|
223
|
+
background-color: var(--n-color-focus-${e});
|
|
224
|
+
`,[M(`state-border`,`
|
|
225
|
+
box-shadow: var(--n-box-shadow-focus-${e});
|
|
226
|
+
border: var(--n-border-focus-${e});
|
|
227
|
+
`)]),x(`focus`,`
|
|
228
|
+
background-color: var(--n-color-focus-${e});
|
|
229
|
+
`,[M(`state-border`,`
|
|
230
|
+
box-shadow: var(--n-box-shadow-focus-${e});
|
|
231
|
+
border: var(--n-border-focus-${e});
|
|
232
|
+
`)])])]))]),le=y(`input`,[x(`disabled`,[M(`input-el, textarea-el`,`
|
|
233
|
+
-webkit-text-fill-color: var(--n-text-color-disabled);
|
|
234
|
+
`)])]);function W(e){let t=0;for(let n of e)t++;return t}function G(e){return e===``||e==null}function ue(e){let t=l(null);function n(){let{value:n}=e;if(!n?.focus){i();return}let{selectionStart:r,selectionEnd:a,value:o}=n;if(r==null||a==null){i();return}t.value={start:r,end:a,beforeText:o.slice(0,r),afterText:o.slice(a)}}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 i(){t.value=null}return s(e,i),{recordCursor:n,restoreCursor:r}}var K=d({name:`InputWordCount`,setup(n,{slots:r}){let{mergedValueRef:a,maxlengthRef:o,mergedClsPrefixRef:s,countGraphemesRef:c}=t(se),l=e(()=>{let{value:e}=a;return e===null||Array.isArray(e)?0:(c.value||W)(e)});return()=>{let{value:e}=o,{value:t}=a;return i(`span`,{class:`${s.value}-input-word-count`},h(r.default,{value:t===null||Array.isArray(t)?``:t},()=>[e===void 0?l.value:`${l.value} / ${e}`]))}}}),q=d({name:`Input`,props:Object.assign(Object.assign({},v.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(t){let{mergedClsPrefixRef:i,mergedBorderedRef:d,inlineThemeDisabled:f,mergedRtlRef:p,mergedComponentPropsRef:h}=m(t),g=v(`Input`,`-input`,ce,oe,t,i);A&&C(`-input-safari`,le,i);let _=l(null),y=l(null),x=l(null),S=l(null),w=l(null),T=l(null),O=l(null),k=ue(O),M=l(null),{localeRef:P}=ie(`Input`),F=l(t.defaultValue),I=ne(u(t,`value`),F),L=ee(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:h?.value?.Input?.size||`medium`}}),{mergedSizeRef:R,mergedDisabledRef:z,mergedStatusRef:B}=L,V=l(!1),H=l(!1),U=l(!1),W=l(!1),K=null,q=e(()=>{let{placeholder:e,pair:n}=t;return n?Array.isArray(e)?e:e===void 0?[``,``]:[e,e]:e===void 0?[P.value.placeholder]:[e]}),de=e(()=>{let{value:e}=U,{value:t}=I,{value:n}=q;return!e&&(G(t)||Array.isArray(t)&&G(t[0]))&&n[0]}),fe=e(()=>{let{value:e}=U,{value:t}=I,{value:n}=q;return!e&&n[1]&&(G(t)||Array.isArray(t)&&G(t[1]))}),J=j(()=>t.internalForceFocus||V.value),pe=j(()=>{if(z.value||t.readonly||!t.clearable||!J.value&&!H.value)return!1;let{value:e}=I,{value:n}=J;return t.pair?!!(Array.isArray(e)&&(e[0]||e[1]))&&(H.value||n):!!e&&(H.value||n)}),me=e(()=>{let{showPasswordOn:e}=t;if(e)return e;if(t.showPasswordToggle)return`click`}),Y=l(!1),he=e(()=>{let{textDecoration:e}=t;return e?Array.isArray(e)?e.map(e=>({textDecoration:e})):[{textDecoration:e}]:[``,``]}),ge=l(void 0),_e=()=>{if(t.type===`textarea`){let{autosize:e}=t;if(e&&(ge.value=M.value?.$el?.offsetWidth),!y.value||typeof e==`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}=x;if(!c)return;if(e.minRows){let t=Math.max(e.minRows,1),n=`${a+o+s*t}px`;c.style.minHeight=n}if(e.maxRows){let t=`${a+o+s*e.maxRows}px`;c.style.maxHeight=t}}},ve=e(()=>{let{maxlength:e}=t;return e===void 0?void 0:Number(e)});o(()=>{let{value:e}=I;Array.isArray(e)||nt(e)});let ye=r().proxy;function X(e,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=t,{nTriggerFormInput:o}=L;r&&D(r,e,n),i&&D(i,e,n),a&&D(a,e,n),F.value=e,o()}function Z(e,n){let{onChange:r}=t,{nTriggerFormChange:i}=L;r&&D(r,e,n),F.value=e,i()}function be(e){let{onBlur:n}=t,{nTriggerFormBlur:r}=L;n&&D(n,e),r()}function xe(e){let{onFocus:n}=t,{nTriggerFormFocus:r}=L;n&&D(n,e),r()}function Se(e){let{onClear:n}=t;n&&D(n,e)}function Ce(e){let{onInputBlur:n}=t;n&&D(n,e)}function we(e){let{onInputFocus:n}=t;n&&D(n,e)}function Te(){let{onDeactivate:e}=t;e&&D(e)}function Ee(){let{onActivate:e}=t;e&&D(e)}function De(e){let{onClick:n}=t;n&&D(n,e)}function Oe(e){let{onWrapperFocus:n}=t;n&&D(n,e)}function ke(e){let{onWrapperBlur:n}=t;n&&D(n,e)}function Ae(){U.value=!0}function je(e){U.value=!1,e.target===T.value?Q(e,1):Q(e,0)}function Q(e,n=0,r=`input`){let i=e.target.value;if(nt(i),e instanceof InputEvent&&!e.isComposing&&(U.value=!1),t.type===`textarea`){let{value:e}=M;e&&e.syncUnifiedContainer()}if(K=i,U.value)return;k.recordCursor();let o=Me(i);if(o)if(!t.pair)r===`input`?X(i,{source:n}):Z(i,{source:n});else{let{value:e}=I;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[n]=i,r===`input`?X(e,{source:n}):Z(e,{source:n})}ye.$forceUpdate(),o||a(k.restoreCursor)}function Me(e){let{countGraphemes:n,maxlength:r,minlength:i}=t;if(n){let t;if(r!==void 0&&(t===void 0&&(t=n(e)),t>Number(r))||i!==void 0&&(t===void 0&&(t=n(e)),t<Number(r)))return!1}let{allowInput:a}=t;return typeof a==`function`?a(e):!0}function Ne(e){Ce(e),e.relatedTarget===_.value&&Te(),e.relatedTarget!==null&&(e.relatedTarget===w.value||e.relatedTarget===T.value||e.relatedTarget===y.value)||(W.value=!1),$(e,`blur`),O.value=null}function Pe(e,t){we(e),V.value=!0,W.value=!0,Ee(),$(e,`focus`),t===0?O.value=w.value:t===1?O.value=T.value:t===2&&(O.value=y.value)}function Fe(e){t.passivelyActivated&&(ke(e),$(e,`blur`))}function Ie(e){t.passivelyActivated&&(V.value=!0,Oe(e),$(e,`focus`))}function $(e,t){e.relatedTarget!==null&&(e.relatedTarget===w.value||e.relatedTarget===T.value||e.relatedTarget===y.value||e.relatedTarget===_.value)||(t===`focus`?(xe(e),V.value=!0):t===`blur`&&(be(e),V.value=!1))}function Le(e,t){Q(e,t,`change`)}function Re(e){De(e)}function ze(e){Se(e),Be()}function Be(){t.pair?(X([``,``],{source:`clear`}),Z([``,``],{source:`clear`})):(X(``,{source:`clear`}),Z(``,{source:`clear`}))}function Ve(e){let{onMousedown:n}=t;n&&n(e);let{tagName:r}=e.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(t.resizable){let{value:t}=_;if(t){let{left:n,top:r,width:i,height:a}=t.getBoundingClientRect();if(n+i-14<e.clientX&&e.clientX<n+i&&r+a-14<e.clientY&&e.clientY<r+a)return}}e.preventDefault(),V.value||Xe()}}function He(){var e;H.value=!0,t.type===`textarea`&&((e=M.value)==null||e.handleMouseEnterWrapper())}function Ue(){var e;H.value=!1,t.type===`textarea`&&((e=M.value)==null||e.handleMouseLeaveWrapper())}function We(){z.value||me.value===`click`&&(Y.value=!Y.value)}function Ge(e){if(z.value)return;e.preventDefault();let t=e=>{e.preventDefault(),N(`mouseup`,document,t)};if(re(`mouseup`,document,t),me.value!==`mousedown`)return;Y.value=!0;let n=()=>{Y.value=!1,N(`mouseup`,document,n)};re(`mouseup`,document,n)}function Ke(e){t.onKeyup&&D(t.onKeyup,e)}function qe(e){switch(t.onKeydown&&D(t.onKeydown,e),e.key){case`Escape`:Ye();break;case`Enter`:Je(e);break}}function Je(e){var n,r;if(t.passivelyActivated){let{value:i}=W;if(i){t.internalDeactivateOnEnter&&Ye();return}e.preventDefault(),t.type===`textarea`?(n=y.value)==null||n.focus():(r=w.value)==null||r.focus()}}function Ye(){t.passivelyActivated&&(W.value=!1,a(()=>{var e;(e=_.value)==null||e.focus()}))}function Xe(){var e,n,r;z.value||(t.passivelyActivated?(e=_.value)==null||e.focus():((n=y.value)==null||n.focus(),(r=w.value)==null||r.focus()))}function Ze(){_.value?.contains(document.activeElement)&&document.activeElement.blur()}function Qe(){var e,t;(e=y.value)==null||e.select(),(t=w.value)==null||t.select()}function $e(){z.value||(y.value?y.value.focus():w.value&&w.value.focus())}function et(){let{value:e}=_;e?.contains(document.activeElement)&&e!==document.activeElement&&Ye()}function tt(e){if(t.type===`textarea`){let{value:t}=y;t?.scrollTo(e)}else{let{value:t}=w;t?.scrollTo(e)}}function nt(e){let{type:n,pair:r,autosize:i}=t;if(!r&&i)if(n===`textarea`){let{value:t}=x;t&&(t.textContent=`${e??``}\r\n`)}else{let{value:t}=S;t&&(e?t.textContent=e:t.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=M.value)==null||t.syncUnifiedContainer()}let ot=null;c(()=>{let{autosize:e,type:n}=t;e&&n===`textarea`?ot=s(I,e=>{!Array.isArray(e)&&e!==K&&nt(e)}):ot?.()});let st=null;c(()=>{t.type===`textarea`?st=s(I,e=>{var t;!Array.isArray(e)&&e!==K&&((t=M.value)==null||t.syncUnifiedContainer())}):st?.()}),n(se,{mergedValueRef:I,maxlengthRef:ve,mergedClsPrefixRef:i,countGraphemesRef:u(t,`countGraphemes`)});let ct={wrapperElRef:_,inputElRef:w,textareaElRef:y,isCompositing:U,clear:Be,focus:Xe,blur:Ze,select:Qe,deactivate:et,activate:$e,scrollTo:tt},lt=b(`Input`,p,i),ut=e(()=>{let{value:e}=R,{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:p,placeholderColorDisabled:m,lineHeightTextarea:h,colorDisabled:ee,colorFocus:_,textColorDisabled:v,boxShadowFocus:y,iconSize:b,colorFocusWarning:x,boxShadowFocusWarning:S,borderWarning:C,borderFocusWarning:w,borderHoverWarning:T,colorFocusError:D,boxShadowFocusError:O,borderError:k,borderFocusError:A,borderHoverError:j,clearSize:M,clearColor:te,clearColorHover:ne,clearColorPressed:N,iconColor:P,iconColorDisabled:F,suffixTextColor:I,countTextColor:L,countTextColorDisabled:re,iconColorHover:ie,iconColorPressed:z,loadingColor:B,loadingColorError:V,loadingColorWarning:H,fontWeight:U,[E(`padding`,e)]:oe,[E(`fontSize`,e)]:se,[E(`height`,e)]:ce}}=g.value,{left:le,right:W}=ae(oe);return{"--n-bezier":t,"--n-count-text-color":L,"--n-count-text-color-disabled":re,"--n-color":n,"--n-font-size":se,"--n-font-weight":U,"--n-border-radius":r,"--n-height":ce,"--n-padding-left":le,"--n-padding-right":W,"--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":p,"--n-placeholder-color-disabled":m,"--n-icon-size":b,"--n-line-height-textarea":h,"--n-color-disabled":ee,"--n-color-focus":_,"--n-text-color-disabled":v,"--n-box-shadow-focus":y,"--n-loading-color":B,"--n-caret-color-warning":s,"--n-color-focus-warning":x,"--n-box-shadow-focus-warning":S,"--n-border-warning":C,"--n-border-focus-warning":w,"--n-border-hover-warning":T,"--n-loading-color-warning":H,"--n-caret-color-error":o,"--n-color-focus-error":D,"--n-box-shadow-focus-error":O,"--n-border-error":k,"--n-border-focus-error":A,"--n-border-hover-error":j,"--n-loading-color-error":V,"--n-clear-color":te,"--n-clear-size":M,"--n-clear-color-hover":ne,"--n-clear-color-pressed":N,"--n-icon-color":P,"--n-icon-color-hover":ie,"--n-icon-color-pressed":z,"--n-icon-color-disabled":F,"--n-suffix-text-color":I}}),dt=f?te(`input`,e(()=>{let{value:e}=R;return e[0]}),ut,t):void 0;return Object.assign(Object.assign({},ct),{wrapperElRef:_,inputElRef:w,inputMirrorElRef:S,inputEl2Ref:T,textareaElRef:y,textareaMirrorElRef:x,textareaScrollbarInstRef:M,rtlEnabled:lt,uncontrolledValue:F,mergedValue:I,passwordVisible:Y,mergedPlaceholder:q,showPlaceholder1:de,showPlaceholder2:fe,mergedFocus:J,isComposing:U,activated:W,showClearButton:pe,mergedSize:R,mergedDisabled:z,textDecorationStyle:he,mergedClsPrefix:i,mergedBordered:d,mergedShowPasswordOn:me,placeholderStyle:it,mergedStatus:B,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:g,cssVars:f?void 0:ut,themeClass:dt?.themeClass,onRender:dt?.onRender})},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:r,countGraphemes:a,onRender:o}=this,s=this.$slots;return o?.(),i(`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},i(`div`,{class:`${e}-input-wrapper`},g(s.prefix,t=>t&&i(`div`,{class:`${e}-input__prefix`},t)),r===`textarea`?i(I,{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 i(f,null,i(`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:a?void 0:this.maxlength,minlength:a?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?i(`div`,{class:`${e}-input__placeholder`,style:[this.placeholderStyle,n],key:`placeholder`},this.mergedPlaceholder[0]):null,this.autosize?i(F,{onResize:this.handleTextAreaMirrorResize},{default:()=>i(`div`,{ref:`textareaMirrorElRef`,class:`${e}-input__textarea-mirror`,key:`mirror`})}):null)}}):i(`div`,{class:`${e}-input__input`},i(`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:a?void 0:this.maxlength,minlength:a?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?i(`div`,{class:`${e}-input__placeholder`},i(`span`,null,this.mergedPlaceholder[0])):null,this.autosize?i(`div`,{class:`${e}-input__input-mirror`,key:`mirror`,ref:`inputMirrorElRef`},`\xA0`):null),!this.pair&&g(s.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?i(`div`,{class:`${e}-input__suffix`},[g(s[`clear-icon-placeholder`],t=>(this.clearable||t)&&i(L,{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:i(R,{clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?i(K,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null,this.mergedShowPasswordOn&&this.type===`password`?i(`div`,{class:`${e}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?_(s[`password-visible-icon`],()=>[i(z,{clsPrefix:e},{default:()=>i(B,null)})]):_(s[`password-invisible-icon`],()=>[i(z,{clsPrefix:e},{default:()=>i(V,null)})])):null]):null)),this.pair?i(`span`,{class:`${e}-input__separator`},_(s.separator,()=>[this.separator])):null,this.pair?i(`div`,{class:`${e}-input-wrapper`},i(`div`,{class:`${e}-input__input`},i(`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:a?void 0:this.maxlength,minlength:a?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?i(`div`,{class:`${e}-input__placeholder`},i(`span`,null,this.mergedPlaceholder[1])):null),g(s.suffix,t=>(this.clearable||t)&&i(`div`,{class:`${e}-input__suffix`},[this.clearable&&i(L,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>s[`clear-icon`]?.call(s),placeholder:()=>s[`clear-icon-placeholder`]?.call(s)}),t]))):null,this.mergedBordered?i(`div`,{class:`${e}-input__border`}):null,this.mergedBordered?i(`div`,{class:`${e}-input__state-border`}):null,this.showCount&&r===`textarea`?i(K,null,{default:e=>{let{renderCount:t}=this;return t?t(e):s.count?.call(s,e)}}):null)}});export{B as i,oe as n,H as r,q as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,N as t,R as n,X as r,ct as i,dt as a,j as o}from"./router-DSISOBmz.js";import{B as s,K as c,R as ee,W as l,c as u,ct as d,d as te,it as ne,n as f,q as p,s as m,st as h,tt as g}from"./browser-C0KKMpa8.js";import{d as re,p as _,s as ie}from"./Suffix-lZvgRyRJ.js";import{r as v}from"./fade-in.cssr-D3Wt-ego.js";import{n as y,r as b}from"./Button-BkFCVws1.js";import{t as x}from"./Add-C5vmHXvi.js";import{n as S,t as C}from"./Input-CACQWEc-.js";var w=o({name:`Remove`,render(){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},t(`line`,{x1:`400`,y1:`256`,x2:`112`,y2:`256`,style:`
|
|
2
2
|
fill: none;
|
|
3
3
|
stroke: currentColor;
|
|
4
4
|
stroke-linecap: round;
|
|
@@ -10,4 +10,4 @@ import{M as e,P as t,Z as n,ft as r,lt as i,w as a,z as o}from"./router-kR4kqS2l
|
|
|
10
10
|
`),d(`input-number-prefix`,`
|
|
11
11
|
display: inline-block;
|
|
12
12
|
margin-left: 10px;
|
|
13
|
-
`)]);function se(e){return e==null||typeof e==`string`&&e.trim()===``?null:Number(e)}function E(e){return e.includes(`.`)&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e===`-`||e===`-0`}function D(e){return e==null?!0:!Number.isNaN(e)}function O(e,t){return typeof e==`number`?t===void 0?String(e):e.toFixed(t):``}function k(e){if(e===null)return null;if(typeof e==`number`)return e;{let t=Number(e);return Number.isNaN(t)?null:t}}var A=800,j=100,M=
|
|
13
|
+
`)]);function se(e){return e==null||typeof e==`string`&&e.trim()===``?null:Number(e)}function E(e){return e.includes(`.`)&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e===`-`||e===`-0`}function D(e){return e==null?!0:!Number.isNaN(e)}function O(e,t){return typeof e==`number`?t===void 0?String(e):e.toFixed(t):``}function k(e){if(e===null)return null;if(typeof e==`number`)return e;{let t=Number(e);return Number.isNaN(t)?null:t}}var A=800,j=100,M=o({name:`InputNumber`,props:Object.assign(Object.assign({},u.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:`right`},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),slots:Object,setup(t){let{mergedBorderedRef:o,mergedClsPrefixRef:c,mergedRtlRef:l,mergedComponentPropsRef:d}=s(t),f=u(`InputNumber`,`-input-number`,oe,ae,t,c),{localeRef:m}=ie(`InputNumber`),h=ee(t,{mergedSize:e=>{let{size:n}=t;if(n)return n;let{mergedSize:r}=e||{};return r?.value?r.value:d?.value?.InputNumber?.size||`medium`}}),{mergedSizeRef:v,mergedDisabledRef:y,mergedStatusRef:b}=h,x=i(null),S=i(null),C=i(null),w=i(t.defaultValue),T=re(a(t,`value`),w),M=i(``),N=e=>{let t=String(e).split(`.`)[1];return t?t.length:0},P=e=>{let n=[t.min,t.max,t.step,e].map(e=>e===void 0?0:N(e));return Math.max(...n)},ce=g(()=>{let{placeholder:e}=t;return e===void 0?m.value.placeholder:e}),F=g(()=>{let e=k(t.step);return e===null||e===0?1:Math.abs(e)}),I=g(()=>{let e=k(t.min);return e===null?null:e}),L=g(()=>{let e=k(t.max);return e===null?null:e}),R=()=>{let{value:e}=T;if(D(e)){let{format:n,precision:r}=t;n?M.value=n(e):e===null||r===void 0||N(e)>r?M.value=O(e,void 0):M.value=O(e,r)}else M.value=String(e)};R();let z=e=>{let{value:n}=T;if(e===n){R();return}let{"onUpdate:value":r,onUpdateValue:i,onChange:a}=t,{nTriggerFormInput:o,nTriggerFormChange:s}=h;a&&p(a,e),i&&p(i,e),r&&p(r,e),w.value=e,o(),s()},B=({offset:e,doUpdateIfValid:n,fixPrecision:r,isInputing:i})=>{let{value:a}=M;if(i&&E(a))return!1;let o=(t.parse||se)(a);if(o===null)return n&&z(null),null;if(D(o)){let a=N(o),{precision:s}=t;if(s!==void 0&&s<a&&!r)return!1;let c=Number.parseFloat((o+e).toFixed(s??P(o)));if(D(c)){let{value:e}=L,{value:r}=I;if(e!==null&&c>e){if(!n||i)return!1;c=e}if(r!==null&&c<r){if(!n||i)return!1;c=r}return t.validator&&!t.validator(c)?!1:(n&&z(c),c)}}return!1},le=g(()=>B({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),V=g(()=>{let{value:e}=T;if(t.validator&&e===null)return!1;let{value:n}=F;return B({offset:-n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),H=g(()=>{let{value:e}=T;if(t.validator&&e===null)return!1;let{value:n}=F;return B({offset:+n,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function U(e){let{onFocus:n}=t,{nTriggerFormFocus:r}=h;n&&p(n,e),r()}function ue(e){if(e.target===x.value?.wrapperElRef)return;let r=B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(r!==!1){let e=x.value?.inputElRef;e&&(e.value=String(r||``)),T.value===r&&R()}else R();let{onBlur:i}=t,{nTriggerFormBlur:a}=h;i&&p(i,e),a(),n(()=>{R()})}function de(e){let{onClear:n}=t;n&&p(n,e)}function W(){let{value:e}=H;if(!e){Q();return}let{value:n}=T;if(n===null)t.validator||z(K());else{let{value:e}=F;B({offset:e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function G(){let{value:e}=V;if(!e){X();return}let{value:n}=T;if(n===null)t.validator||z(K());else{let{value:e}=F;B({offset:-e,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}let fe=U,pe=ue;function K(){if(t.validator)return null;let{value:e}=I,{value:n}=L;return e===null?n===null?0:Math.min(0,n):Math.max(0,e)}function me(e){de(e),z(null)}function he(e){var t;C.value?.$el.contains(e.target)&&e.preventDefault(),S.value?.$el.contains(e.target)&&e.preventDefault(),(t=x.value)==null||t.activate()}let q=null,J=null,Y=null;function X(){Y&&=(window.clearTimeout(Y),null),q&&=(window.clearInterval(q),null)}let Z=null;function Q(){Z&&=(window.clearTimeout(Z),null),J&&=(window.clearInterval(J),null)}function $(){X(),Y=window.setTimeout(()=>{q=window.setInterval(()=>{G()},j)},A),_(`mouseup`,document,X,{once:!0})}function ge(){Q(),Z=window.setTimeout(()=>{J=window.setInterval(()=>{W()},j)},A),_(`mouseup`,document,Q,{once:!0})}let _e=()=>{J||W()},ve=()=>{q||G()};function ye(e){var n;if(e.key===`Enter`){if(e.target===x.value?.wrapperElRef)return;B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((n=x.value)==null||n.deactivate())}else if(e.key===`ArrowUp`){if(!H.value||t.keyboard.ArrowUp===!1)return;e.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&W()}else if(e.key===`ArrowDown`){if(!V.value||t.keyboard.ArrowDown===!1)return;e.preventDefault(),B({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&G()}}function be(e){M.value=e,t.updateValueOnInput&&!t.format&&!t.parse&&t.precision===void 0&&B({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}r(T,()=>{R()});let xe={focus:()=>x.value?.focus(),blur:()=>x.value?.blur(),select:()=>x.value?.select()},Se=te(`InputNumber`,l,c);return Object.assign(Object.assign({},xe),{rtlEnabled:Se,inputInstRef:x,minusButtonInstRef:S,addButtonInstRef:C,mergedClsPrefix:c,mergedBordered:o,uncontrolledValue:w,mergedValue:T,mergedPlaceholder:ce,displayedValueInvalid:le,mergedSize:v,mergedDisabled:y,displayedValue:M,addable:H,minusable:V,mergedStatus:b,handleFocus:fe,handleBlur:pe,handleClear:me,handleMouseDown:he,handleAddClick:_e,handleMinusClick:ve,handleAddMousedown:ge,handleMinusMousedown:$,handleKeyDown:ye,handleUpdateDisplayedValue:be,mergedTheme:f,inputThemeOverrides:{paddingSmall:`0 8px 0 10px`,paddingMedium:`0 8px 0 12px`,paddingLarge:`0 8px 0 14px`},buttonThemeOverrides:e(()=>{let{self:{iconColorDisabled:e}}=f.value,[t,n,r,i]=ne(e);return{textColorTextDisabled:`rgb(${t}, ${n}, ${r})`,opacityDisabled:`${i}`}})})},render(){let{mergedClsPrefix:e,$slots:n}=this,r=()=>t(y,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:`minusButtonInstRef`},{icon:()=>l(n[`minus-icon`],()=>[t(v,{clsPrefix:e},{default:()=>t(w,null)})])}),i=()=>t(y,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:`addButtonInstRef`},{icon:()=>l(n[`add-icon`],()=>[t(v,{clsPrefix:e},{default:()=>t(x,null)})])});return t(`div`,{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},t(C,{ref:`inputInstRef`,autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?`line-through`:void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>this.showButton&&this.buttonPlacement===`both`?[r(),c(n.prefix,n=>n?t(`span`,{class:`${e}-input-number-prefix`},n):null)]:n.prefix?.call(n),suffix:()=>this.showButton?[c(n.suffix,n=>n?t(`span`,{class:`${e}-input-number-suffix`},n):null),this.buttonPlacement===`right`?r():null,i()]:n.suffix?.call(n)}))}});export{M as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jobs-B5TmkmHx.js","assets/jobs-ByeskmbT.js","assets/router-DSISOBmz.js","assets/chunk-DECur_0Z.js","assets/preload-helper-rov5CBGT.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{A as e,C as t,D as n,E as r,G as i,O as a,Q as o,T as s,U as c,ct as l,gt as u,j as d,k as f,mt as p,pt as m,q as h,w as g,y as _}from"./router-DSISOBmz.js";import{n as v}from"./pinia-Bf3FnMGw.js";import{t as y}from"./preload-helper-rov5CBGT.js";import{r as b,t as x}from"./_plugin-vue_export-helper-BQLp1Z61.js";import{t as S}from"./Modal-pv2obz6L.js";import{n as C,t as w}from"./FormItem-rZXpOEwq.js";import{t as T}from"./Select-D9RT-keZ.js";import{t as E}from"./Button-BkFCVws1.js";import{t as D}from"./Input-CACQWEc-.js";import{t as O}from"./InputNumber-BtDJhuZ_.js";import{t as k}from"./Tooltip-BSRTJcks.js";import{t as A}from"./use-message-DOCgeMXd.js";import{t as j}from"./Spin-Cl861IYY.js";import{a as M,c as N,i as P,n as F,o as I,s as L,t as ee}from"./jobs-ByeskmbT.js";function R(e,t){return e.job_id===t||e.id===t}var z=v(`jobs`,()=>{let e=l([]),t=l(!1);async function n(){t.value=!0;try{e.value=await P()}catch(e){console.error(`Failed to fetch jobs:`,e)}finally{t.value=!1}}async function r(t){let n=await ee(t);return e.value.unshift(n),n}async function i(t,n){let r=await N(t,n),i=e.value.findIndex(e=>R(e,t));return i!==-1&&(e.value[i]=r),r}async function a(t){await F(t),e.value=e.value.filter(e=>!R(e,t))}async function o(t){let n=await M(t),r=e.value.findIndex(e=>R(e,t));r!==-1&&(e.value[r]=n)}async function s(t){let n=await I(t),r=e.value.findIndex(e=>R(e,t));r!==-1&&(e.value[r]=n)}async function c(t){let n=await L(t),r=e.value.findIndex(e=>R(e,t));r!==-1&&(e.value[r]=n)}return{jobs:e,loading:t,fetchJobs:n,createJob:r,updateJob:i,deleteJob:a,pauseJob:o,resumeJob:s,runJob:c}}),B={class:`job-card`},V={class:`card-header`},H={class:`job-name`},U={class:`card-body`},W={class:`info-row`},G={class:`info-label`},K={class:`info-value mono`},q={class:`info-row`},J={class:`info-label`},Y={class:`info-value`},X={class:`info-row`},Z={class:`info-label`},Q={class:`info-value`},te={class:`info-row`},ne={class:`info-label`},re={class:`info-value`},ie={key:0,class:`info-row`},ae={class:`info-label`},oe={class:`info-value`},se={class:`card-actions`},$=x(d({__name:`JobCard`,props:{job:{}},emits:[`edit`],setup(a,{emit:c}){let l=a,d=c,{t:h}=b(),v=z(),y=A(),x=t(()=>l.job.job_id||l.job.id),S=t(()=>l.job.state===`running`?h(`jobs.status.running`):l.job.state===`paused`?h(`jobs.status.paused`):l.job.enabled?h(`jobs.status.scheduled`):h(`jobs.status.disabled`)),C=t(()=>l.job.state===`running`?`info`:l.job.state===`paused`?`warning`:l.job.enabled?`success`:`error`),w=t(()=>{let e=l.job.schedule;return typeof e==`string`?e:e?.expr||l.job.schedule_display||`—`}),T=e=>e?new Date(e).toLocaleString():`—`;async function D(){try{await v.pauseJob(x.value),y.success(h(`jobs.jobPaused`))}catch(e){y.error(e.message)}}async function O(){try{await v.resumeJob(x.value),y.success(h(`jobs.jobResumed`))}catch(e){y.error(e.message)}}async function j(){try{await v.runJob(x.value),y.info(h(`jobs.jobTriggered`))}catch(e){y.error(e.message)}}async function M(){try{await v.deleteJob(x.value),y.success(h(`jobs.jobDeleted`))}catch(e){y.error(e.message)}}return(t,c)=>(i(),n(`div`,B,[g(`div`,V,[g(`h3`,H,u(a.job.name),1),g(`span`,{class:p([`status-badge`,C.value])},u(S.value),3)]),g(`div`,U,[g(`div`,W,[g(`span`,G,u(m(h)(`jobs.info.schedule`)),1),g(`code`,K,u(w.value),1)]),g(`div`,q,[g(`span`,J,u(m(h)(`jobs.info.lastRun`)),1),g(`span`,Y,[f(u(T(a.job.last_run_at))+` `,1),a.job.last_status?(i(),n(`span`,{key:0,class:p([`run-status`,{ok:a.job.last_status===`ok`,err:a.job.last_status!==`ok`}])},u(a.job.last_status===`ok`?m(h)(`common.ok`):a.job.last_status),3)):r(``,!0)])]),g(`div`,X,[g(`span`,Z,u(m(h)(`jobs.info.nextRun`)),1),g(`span`,Q,u(T(a.job.next_run_at)),1)]),g(`div`,te,[g(`span`,ne,u(m(h)(`jobs.info.deliver`)),1),g(`span`,re,[f(u(a.job.deliver),1),a.job.origin?(i(),n(_,{key:0},[f(` (`+u(a.job.origin.platform)+`)`,1)],64)):r(``,!0)])]),a.job.repeat?(i(),n(`div`,ie,[g(`span`,ae,u(m(h)(`jobs.info.repeat`)),1),g(`span`,oe,[typeof a.job.repeat==`string`?(i(),n(_,{key:0},[f(u(a.job.repeat),1)],64)):(i(),n(_,{key:1},[f(u(a.job.repeat.completed)+` / `+u(a.job.repeat.times??`∞`),1)],64))])])):r(``,!0)]),g(`div`,se,[a.job.state!==`paused`&&a.job.enabled?(i(),s(m(k),{key:0},{trigger:o(()=>[e(m(E),{size:`tiny`,quaternary:``,onClick:D},{default:o(()=>[f(u(m(h)(`jobs.action.pause`)),1)]),_:1})]),default:o(()=>[f(` `+u(m(h)(`jobs.action.pauseJob`)),1)]),_:1})):a.job.state===`paused`?(i(),s(m(k),{key:1},{trigger:o(()=>[e(m(E),{size:`tiny`,quaternary:``,onClick:O},{default:o(()=>[f(u(m(h)(`jobs.action.resume`)),1)]),_:1})]),default:o(()=>[f(` `+u(m(h)(`jobs.action.resumeJob`)),1)]),_:1})):r(``,!0),e(m(k),null,{trigger:o(()=>[e(m(E),{size:`tiny`,quaternary:``,onClick:j},{default:o(()=>[f(u(m(h)(`jobs.action.runNow`)),1)]),_:1})]),default:o(()=>[f(` `+u(m(h)(`jobs.action.triggerImmediately`)),1)]),_:1}),e(m(E),{size:`tiny`,quaternary:``,onClick:c[0]||=e=>d(`edit`,x.value)},{default:o(()=>[f(u(m(h)(`common.edit`)),1)]),_:1}),e(m(E),{size:`tiny`,quaternary:``,type:`error`,onClick:M},{default:o(()=>[f(u(m(h)(`common.delete`)),1)]),_:1})])]))}}),[[`__scopeId`,`data-v-5c958088`]]),ce={key:0,class:`empty-state`},le={key:1,class:`jobs-grid`},ue=x(d({__name:`JobsPanel`,emits:[`edit`],setup(e,{emit:t}){let{t:r}=b(),o=t,c=z();return(e,t)=>m(c).jobs.length===0?(i(),n(`div`,ce,[t[0]||=a(`<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" class="empty-icon" data-v-a0a8d138><rect x="3" y="4" width="18" height="18" rx="2" ry="2" data-v-a0a8d138></rect><line x1="16" y1="2" x2="16" y2="6" data-v-a0a8d138></line><line x1="8" y1="2" x2="8" y2="6" data-v-a0a8d138></line><line x1="3" y1="10" x2="21" y2="10" data-v-a0a8d138></line></svg>`,1),g(`p`,null,u(m(r)(`jobs.noJobs`)),1)])):(i(),n(`div`,le,[(i(!0),n(_,null,h(m(c).jobs,e=>(i(),s($,{key:e.id,job:e,onEdit:t=>o(`edit`,e.id)},null,8,[`job`,`onEdit`]))),128))]))}}),[[`__scopeId`,`data-v-a0a8d138`]]),de={class:`modal-footer`},fe=x(d({__name:`JobFormModal`,props:{jobId:{}},emits:[`close`,`saved`],setup(n,{emit:r}){let{t:a}=b(),d=n,p=r,h=z(),_=A(),v=l(!0),x=l(!1),k=l({name:``,schedule:``,prompt:``,deliver:`origin`,repeat_times:null}),j=l(null),M=t(()=>!!d.jobId),N=t(()=>[{label:a(`jobs.presetEveryMinute`),value:`* * * * *`},{label:a(`jobs.presetEvery5Min`),value:`*/5 * * * *`},{label:a(`jobs.presetEveryHour`),value:`0 * * * *`},{label:a(`jobs.presetEveryDay`),value:`0 0 * * *`},{label:a(`jobs.presetEveryDay9`),value:`0 9 * * *`},{label:a(`jobs.presetEveryMonday`),value:`0 9 * * 1`},{label:a(`jobs.presetEveryMonth`),value:`0 9 1 * *`}]),P=t(()=>[{label:a(`jobs.origin`),value:`origin`},{label:a(`jobs.local`),value:`local`}]),F=l(null);c(async()=>{if(d.jobId)try{let{getJob:e}=await y(async()=>{let{getJob:e}=await import(`./jobs-B5TmkmHx.js`);return{getJob:e}},__vite__mapDeps([0,1,2,3,4])),t=await e(d.jobId);k.value={name:t.name,schedule:typeof t.schedule==`string`?t.schedule:t.schedule?.expr||t.schedule_display||``,prompt:t.prompt,deliver:t.deliver||`origin`,repeat_times:typeof t.repeat==`number`?t.repeat:typeof t.repeat==`object`?t.repeat.times:null},typeof t.schedule==`object`&&t.schedule&&(F.value=t.schedule)}catch(e){_.error(a(`jobs.loadFailed`)+`: `+e.message)}});async function I(){if(!k.value.name.trim()){_.warning(a(`jobs.nameRequired`));return}if(!k.value.schedule.trim()){_.warning(a(`jobs.scheduleRequired`));return}x.value=!0;try{let e={name:k.value.name,schedule:k.value.schedule,prompt:k.value.prompt,deliver:k.value.deliver,repeat:k.value.repeat_times??void 0};M.value&&F.value&&(e.schedule={kind:F.value.kind,expr:k.value.schedule,display:k.value.schedule}),M.value?(await h.updateJob(d.jobId,e),_.success(a(`jobs.jobUpdated`))):(await h.createJob(e),_.success(a(`jobs.jobCreated`))),p(`saved`)}catch(e){_.error(e.message)}finally{x.value=!1}}function L(){v.value=!1,setTimeout(()=>p(`close`),200)}return(t,n)=>(i(),s(m(S),{show:v.value,"onUpdate:show":n[7]||=e=>v.value=e,preset:`card`,title:M.value?m(a)(`jobs.editJob`):m(a)(`jobs.createJob`),style:{width:`min(520px, calc(100vw - 32px))`},"mask-closable":!x.value,onAfterLeave:n[8]||=e=>p(`close`)},{footer:o(()=>[g(`div`,de,[e(m(E),{onClick:L},{default:o(()=>[f(u(m(a)(`common.cancel`)),1)]),_:1}),e(m(E),{type:`primary`,loading:x.value,onClick:I},{default:o(()=>[f(u(M.value?m(a)(`common.update`):m(a)(`common.create`)),1)]),_:1},8,[`loading`])])]),default:o(()=>[e(m(C),{"label-placement":`top`},{default:o(()=>[e(m(w),{label:m(a)(`jobs.name`),required:``},{default:o(()=>[e(m(D),{value:k.value.name,"onUpdate:value":n[0]||=e=>k.value.name=e,placeholder:m(a)(`jobs.namePlaceholder`),maxlength:`200`,"show-count":``},null,8,[`value`,`placeholder`])]),_:1},8,[`label`]),e(m(w),{label:m(a)(`jobs.schedule`),required:``},{default:o(()=>[e(m(D),{value:k.value.schedule,"onUpdate:value":n[1]||=e=>k.value.schedule=e,placeholder:m(a)(`jobs.schedulePlaceholder`)},null,8,[`value`,`placeholder`])]),_:1},8,[`label`]),e(m(w),{label:m(a)(`jobs.quickPresets`)},{default:o(()=>[e(m(T),{value:j.value,"onUpdate:value":[n[2]||=e=>j.value=e,n[3]||=e=>k.value.schedule=e],options:N.value,placeholder:m(a)(`jobs.selectPreset`)},null,8,[`value`,`options`,`placeholder`])]),_:1},8,[`label`]),e(m(w),{label:m(a)(`jobs.prompt`),required:``},{default:o(()=>[e(m(D),{value:k.value.prompt,"onUpdate:value":n[4]||=e=>k.value.prompt=e,type:`textarea`,placeholder:m(a)(`jobs.promptPlaceholder`),rows:4,maxlength:`5000`,"show-count":``},null,8,[`value`,`placeholder`])]),_:1},8,[`label`]),e(m(w),{label:m(a)(`jobs.deliverTarget`)},{default:o(()=>[e(m(T),{value:k.value.deliver,"onUpdate:value":n[5]||=e=>k.value.deliver=e,options:P.value},null,8,[`value`,`options`])]),_:1},8,[`label`]),e(m(w),{label:m(a)(`jobs.repeatCount`)},{default:o(()=>[e(m(O),{value:k.value.repeat_times,"onUpdate:value":n[6]||=e=>k.value.repeat_times=e,min:1,placeholder:m(a)(`jobs.repeatPlaceholder`),clearable:``,style:{width:`100%`}},null,8,[`value`,`placeholder`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`show`,`title`,`mask-closable`]))}}),[[`__scopeId`,`data-v-b339cfa2`]]),pe={class:`jobs-view`},me={class:`page-header`},he={class:`header-title`},ge={class:`jobs-content`},_e=x(d({__name:`JobsView`,setup(t){let{t:a}=b(),d=z(),p=l(!1),h=l(null);c(()=>{d.fetchJobs()});function _(){h.value=null,p.value=!0}function v(e){h.value=e,p.value=!0}function y(){p.value=!1,h.value=null}async function x(){await d.fetchJobs(),y()}return(t,c)=>(i(),n(`div`,pe,[g(`header`,me,[g(`h2`,he,u(m(a)(`jobs.title`)),1),e(m(E),{type:`primary`,size:`small`,onClick:_},{icon:o(()=>[...c[0]||=[g(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`},[g(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),g(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})],-1)]]),default:o(()=>[f(` `+u(m(a)(`jobs.createJob`)),1)]),_:1})]),g(`div`,ge,[e(m(j),{show:m(d).loading&&m(d).jobs.length===0},{default:o(()=>[e(ue,{onEdit:v})]),_:1},8,[`show`])]),p.value?(i(),s(fe,{key:0,"job-id":h.value,onClose:y,onSaved:x},null,8,[`job-id`])):r(``,!0)]))}}),[[`__scopeId`,`data-v-c0d68ae3`]]);export{_e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,D as t,E as n,G as r,U as i,_ as a,a as o,ct as s,g as c,gt as l,j as u,l as d,m as f,mt as p,pt as m,s as h,w as g,y as _}from"./router-DSISOBmz.js";import{r as v,t as y}from"./_plugin-vue_export-helper-BQLp1Z61.js";import"./logo-D12u0f1i.js";import{i as b,r as x}from"./auth-Bkk8rJhI.js";var S={class:`login-view`},C={class:`login-card`},w={class:`login-title`},T={class:`login-desc`},E={key:0,class:`login-method-toggle`},D=[`placeholder`],O=[`placeholder`],k=[`placeholder`],A={key:2,class:`login-error`},j=[`disabled`],M=y(u({__name:`LoginView`,setup(u){let{t:y}=v(),M=d(),N=window.__LOGIN_TOKEN__||``,P=s(N),F=s(``),I=s(``),L=s(!1),R=s(``),z=s(`token`),B=s(!1);o()&&M.replace(`/hermes/chat`),i(async()=>{try{let e=await x();B.value=e.hasPasswordLogin,e.hasPasswordLogin&&!N&&(z.value=`password`)}catch{}});async function V(){z.value===`token`?await H():await U()}async function H(){let e=P.value.trim();if(!e){R.value=y(`login.tokenRequired`);return}L.value=!0,R.value=``;try{if((await fetch(`/api/sessions`,{headers:{Authorization:`Bearer ${e}`}})).status===401){R.value=y(`login.invalidToken`),L.value=!1;return}h(e),M.replace(`/hermes/chat`)}catch{R.value=y(`login.connectionFailed`)}finally{L.value=!1}}async function U(){if(!F.value.trim()||!I.value){R.value=y(`login.credentialsRequired`);return}L.value=!0,R.value=``;try{h(await b(F.value.trim(),I.value)),M.replace(`/hermes/chat`)}catch(e){R.value=e.message||y(`login.invalidCredentials`)}finally{L.value=!1}}return(i,o)=>(r(),t(`div`,S,[g(`div`,C,[o[5]||=g(`div`,{class:`login-logo`},[g(`img`,{src:`/logo.png`,alt:`Hermes`,width:`80`,height:`80`})],-1),g(`h1`,w,l(m(y)(`login.title`)),1),g(`p`,T,l(m(y)(`login.description`)),1),B.value?(r(),t(`div`,E,[g(`button`,{class:p([`toggle-btn`,{active:z.value===`password`}]),onClick:o[0]||=e=>z.value=`password`},l(m(y)(`login.passwordLogin`)),3),g(`button`,{class:p([`toggle-btn`,{active:z.value===`token`}]),onClick:o[1]||=e=>z.value=`token`},l(m(y)(`login.tokenLogin`)),3)])):n(``,!0),g(`form`,{class:`login-form`,onSubmit:a(V,[`prevent`])},[z.value===`token`?e((r(),t(`input`,{key:0,"onUpdate:modelValue":o[2]||=e=>P.value=e,type:`password`,class:`login-input`,placeholder:m(y)(`login.placeholder`),autofocus:``},null,8,D)),[[f,P.value]]):n(``,!0),z.value===`password`?(r(),t(_,{key:1},[e(g(`input`,{"onUpdate:modelValue":o[3]||=e=>F.value=e,type:`text`,class:`login-input`,placeholder:m(y)(`login.usernamePlaceholder`),autofocus:``},null,8,O),[[f,F.value]]),e(g(`input`,{"onUpdate:modelValue":o[4]||=e=>I.value=e,type:`password`,class:`login-input`,placeholder:m(y)(`login.passwordPlaceholder`),onKeyup:c(V,[`enter`])},null,40,k),[[f,I.value]])],64)):n(``,!0),R.value?(r(),t(`div`,A,l(R.value),1)):n(``,!0),g(`button`,{type:`submit`,class:`login-btn`,disabled:L.value},l(L.value?`...`:m(y)(`login.submit`)),9,j)],32)])]))}}),[[`__scopeId`,`data-v-852ca6c8`]]);export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,C as n,D as r,E as ee,G as i,Q as a,U as o,ct as s,gt as c,j as l,k as u,m as d,mt as f,o as p,pt as m,q as h,w as g,y as _}from"./router-DSISOBmz.js";import{r as v,t as y}from"./_plugin-vue_export-helper-BQLp1Z61.js";import{t as b}from"./Select-D9RT-keZ.js";import{t as x}from"./Button-BkFCVws1.js";import{t as S}from"./use-message-DOCgeMXd.js";import{t as C}from"./Spin-Cl861IYY.js";async function w(){return(await p(`/api/hermes/logs`)).files}async function T(e,t){let n=new URLSearchParams;t?.lines&&n.set(`lines`,String(t.lines)),t?.level&&n.set(`level`,t.level),t?.session&&n.set(`session`,t.session),t?.since&&n.set(`since`,t.since);let r=n.toString();return(await p(`/api/hermes/logs/${e}${r?`?${r}`:``}`)).entries.filter(e=>e!==null)}var E={class:`logs-view`},D={class:`page-header`},O={class:`header-title`},k={class:`header-actions`},A=[`placeholder`],j={class:`logs-body`},M={key:0,class:`logs-empty`},N={class:`log-list`},P={class:`log-time`},F={class:`log-logger`},I={class:`access-method`},L={class:`access-path`},R={key:1,class:`log-message`},z=y(l({__name:`LogsView`,setup(l){let{t:p}=v(),y=S(),z=s([]),B=s(`agent`),V=s([]),H=s(!1),U=s(100),W=s(``),G=s(``),K=n(()=>z.value.map(e=>({label:`${e.name} (${e.size})`,value:e.name}))),q=n(()=>[{label:p(`logs.all`),value:``},{label:`ERROR`,value:`ERROR`},{label:`WARNING`,value:`WARNING`},{label:`INFO`,value:`INFO`},{label:`DEBUG`,value:`DEBUG`}]),J=[{label:`50`,value:50},{label:`100`,value:100},{label:`200`,value:200},{label:`500`,value:500}],Y=n(()=>{if(!G.value)return V.value;let e=G.value.toLowerCase();return V.value.filter(t=>t.message.toLowerCase().includes(e)||t.logger.toLowerCase().includes(e)||t.raw.toLowerCase().includes(e))});function X(e){switch(e){case`ERROR`:return`level-error`;case`WARNING`:return`level-warning`;case`DEBUG`:return`level-debug`;default:return`level-info`}}function Z(e){let t=e.match(/\d{2}:\d{2}:\d{2}/);return t?t[0]:e}function Q(e){let t=e.match(/"(\w+)\s+(\S+)\s+HTTP\/[^"]+"\s+(\d+)/);return t?{method:t[1],path:t[2],status:t[3]}:null}async function $(){H.value=!0;try{V.value=(await T(B.value,{lines:U.value,level:W.value||void 0})).filter(e=>e!==null)}catch(e){y.error(e.message)}finally{H.value=!1}}return o(async()=>{z.value=await w(),await $()}),(n,o)=>(i(),r(`div`,E,[g(`header`,D,[g(`h2`,O,c(m(p)(`logs.title`)),1),g(`div`,k,[t(m(b),{value:B.value,"onUpdate:value":[o[0]||=e=>B.value=e,$],options:K.value,size:`small`,class:`input-md`},null,8,[`value`,`options`]),t(m(b),{value:W.value,options:q.value,size:`small`,class:`input-sm`,"onUpdate:value":o[1]||=e=>{W.value=e,$()}},null,8,[`value`,`options`]),t(m(b),{value:U.value,options:J,size:`small`,class:`input-sm`,"onUpdate:value":o[2]||=e=>{U.value=e,$()}},null,8,[`value`]),e(g(`input`,{"onUpdate:modelValue":o[3]||=e=>G.value=e,class:`search-input`,placeholder:m(p)(`logs.searchPlaceholder`)},null,8,A),[[d,G.value]]),t(m(x),{size:`small`,loading:H.value,onClick:$},{default:a(()=>[u(c(m(p)(`logs.refresh`)),1)]),_:1},8,[`loading`])])]),g(`div`,j,[t(m(C),{show:H.value},{default:a(()=>[Y.value.length===0&&!H.value?(i(),r(`div`,M,c(m(p)(`logs.noEntries`)),1)):ee(``,!0),g(`div`,N,[(i(!0),r(_,null,h(Y.value,(e,t)=>(i(),r(`div`,{key:t,class:f([`log-entry`,X(e.level)])},[g(`span`,P,c(Z(e.timestamp)),1),g(`span`,{class:f([`log-level`,X(e.level)])},c(e.level),3),g(`span`,F,c(e.logger),1),Q(e.message)?(i(),r(_,{key:0},[g(`span`,I,c(Q(e.message).method),1),g(`span`,L,c(Q(e.message).path),1),g(`span`,{class:f([`access-status`,`status-`+(Q(e.message).status?.[0]||`x`)])},c(Q(e.message).status),3)],64)):(i(),r(`span`,R,c(e.message),1))],2))),128))])]),_:1},8,[`show`])])]))}}),[[`__scopeId`,`data-v-c785e2a9`]]);export{z as default};
|