Files
infineon_plc/Packages/Beckhoff.TwinCAT.HMI.Controls.14.4.1/runtimes/native1.12-tchmi/dist/TcHmiThemeSelect/TcHmiThemeSelect.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

14 lines
11 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";let TcHmiThemeSelect=(()=>{let ___onThemeChanged_decorators,___onUserInteractionFinished_decorators,___onComboboxPropertyChanged_decorators,_classSuper=TcHmiControl.Control,_instanceExtraInitializers=[];return class extends _classSuper{static{const _metadata="function"==typeof Symbol&&Symbol.metadata?Object.create(_classSuper[Symbol.metadata]??null):void 0;___onThemeChanged_decorators=[TcHmi.EventHandler()],___onUserInteractionFinished_decorators=[TcHmi.EventHandler({checkIsEnabled:!0,checkAccess:"operate"})],___onComboboxPropertyChanged_decorators=[TcHmi.EventHandler()],__esDecorate(this,null,___onThemeChanged_decorators,{kind:"method",name:"__onThemeChanged",static:!1,private:!1,access:{has:obj=>"__onThemeChanged"in obj,get:obj=>obj.__onThemeChanged},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onUserInteractionFinished_decorators,{kind:"method",name:"__onUserInteractionFinished",static:!1,private:!1,access:{has:obj=>"__onUserInteractionFinished"in obj,get:obj=>obj.__onUserInteractionFinished},metadata:_metadata},null,_instanceExtraInitializers),__esDecorate(this,null,___onComboboxPropertyChanged_decorators,{kind:"method",name:"__onComboboxPropertyChanged",static:!1,private:!1,access:{has:obj=>"__onComboboxPropertyChanged"in obj,get:obj=>obj.__onComboboxPropertyChanged},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);__isReadOnly;__combobox;__themeChangeEventDestroyFunction=null;__onThemeDefinitionChangedDestroyFunction=null;__userInteractionFinishedEventDestroyFunction=null;__passThroughPropertyEventDestroyFunction=null;__previnit(){super.__previnit(),this.__elementTemplateRoot=this.__element[0].getElementsByClassName("TcHmi_Controls_Beckhoff_TcHmiThemeSelect-template")[0];let combobox=TcHmi.Controls.get(this.getId()+"_TcHmiCombobox");if(!combobox||!this.__elementTemplateRoot)throw new Error("Invalid Template.html");this.__combobox=combobox,this.__passThroughPropertyEventDestroyFunction=TcHmi.EventProvider.register(`${this.__id}_TcHmiCombobox.onPropertyChanged`,this.__onComboboxPropertyChanged)}__init(){super.__init(),this.__displayThemes()}__attach(){super.__attach(),this.__selectActiveTheme(),this.__destroyOnDetach.push(TcHmi.EventProvider.register("onThemeDataChanged",this.__onThemeChanged),TcHmi.EventProvider.register(this.__id+"_TcHmiCombobox.onUserInteractionFinished",this.__onUserInteractionFinished)),TCHMI_ENGINEERING&&this.__destroyOnDetach.push(TcHmi.EventProvider.register("onConfigChanged",(_event,param)=>{tchmi_equal(param.configNew.themes,param.configOld.themes)||this.__displayThemes()}))}__detach(){super.__detach()}destroy(){this.__keepAlive||(this.__passThroughPropertyEventDestroyFunction?.(),this.__passThroughPropertyEventDestroyFunction=null,super.destroy())}__displayThemes(){let themes=TcHmi.Theme.getRegisteredThemes(),themeData=[];themes.forEach((theme,itemId)=>{let themeListItem={text:theme,id:itemId,value:theme};themeData.push(themeListItem)}),themeData.length>0&&this.__combobox.setSrcData(themeData)}__selectActiveTheme(){let theme=TcHmi.Theme.get(),srcData=this.__combobox.getSrcData();if(theme&&srcData?.length){for(let i=0;i<srcData.length;i++)if(srcData[i].value===theme){this.__combobox.setSelectedIndex(i);break}}else this.__combobox.setSelectedIndex(null)}__onThemeChanged(event){this.__selectActiveTheme()}__onUserInteractionFinished(event){TcHmi.Theme.set(this.__combobox.getSelectedValue()??"Base")}__onComboboxPropertyChanged(event,data,...args){["BackgroundColor","TextHorizontalAlignment","ContentPadding","DropDownHighlightColor","DropDownHighlightTextColor","DropDownToggleButtonBackgroundColor","DropDownToggleButtonArrowColor","TextColor","TextFontSize","TextFontSizeUnit","TextFontFamily","TextFontStyle","TextFontWeight","DataHeight","MaxListHeight","DropDownStyle","DropDownFontSize","DropDownFontSizeUnit","DropDownFontFamily","DropDownFontStyle","DropDownFontWeight","DropDownHorizontalAlignment","DropDownVerticalAlignment","DropDownTextColor","DropDownBackgroundColor"].includes(data.propertyName)&&TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",data,...args)}
/**
* Sets the background value and calls the associated process function (processBackground).
* @param valueNew
* @preserve (Part of the public API)
*/setBackgroundColor(valueNew){this.__combobox.setBackgroundColor(valueNew)}
/**
* Returns the current background value.
* @preserve (Part of the public API)
*/getBackgroundColor(){return this.__combobox.getBackgroundColor()}setTextHorizontalAlignment(valueNew){this.__combobox.setTextHorizontalAlignment(valueNew)}getTextHorizontalAlignment(){return this.__combobox.getTextHorizontalAlignment()}setContentPadding(valueNew){this.__combobox.setContentPadding(valueNew)}getContentPadding(){return this.__combobox.getContentPadding()}setDropDownHighlightColor(valueNew){this.__combobox.setDropDownHighlightColor(valueNew)}getDropDownHighlightColor(){return this.__combobox.getDropDownHighlightColor()}setDropDownHighlightTextColor(valueNew){this.__combobox.setDropDownHighlightTextColor(valueNew)}getDropDownHighlightTextColor(){return this.__combobox.getDropDownHighlightTextColor()}setDropDownToggleButtonBackgroundColor(valueNew){this.__combobox.setDropDownToggleButtonBackgroundColor(valueNew)}getDropDownToggleButtonBackgroundColor(){return this.__combobox.getDropDownToggleButtonBackgroundColor()}setDropDownToggleButtonArrowColor(valueNew){this.__combobox.setDropDownToggleButtonArrowColor(valueNew)}getDropDownToggleButtonArrowColor(){return this.__combobox.getDropDownToggleButtonArrowColor()}setTextColor(valueNew){this.__combobox.setTextColor(valueNew)}getTextColor(){return this.__combobox.getTextColor()}setTextFontSize(valueNew){this.__combobox.setTextFontSize(valueNew)}getTextFontSize(){return this.__combobox.getTextFontSize()}setTextFontSizeUnit(valueNew){this.__combobox.setTextFontSizeUnit(valueNew)}getTextFontSizeUnit(){return this.__combobox.getTextFontSizeUnit()}setTextFontFamily(valueNew){this.__combobox.setTextFontFamily(valueNew)}getTextFontFamily(){return this.__combobox.getTextFontFamily()}setTextFontStyle(valueNew){this.__combobox.setTextFontStyle(valueNew)}getTextFontStyle(){return this.__combobox.getTextFontStyle()}setTextFontWeight(valueNew){this.__combobox.setTextFontWeight(valueNew)}getTextFontWeight(){return this.__combobox.getTextFontWeight()}setDataHeight(valueNew){this.__combobox.setDataHeight(valueNew)}getDataHeight(){return this.__combobox.getDataHeight()}setMaxListHeight(valueNew){this.__combobox.setMaxListHeight(valueNew)}getMaxListHeight(){return this.__combobox.getMaxListHeight()}setDropDownStyle(valueNew){this.__combobox.setDropDownStyle(valueNew)}getDropDownStyle(){return this.__combobox.getDropDownStyle()}setDropDownFontSize(valueNew){this.__combobox.setDropDownFontSize(valueNew)}getDropDownFontSize(){return this.__combobox.getDropDownFontSize()}setDropDownFontSizeUnit(valueNew){this.__combobox.setDropDownFontSizeUnit(valueNew)}getDropDownFontSizeUnit(){return this.__combobox.getDropDownFontSizeUnit()}setDropDownFontFamily(valueNew){this.__combobox.setDropDownFontFamily(valueNew)}getDropDownFontFamily(){return this.__combobox.getDropDownFontFamily()}setDropDownFontStyle(valueNew){this.__combobox.setDropDownFontStyle(valueNew)}getDropDownFontStyle(){return this.__combobox.getDropDownFontStyle()}setDropDownFontWeight(valueNew){this.__combobox.setDropDownFontWeight(valueNew)}getDropDownFontWeight(){return this.__combobox.getDropDownFontWeight()}setDropDownHorizontalAlignment(valueNew){this.__combobox.setDropDownHorizontalAlignment(valueNew)}getDropDownHorizontalAlignment(){return this.__combobox.getDropDownHorizontalAlignment()}setDropDownVerticalAlignment(valueNew){this.__combobox.setDropDownVerticalAlignment(valueNew)}getDropDownVerticalAlignment(){return this.__combobox.getDropDownVerticalAlignment()}setDropDownTextColor(valueNew){this.__combobox.setDropDownTextColor(valueNew)}getDropDownTextColor(){return this.__combobox.getDropDownTextColor()}setDropDownBackgroundColor(valueNew){this.__combobox.setDropDownBackgroundColor(valueNew)}getDropDownBackgroundColor(){return this.__combobox.getDropDownBackgroundColor()}
/**
* 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.__combobox.setIsReadOnly(this.__isReadOnly??!1)}}})();TcHmi.Controls.registerEx("TcHmiThemeSelect","TcHmi.Controls.Beckhoff",TcHmiThemeSelect,{injectInGlobalObject:!0});export{TcHmiThemeSelect as Control};