Files
nextcloud-server/dist/NcPasswordField-BOLzDHBJ-DvzsiWPp.chunk.mjs
nextcloud-command 78098c8325 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-01 13:41:02 +00:00

3 lines
2.7 KiB
JavaScript

import{l as k,h as V,i as S}from"./mdi-BUoBIgaz.chunk.mjs";import{c as N}from"./index-ClciYKp3.chunk.mjs";import{g as F}from"./public-CvthP4YJ.chunk.mjs";import{d as L,c as M}from"./index-Bp9-GhMo.chunk.mjs";import{r as $,e as z,_ as A,b as n,N as D}from"./NcIconSvgWrapper-De-2-ukl-CcvQeIAt.chunk.mjs";import{N as H}from"./NcInputField-CPL-a_MM-DHVwy56P.chunk.mjs";import{b as I,z as c,n as O,A as U,o as j,c as q,B as E,w as v,i as G,k as J,u as o,m as K,C as m,l as h,D as f}from"./preload-helper-DoJVKVMq.chunk.mjs";$(z);const Q=I({__name:"NcPasswordField",props:m({class:{},inputClass:{default:""},id:{},label:{},labelOutside:{type:Boolean},placeholder:{},showTrailingButton:{type:Boolean,default:!0},success:{type:Boolean},error:{type:Boolean},helperText:{},disabled:{type:Boolean},pill:{type:Boolean},checkPasswordStrength:{type:Boolean},minlength:{default:void 0},asText:{type:Boolean}},{modelValue:{default:""},modelModifiers:{},visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:m(["valid","invalid"],["update:modelValue","update:visible"]),setup(l,{expose:w,emit:y}){const s=c(l,"modelValue"),a=c(l,"visible"),t=l,d=y;O(s,L(b,500)),w({focus:_,select:C});const{password_policy:g}=F(),u=U("inputField"),i=h(""),r=h(),x=f(()=>{const e={...t};return delete e.checkPasswordStrength,delete e.minlength,delete e.asText,delete e.error,delete e.helperText,delete e.inputClass,delete e.success,e}),B=f(()=>t.minlength??(t.checkPasswordStrength?g?.minLength:void 0)??void 0);async function b(){if(t.checkPasswordStrength)try{const{data:e}=await N.post(M("apps/password_policy/api/v1/validate"),{password:s.value});if(r.value=e.ocs.data.passed,e.ocs.data.passed){i.value=n("Password is secure"),d("valid");return}i.value=e.ocs.data.reason,d("invalid")}catch(e){k.error("Password policy returned an error",{error:e})}}function T(){a.value=!a.value}function _(e){u.value.focus(e)}function C(){u.value.select()}return(e,p)=>(j(),q(H,K(x.value,{ref:"inputField",modelValue:s.value,"onUpdate:modelValue":p[0]||(p[0]=P=>s.value=P),error:e.error||r.value===!1,helperText:e.helperText||i.value,inputClass:[e.inputClass,{"password-field__input--secure-text":!a.value&&e.asText}],minlength:B.value,success:e.success||r.value===!0,trailingButtonLabel:a.value?o(n)("Hide password"):o(n)("Show password"),type:a.value||e.asText?"text":"password",onTrailingButtonClick:T}),E({"trailing-button-icon":v(()=>[J(D,{path:a.value?o(V):o(S)},null,8,["path"])]),_:2},[e.$slots.icon?{name:"icon",fn:v(()=>[G(e.$slots,"icon",{},void 0,!0)]),key:"0"}:void 0]),1040,["modelValue","error","helperText","inputClass","minlength","success","trailingButtonLabel","type"]))}}),se=A(Q,[["__scopeId","data-v-00e75248"]]);export{se as N};
//# sourceMappingURL=NcPasswordField-BOLzDHBJ-DvzsiWPp.chunk.mjs.map