12345678 |
- /*!
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Modeling UI
- * (C) Copyright IBM Corp. 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- (window.caModellingPerspective=window.caModellingPerspective||[]).push([[27],{1861:function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return g});var n,o=r(1),a=r.n(o),i=r(5),c=r(3),s=r(2),l=r(19),u=r(826),p=r.n(u),h=r(8),d=r(263),b=r(317),f=r(1862);function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var g=Object(i.e)(function(e){return{members:e.memberSearchResults,searchTerm:e.searchTerm,isSearching:e.isSearching,performSearch:e.performSearch,parentMoserObject:e.parentMoserObject,grandParentMoserObject:e.grandParentMoserObject,isGrandParentSearchable:e.isGrandParentSearchable,searchGrandParent:e.searchGrandParent}})(n=function(e){function t(){return e.apply(this,arguments)||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e=this.props,t=e.close,r=e.searchTerm,n=e.members,o=e.isSearching,i=e.performSearch,u=e.parentMoserObject,g=e.grandParentMoserObject,v=e.isGrandParentSearchable,y=e.searchGrandParent,S=e.selectionMode,O=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,["close","searchTerm","members","isSearching","performSearch","parentMoserObject","grandParentMoserObject","isGrandParentSearchable","searchGrandParent","selectionMode"]);return a.a.createElement(c.FlexLayout,{direction:"column",height:"100%"},a.a.createElement(c.FlexItem,null,a.a.createElement(c.FlexLayout,null,a.a.createElement(c.FlexItem,{grow:!0},a.a.createElement(c.SearchInput,{key:Object(h.getUniqueId)(u),autoFocus:!0,fullWidth:!0,value:r,onChange:i,placeholder:Object(s.getString)("memberSearchInput"),"aria-label":Object(s.getString)("memberSearchInput"),delay:1e3})),t&&a.a.createElement(c.FlexItem,null,a.a.createElement(c.Button,{variant:"",onClick:t,style:{padding:"0px 16px",fontWeight:"normal",fontSize:"1rem"}},Object(s.getString)("cancel"))))),a.a.createElement(c.FlexItem,null,a.a.createElement(c.FlexLayout,{width:"100%",style:{padding:"16px"}},a.a.createElement(c.FlexItem,{shrink:!0,grow:!0,style:{textAlign:"right"}},v?a.a.createElement(c.Button,{button:!1,variant:"inline",onClick:y,style:{verticalAlign:"initial"}},a.a.createElement(d.a,{object:g})):a.a.createElement(d.a,{object:g})),a.a.createElement(c.FlexItem,{gutter:[0,2]},a.a.createElement(c.SVGIcon,{iconId:p.a.id})),a.a.createElement(c.FlexItem,{shrink:!0,grow:!0},a.a.createElement(d.a,{object:u})))),!o&&n&&n.length>0&&a.a.createElement(c.FlexItem,{grow:!0},a.a.createElement(f.a,m({selectionMode:S},O))),!o&&(!n||0===n.length)&&r&&a.a.createElement(b.a,null),o&&a.a.createElement(l.ProgressPanelMessage,{size:"large"}),!o&&!r&&a.a.createElement(b.a,{label:Object(s.getString)("memberSearchInfo")}))},t}(o.Component))||n},1862:function(e,t,r){"use strict";r.d(t,"a",function(){return l});var n,o=r(5),a=r(1),i=r.n(a),c=r(57);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var l=Object(o.e)(function(e){return{memberSearchResults:e.memberSearchResults.slice(),getTreeProvider:e.treeStore.getTreeProvider,selectedNodes:e.treeStore.selected,expandedNodes:e.treeStore.expanded,setExpandedNodes:e.treeStore.setExpandedNodes,setSelectedNodes:e.treeStore.setSelected,showContextMenu:e.showContextMenu}})(n=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(t=e.call.apply(e,[this].concat(n))||this)._onMenu=function(e,r){t.props.showContextMenu(e,r,document.activeElement)},t._moserObjectRenderer=function(e,t,r,n,o){return i.a.createElement(n,t,i.a.createElement(o,s({},r,{showIdForExpression:!0})))},t}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){var e=this.props,t=e.memberSearchResults,r=e.getTreeProvider,n=e.selectedNodes,o=e.expandedNodes,a=e.selectionMode,l=e.setExpandedNodes,u=e.setSelectedNodes,p=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,["memberSearchResults","getTreeProvider","selectedNodes","expandedNodes","selectionMode","setExpandedNodes","setSelectedNodes"]);return i.a.createElement(c.a,s({},p,{useSelectionOrderBadges:!1,onMenu:this._onMenu,rootObject:t,isAlwaysExpanded:function(){return!1},getTreeProvider:r,selectedNodes:n,expandedNodes:o,onSelectionChange:u,onExpand:l,selectionMode:a,moserObjectRenderer:this._moserObjectRenderer}))},t}(a.Component))||n},1863:function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return x});var n,o,a,i,c,s,l,u,p=r(45),h=r.n(p),d=r(6),b=r(5),f=r(178),m=r(23),g=r(14),v=r(4),y=r(40),S=r(102),O=r(33);function M(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function w(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e,t,r,n,o){var a={};return Object.keys(n).forEach(function(e){a[e]=n[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce(function(r,n){return n(e,t,r)||r},a),o&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(o):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}var x=(u=l=function(e){function t(t,r){var n,l=r.parentMoserObject;return(n=e.apply(this,arguments)||this)._currentSearch=void 0,n.parentMoserObject=void 0,n.grandParentMoserObject=null,M(n,"_memberSearchResults",o,w(n)),M(n,"searchTerm",a,w(n)),M(n,"isSearching",i,w(n)),M(n,"hasMore",c,w(n)),M(n,"_fetchingMore",s,w(n)),n.isGrandParentSearchable=void 0,n.parentMoserObject=l,n.grandParentMoserObject=Object(g.n)(n.parentMoserObject),n.isGrandParentSearchable=Object(v.isMemberContainer)(n.grandParentMoserObject)||Object(v.isMemberType)(n.grandParentMoserObject),n}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.performSearch=function(e){var t=this;this.searchTerm=e.trim(),this.hasMore=!1,this.searchTerm?(this._currentSearch&&this._currentSearch.cancel(),this.isSearching=!0,this._currentSearch=this.action(Object(m.l)(this.provider.getModuleId(),this.parentMoserObject,this.searchTerm,50)).then(function(e){return t.action(function(){t._memberSearchResults=e||[],t.hasMore=t._memberSearchResults.length>=50})},function(e){return t.provider.showToast(Object(O.a)(e))}).finally(function(){return t.action(function(){return t.isSearching=!1})})):this.isSearching=!1},r.loadMore=function(){var e=this;this._fetchingMore=!0,this._currentSearch=this.action(Object(m.l)(this.provider.getModuleId(),this.parentMoserObject,this.searchTerm,50,this._memberSearchResults.length)).then(function(t){return e.action(function(){e._memberSearchResults=e._memberSearchResults.concat(t),e.hasMore=t.length>=50})},function(t){return e.provider.showToast(Object(O.a)(t))}).finally(function(){return e.action(function(){return e._fetchingMore=!1})})},r.searchGrandParent=function(){this.provider.doSearch&&this.provider.doSearch(this.grandParentMoserObject)},r.showContextMenu=function(){var e;this.provider.showContextMenu&&(e=this.provider).showContextMenu.apply(e,arguments)},function(e,t,r){t&&j(e.prototype,t),r&&j(e,r)}(t,[{key:"treeStore",get:function(){var e=this;return new f.a({getSelection:function(){return e.provider.getSelection()},setSelection:function(t){return e.provider.setSelection(t)}})}},{key:"memberSearchResults",get:function(){var e=this;if(!this._memberSearchResults||!this.searchTerm)return[];var t=this._memberSearchResults.slice();return this._fetchingMore?t.push(Object(S.a)({type:y.a})()):this.hasMore&&t.push(Object(S.a)({type:y.b,onAction:function(){return e.loadMore()}})()),t}}]),t}(b.a),l.providerTypes={getSelection:h.a.func.isRequired,setSelection:h.a.func.isRequired,getModuleId:h.a.func.isRequired,showContextMenu:h.a.func,doSearch:h.a.func,showToast:h.a.func.isRequired},o=P((n=u).prototype,"_memberSearchResults",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),a=P(n.prototype,"searchTerm",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),i=P(n.prototype,"isSearching",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),c=P(n.prototype,"hasMore",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),s=P(n.prototype,"_fetchingMore",[d.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),P(n.prototype,"treeStore",[b.k],Object.getOwnPropertyDescriptor(n.prototype,"treeStore"),n.prototype),P(n.prototype,"memberSearchResults",[d.computed],Object.getOwnPropertyDescriptor(n.prototype,"memberSearchResults"),n.prototype),P(n.prototype,"performSearch",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"performSearch"),n.prototype),P(n.prototype,"loadMore",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"loadMore"),n.prototype),P(n.prototype,"searchGrandParent",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"searchGrandParent"),n.prototype),P(n.prototype,"showContextMenu",[b.c],Object.getOwnPropertyDescriptor(n.prototype,"showContextMenu"),n.prototype),n)},718:function(e,t,r){"use strict";r.r(t);var n=r(1861),o=r(1863);t.default={"components/MemberSearchView":n,"stores/MemberSearchStore":o}},826:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([1635],{"11851ffb8d2b05d6700a":function(e,t,r){"use strict";var n=r("9689a9c94ae38b47fa2c"),o=r.n(n),a=r("9ce58a7deea14f49ef01"),i=r.n(a),c=new o.a({id:"chevron-right_16_v7",use:"chevron-right_16_v7-usage",viewBox:"0 0 16 16",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" id="chevron-right_16_v7"><path d="M11 8l-5 5-.7-.7L9.6 8 5.3 3.7 6 3z" /><path style="fill:none" d="M0 0h16v16H0z" /></symbol>'});i.a.add(c),t.a=c},"3865314c5959606874d4":function(t,r){t.exports=e},"5863da78ae10546f8ae3":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("3865314c5959606874d4"),o=(r.n(n),r("11851ffb8d2b05d6700a"));t.default=o.a}},["5863da78ae10546f8ae3"])}(r(15))}}]);
- //# sourceMappingURL=memberSearch.js.map
|