Files
infineon_plc/Packages/Beckhoff.TwinCAT.HMI.Controls.14.4.1/runtimes/native1.12-tchmi/dist/TcHmiInput/TcHmiInput.esm.js
m.heisig 2d11c43579 Added minimal functionality for Robot teaching
- Added minimal HMI
- Added possibility to open and close all chamber doors
2026-01-17 09:20:39 +01:00

9 lines
26 KiB
JavaScript

var __runInitializers=this&&this.__runInitializers||function(thisArg,initializers,value){for(var useValue=arguments.length>2,i=0;i<initializers.length;i++)value=useValue?initializers[i].call(thisArg,value):initializers[i].call(thisArg);return useValue?value:void 0},__esDecorate=this&&this.__esDecorate||function(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(void 0!==f&&"function"!=typeof f)throw new TypeError("Function expected");return f}for(var _,kind=contextIn.kind,key="getter"===kind?"get":"setter"===kind?"set":"value",target=!descriptorIn&&ctor?contextIn.static?ctor:ctor.prototype:null,descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{}),done=!1,i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]="access"===p?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null))};var result=(0,decorators[i])("accessor"===kind?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if("accessor"===kind){if(void 0===result)continue;if(null===result||"object"!=typeof result)throw new TypeError("Object expected");(_=accept(result.get))&&(descriptor.get=_),(_=accept(result.set))&&(descriptor.set=_),(_=accept(result.init))&&initializers.unshift(_)}else(_=accept(result))&&("field"===kind?initializers.unshift(_):descriptor[key]=_)}target&&Object.defineProperty(target,contextIn.name,descriptor),done=!0};import{TcHmiControl}from"Beckhoff.TwinCAT.HMI.Framework/index.esm.js";import{ValueBuffer,InputProcessingPoint}from"../Helpers/TcHmiValueBuffer/ValueBuffer.js";let TcHmiInput=(()=>{var _a,_b;let ___onKeydown_decorators,___onInput_decorators,___onPaste_decorators,___onCut_decorators,___onFocusIn_decorators,___onFocusOut_decorators,___onIndirectInputFinished_decorators,___onIndirectInputCanceled_decorators,___onResolverForContentPaddingWatchCallback_decorators,___onResolverForTextColorWatchCallback_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class TcHmiInput extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___onKeydown_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate",checkIsReadOnly:!0})],___onInput_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate",checkIsReadOnly:!0})],___onPaste_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate",checkIsReadOnly:!0})],___onCut_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate",checkIsReadOnly:!0})],___onFocusIn_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onFocusOut_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onIndirectInputFinished_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate",checkIsReadOnly:!0})],___onIndirectInputCanceled_decorators=[TcHmi.EventHandler()],___onResolverForContentPaddingWatchCallback_decorators=[(_a=TcHmi).CallbackMethod.bind(_a)],___onResolverForTextColorWatchCallback_decorators=[(_b=TcHmi).CallbackMethod.bind(_b)],__esDecorate(this,null,___onKeydown_decorators,{kind:"method",name:"__onKeydown",static:!1,private:!1,access:{has:obj=>"__onKeydown"in obj,get:obj=>obj.__onKeydown},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onInput_decorators,{kind:"method",name:"__onInput",static:!1,private:!1,access:{has:obj=>"__onInput"in obj,get:obj=>obj.__onInput},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onPaste_decorators,{kind:"method",name:"__onPaste",static:!1,private:!1,access:{has:obj=>"__onPaste"in obj,get:obj=>obj.__onPaste},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onCut_decorators,{kind:"method",name:"__onCut",static:!1,private:!1,access:{has:obj=>"__onCut"in obj,get:obj=>obj.__onCut},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onFocusIn_decorators,{kind:"method",name:"__onFocusIn",static:!1,private:!1,access:{has:obj=>"__onFocusIn"in obj,get:obj=>obj.__onFocusIn},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onFocusOut_decorators,{kind:"method",name:"__onFocusOut",static:!1,private:!1,access:{has:obj=>"__onFocusOut"in obj,get:obj=>obj.__onFocusOut},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onIndirectInputFinished_decorators,{kind:"method",name:"__onIndirectInputFinished",static:!1,private:!1,access:{has:obj=>"__onIndirectInputFinished"in obj,get:obj=>obj.__onIndirectInputFinished},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onIndirectInputCanceled_decorators,{kind:"method",name:"__onIndirectInputCanceled",static:!1,private:!1,access:{has:obj=>"__onIndirectInputCanceled"in obj,get:obj=>obj.__onIndirectInputCanceled},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForContentPaddingWatchCallback_decorators,{kind:"method",name:"__onResolverForContentPaddingWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForContentPaddingWatchCallback"in obj,get:obj=>obj.__onResolverForContentPaddingWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onResolverForTextColorWatchCallback_decorators,{kind:"method",name:"__onResolverForTextColorWatchCallback",static:!1,private:!1,access:{has:obj=>"__onResolverForTextColorWatchCallback"in obj,get:obj=>obj.__onResolverForTextColorWatchCallback},metadata:_metadata},null,_instanceExtraInitializers),_metadata&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:_metadata})}static#tchmiFQN="TcHmi.Controls.Beckhoff."+this.name;constructor(element,pcElement,attrs){super(element,pcElement,attrs)}__elementTemplateRoot=__runInitializers(this,_instanceExtraInitializers);__elementInput;__elementInvalidNotificationLabel;__locked=!1;__text;__systemKeyboardInputMode;__ignoreEscapeSequences;__oldText;__textHorizontalAlignment;__contentPadding;__textFontSize;__textFontSizeUnit;__textFontFamily;__textFontStyle;__textFontWeight;__placeholder;__textColor;__autoFocusOut;__autoSelectText;__customValidity;__maxTextLength;__resetToLastValidValue;__valueBuffer;__localizedCustomValidity={key:"",parameters:[]};__localizationReader=void 0;__isReadOnly;__triggerUIFinishedOnBlur=!1;__previnit(){if(this.__elementTemplateRoot=this.__element[0].getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiInput-template")[0],this.__elementInput=this.__elementTemplateRoot.getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiInput-template-input")[0],this.__elementInvalidNotificationLabel=this.__elementTemplateRoot.getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiInput-template-input-invalid-notification")[0],!this.__elementTemplateRoot||!this.__elementInput||!this.__elementInvalidNotificationLabel)throw new Error("Invalid Template.html");this.__destroyOnDestroy.push(this.__localization.watch(data=>{if(data.error===TcHmi.Errors.NONE&&data.reader&&(this.__localizationReader=data.reader,""!==this.__localizedCustomValidity.key)){let localizedText=data.reader.get(this.__localizedCustomValidity.key);this.__localizedCustomValidity.parameters.length>0&&(localizedText=tchmi_format_string(localizedText,...this.__localizedCustomValidity.parameters)),TCHMI_DESIGNER||this.__elementInput.setCustomValidity(tchmi_decode_control_characters(localizedText))}})),super.__previnit()}__init(){super.__init(),this.__destroyOnDestroy.push(TcHmi.EventProvider.registerDomEvent(this.__elementTemplateRoot,"focusin",this.__onFocusIn),TcHmi.EventProvider.registerDomEvent(this.__elementTemplateRoot,"focusout",this.__onFocusOut),TcHmi.EventProvider.registerDomEvent(this.__elementTemplateRoot,"indirectinputfinished",this.__onIndirectInputFinished),TcHmi.EventProvider.registerDomEvent(this.__elementTemplateRoot,"indirectinputcanceled",this.__onIndirectInputCanceled),TcHmi.EventProvider.registerDomEvent(this.__elementInput,"keydown",this.__onKeydown,{passive:!1}),TcHmi.EventProvider.registerDomEvent(this.__elementInput,"input",this.__onInput),TcHmi.EventProvider.registerDomEvent(this.__elementInput,"paste",this.__onPaste),TcHmi.EventProvider.registerDomEvent(this.__elementInput,"cut",this.__onCut))}__attach(){super.__attach()}__detach(){super.__detach()}destroy(){this.__keepAlive||super.destroy()}__onKeydown(event){this.__triggerUIFinishedOnBlur=!0,"Escape"===event.key?(this.__setText(this.__oldText),TcHmi.EventProvider.raise(this.__id+".onUserInteractionCanceled"),this.__triggerUIFinishedOnBlur=!1,this.__autoFocusOut&&this.__elementInput.blur()):"Enter"===event.key&&(this.__oldText=this.__text,this.__triggerUIFinishedOnBlur=!1,this.__autoFocusOut&&(this.__elementInput.blur(),this.__unlock()),this.__valueBuffer?.interactionFinished(),TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"),this.__resetToLastValidValue&&this.__text&&(this.__elementInput.value=this.__text,this.__validateTextValue(this.__text)),event.preventDefault())}__onInput(_event){this.__triggerUIFinishedOnBlur=!0;let text=this.__elementInput.value;this.__ignoreEscapeSequences||(text=tchmi_encode_control_characters(text)),this.__validateTextValue(text)&&this.__valueBuffer?.setValue(text)}__onPaste(_event){this.__triggerUIFinishedOnBlur=!0,window.setTimeout(()=>{let text=this.__elementInput.value;this.__ignoreEscapeSequences||(text=tchmi_encode_control_characters(text)),this.__validateTextValue(text)&&this.__valueBuffer?.setValue(text)})}__onCut(_event){this.__triggerUIFinishedOnBlur=!0,window.setTimeout(()=>{let text=this.__elementInput.value;this.__ignoreEscapeSequences||(text=tchmi_encode_control_characters(text)),this.__validateTextValue(text)&&this.__valueBuffer?.setValue(text)})}__onFocusIn(event){this.__triggerUIFinishedOnBlur=!0,this.__oldText=this.__text,this.__elementInput.classList.add("tchmi-focus"),this.__autoSelectText&&(this.__elementInput.setSelectionRange(0,0),this.__elementInput.select()),TcHmi.EventProvider.raise(this.__id+".onFocusIn",event),this.__elementInput===document.activeElement&&this.__lock()}__onFocusOut(event){this.__elementInput.classList.contains("tchmi-keyboard-user-input")||this.__performFocusOut(event)}__performFocusOut(event){this.__unlock(),this.__elementInput.classList.remove("tchmi-focus"),this.__valueBuffer?.interactionFinished(),TcHmi.EventProvider.raise(this.__id+".onFocusOut",event),this.__resetToLastValidValue&&this.__text&&(this.__elementInput.value=this.__text,this.__validateTextValue(this.__text)),this.__oldText=this.__text,this.__triggerUIFinishedOnBlur&&TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"),this.__triggerUIFinishedOnBlur=!1}__onIndirectInputFinished(_event){this.__oldText=this.__text,this.__autoFocusOut?(this.__elementInput?.blur(),this.__unlock()):(this.__valueBuffer?.interactionFinished(),TcHmi.EventProvider.raise(this.__id+".onUserInteractionFinished"),this.__triggerUIFinishedOnBlur=!1)}__onIndirectInputCanceled(event){TcHmi.EventProvider.raise(this.__id+".onUserInteractionCanceled"),this.__triggerUIFinishedOnBlur=!1,this.__elementInput!==document.activeElement?this.__performFocusOut(event):this.__autoFocusOut&&this.__elementInput.blur()}setText(valueNew){if(this.__locked&&!this.__isReadOnly)return;let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Text")),this.__setText(convertedValue)}__setText(valueNew,process=!0){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Text")),this.__validateTextValue(convertedValue),convertedValue!==this.__text&&(this.__text=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Text"}),TcHmi.EventProvider.raise(this.__id+".onTextChanged",this.__text),process&&this.__processText())}getText(){return this.__text}__processText(){if(void 0===this.__text)return;let text=this.__text??"";this.__ignoreEscapeSequences||(text=tchmi_decode_control_characters(text)),this.__elementInput.value=text}setSystemKeyboardInputMode(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("SystemKeyboardInputMode")),convertedValue!==this.__systemKeyboardInputMode&&(this.__systemKeyboardInputMode=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"SystemKeyboardInputMode"}),this.__processSystemKeyboardInputMode())}getSystemKeyboardInputMode(){return this.__systemKeyboardInputMode}__processSystemKeyboardInputMode(){this.__systemKeyboardInputMode&&this.__elementInput.setAttribute("data-tchmi-input-mode",this.__systemKeyboardInputMode)}setIgnoreEscapeSequences(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IgnoreEscapeSequences")),convertedValue!==this.__ignoreEscapeSequences&&(this.__ignoreEscapeSequences=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IgnoreEscapeSequences"}),this.__processText())}getIgnoreEscapeSequences(){return this.__ignoreEscapeSequences}setTextHorizontalAlignment(valueNew){let convertedValue=TcHmi.ValueConverter.toHorizontalAlignment(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextHorizontalAlignment")),convertedValue!==this.__textHorizontalAlignment&&(this.__textHorizontalAlignment=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextHorizontalAlignment"}),this.__processTextHorizontalAlignment())}getTextHorizontalAlignment(){return this.__textHorizontalAlignment}__processTextHorizontalAlignment(){switch(this.__textHorizontalAlignment){case"Left":TcHmi.StyleProvider.setSimpleElementStyle(this.__elementInput,"text-align","left");break;case"Center":TcHmi.StyleProvider.setSimpleElementStyle(this.__elementInput,"text-align","center");break;case"Right":TcHmi.StyleProvider.setSimpleElementStyle(this.__elementInput,"text-align","right");break;default:TcHmi.StyleProvider.setSimpleElementStyle(this.__elementInput,"text-align",null)}this.__elementInvalidNotificationLabel.classList.toggle("invalid-notification-alignment-left","Right"===this.__textHorizontalAlignment)}setContentPadding(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ContentPadding"));let resolverInfo=this.__objectResolvers.get("contentPadding");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("ContentPadding")?.type});this.__objectResolvers.set("contentPadding",{resolver,watchCallback:this.__onResolverForContentPaddingWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForContentPaddingWatchCallback)})}__onResolverForContentPaddingWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("contentPadding"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__contentPadding)||(this.__contentPadding=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ContentPadding"}),this.__processContentPadding()):TcHmi.Log.Controls.error(this,TcHmiInput.#tchmiFQN,{Attribute:"ContentPadding"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getContentPadding(){return this.__contentPadding}__processContentPadding(){TcHmi.StyleProvider.processContentPadding(this.__elementInput,this.__contentPadding),TcHmi.StyleProvider.processContentPadding(this.__elementInvalidNotificationLabel,this.__contentPadding)}setTextFontSize(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontSize")),convertedValue!==this.__textFontSize&&(this.__textFontSize=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontSize"}),this.__processTextFontSize())}getTextFontSize(){return this.__textFontSize}__processTextFontSize(){TcHmi.StyleProvider.processFontSize(this.__elementInput,this.__textFontSize,this.__textFontSizeUnit)}setTextFontSizeUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toFontSizeUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontSizeUnit")),convertedValue!==this.__textFontSizeUnit&&(this.__textFontSizeUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontSizeUnit"}),this.__processTextFontSizeUnit())}getTextFontSizeUnit(){return this.__textFontSizeUnit}__processTextFontSizeUnit(){TcHmi.StyleProvider.processFontSize(this.__elementInput,this.__textFontSize,this.__textFontSizeUnit)}setTextFontFamily(valueNew){let convertedValue=TcHmi.ValueConverter.toFontFamily(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontFamily")),convertedValue!==this.__textFontFamily&&(this.__textFontFamily=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontFamily"}),this.__processTextFontFamily())}getTextFontFamily(){return this.__textFontFamily}__processTextFontFamily(){TcHmi.StyleProvider.processFontFamily(this.__elementInput,this.__textFontFamily)}setTextFontStyle(valueNew){let convertedValue=TcHmi.ValueConverter.toFontStyle(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontStyle")),convertedValue!==this.__textFontStyle&&(this.__textFontStyle=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontStyle"}),this.__processTextFontStyle())}getTextFontStyle(){return this.__textFontStyle}__processTextFontStyle(){TcHmi.StyleProvider.processFontStyle(this.__elementInput,this.__textFontStyle)}setTextFontWeight(valueNew){let convertedValue=TcHmi.ValueConverter.toFontWeight(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextFontWeight")),convertedValue!==this.__textFontWeight&&(this.__textFontWeight=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextFontWeight"}),this.__processTextFontWeight())}getTextFontWeight(){return this.__textFontWeight}__processTextFontWeight(){TcHmi.StyleProvider.processFontWeight(this.__elementInput,this.__textFontWeight)}setPlaceholder(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Placeholder")),convertedValue!==this.__placeholder&&(this.__placeholder=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Placeholder"}),this.__processPlaceholder())}getPlaceholder(){return this.__placeholder}__processPlaceholder(){this.__placeholder?this.__elementInput.setAttribute("placeholder",this.__placeholder):this.__elementInput.removeAttribute("placeholder")}setTextColor(valueNew){let convertedValue=TcHmi.ValueConverter.toObject(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("TextColor"));let resolverInfo=this.__objectResolvers.get("textColor");resolverInfo&&(resolverInfo.watchDestroyer&&resolverInfo.watchDestroyer(),resolverInfo.resolver.destroy());let resolver=new TcHmi.Symbol.ObjectResolver(convertedValue,{parentControl:this,type:this.getAttributeDescription("TextColor")?.type});this.__objectResolvers.set("textColor",{resolver,watchCallback:this.__onResolverForTextColorWatchCallback,watchDestroyer:resolver.watch(this.__onResolverForTextColorWatchCallback)})}__onResolverForTextColorWatchCallback(data){this.__isAttached||this.__suspendObjectResolver("textColor"),data.error===TcHmi.Errors.NONE?tchmi_equal(data.value,this.__textColor)||(this.__textColor=data.value,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"TextColor"}),this.__processTextColor()):TcHmi.Log.Controls.error(this,TcHmiInput.#tchmiFQN,{Attribute:"TextColor"},`Resolving symbols from object failed with error: ${TcHmi.Log.buildMessage(data.details)}`)}getTextColor(){return this.__textColor}__processTextColor(){TcHmi.StyleProvider.processTextColor(this.__elementInput,this.__textColor)}setAutoFocusOut(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("AutoFocusOut")),convertedValue!==this.__autoFocusOut&&(this.__autoFocusOut=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"AutoFocusOut"}),this.__processAutoFocusOut())}getAutoFocusOut(){return this.__autoFocusOut}__processAutoFocusOut(){}__lock(){this.__locked=!0}__unlock(){this.__locked=!1}__processControlActivation(){const textInput=this.__elementInput;TcHmi.Access.checkAccess(this,"operate")&&this.getIsEnabled()?textInput.disabled=!1:(this.__unlock(),textInput.blur(),textInput.disabled=!0)}__processIsEnabled(){super.__processIsEnabled(),this.__processControlActivation()}__processAccessConfig(){super.__processAccessConfig(),this.__processControlActivation()}
/**
* Sets the isReadOnly attribute and calls the associated process function (processIsReadOnly).
* @preserve (Part of the public API)
*/setIsReadOnly(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("IsReadOnly")),convertedValue!==this.__isReadOnly&&(this.__isReadOnly=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"IsReadOnly"}),this.__processIsReadOnly())}getIsReadOnly(){return this.__isReadOnly}__processIsReadOnly(){this.__element[0].classList.toggle("read-only",this.__isReadOnly??!1),this.__elementInput.readOnly=this.__isReadOnly??!1}setAutoSelectText(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("AutoSelectText")),convertedValue!==this.__autoSelectText&&(this.__autoSelectText=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"AutoSelectText"}))}getAutoSelectText(){return this.__autoSelectText}setCustomValidity(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("CustomValidity")),convertedValue!==this.__customValidity&&(this.__customValidity=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"CustomValidity"}),this.__processCustomValidity())}getCustomValidity(){return this.__customValidity}__processCustomValidity(){TCHMI_DESIGNER||this.__elementInput.setCustomValidity(this.__customValidity??""),this.__elementInvalidNotificationLabel.title=this.__customValidity??"",this.__customValidity||this.__validateTextValue(this.__elementInput.value)}focus(){this.__elementInput.focus()}
/**
* Sets the maxTextLength attribute and calls the associated process function (processMaxTextLength).
* @preserve (Part of the public API)
*/setMaxTextLength(valueNew){let convertedValue=TcHmi.ValueConverter.toNumber(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("MaxTextLength")),convertedValue!==this.__maxTextLength&&(this.__maxTextLength=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"MaxTextLength"}),this.__processMaxTextLength())}getMaxTextLength(){return this.__maxTextLength}__processMaxTextLength(){this.__elementInput&&this.__validateTextValue(this.__elementInput.value)&&this.__setText(this.__elementInput.value)}__validateTextValue(newValue){return!(this.__elementInput&&!this.__customValidity)||(this.__elementInput.setCustomValidity(""),void 0===this.__maxTextLength||null===this.__maxTextLength||(!(newValue&&newValue.length>this.__maxTextLength)||(this.__setLocalizedInputValidity("MaxTextLengthReached"),!1)))}setResetToLastValidValue(valueNew){let convertedValue=TcHmi.ValueConverter.toBoolean(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("ResetToLastValidValue")),convertedValue!==this.__resetToLastValidValue&&(this.__resetToLastValidValue=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"ResetToLastValidValue"}),this.__processResetToLastValidValue())}getResetToLastValidValue(){return this.__resetToLastValidValue}__processResetToLastValidValue(){this.__resetToLastValidValue&&this.__elementInput&&(this.__elementInput.value=this.__text?this.__text:"",this.__validateTextValue(this.__text))}setInputProcessingPoint(valueNew){let convertedValue=TcHmi.ValueConverter.toEnum(valueNew,InputProcessingPoint);null===convertedValue&&(convertedValue=InputProcessingPoint[this.getAttributeDefaultValueInternal("InputProcessingPoint")]),convertedValue!==this.__valueBuffer?.processingPoint&&(this.__valueBuffer?this.__valueBuffer.processingPoint=convertedValue:this.__valueBuffer=new ValueBuffer(convertedValue,text=>this.__setText(text,!1)),TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"InputProcessingPoint"}),this.__processInputProcessingPoint())}getInputProcessingPoint(){return this.__valueBuffer?.processingPoint}__processInputProcessingPoint(){}__setLocalizedInputValidity(key,...parameters){if(this.__elementInput)if(this.__localizedCustomValidity.key=key,this.__localizedCustomValidity.parameters=parameters,""===key)this.__elementInput.setCustomValidity("");else if(this.__localizationReader){let localizedText=this.__localizationReader.get(key);this.__localizedCustomValidity.parameters.length>0&&(localizedText=tchmi_format_string(localizedText,...this.__localizedCustomValidity.parameters)),TCHMI_DESIGNER||this.__elementInput.setCustomValidity(tchmi_decode_control_characters(localizedText))}else TCHMI_DESIGNER||this.__elementInput.setCustomValidity("Invalid")}}})();TcHmi.Controls.registerEx("TcHmiInput","TcHmi.Controls.Beckhoff",TcHmiInput,{injectInGlobalObject:!0});export{TcHmiInput as Control};