simpleCalculations.js 29 KB

12345678
  1. /*!
  2. * Licensed Materials - Property of IBM
  3. * IBM Cognos Products: Modeling UI
  4. * (C) Copyright IBM Corp. 2020
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. (window.caModellingPerspective=window.caModellingPerspective||[]).push([[42],{1016:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([546],{"10eed102fbc488d5f846":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("3865314c5959606874d4"),a=(r.n(i),r("33c7892ad4967aa3ba24"));t.default=a.a},"33c7892ad4967aa3ba24":function(e,t,r){"use strict";var i=r("9689a9c94ae38b47fa2c"),a=r.n(i),o=r("9ce58a7deea14f49ef01"),n=r.n(o),l=new a.a({id:"repeat_32_v7",use:"repeat_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="repeat_32_v7"><path d="M26 6H5.83l3.58-3.59L8 1 2 7l6 6 1.41-1.41L5.83 8H26v7h2V8a2 2 0 00-2-2zm-3.41 14.41L26.17 24H6v-7H4v7a2 2 0 002 2h20.17l-3.58 3.59L24 31l6-6-6-6z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});n.a.add(l),t.a=l},"3865314c5959606874d4":function(t,r){t.exports=e}},["10eed102fbc488d5f846"])}(r(15))},1743:function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return m});var i,a=r(1),o=r.n(a),n=r(3),l=r(25),c=r(5),s=r(2),p=r(10),u=r(44),g=r(1744),b=r(1752);var m=Object(u.a)(p.y,{initializer:function(e,t){return new b.a({},t)}})(i=Object(c.e)(function(e){return{simpleCalculationsStore:e,isValid:e.isValid,isDirty:e.isDirty,isMemberCalculation:e.isMemberCalculation,saveSimpleCalculation:e.saveSimpleCalculation,parentForSimpleCalculation:e.parentForSimpleCalculation}})(i=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))||this)._onSave=function(){var e=t.props;(0,e.onClose)(e.saveSimpleCalculation)},t._tid=function(e){return Object(l.a)("simpleCalculationsDialog",e)},t._launchExpressionEditor=function(){var e=t.props,r=e.forwardDialog,i=e.simpleCalculationsStore,a=e.parentForSimpleCalculation;r(p.i,{element:i.edit?i.selectedMoserObject:a,expression:i.expression,label:i.displayName,edit:i.edit,forceGlobal:i.isGlobal,calculateAfterAggregation:i.calculateAfterAggregationToggled?i.isCalculateAfterAggregation:void 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.elements,r=e.edit,i=e.isValid,a=e.isDirty,l=e.isMemberCalculation,c=e.valuesLoading,p=e.prepareForClose,u=e.onClose,b=e.forceGlobal,m=l?"900px":"600px",d=l?"450px":"250px";return o.a.createElement(n.Dialog,{"data-tid":this._tid(""),width:m,onClose:u},o.a.createElement(n.Dialog.Header,{"data-tid":this._tid("header")},o.a.createElement(n.TruncatedText,{value:Object(s.getString)(r?"simpleCalcDialogEditTitle":"simpleCalcDialogCreateTitle")})),o.a.createElement(n.Dialog.Body,null,o.a.createElement(n.FlexLayout,{direction:"row",height:d},o.a.createElement(n.FlexItem,{grow:!0},o.a.createElement(g.a,{elements:t,edit:r,forceGlobal:b})))),o.a.createElement(n.Dialog.Footer,null,o.a.createElement(n.FlexItem,{grow:!0,alignSelf:"center"},o.a.createElement(n.Button,{variant:"inline",intent:"primary","aria-label":Object(s.getString)("simpleCalcEditInExpressionEditor"),title:Object(s.getString)("simpleCalcEditInExpressionEditor"),onClick:this._launchExpressionEditor,style:{"margin-left":"0px"},"data-tid":this._tid("expressionEditor")},Object(s.getString)("simpleCalcUseCalculationEditor"))),o.a.createElement(n.Dialog.Button,{primary:!0,"data-tid":this._tid("ok"),label:Object(s.getString)("ok"),onClick:this._onSave,disabled:!i||c||p||!a}),o.a.createElement(n.Dialog.Button,{"data-tid":this._tid("cancel"),label:Object(s.getString)("cancel"),onClick:u})))},t}(a.Component))||i)||i},1744:function(e,t,r){"use strict";r.d(t,"a",function(){return h});var i,a=r(1),o=r.n(a),n=r(16),l=r(3),c=r(1016),s=r.n(c),p=r(17),u=r(5),g=r(2),b=r(25),m=r(1745),d=r(1749);r(1750);var h=Object(u.e)(function(e){return{operation:e.operation,operationList:e.operationList,isCalculateAfterAggregation:e.isCalculateAfterAggregation,isMemberCalculation:e.isMemberCalculation,setCalculateAfterAggregation:e.setCalculateAfterAggregation,showCalculateAfterAggregation:e.showCalculateAfterAggregation,leftLabel:e.leftLabel,rightLabel:e.rightLabel,leftValue:e.leftValue,rightValue:e.rightValue,displayName:e.displayName,setOperation:e.setOperation,toggleSwap:e.toggleSwap,setLeftNumber:e.setLeftNumber,setRightNumber:e.setRightNumber,setDisplayName:e.setDisplayName}})(i=Object(n.observer)(i=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))||this)._textDir=p.getTextDirPref(),t._tid=function(e){return Object(b.a)("SimpleCalculationsView",e)},t._getEditableInputOnValueChange=function(e,r){var i=t.props,a=i.setLeftNumber,o=i.setRightNumber;void 0!==e&&(r?a(e):o(e))},t._getName=function(){var e=t.props,r=e.setDisplayName,i=e.displayName;return o.a.createElement(l.FlexLayout,{direction:"column"},o.a.createElement(l.Label,{label:Object(g.getString)("simpleCalcName"),style:{"font-weight":"bold"}}),o.a.createElement(l.VSpacer,{size:1}),o.a.createElement(l.TextInput,{fullWidth:!0,fireOnBlur:!0,value:i,onChange:r,textDir:t._textDir}))},t._getExpression=function(){var e=t.props,r=e.operation,i=e.operationList,a=e.isMemberCalculation,n=e.leftLabel,c=e.rightLabel,p=e.setOperation,u=e.toggleSwap,b=a?{gutter:[5,5,0,0]}:{};return o.a.createElement(l.Container,b,o.a.createElement(l.Label,{label:Object(g.getString)("simpleCalcDialogCreateHeader"),style:{"font-weight":"bold"}}),o.a.createElement(l.VSpacer,{size:1}),o.a.createElement(l.FlexLayout,{alignItems:"flex-start",direction:"row"},o.a.createElement(d.a,{isLeft:!0},function(e){return o.a.createElement(l.FlexItem,{className:Object(l.classnames)("bi-mui-simpleCalculationView__calculation-operand",{leftLabel:n,active:e}),"data-tid":"simpleCalculationViewLeft",textAlign:"left",basis:175},n?o.a.createElement("h5",null,t._getNonEditableInput(!0)):t._getEditableInput(!0))}),o.a.createElement(l.FlexItem,{className:"bi-mui-simpleCalculationView__calculation-operator",gutter:[0,0],grow:!0},o.a.createElement(l.FlexLayout,{direction:"column",width:"100%",justifyContent:"space-between"},o.a.createElement(l.Select,{size:"normal",customWidth:"100%",showAllList:!0,intent:"",options:i,selected:r,onChange:p,"aria-label":Object(g.getString)("simpleCalcOperation")}),o.a.createElement(l.Button,{size:"normal",variant:"icon",intent:"primary",icon:s.a.id,onClick:u,"aria-label":Object(g.getString)("simpleCalcSwapOperands"),title:Object(g.getString)("simpleCalcSwapOperands")}))),o.a.createElement(d.a,null,function(e){return o.a.createElement(l.FlexItem,{className:Object(l.classnames)("bi-mui-simpleCalculationView__calculation-operand",{rightLabel:c,active:e}),"data-tid":"simpleCalculationViewRight",basis:175},c?o.a.createElement("h5",null,t._getNonEditableInput(!1)):t._getEditableInput(!1))})))},t._getAggregationCheckbox=function(){var e=t.props,r=e.isCalculateAfterAggregation,i=e.setCalculateAfterAggregation;return o.a.createElement(l.Checkbox,{label:Object(g.getString)("simpleCalcAggregation"),checked:r,onChange:i,"data-tid":t._tid("aggregation")})},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r._getEditableInput=function(e){var t=this,r=this.props,i=r.leftValue,a=r.rightValue;return o.a.createElement(l.NumberInput,{fullWidth:!0,textAlign:"left",value:e?i:a,placeholder:Object(g.getString)("simpleCalcNumberPlaceholder"),onValueChange:function(r){return t._getEditableInputOnValueChange(r,e)}})},r._getNonEditableInput=function(e){var t=this.props,r=t.leftLabel,i=t.rightLabel;return o.a.createElement(l.TruncatedText,{value:e?r:i,textDir:this._textDir})},r.render=function(){var e=this.props.isMemberCalculation;return o.a.createElement(l.FlexLayout,{direction:"column",fullHeight:!0},o.a.createElement(l.FlexItem,{gutter:[0,0,2,0],width:e?"500px":"100%"},this._getName()),o.a.createElement(l.FlexItem,{grow:!0},o.a.createElement(l.FlexLayout,{fullHeight:!0,className:"bi-mui-simpleCalculationView "+(e?"has-border":""),"data-tid":"simpleCalculationView"},e&&o.a.createElement(m.a,null),o.a.createElement(l.FlexItem,{grow:!0,className:"bi-mui-simpleCalculationView__calculation"},this._getExpression()))),this.props.showCalculateAfterAggregation&&o.a.createElement(l.FlexItem,{gutter:[1,0,0,0]},this._getAggregationCheckbox()))},t}(a.Component))||i)||i},1745:function(e,t,r){"use strict";r.d(t,"a",function(){return h});var i,a=r(1),o=r.n(a),n=r(16),l=r(3),c=r(1746),s=r.n(c),p=r(5),u=r(2),g=r(13),b=r(47),m=r(25);r(1747);var d=function(){return Object(g.l)(g.e,"components/MemberSearchView",!0)},h=Object(p.e)(function(e){return{isSearchCollapsed:e.isSearchCollapsed,memberSearchStore:e.memberSearchStore,toggleSearchPanelVisible:e.toggleSearchPanelVisible}})(i=Object(n.observer)(i=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))||this)._tid=function(e){return Object(m.a)("CollapsableMemberSearchView",e)},t._renderMemberSearch=function(){var e=t.props,r=e.isSearchCollapsed,i=e.memberSearchStore;if(r)return o.a.createElement("div",{className:"bi-mui-collapsableMemberSearchView__collapsed"});var a=o.a.createElement(b.a,{resolver:d},function(e){return o.a.createElement(p.b,{store:i},o.a.createElement(e,{selectionMode:"single"}))});return o.a.createElement(l.Container,{width:250,resizeMinConstraintsX:150,resizeMaxConstraintsX:300,resizable:!0,resizeDirection:"x",overflow:"hidden"},a)},t}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e),t.prototype.render=function(){return o.a.createElement(l.FlexItem,null,o.a.createElement(l.FlexLayout,{fullHeight:!0},this._renderMemberSearch(),o.a.createElement(l.Container,{gutter:[0,.5,0,0],style:{justifyContent:"center",alignSelf:"center"},"data-tid":this._tid("memberSearchViewButton")},o.a.createElement(l.Button,{"aria-label":Object(u.getString)("memberSearchViewToggle"),"data-tid":this._tid("memberSearchViewToggle"),size:"small",variant:"inline",onClick:this.props.toggleSearchPanelVisible},o.a.createElement(l.SVGIcon,{className:"bi-mui-collapsableMemberSearchView__toggleIcon",iconId:s.a.id})))))},t}(a.Component))||i)||i},1746:function(e,t,r){"undefined"!=typeof self&&self,e.exports=function(e){return webpackJsonPBaGraphics([951],{"3865314c5959606874d4":function(t,r){t.exports=e},"7119a1c97240ad971958":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("3865314c5959606874d4"),a=(r.n(i),r("a6b34c9a7ef8a94f7de6"));t.default=a.a},a6b34c9a7ef8a94f7de6:function(e,t,r){"use strict";var i=r("9689a9c94ae38b47fa2c"),a=r.n(i),o=r("9ce58a7deea14f49ef01"),n=r.n(o),l=new a.a({id:"list_32_v7",use:"list_32_v7-usage",viewBox:"0 0 32 32",content:'<symbol xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" id="list_32_v7"><path d="M10 6h18v2H10zm0 18h18v2H10zm0-9h18v2H10zm-6 0h2v2H4zm0-9h2v2H4zm0 18h2v2H4z" /><path style="fill:none" d="M0 0h32v32H0z" /></symbol>'});n.a.add(l),t.a=l}},["7119a1c97240ad971958"])}(r(15))},1747:function(e,t,r){var i=r(1748);"string"==typeof i&&(i=[[e.i,i,""]]);var a={hmr:!0,transform:void 0};r(36)(i,a);i.locals&&(e.exports=i.locals)},1748:function(e,t,r){(e.exports=r(32)(void 0)).push([e.i,'.bi-mui-collapsableMemberSearchView__toggleIcon{padding:8px;border:1px solid #eaeaea;border-left:3px solid #1f57a4}.bi-mui-collapsableMemberSearchView__collapsed{width:8px;background-color:#eaeaea;background-position:0;padding:0 3px 3px 0;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4IDE2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iOHB4IiBoZWlnaHQ9IjE2cHgiPjxnIG9wYWNpdHk9IjEiPjxwYXRoIGQ9Ik01LjY2NyAxNmgtMVYwaDF2MTZ6TTMuMzMzIDBoLTF2MTZoMVYweiIgZmlsbD0iIzAwMDAwMCIvPjwvZz48L3N2Zz4=")}',""])},1749:function(e,t,r){"use strict";r.d(t,"a",function(){return m});var i,a=r(0),o=r.n(a),n=r(1),l=r.n(n),c=r(16),s=r(3),p=r(5),u=r(63);function g(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var b=Object(s.itemDnD)(function(e){function t(){return e.apply(this,arguments)||this}return g(t,e),t.prototype.render=function(){var e=this.props,t=e.hoveredActive;return(0,e.children)(t)},t}(n.Component),{dropItemType:u.e,simpleHoverStates:!1}),m=Object(p.e)(function(e){return{setLeftElement:e.setLeftElement,setRightElement:e.setRightElement}})(i=Object(c.observer)(i=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))||this)._canDrop=function(e,t){return t.items.filter(function(e){return e.getObjectType()===o.a.MoserObjectTypes.MEMBER_TYPE}).length},t._onDrop=function(e,r){var i=t.props.isLeft,a=r.items,o=t.props,n=o.setLeftElement,l=o.setRightElement;i?n(a[0]):l(a[0])},t}return g(t,e),t.prototype.render=function(){var e=this.props.children;return l.a.createElement(b,{canDrop:this._canDrop,onDrop:this._onDrop},e)},t}(n.Component))||i)||i},1750:function(e,t,r){var i=r(1751);"string"==typeof i&&(i=[[e.i,i,""]]);var a={hmr:!0,transform:void 0};r(36)(i,a);i.locals&&(e.exports=i.locals)},1751:function(e,t,r){(e.exports=r(32)(void 0)).push([e.i,".bi-mui-simpleCalculationView__calculation .ba-common-flexLayout-item{margin-right:24px}[dir=rtl] .bi-mui-simpleCalculationView__calculation .ba-common-flexLayout-item{margin-right:0;margin-left:24px}.bi-mui-simpleCalculationView__calculation .ba-common-flexLayout-item:last-child{margin-right:0}[dir=rtl] .bi-mui-simpleCalculationView__calculation .ba-common-flexLayout-item:last-child{margin-right:auto;margin-left:0}.bi-mui-simpleCalculationView__calculation-operator{height:80px}.bi-mui-simpleCalculationView__calculation-operand{text-align:center;display:inline;align-items:center;justify-content:center;background-color:rgba(255,0,0,0)}.bi-mui-simpleCalculationView__calculation-operand.is-leftLabel,.bi-mui-simpleCalculationView__calculation-operand.is-rightLabel{text-align:left;flex-direction:column;align-items:flex-start;padding-left:16px;padding-right:16px;border:2px solid #595859}[dir=rtl] .bi-mui-simpleCalculationView__calculation-operand.is-leftLabel,[dir=rtl] .bi-mui-simpleCalculationView__calculation-operand.is-rightLabel{text-align:right;padding-left:0;padding-right:16px;padding-left:16px}.bi-mui-simpleCalculationView__calculation-operand.is-active,.bi-mui-simpleCalculationView__calculation-operand.is-leftLabel.is-active,.bi-mui-simpleCalculationView__calculation-operand.is-rightLabel.is-active{border:2px solid #2d74da}.bi-mui-simpleCalculationView.has-border{border:2px solid #eaeaea}.ba-theme-default .bi-mui-simpleCalculationView__calculation-operand.is-leftLabel,.ba-theme-default .bi-mui-simpleCalculationView__calculation-operand.is-rightLabel{border:2px solid #595859}.ba-theme-default .bi-mui-simpleCalculationView__calculation-operand.is-active,.ba-theme-default .bi-mui-simpleCalculationView__calculation-operand.is-leftLabel.is-active,.ba-theme-default .bi-mui-simpleCalculationView__calculation-operand.is-rightLabel.is-active{border:2px solid #2d74da}",""])},1752:function(e,t,r){"use strict";r.d(t,"a",function(){return B});var i,a,o,n,l,c,s,p,u,g,b,m,d,h,f,y,O=r(736),v=r.n(O),w=r(0),C=r.n(w),_=r(6),j=r(4),x=r(5),S=r(26),E=r(13),A=r(8),L=r(2),M=r(9),D=r(217),V=r(29),N=r(27),P=r(260),I=r(303);function z(){return(z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}function F(e,t,r,i){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(i):void 0})}function T(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e,t,r,i,a){var o={};return Object.keys(i).forEach(function(e){o[e]=i[e]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,i){return i(e,t,r)||r},o),a&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(a):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}var B=(i=x.c.undoable(function(e){return""+Object(L.getString)("simpleCalcSetLeftElement",{value:e||Object(L.getString)("simpleCalcElementPlaceholder")})}),a=x.c.undoable(function(e){return""+Object(L.getString)("simpleCalcSetLeftNumber",{value:e||Object(L.getString)("simpleCalcNumberPlaceholder")})}),o=x.c.undoable(function(e){return""+Object(L.getString)("simpleCalcSetRightElement",{value:e||Object(L.getString)("simpleCalcElementPlaceholder")})}),n=x.c.undoable(function(e){return""+Object(L.getString)("simpleCalcSetRightNumber",{value:e||Object(L.getString)("simpleCalcNumberPlaceholder")})}),l=x.c.undoable(function(e){return""+(e?Object(L.getString)("simpleCalcSetName",{value:e}):Object(L.getString)("simpleCalcClearName"))}),c=function(e){function t(){for(var t,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))||this).originalCalculation={},t.selectedMoserObject=null,t.edit=!1,t.parentObject=null,F(t,"inputtedName",s,k(t)),F(t,"operation",p,k(t)),F(t,"swap",u,k(t)),F(t,"elementOperands",g,k(t)),F(t,"numberOperands",b,k(t)),F(t,"forceGlobal",m,k(t)),F(t,"calculateAfterAggregation",d,k(t)),F(t,"showCalculateAfterAggregation",h,k(t)),t.calculateAfterAggregationToggled=!1,t.operationList=I.f,F(t,"selection",f,k(t)),F(t,"isSearchCollapsed",y,k(t)),t.isMemberCalculation=void 0,t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var r=t.prototype;return r.storeDidMount=function(e){var t=e.elements,r=void 0===t?[]:t,i=e.edit,a=void 0!==i&&i,o=e.forceGlobal,n=void 0!==o&&o,l=e.isMemberCalculation,c=void 0!==l&&l;this.isMemberCalculation=c,this.edit=a,this.forceGlobal=n,this.edit?(this.selectedMoserObject=r[0],this._loadBinInfo(),Object(j.isCalculateAfterAggregationAllowed)(this.selectedMoserObject)&&(this.showCalculateAfterAggregation=!0,this.calculateAfterAggregation=this.selectedMoserObject.getRegularAggregate()===C.a.RegularAggregateType.CALCULATED),this.originalCalculation=this.calculationParameters):(this.elementOperands[I.a]=r&&r.length>0?r[I.a]:"",this.elementOperands[I.b]=r&&r.length>1?r[I.b]:"",this.showCalculateAfterAggregation=!0,this.calculateAfterAggregation=this.isGlobal),c&&(this.parentObject=Object(j.getParentHierarchy)(r[0])||Object(j.getAncestorOrModule)(r[0],C.a.MoserObjectTypes.QUERY_ITEM))},r._realSide=function(e){return this.swap?e===I.a?I.b:I.a:e},r._operands=function(e){var t=this._realSide(e);return this.elementOperands[t]?this.elementOperands[t]:void 0},r._label=function(e){var t=this._operands(e);return t?t.getLabel():void 0},r._value=function(e){return this.numberOperands[this._realSide(e)]},r.setCalculateAfterAggregation=function(e){this.calculateAfterAggregation=e,this.calculateAfterAggregationToggled=!0},r._loadBinInfoNewest=function(){var e=Object(A.getObjectProperty)(this.selectedMoserObject,M.t);Object.assign(this,e)},r._loadBinInfo=function(){if(this._loadBinInfoNewest(),this.elementOperands[I.a]){var e=C.a.ModuleUtils.getMoserObjectByIdForExpression(this.elementOperands[I.a],Object(j.getModule)(this.selectedMoserObject));e||this.provider.showToast(Object(L.getString)("errorCanNotResolveQI",{qi:this.elementOperands[I.a]})),this.elementOperands[I.a]=e||""}if(this.elementOperands[I.b]){var t=C.a.ModuleUtils.getMoserObjectByIdForExpression(this.elementOperands[I.b],Object(j.getModule)(this.selectedMoserObject));t||this.provider.showToast(Object(L.getString)("errorCanNotResolveQI",{qi:this.elementOperands[I.b]})),this.elementOperands[I.b]=t||""}},r.setOperation=function(e){this.operation=e},r.toggleSwap=function(){this.swap=!this.swap},r.setLeftElement=function(e){this.elementOperands[this.swap?I.b:I.a]=e,this.setLeftNumber("")},r.setLeftNumber=function(e){this.numberOperands[this.swap?I.b:I.a]=e},r.setRightElement=function(e){this.elementOperands[this.swap?I.a:I.b]=e,this.setRightNumber("")},r.setRightNumber=function(e){this.numberOperands[this.swap?I.a:I.b]=e},r.setDisplayName=function(e){this.inputtedName=e},r.setSelection=function(e){this.selection=e},r.toggleSearchPanelVisible=function(){this.isSearchCollapsed=!this.isSearchCollapsed},r.saveSimpleCalculation=function(){var e=this,t=Object(L.getString)("simpleCalcSave"),r=this.properties,i=this.edit?this.selectedMoserObject:Object(N.createExpressionObject)(this.context,this.parentForSimpleCalculation,r);return this.calculateAfterAggregationToggled&&(Object(V.h)(i,C.a.Features.REGULAR_AGGREGATE),this.calculateAfterAggregation?i.setRegularAggregate(C.a.RegularAggregateType.CALCULATED):i.setRegularAggregate(C.a.RegularAggregateType.TOTAL)),this.provider.saveGlobalSessionModule().then(function(){return Object(P.a)(e.context,{moduleId:e.provider.getModuleId(),moduleURL:e.provider.getModuleURL(),moserObject:i,moserObjectParent:e.parentForSimpleCalculation,expression:r.expression,calculateAfterAggregation:e.calculateAfterAggregation})}).then(function(a){return e.action(Object(S.b)(t)(function(){e.edit?Object(N.updateExpressionProperties)(e.context,i,z({},r,{},a.columnList[0])):(Object(N.updateExpressionProperties)(e.context,i,a.columnList[0]),Object(N.addExpressionObjectToModule)(e.context,e.parentForSimpleCalculation,i))}))},function(a){return Object(D.b)(a)&&e.provider.showToast(Object(L.getString)("calcParamErrorFromValidation")),e.action(Object(S.b)(t)(function(){e.edit?Object(N.updateExpressionProperties)(e.context,i,r):Object(N.addExpressionObjectToModule)(e.context,e.parentForSimpleCalculation,i)}))}).then(function(){return i})},function(e,t,r){t&&T(e.prototype,t),r&&T(e,r)}(t,[{key:"memberSearchStore",get:function(){var e=this,t=Object(E.n)(E.e,"stores/MemberSearchStore");return this.isMemberCalculation&&t&&this.parentObject?new t({getSelection:function(){return e.selection},setSelection:function(t){return e.setSelection(t)},getModuleId:function(){return e.provider.getModuleId()}},{parentMoserObject:this.parentObject}):null}},{key:"leftLabel",get:function(){return this._label(I.a)}},{key:"rightLabel",get:function(){return this._label(I.b)}},{key:"leftValue",get:function(){return this._label(I.a)?"":this._value(I.a)}},{key:"rightValue",get:function(){return this._label(I.b)?"":this._value(I.b)}},{key:"displayName",get:function(){return Object(I.c)(this.inputtedName,this.operation,this._operands(I.a)||this._value(I.a),this._operands(I.b)||this._value(I.b))}},{key:"parentForSimpleCalculation",get:function(){var e=[];return this.edit?e.push(this.selectedMoserObject):(this.elementOperands[I.a]&&e.push(this.elementOperands[I.a]),this.elementOperands[I.b]&&e.push(this.elementOperands[I.b])),Object(N.getParentForExpression)(e,this.forceGlobal)}},{key:"properties",get:function(){return Object(I.e)({inputtedName:this.inputtedName,operation:this.operation,swap:this.swap,elementOperands:this.elementOperands,numberOperands:this.numberOperands},this.parentForSimpleCalculation,this.forceGlobal)}},{key:"expression",get:function(){return Object(I.d)(this.operation,this.parentForSimpleCalculation,this._operands(I.a)||this._value(I.a),this._operands(I.b)||this._value(I.b),this.forceGlobal)}},{key:"calculationParameters",get:function(){return{calculateAfterAggregation:this.calculateAfterAggregation,expression:this.expression,displayName:this.displayName}}},{key:"isValid",get:function(){return!!("/"!==this.operation&&"%"!==this.operation&&"¢"!==this.operation||this._operands(I.b)||0!==Number(this._value(I.b)))&&!(!(this._operands(I.a)||this._value(I.a).length&&!isNaN(this._value(I.a)))||!(this._operands(I.b)||this._value(I.b).length&&!isNaN(this._value(I.b))))}},{key:"isDirty",get:function(){return!v()(this.originalCalculation,this.calculationParameters)}},{key:"isGlobal",get:function(){return this.forceGlobal||Object(N.isExpressionParentGlobal)(this.parentForSimpleCalculation)}},{key:"isCalculateAfterAggregation",get:function(){return this.calculateAfterAggregation}}]),t}(x.a),s=R(c.prototype,"inputtedName",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),p=R(c.prototype,"operation",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"+"}}),u=R(c.prototype,"swap",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),g=R(c.prototype,"elementOperands",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return["",""]}}),b=R(c.prototype,"numberOperands",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return["",""]}}),m=R(c.prototype,"forceGlobal",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),d=R(c.prototype,"calculateAfterAggregation",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),h=R(c.prototype,"showCalculateAfterAggregation",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),f=R(c.prototype,"selection",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),y=R(c.prototype,"isSearchCollapsed",[_.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),R(c.prototype,"memberSearchStore",[x.d],Object.getOwnPropertyDescriptor(c.prototype,"memberSearchStore"),c.prototype),R(c.prototype,"leftLabel",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"leftLabel"),c.prototype),R(c.prototype,"rightLabel",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"rightLabel"),c.prototype),R(c.prototype,"leftValue",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"leftValue"),c.prototype),R(c.prototype,"rightValue",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"rightValue"),c.prototype),R(c.prototype,"displayName",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"displayName"),c.prototype),R(c.prototype,"parentForSimpleCalculation",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"parentForSimpleCalculation"),c.prototype),R(c.prototype,"properties",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"properties"),c.prototype),R(c.prototype,"expression",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"expression"),c.prototype),R(c.prototype,"calculationParameters",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"calculationParameters"),c.prototype),R(c.prototype,"isValid",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isValid"),c.prototype),R(c.prototype,"isDirty",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isDirty"),c.prototype),R(c.prototype,"isGlobal",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isGlobal"),c.prototype),R(c.prototype,"isCalculateAfterAggregation",[_.computed],Object.getOwnPropertyDescriptor(c.prototype,"isCalculateAfterAggregation"),c.prototype),R(c.prototype,"setCalculateAfterAggregation",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"setCalculateAfterAggregation"),c.prototype),R(c.prototype,"setOperation",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"setOperation"),c.prototype),R(c.prototype,"toggleSwap",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"toggleSwap"),c.prototype),R(c.prototype,"setLeftElement",[i],Object.getOwnPropertyDescriptor(c.prototype,"setLeftElement"),c.prototype),R(c.prototype,"setLeftNumber",[a],Object.getOwnPropertyDescriptor(c.prototype,"setLeftNumber"),c.prototype),R(c.prototype,"setRightElement",[o],Object.getOwnPropertyDescriptor(c.prototype,"setRightElement"),c.prototype),R(c.prototype,"setRightNumber",[n],Object.getOwnPropertyDescriptor(c.prototype,"setRightNumber"),c.prototype),R(c.prototype,"setDisplayName",[l],Object.getOwnPropertyDescriptor(c.prototype,"setDisplayName"),c.prototype),R(c.prototype,"setSelection",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"setSelection"),c.prototype),R(c.prototype,"toggleSearchPanelVisible",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"toggleSearchPanelVisible"),c.prototype),R(c.prototype,"saveSimpleCalculation",[x.c],Object.getOwnPropertyDescriptor(c.prototype,"saveSimpleCalculation"),c.prototype),c)},709:function(e,t,r){"use strict";r.r(t);var i=r(1743);t.default={"components/SimpleCalculationsDialog":i}},736:function(e,t,r){var i=r(264);e.exports=function(e,t){return i(e,t)}}}]);
  8. //# sourceMappingURL=simpleCalculations.js.map