/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define(['./Select','sap/ui/core/InvisibleText','./library','./ActionSelectRenderer'],function(S,I,l,A){"use strict";var a=S.extend("sap.m.ActionSelect",{metadata:{library:"sap.m",associations:{buttons:{type:"sap.m.Button",multiple:true,singularName:"button"}}}});a.prototype.init=function(){S.prototype.init.call(this);this.getList().addEventDelegate({onfocusin:this.onfocusinList},this);};a.prototype.hasContent=function(){return S.prototype.hasContent.call(this)||!!this.getButtons().length;};a.prototype.addContent=function(){var c=sap.ui.getCore(),p=this.getPicker();this.getButtons().forEach(function(b){p.addContent(c.byId(b));});};a.prototype._onBeforeRenderingPopover=function(){S.prototype._onBeforeRenderingPopover.call(this);this._updateTutorMessage();};a.prototype.onAfterRenderingPicker=function(){S.prototype.onAfterRenderingPicker.call(this);var p=this.getPicker(),r=this.getRenderer();p.addStyleClass(r.CSS_CLASS+"Picker");p.addStyleClass(r.ACTION_SELECT_CSS_CLASS+"Picker");p.addStyleClass(r.ACTION_SELECT_CSS_CLASS+"Picker-CTX");};a.prototype.createPickerCloseButton=function(){};a.prototype.removeButton=function(b){var p=this.getPicker();if(p){if(typeof b==="number"){b=this.getButtons()[b];}p.removeContent(b);}return this.removeAssociation("buttons",b);};a.prototype.removeAllButtons=function(){var p=this.getPicker();if(p){this.getButtons().forEach(function(b){p.removeContent(b);});}return this.removeAllAssociation("buttons");};a.prototype.onsaptabprevious=function(e){var b=this.getButtons(),p=this.getPicker(),i;if(e.isMarked()||!this.getEnabled()){return;}e.setMarked();if(p&&p.isOpen()&&b.length>0){for(i=b.length-1;i>=0;i--){if(sap.ui.getCore().byId(b[i]).getEnabled()){sap.ui.getCore().byId(b[i]).focus();e.preventDefault();break;}}}};a.prototype.onsaptabnext=function(e){var b=this.getButtons(),p=this.getPicker(),i;if(e.isMarked()||!this.getEnabled()){return;}e.setMarked();if(p&&p.isOpen()&&b.length>0){for(i=0;i