123456 |
- // Licensed Materials - Property of IBM
- // IBM Cognos Products: irot
- // (C) Copyright IBM Corp. 2003, 2022.
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- define([],function(){"use strict";function _w57(_pk5, _8w6, _pl5, _j48, _ae6){this._if5=_pk5;this._if5.style.display="flex";this._hh5=_pk5.id;this._jp6=_8w6||null;this._tf5=_pl5||0;if(_j48){this._kw7=_j48;}if(_ae6){this._546=_ae6;}this._a99();};_w57.prototype._2b7=false;_w57.prototype._9v4="";_w57.prototype._kw7={};_w57.prototype._546 ={search:"def_hal_search_16x16",clear:"def_clearSearchTextBtn"};_w57.prototype._uw=!!window["ResizeObserver"];_w57.prototype._1o8=function(){this._2b7=true;if(this._2p3){this._2p3.disconnect();this._2p3=null;}_fe9._6a(this._o26);this._o26=null;this._jp6=null;this._if5.innerHTML="";this._if5.classList.remove("clsMinimalSearchBox");this._if5.classList.remove("clsCompactSearchBox");this._if5.classList.remove("clsActiveSearchBox");this._if5=null;};_w57.prototype._uz3=function(){return this._o26.value;};_w57.prototype._a99=function(){this._if5.classList.add("clsSearchBoxContainer");this._if5.innerHTML=_3z2._3y2('<svg class="clsSvgIcon16x16 clsSearchIcon" style="flex:0 0 auto"><use xlink:href="#' + this._546.search + '"/></svg>' +'<input type="text" autocomplete="off" class="clsSearchBox" style="width:100%" HAL_isSelectable="true" placeholder="' + ( this._kw7.searchPlaceHolder||"" ) + '"/>' +'<button class="clsSearchBtnClear" style="margin-right:var(--8XS); flex:0 0 auto"><svg class="clsSvgIcon16x16"><use xlink:href="#' + this._546.clear + '"/></svg></button>' );this._o26=this._if5.querySelector('.clsSearchBox');_fe9._we(this._o26, _sa8._1r7(this._5u7.bind(this, false), this._tf5, true));if(this._hh5){this._o26.id=this._hh5+'_SeachInput"';this._if5.querySelector( '.clsSearchBtnClear' ).id = this._hh5 + '_btnClearSearch"';}this._6v7=this._if5.querySelector('.clsSearchBtnClear');this._6v7.onclick=this._v72.bind(this, false);this._o26.addEventListener("keydown", this._f82.bind(this));if(this._uw){this._2p3=new ResizeObserver(this._pg.bind(this));this._2p3.observe(this._if5);}};_w57.prototype._pg=function(){window.requestAnimationFrame(this._7v1.bind(this, this._if5.offsetWidth));};_w57.prototype._7v1=function(_gv8){if(this._2b7){return;}if(_gv8<70){this._if5.classList.add("clsMinimalSearchBox");this._if5.classList.remove("clsCompactSearchBox");}else if(_gv8<110){this._if5.classList.remove("clsMinimalSearchBox");this._if5.classList.add("clsCompactSearchBox");}else{this._if5.classList.remove("clsMinimalSearchBox");this._if5.classList.remove("clsCompactSearchBox");}};_w57.prototype._f82=function(e){switch(e.keyCode){case _fe9._al6:this._v72(true);break;case _fe9._687:e.preventDefault();break;}};_w57.prototype._v72=function(_w66){var b=(this._o26.value.length==0);this._o26.value="";this._5u7(b&&_w66);if(!this._2b7){this._o26.focus();}};_w57.prototype._5u7=function(_2o1){if(this._2b7){return;}var b=(this._o26.value.length>0);if(b){this._if5.classList.add("clsActiveSearchBox");}else{this._if5.classList.remove("clsActiveSearchBox");}this._6v7.style.display=b?"block":"none";var s=this._o26.value;if(_2o1||(s!=this._9v4)){this._9v4=s;if(this._jp6){this._jp6(s, _2o1);}}};return _w57;});
|