_sy.js 12 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. function _sy(_pk5, _pe4, _vl7){_be9._452("_1k4");_be9._452("_1u5");_be9._452("_lv2");_sy.baseConstructor.call(this, _pe4, _vl7);this._yk2();this._if5=_pk5;this._sa7=[];if(this._ds4){this._if5.classList.add(_1k4._bb5);this._if5.setAttribute("nemesis_id","PromptControl");if(_kx5._y14){this._if5.classList.add(_1k4._cb5);}if(_fe9._a04(this._if5)){this._if5.classList.add("clsDirectionRtl");}}this._252(_pk5);this._a99();this._uq4(this._a09||[]);};_9t7._v88(_sy, _1k4);_sy.prototype._yk2=function(){_sy.superClass._yk2.call(this);this._1g5=parseInt(this._j74.getAttribute("rowsPerPage"))||5000;this._nd7=this._j74.getAttribute("refQuery")||"";this._av4=this._j74.getAttribute("columnName")||"";this._h19=this._j74.getAttribute("roid")||"";this._uu7=(this._j74.getAttribute("dataType")==="memberUniqueName");this._8q8=(this._av4.length>0); };_sy.prototype._1o8=function(){this._yo2=undefined;while(this._sa7.length>0){this._sa7.pop()._xp8();}this._8q2._1o8();};_sy.prototype._003=function(_st8,_ki5,_6e7){if(_st8){var _d07=_st8.classList;for(var i=0; i<_ki5.length; i++){_d07.remove(_ki5[i]);}for(var i=0; i<_6e7.length; i++){_d07.add(_6e7[i]);}}};_sy.prototype._fj3=function(){var _z45;if(this._ds4&&this._3f5){var _pe4=this._j74;var _kq5=_pe4.getAttribute("choicesText")||this._ol2( "PMT_UIM_CHOICES", "IDS_CCHL_PRMT_CHOICES" );var _oh4=_pe4.getAttribute("insertText")||this._ol2( "PMT_UIM_INSERTTIP", "IDS_CCHL_PRMT_INSERTTIP" );var _ii4=_pe4.getAttribute("removeText")||this._ol2( "PMT_UIM_REMOVETIP", "IDS_CCHL_PRMT_REMOVETIP" );var _ye1=_pe4.getAttribute("choicesSelectAllText")||this._ol2( "PMT_UIM_SELECTALL", "IDS_CCHL_PRMT_SELECTALL" );var _dy=_pe4.getAttribute("choicesDeselectAllText")||this._ol2( "PMT_UIM_DESELECTALL", "IDS_CCHL_PRMT_DESELECTALL" );var _af2=this._if5.id;var _5q5=_af2+'_AddButton';var _kw3=_af2+'_RemoveButton';_z45 ='<div class="clsPromptSelectWithSearchMultiSelPane" style="display: flex; flex-direction: row">' +'<div style="padding: 0 8px">' +'<div style="line-height: 40px">&nbsp;</div>' +'<div class="clsPromptButtonContainer" style="width:40px; height:40px">' +'<button name="add" class="clsSvgButton16x16 clsPromptInsertButton" id="' + _5q5 + '" title="' + _jp8._hr1(_oh4) + '">' +'<svg><use xlink:href="#def_hal_move_right_16x16"/></svg>' +'</button>'+'</div>'+'<div class="clsPromptButtonContainer" style="width:40px; height:40px">' +'<button name="remove" class="clsSvgButton16x16 clsPromptRemoveButton" id="' + _kw3 + '" title="' + _jp8._hr1(_ii4) + '">' +'<svg><use xlink:href="#def_hal_move_left_16x16"/></svg>' +'</button>'+'</div>'+'</div>'+'<div style="flex: 1 0 auto; display: flex; flex-direction: column">' +'<div class="pc" style="line-height: 40px">' +((this._gb7&&!this._qm3)?'<div class="clsAdormentArea" style="display: inline-block"></div>':'') +_jp8._hj6(_kq5)+'</div>'+'<div class="clsOutputArea pv" style="flex: 1 0 auto; position: relative"></div>' +'<div class="clsPromptHyperlinksContainer" style="text-align: right; line-height: 40px">' +'<a class="clsHyperlink pl" href="#" name="select">' + _jp8._hj6(_ye1) + '</a>' +'<a class="clsHyperlink pl" href="#" name="deselect" style="margin-left: 8px">' + _jp8._hj6(_dy) + '</a>' +'</div>'+'</div>'+'</div>';}return _z45||"";};_sy.prototype._a99=function(){var _pk5=this._if5;_pk5.innerHTML ='<div class="clsPromptSelectWithSearch" style="display: flex; flex-direction: row; width: 100%; height: 100%">' +((this._gb7===true&&this._qm3===false&&(!this._ds4||!this._3f5))?'<div class="clsAdormentArea"></div>':'') +'<div class="clsPromptSelectWithSearchControlArea"></div>' +this._fj3()+'</div>';var _sb4=_pk5.querySelector(".clsPromptSelectWithSearchControlArea");if(this._gb7===true&&this._qm3===false){var _5r3=_pk5.querySelector(".clsAdormentArea");_5r3.style.paddingTop=(this._ds4&&this._3f5)?"0":"13px";this._0a1(_5r3);}this._8q2=new _lv2(_sb4, this._j74,(this._8q8?{requestData: this._f06.bind(this)}:undefined));this._8q2._f89();if(this._ds4&&this._3f5){this._8q2._o77("/OnValueChange", this._i44.bind(this));}else{this._8q2._o77("/OnValueChange", this._uq4.bind(this));}this._i53=_sb4.querySelector(".clsListViewHolder").parentNode;if(this._ds4){_sb4.querySelector(".clsSearchTitle").classList.add("pc");_sb4.querySelector(".clsCboContainer").classList.add("po");_sb4.querySelector(".clsCheckContaner").classList.add("pe");_sb4.querySelector(".clsListViewHolder").classList.add("pv");var _af2=this._if5.id;var _0g6=_af2+'_searchWithSelect';_sb4.querySelector(".clsListViewHolder").setAttribute("id", _0g6+'Holder');_sb4.querySelector(".clsSelectWithSearchSearchText").setAttribute("id", _af2+'_searchText');_sb4.querySelector(".clsSelectWithSearchSearchButton").setAttribute("id", _af2+'_searchButton');_sb4.querySelector(".clsComboBox").setAttribute("id", _af2+'_ComboBox');if(_sb4.querySelectorAll(".clsListView").length==1){_sb4.querySelector(".clsListView").setAttribute("id", _af2+'_searchListView');}var _wc6=this._8q2._w22();this._003(_wc6._9v5()._v75(), ["clsListView_dropdown"], ["po_clsListView_dropdown", "po"]);if(_kx5._y14){_wc6._9v5()._v75().classList.add(_1k4._cb5);}if(_fe9._a04(_pk5)){_wc6._9v5()._v75().classList.add("clsDirectionRtl");}this._a09=[];var _ei8, _1u3=this._j74.selectNodes("selectChoices/selectOption");if(this._3f5){var _3l5=_pk5.querySelector(".clsOutputArea");_3l5.innerHTML='<div class="clsListView" style="position: absolute; top: 0; right: 0; bottom: 0; left: 0"></div>';_3l5.querySelector(".clsListView").setAttribute("id", _0g6);this._i53=_3l5;var _8k8=_ie9._py3();var _zj7=_8k8.createElement("listView");_zj7.setAttribute("id", _0g6+'UnderHolder');var _6z6=_zj7.appendChild(_zj7.ownerDocument.createElement("listItems"));for(var i=0; i<_1u3.length; i++){var _xj7=_6z6.appendChild(_6z6.ownerDocument.createElement("listItem"));_ei8=_1u3.item(i);var _tp7=_ei8.getAttribute("useValue");var _c45=_ei8.getAttribute("displayValue")||_tp7;_xj7.setAttribute("value", _tp7);_xj7.setAttribute("label", _c45);this._a09.push({"value": _tp7, "label": _c45});}_zj7.setAttribute("multiSelect", "true");this._3p3=new _lq7(_3l5.firstChild, _zj7, this);this._8n3=_pk5.querySelector(".clsPromptSelectWithSearchMultiSelPane");var _cx7=this._8n3.querySelectorAll("button");for(var i=0; i<_cx7.length; i++){this._uh3(_cx7[i], "click", this._kq4);}var _s56=this._8n3.querySelectorAll(".clsHyperlink");for(var i=0; i<_s56.length; i++){this._uh3(_s56[i], "click", this._i23);}this._a62(0,(!this._h16||!this._h16.length));this._a62(1, !this._3p3._lg1().length);}else{var _ul7=this._8q2._x22();if(_ul7){for(var i=0; i<_1u3.length; i++){_ei8=_1u3.item(i);_ul7._rm4(_ei8.getAttribute("useValue"), false, false);}_ei8=_ul7._8r1();if(_ei8){this._a09.push({"value": _ei8.getAttribute("value"), "label": _ei8.getAttribute("label")});}}}}else{var _ul7=this._8q2._x22();if(_ul7){this._a09=this._2j1(this._3f5?_ul7._sq1():_ul7._lg1()); }}};_sy.prototype._f06=function(_447,_3w6){this._yo2=_3w6;this._i97(_447); };_sy.prototype._z22=function(){return(this._a09||[]).map(function(_e59){var _np5=new _1u5(false, _e59["value"], _1u5._509, undefined);_np5._gv4=_e59["label"];return _np5;});};_sy.prototype._fu7=function(_w19){if(this._gb7===true){if(this._s26){this._0a2=this._s26(this._q67());}else{if(_w19.length===0){this._0a2=false;}else{this._0a2=true;}}}else{this._0a2=true;}if(this._0a2){if(this._0d7&&this._0d7._53){this._0d7._53(this);}}else{if(this._0d7&&this._0d7._n1){this._0d7._n1(this);}}if(this._qm3!==true){this._i53.parentNode.className=(this._0a2===true)?"":"clsInvalid";}};_sy.prototype._i44=function(_w19){this._h16=_w19;this._a62(0,(!_w19||!_w19.length));};_sy.prototype._uq4=function(_w19){this._a09=_w19;if(this._0d7&&this._0d7._gc){this._0d7._gc(this);}this._fu7(_w19);};_sy.prototype._i97=function(_447){if(this._h19){var _a38=_3l6._tl4().selectSingleNode("layouts/layout//" + this._j74.nodeName + "[@iid='" + this._h19 + "']/useItem");if(_a38){this._av4=_a38.getAttribute("refDataItem");}}var _6p1={_promptControl: 'search',_searchParameter: _jp8._s77(this._qr6),_promptIdBasedNames: 'true',encoding: 'UTF-8'};var _qx=this._0d7._te();for(var i=0; i<_qx.length; i++){var _qf4=_qx[i]._nw2(_qx[i]==this);for(var _969 in _qf4){_6p1[_969]=_qf4[_969];}}this._0d7._xf1(_6p1);};_sy.prototype._nw2=function(_gf8){var _ri4='<selectChoices>';if((!_gf8||this._3f5)&&this._a09){for(var i=0; i<this._a09.length; i++){_ri4 += '<selectOption useValue="' + _jp8._s77(this._a09[i].value) + '" displayValue="' + _jp8._s77(this._a09[i].label) + '"/>';}}_ri4+= '</selectChoices>';var _7b3=this._8q2._x22();var _si4='<selectOptions>';if(_7b3){var _kc6=_7b3._685();for(var i=0; i<_kc6.length; i++){var _f49=_kc6.item(i);_si4 += '<selectOption useValue="' + _jp8._s77(_f49.getAttribute('value')) + '" displayValue="' + _jp8._s77(_f49.getAttribute('label')) + '"/>';}}_si4+= '</selectOptions>';var _qf4={};_qf4['_sws_' + this._f19 + '_selectOptions'] = _jp8._s77(_si4); _qf4['_sws_' + this._f19 + '_matchAll'] = this._8q2._cv5().toString(); _qf4['_sws_' + this._f19 + '_caseInsensitive'] = this._8q2._ei2().toString();_qf4['_sws_' + this._f19 + '_searchValue'] = _jp8._s77(this._8q2._vl4());_qf4['_sws_' + this._f19 + '_showOptions'] = 'true';_qf4['_sws_' + this._f19 + '_submit'] = _gf8?'true':'false';_qf4['_sws_' + this._f19 + '_matchAnywhere'] = this._8q2._vw2().toString();_qf4['p_'+this._qr6]=_jp8._s77(_ri4);return _qf4;};_sy.prototype._rf1=function(){while(this._a09.length>0){this._a09.pop();}if(this._ds4&&this._3f5){this._3p3._az8();this._3p3._f89();this._uq4(this._2j1(this._3p3._685()));}else{this._8q2._kd3();}};_sy.prototype._567=function(_le8){if(!_le8||_le8.length<1){this._rf1();}else{if(this._ds4&&this._3f5){var _6z6=this._3p3._tw2();for(var i=0; i<_le8.length; i++){var _8x8=_le8[i];var _tp7=_8x8["use"];if(!this._3p3._l75("value", _tp7)){var _xj7=_6z6.appendChild(_6z6.ownerDocument.createElement("listItem"));_xj7.setAttribute("value", _tp7);_xj7.setAttribute("label", _8x8["display"]||_tp7);}}this._3p3._f89();this._uq4(this._2j1(this._3p3._685()));}else{this._8q2._gg2(_le8);}}};_sy.prototype._uh3=function(el,_t58,_3w6){var _gg8=_3w6.bind(this);el.addEventListener(_t58, _gg8);this._sa7.push({_xp8: function(){el.removeEventListener(_t58, _gg8);}});};_sy.prototype._kq4=function(e){e.stopPropagation();var _579=e.currentTarget.name||"";if(_579==="add"){var _w19=this._h16;if(_w19){var _6z6=this._3p3._tw2();for(var i=0; i<_w19.length; i++){var _e59=_w19[i];var _tp7=_e59["value"];if(!this._3p3._l75("value", _tp7)){var _xj7=_6z6.appendChild(_6z6.ownerDocument.createElement("listItem"));_xj7.setAttribute("value", _tp7);_xj7.setAttribute("label", _e59["label"]||_tp7);}}this._3p3._f89();}}else if(_579==="remove"){var _ns6=this._3p3._lg1();if(_ns6.length>0){for(var i=0; i<_ns6.length; i++){var _xj7=_ns6[i];var _tp7=_xj7.getAttribute("value");this._3p3._vt(_tp7);}this._3p3._f89();}this._a62(1, !this._3p3._lg1().length);}this._uq4(this._2j1(this._3p3._685()));};_sy.prototype._2j1=function(_kc6){var _w19=[];if(Array.isArray(_kc6)){_kc6=new _nq7(_kc6);}for(var i=0; i<_kc6.length; i++){var _xj7=_kc6.item(i);_w19.push({"value": _xj7.getAttribute("value"), "label": _xj7.getAttribute("label")});}return _w19;};_sy.prototype._i23=function(e){e.stopPropagation();var _579=e.currentTarget.name||"";if(_579==="select"){this._3p3._977();}else if(_579==="deselect"){this._3p3._eu5();}this._a62(1, !this._3p3._lg1().length);};_sy.prototype._a62=function(i,_3f7){var _cx7=this._8n3.getElementsByTagName("button");if(_cx7&&i<_cx7.length){if(this._k53>=11.5){_fe9._bf(_cx7[i], !_3f7);}else{_cx7[i].disabled=_3f7;_cx7[i].parentNode.style.opacity=_3f7?0.3:1.0;_cx7[i].style.cursor=(_3f7?"initial":"pointer");}}};_sy.prototype._xg1=function(_ul7,_xj7,_am5){if(_ul7===this._3p3){this._a62(1, !_ul7._lg1().length);}};