_lv2.js 11 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: irot
  3. // (C) Copyright IBM Corp. 2003, 2022.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. var _lv2=function(_zz7,_r49,_hw8,_yw4){_be9._452("_4l6");_be9._452("_lq7");this._lo6=!!_r49.getAttribute("isControl");this._f73=_r49.getAttribute("useStyleVersion");if(this._f73){this._k53=Number(this._f73);}this._iv7=_zz7;this._s09=_r49;this._wq8=_hw8;this._ds4=_yw4;this._4r8={};this._sa7=[];this._yk2();this._4z5();this._0i5=_r49.getAttribute("keywordsText")||_099._zh2( this._264, "PMT_SSM_KEYWORDSLABEL", "IDS_HAL_SEARCH_LABEL" );this._ir6=_r49.getAttribute("searchInstructionsText")||_099._zh2( this._264, "PMT_SSM_KEYWORDTIP", "IDS_HAL_SEARCH_HINT" );if(this._3f5===true){this._pq2=_r49.getAttribute("resultsSelectAllText")||_099._zh2( this._264, "PMT_UIM_SELECTALL", "IDS_HAL_SEARCH_CHECKBOX_LABEL" );}this._ld7=_099._zh2( this._264, "PMT_SSM_NORESULTSFOUND", "IDS_HAL_SEARCH_LIST_HINT" );this._gp3=_099._zh2( this._264, "PMT_SSM_CASEINSENSITIVE", "IDS_HAL_SEARCH_CASE" );this._x54=[];this._x54.push(_099._zh2( this._264, "PMT_SSM_STARTANY", "IDS_HAL_SEARCH_START_WITH_ANY" ));this._x54.push(_099._zh2( this._264, "PMT_SSM_STARTALL", "IDS_HAL_SEARCH_START_WITH_FIRST" ));this._x54.push(_099._zh2( this._264, "PMT_SSM_CONTAINANY", "IDS_HAL_SEARCH_START_CONTAIN_ANY" ));this._x54.push(_099._zh2( this._264, "PMT_SSM_CONTAINALL", "IDS_HAL_SEARCH_START_CONTAIN_ALL" ));};_lv2.prototype._k53=NaN;_lv2.prototype._1o8=function(){while(this._sa7.length>0){this._sa7.pop()._xp8();}if(this._zc7){this._zc7._1o8();this._zc7=null;}if(this._g36){this._g36._1o8();this._g36=null;}this._iv7.innerHTML="";};_lv2.prototype._yk2=function(){this._qr6=this._s09.getAttribute("parameter")||"";this._3f5=(this._s09.getAttribute("multiSelect")==="true");this._am=(this._s09.getAttribute("caseInsensitiveIsDefault")==="false")?false:true;this._gb7=(this._s09.getAttribute("required")==="false")?false:true;this._qm3=(this._s09.getAttribute("hideAdornments")==="true");this._e64=(this._s09.getAttribute("matchAnywhere")==="true");this._cb7=(this._s09.getAttribute("matchAll")==="true");this._264=!!this._s09.getAttribute("specname")&&!this._lo6;this._1i5=this._s09.getAttribute("searchValue")||"";};_lv2.prototype._4z5=function(){this._v09={};var _ux7=this._v09["options"]=[], _tp7, _fe8;var _1u3=this._s09.selectNodes("selectOptions/selectOption");for(var i=0; i<_1u3.length; i++){var _ei8=_1u3.item(i);_tp7=_ei8.getAttribute("useValue");_ux7.push({"value": _tp7, "label": _ei8.getAttribute("displayValue")||_tp7});}if(!this._3f5||!this._ds4){var _1u3=this._s09.selectNodes("selectChoices/selectOption");var _908=function(_qj8){return(_qj8["value"]==_tp7);};for(var i=0; i<_1u3.length; i++){var _ei8=_1u3.item(i);_tp7=_ei8.getAttribute("useValue");_fe8=_ux7.filter(_908);if(!_fe8||_fe8.length<=0){_ux7.push({"value": _tp7, "label": _ei8.getAttribute("displayValue")||_tp7, "selected": true});}else{_fe8[0]["selected"]=true;}}}};_lv2.prototype._f89=function(){var _hp7='<div class="clsSelectWithSearch" style="display:flex; flex-direction:column; font-family:Arial, Helvetica, sans-serif; font-size:14px; width:100%; height:100%; min-height:200px">' +'<div class="clsSearchTitle" style="padding-right: 16px; line-height: 40px; text-align: middle">' + this._0i5 + '</div>' +'<div style="flex: 1; display: flex; flex-direction: column">' +'<div style="display: flex; flex-direction: row; overflow: hidden">' +'<div style="flex: 1">' +'<input class="clsSelectWithSearchSearchText" type="text" placeholder="' + this._ir6 + '" value="' + this._1i5 + '" style="width: 100%; height: 40px; font-size: 14px; border-width: 1px; border-style: solid; padding: 0 8px 0 8px"/>' +'</div>'+'<button class="clsSelectWithSearchSearchButton" style="width:40px; height:40px; line-height:40px; text-align:center; border-width: 1px; border-style: solid; margin:0" tabIndex="0">' +'<img src="cchl/images/search_small.svg" alt="$Search" width="24" height="24" style="vertical-align: -7px;"/>' +'</button>'+'</div>'+'<div class="clsAdorment" style="flex: 1; padding: 8px; display: flex; flex-direction: column">' +(this._3f5? '<div>'+'<div style="padding:8px 0">' +'<label class="clsCheckbox clsSelectWithSearchSelectAllLabel"><input class="clsSelectWithSearchSelectAll" type="checkbox" name="selectAll" value=""/><span>' + this._pq2 + '</span></label>' +'</div>'+'<div class="clsPromptSelectWithSearchMsgSeparator" style="height:2px; margin: 0 8px; border-top-width:1px; border-top-style:solid"></div>' +'</div>': '')+'<div class="clsListViewHolder" style="flex: 1; position: relative">' +'<div class="clsPromptSelectWithSearchMsg" style="line-height:40px; text-align:center;">' + this._ld7 + '</div>' +'</div>'+'</div>'+'<div class="clsCboContainer" style="margin: 5px 3px 0 3px">' +'<table class="clsCboOptions" style="width: 100%"></table>' +'</div>'+'<div class="clsCheckContaner" style="padding-top:var(--16S)">' +'<label class="clsCheckbox">' +'<input class="clsCaseInsensitive" type="checkbox" name="caseInsensitive" value=""' + (this._am?'checked="true"':'') + '/>' +'<span>' + this._gp3 + '</span>' +'</label>'+'</div>'+'</div>'+'</div>';this._iv7.innerHTML=_3z2._3y2(_hp7);this._f53=this._iv7.querySelector(".clsListViewHolder");this._of5=this._iv7.querySelector(".clsSelectWithSearchSearchText");_fe9._we(this._of5, this._km2.bind(this));this._uh3(this._of5, "input", this._km2);this._uh3(this._of5, "keydown", this._km2);this._uh3(this._of5, "change", this._km2);this._u64=this._iv7.querySelector(".clsSelectWithSearchSearchButton");this._uh3(this._u64, "click", this._6v1);if(this._3f5){this._p26=this._iv7.querySelector(".clsSelectWithSearchSelectAll");this._uh3(this._p26, "change", this._lm2);this._q03(true);}this._k03();this._863=this._iv7.querySelector(".clsCaseInsensitive");this._uh3(this._863, "change", this._nv);this._vt1(!this._1i5);if(this._v09["options"].length>0){this._p24(this._v09);}};_lv2.prototype._uh3=function(_m49,_t58,_3w6){var _gg8=_3w6.bind(this);_m49.addEventListener(_t58, _gg8);this._sa7.push({_xp8: function(){_m49.removeEventListener(_t58, _gg8);}});};_lv2.prototype._k03=function(){var _wk5=this._iv7.querySelector(".clsCboOptions");var _ov8=_4l6._lv5("EmptyCombo");_ov8.setAttribute("limitDropDownWidth", "false");this._g36=new _jq7(_wk5, _ov8, null, this);this._g36._9v5()._v75().classList.add("clsListView_selectWithSearchHardcodedForSize");var _ul7=this._g36._9v5();var _le8=["beginWithAny", "beginAndContain", "containAny", "containAll"];for(var i=0; i<this._x54.length; i++){var _xj7=_ul7._hg2();_xj7.setAttribute("label", this._x54[i]);_xj7.setAttribute("value", _le8[i]);}_ul7._f89();var _wr5=(this._cb7===true)?((this._e64===true)?"containAll":"beginAndContain"):((this._e64===true)?"containAny":"beginWithAny");this._g36._rm4(_wr5);};_lv2.prototype._p24=function(_459){if(this._f53){var _d93=this._f53;while(_d93.hasChildNodes()){_d93.removeChild(_d93.firstChild);}var _ux7, _4m8=this._vl4();if(this._wq8){if(_459){_ux7=_459["options"];}else{_d93.innerHTML=_3z2._3y2('<div style="line-height: 40px; text-align: center;">' +'<img src="hal/images/progress.gif" alt="Working..." width="24" height="24" style="vertical-align: -7px;"/>' +'</div>');this._wq8.requestData(_4m8, this._p24.bind(this));return;}}else{var _eo7=(this._am===true)?"i":"";var _tj8=new RegExp("^"+_4m8, _eo7);_ux7=(!_4m8||_4m8.length===0)?[]:this._v09["options"];_ux7=_ux7.filter(function(_qj8){return _qj8.label.search(_tj8)>=0;});}if(_ux7.length===0){if(this._zc7){this._zc7._1o8();this._zc7=undefined;this._9b8();}_d93.innerHTML=_3z2._3y2( '<div class="clsPromptSelectWithSearchMsg" style="line-height: 40px; text-align: center;">' + this._ld7 + '</div>' );if(this._3f5===true){this._q03(true);}}else{_d93.innerHTML='<div class="clsListView" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; border: none"></div>';var _zj7=_4l6._lv5("EmptyList");var _6z6=_zj7.selectSingleNode("listItems");if(this._3f5===true){_zj7.setAttribute("view", "checkbox");_zj7.setAttribute("multiSelect", "true");this._p26.checked=false;this._q03(false);}else{_zj7.setAttribute("view", "radio");}var _969=this._3f5?"checked":"selected";for(var i=0; i<_ux7.length; i++){var _xj7=_6z6.appendChild(_6z6.ownerDocument.createElement("listItem"));var _qj8=_ux7[i];_xj7.setAttribute("value", _qj8["value"]);_xj7.setAttribute("label", _qj8["label"]);if(_qj8["selected"]){_xj7.setAttribute(_969, "true");}}this._zc7=new _lq7(_d93.firstChild, _zj7, this);this._zc7._f89();this._9b8();}}};_lv2.prototype._km2=function(e){var _4m8=this._of5.value;if(e){e.stopPropagation();if(_be9._co4&&_be9._co4._s1){_be9._co4._s1(e, this);}if(e.type =="keydown"&&e.keyCode===_fe9._687){if(_4m8!==""){this._p24();}}}this._vt1(_4m8==="");};_lv2.prototype._vt1=function(_3f7){this._u64.disabled=_3f7;this._u64.style.opacity=_3f7?"0.3":"1.0";this._u64.style.cursor=_3f7?"initial":"pointer";};_lv2.prototype._q03=function(_3f7){this._p26.disabled=_3f7;this._p26.style.cursor=_3f7?"initial":"pointer";this._p26.nextSibling.style.opacity=_3f7?"0.3":"1.0";this._p26.nextSibling.style.cursor=_3f7?"initial":"pointer";};_lv2.prototype._6v1=function(e){e.stopPropagation();this._p24();};_lv2.prototype._lm2=function(e){e.stopPropagation();if(e.target.checked===true){this._zc7._xq7();}else{this._zc7._sk6();}this._9b8();};_lv2.prototype._9b8=function(){var _w19=[];if(this._zc7){var _ns6, _xj7;if(this._3f5===true){_ns6=_ie9._l61(null, this._zc7._sq1());}else{_ns6=this._zc7._lg1();}for(var i=0; i<_ns6.length; i++){_xj7=_ns6[i];_w19.push({"value": _xj7.getAttribute("value"), "label": _xj7.getAttribute("label")});}}this._r98("/OnValueChange", _w19);};_lv2.prototype._nv=function(e){e.stopPropagation();this._am=e.target.checked;};_lv2.prototype._xg1=function(_ul7,_xj7,_am5){this._9b8();};_lv2.prototype._8o=function(_ul7,_xj7){this._9b8();};_lv2.prototype._o77=function(_fy8,_3w6){if(!this._4r8[_fy8]){this._4r8[_fy8]=[];}this._4r8[_fy8].push(_3w6);};_lv2.prototype._r98=function(_fy8,_w19){if(this._4r8[_fy8]){for(var i=0; i<this._4r8[_fy8].length; i++){this._4r8[_fy8][i](_w19);}}};_lv2.prototype._ei2=function(){return this._am;};_lv2.prototype._lg2=function(_wc6,_xj7){switch(_xj7.getAttribute("value")){case "beginWithAny":this._e64=false;this._cb7=false;break;case "beginAndContain":this._e64=false;this._cb7=true;break;case "containAny":this._e64=true;this._cb7=false;break;case "containAll":this._e64=true;this._cb7=true;break;}};_lv2.prototype._vw2=function(){return this._e64;};_lv2.prototype._cv5=function(){return this._cb7;};_lv2.prototype._vl4=function(){return this._of5.value.trim();};_lv2.prototype._kd3=function(){if(this._zc7){if(this._3f5===true){this._zc7._sk6();this._p26.checked=false;}else{this._zc7._eu5();}this._9b8();}};_lv2.prototype._gg2=function(_le8){var _8x8;if(!_le8){_le8=[];}if(!this._zc7){var _w19=[];for(var i=0; i<_le8.length; i++){_8x8=_le8[i];_w19.push({"value": _8x8["use"], "label": _8x8["display"]});}this._p24({"options": _w19});}var _zj7=this._zc7._re3();var _969=this._3f5?"checked":"selected", _xj7;for(var i=0; i<_le8.length; i++){_8x8=_le8[i];_xj7=_lq7._l75(_zj7, "value", _8x8["use"]);if(!_xj7){_xj7=this._zc7._hg2();_xj7.setAttribute("value", _8x8["use"]);_xj7.setAttribute("label", _8x8["display"]);}if(_xj7.getAttribute(_969)!="true"){_xj7.setAttribute(_969, "true");}}this._zc7._f89();this._9b8();};_lv2.prototype._w22=function(){return this._g36;};_lv2.prototype._x22=function(){return this._zc7;};