PageSourceSearch

https://www.nunhems.com/chunk-6Y3DFLCN.js

js nunhems.com collected 2026-10-01 13:07:16 UTC 6,552 bytes, 1 lines download raw bytes

1import{a as k}from"./chunk-NZXDCRFC.js";import{b as A}from"./chunk-3LEWU7XO.js";import"./chunk-YUQU5SND.js";import"./chunk-S2MD3SH4.js";import{b as D}from"./chunk-NAN5QWJE.js";import"./chunk-I5TDGRI5.js";import{e as a,g as S,k as I,o as _,r as P,v as N,w as O}from"./chunk-AWFS4BY4.js";import"./chunk-MRMFTTD6.js";import{a as q}from"./chunk-N2BRNX2G.js";import{S as R,ea as x,j as r}from"./chunk-5B73PZKH.js";import{Ue as w,jb as h,kb as d,lb as b,ob as l}from"./chunk-BDKH7HVI.js";import{Ca as C,E as u,G as g,Hb as F,Ia as n,L as c,Mb as v,Oa as M,Qa as y,c as f,hc as T,ic as L,jc as V,k as p,na as s,xc as E}from"./chunk-4Q6BE6NT.js";import{h as m}from"./chunk-DIQPMGB2.js";var se=(()=>{class o extends q{constructor(){super(...arguments),this.formService=s(R,{optional:!0}),this.userProfileCache=s(w,{optional:!0}),this.translateService=s(x),this.elementRef=s(y),this.destroyRef=s(C),this.showLabel=!0,this.readonly=!1,this.required=!1,this.charLimit=4096,this.helpMessagePlaceholder=!1,this.showField=n(!0),this.fieldType="text",this.textareaLines=2,this.errorMessage=n(""),this.emailValidation=!1,this.phoneValidation=!1}ngOnInit(){this.initFormField();let e=this.autoFillField;e&&this.userProfileCache?this.userProfileCache.getUserProfileData().pipe(c(1),g(()=>p(void 0))).subscribe(i=>{let t=i?.[e];this.applyFieldValue(t)}):this.applyFieldValue(),this.registerControl(),this.formControl.valueChanges.pipe(l(this.destroyRef)).subscribe(i=>{this.checkFieldValidity(),this.formService?.updateControl(this.metadata["@id"],i,this.formControl.valid)}),this.formService&&(this.formService.controls$.pipe(l(this.destroyRef),u(i=>i.some(t=>t.id===this.metadata["@id"]&&(t.checkValidity||t.resetField)))).subscribe(i=>{i.some(t=>t.resetField)&&this.resetFormControl(),this.updateFormControl()}),this.formService.addFieldDependencyListener(this.formService,this.dependency,this.destroyRef,()=>{this.registerControl(),this.showField.set(!0),this.getEditableComponentElement().classList.remove("hide")},()=>{this.showField.set(!1),this.unregisterControl(),this.getEditableComponentElement().classList.add("hide")}))}updateFormControl(){new f(e=>{e.next()}).pipe(l(this.destroyRef)).subscribe(()=>{this.checkFieldValidity(),this.formService?.updateControl(this.metadata["@id"],this.formControl.value,this.formControl.valid)})}resetFormControl(){this.formControl.reset()}checkFieldValidity(){return m(this,null,function*(){let e="";if(this.formControl.value&&this.formControl.value.length>this.charLimit){e=yield this.translateService.getTranslatedKeyValue("forms.charLimitMessage"),this.errorMessage.set(this.charLimitMessage??e);return}if(this.required&&!this.formControl.value){e=yield this.translateService.getTranslatedKeyValue("forms.requiredMessage"),this.errorMessage.set(this.requiredMessage??e);return}if(!this.formControl.valid){if(this.isInvalidPhoneNumber()){e=yield this.translateService.getTranslatedKeyValue("forms.validInternationalPhone"),this.errorMessage.set(this.phoneValidationConstraintMessage??e);return}if(this.isInvalidEmail()){e=yield this.translateService.getTranslatedKeyValue("forms.privateEmailNotAllowed"),this.errorMessage.set(this.emailValidationConstraintMessage??e);return}e=yield this.translateService.getTranslatedKeyValue("forms.validationMessage"),this.errorMessage.set(this.validationMessage??e);return}this.errorMessage.set("")})}isInvalidPhoneNumber(){return this.formControl.value&&this.fieldType===r.TEL&&this.phoneValidation&&!h.test(this.formControl.value.toString())}isInvalidEmail(){return this.formControl.value&&this.fieldType===r.EMAIL&&this.emailValidation&&!d.test(this.formControl.value.toString())}initFormField(){this.fieldType=this.fieldOpts.field,this.fieldType===r.EMAIL&&(this.emailValidation=this.fieldOpts.emailValidation,this.emailValidationConstraintMessage=this.fieldOpts.emailValidationConstraintMessage),this.fieldType===r.TEL&&(this.phoneValidation=this.fieldOpts.phoneValidation,this.phoneValidationConstraintMessage=this.fieldOpts.phoneValidationConstraintMessage),this.fieldOpts.textareaLines&&(this.textareaLines=this.fieldOpts.textareaLines??1);let e=[a.maxLength(this.charLimit)];this.fieldType===r.EMAIL&&e.push(a.pattern(b)),this.fieldType===r.EMAIL&&this.emailValidation&&e.push(a.pattern(d)),this.fieldType===r.TEL&&this.phoneValidation&&e.push(a.pattern(h)),this.required&&e.push(a.required),this.formControl=new I(null,e)}applyFieldValue(e){let i=e??this.fieldOpts.value,t=this.getInputValue(i);t!==null&&!this.formControl.value&&this.formControl.setValue(t)}getInputValue(e){return e?this.fieldType===r.DATE?e.split("T")[0]:this.fieldType===r.TIME?new Date(e).toLocaleTimeString("en",{timeStyle:"short",hour12:!1}):e:null}registerControl(){this.formService?.registerControl(this.metadata["@id"],this.fieldName,this.formControl?this.formControl.value:"",this.errorMessage()==="",this.fieldType,this.label,this.readonly)}unregisterControl(){this.formService?.unregisterControl(this.metadata["@id"])}getEditableComponentElement(){return this.elementRef.nativeElement.parentElement}static{this.\u0275fac=(()=>{let e;return function(t){return(e||(e=M(o)))(t||o)}})()}static{this.\u0275cmp=F({type:o,selectors:[["basf-mgnl-form-field-text"]],inputs:{label:"label",showLabel:"showLabel",fieldName:"fieldName",readonly:"readonly",required:"required",requiredMessage:"requiredMessage",charLimit:"
1charLimit",charLimitMessage:"charLimitMessage",helpMessage:"helpMessage",helpMessagePlaceholder:"helpMessagePlaceholder",validationMessage:"validationMessage",fieldOpts:"fieldOpts",metadata:"metadata",dependency:"dependency",autoFillField:"autoFillField"},features:[v],decls:1,vars:12,consts:[[3,"updateFormControl","label","showLabel","required","fieldName","fieldType","helpMessagePlaceholder","helpMessage","errorMessage","formControl","readonly","textareaLines","showField"]],template:function(i,t){i&1&&(L(0,"basf-wxp-form-field-text",0),E("updateFormControl",function(){return t.updateFormControl()}),V()),i&2&&T("label",t.label)("showLabel",t.showLabel)("required",t.required)("fieldName",t.fieldName)("fieldType",t.fieldType)("helpMessagePlaceholder",t.helpMessagePlaceholder)("helpMessage",t.helpMessage)("errorMessage",t.errorMessage())("formControl",t.formControl)("readonly",t.readonly)("textareaLines",t.textareaLines)("showField",t.showField())},dependencies:[D,A,N,S,P,O,_,k],styles:[".mgnl-form-field-text__input[_ngcontent-%COMP%], .mgnl-form-field-text__textarea[_ngcontent-%COMP%]{width:100%;resize:vertical}"]})}}return o})();export{se as MgnlFormFieldTextComponent};

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.