PageSourceSearch

https://ntm.ndw.nu/chunk-3M6UNZRO.js

js ndw.nu collected 2026-09-24 09:51:04 UTC 3,752 bytes, 1 lines download raw bytes

1import{a as w}from"./chunk-P2P3TLWY.js";import{e as b}from"./chunk-P2RBSFX3.js";import{$ as l,Ab as q,Ad as j,Bb as D,Cb as A,Da as s,Hb as F,Ja as N,Jb as R,Mb as _,Ob as u,Pb as x,Q as I,Qa as C,Qb as S,Rc as $,db as p,e as E,fb as h,gc as g,hc as v,kb as f,lb as d,mb as a,nb as y,nc as m,rc as o,sa as M,uc as c,xd as B,yd as T}from"./chunk-IBQKU4RN.js";var Q=["input"],k=["select"],z=["textarea"],O=["*"];function U(n,W){n&1&&(d(0,"span",1),u(1,"*"),a())}function G(n,W){if(n&1&&(d(0,"div",3),u(1),g(2,"translate"),a()),n&2){let e=q();s(),x(v(2,1,e.hint()))}}var oe=(()=>{class n{constructor(){this.renderer=l(N),this.elementRef=l(M),this.translate=l(B),this.destroy$=new E,this.ariaInvalidAttr="aria-invalid",this.controlName=o.required(),this.label=o.required(),this.control=o.required(),this.errorMessages=o(),this.marginBottom=o(!0),this.isRequired=o(void 0),this.hint=o(),this.inputElement=c("input"),this.selectElement=c("select"),this.textareaElement=c("textarea"),this.inputId=m(()=>`ntm-field-${this.sanitizePath(this.controlName())}`),this.resolvedIsRequired=m(()=>{if(this.isRequired()!==void 0)return this.isRequired();let e=this.control();return(e?.hasValidator(b.required)??!1)||(e?.hasValidator(b.requiredTrue)??!1)}),this.translatedErrorMessages=m(()=>{let e=this.errorMessages();if(!e)return;let t={};for(let[i,r]of Object.entries(e))t[i]=this.translate.instant(r);return t})}ngAfterContentInit(){this.setupInput()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setupInput(){let e=this.getInputElement();if(!e){console.info(`Form wrapper (controlName="${this.controlName()}"): No input element found`);return}this.renderer.setAttribute(e,"id",this.inputId()),this.resolvedIsRequired()&&this.renderer.setAttribute(e,"aria-required","true"),this.applyAccessibilityAttributes(e)}applyAccessibilityAttributes(e){let t=this.control();if(!t){console.info(`Form wrapper (controlName="${this.controlName()}"): Control is null`);return}let r=`${e.id}-error`;this.renderer.setAttribute(e,"aria-describedby",r),t.statusChanges.pipe(I(this.destroy$)).subscribe(()=>{let V=t.touched||!t.pristine;t.invalid&&V?this.renderer.setAttribute(e,this.ariaInvalidAttr,"true"):this.renderer.removeAttribute(e,this.ariaInvalidAttr)});let P=t.touched||!t.pristine;t.invalid&&P&&this.renderer.setAttribute(e,this.ariaInvalidAttr,"true")}getInputElement(){let e=this.inputElement();if(e)return e.nativeElement;let t=this.selectElement();if(t)return t.nativeElement;let i=this.textareaElement();return i?i.nativeElement:this.elementRef.nativeElement.querySelector("input, select, textarea")}sanitizePath(e){return e.replace(/\./g,"-")}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["ntm-form-field-wrapper"]],contentQueries:function(t,i,r){t&1&&F(r,i.inputElement,Q,5)(r,i.selectElement,k,5)(r,i.textareaElement,z,5),t&2&&R(3)},inputs:{controlName:[1,"controlName"],label:[1,"label"],control:[1,"control"],errorMessages:[1,"errorMessages"],marginBottom:[1,"marginBottom"],isRequired:[1,"isRequired"],hint:[1,"hint"]},ngContentSelectors:O,decls:8,vars:11,consts:[[1,"form-label",3,"for"],["aria-hidden","true",1,"required-indicator"],[3,"inputId","control","errorMessages"],[1,"form-text"]],template:function(t,i){t&1&&(D(),d(0,"div")(1,"label",0),u(2),g(3,"translate"),p(4,U,2,0,"span",1),a(),A(5),y(6,"ntm-form-control-validation",2),p(7,G,3,3,"div",3),a()),t&2&&(_("mb-3",i.marginBottom()),s(),f("for",i.inputId()),s(),S(" ",v(3,9,i.label())," "),s(2),h(i.resolvedIsRequired()?4:-1),s(2),f("inputId",i.inputId())("control",i.control())("errorMessages",i.translatedErrorMessages()),s(),h(i.hint()?7:-1))},dependencies:[$,j,w,T],encapsulation:2,changeDetection:0})}}return n})();export{oe as a};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.