UNPKG

xrm-mock-generator

Version:

Generates a mock Xrm.Page object. Commonly used by xrm-mock to test Dynamics 365 client-side customisations.

1 lines 39.3 kB
!function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=4)}([function(t,e,o){"use strict";e.__esModule=!0;var n=o(7);e.FormSelectorMock=n.FormSelectorMock;var r=o(8);e.FormItemMock=r.FormItemMock;var i=o(9);e.ClientContextMock=i.ClientContextMock;var u=o(10);e.ItemCollectionMock=u.ItemCollectionMock;var s=o(11);e.ContextMock=s.ContextMock;var a=o(12);e.DataMock=a.DataMock;var c=o(13);e.ProcessDictionaryMock=c.ProcessDictionaryMock;var p=o(14);e.ProcessManagerMock=p.ProcessManagerMock;var l=o(15);e.AttributeMock=l.AttributeMock;var f=o(16);e.AutoLookupControlMock=f.AutoLookupControlMock;var h=o(17);e.BooleanAttributeMock=h.BooleanAttributeMock;var d=o(18);e.ControlMock=d.ControlMock;var y=o(19);e.DateAttributeMock=y.DateAttributeMock;var g=o(20);e.DateControlMock=g.DateControlMock;var b=o(21);e.EntityMock=b.EntityMock;var m=o(22);e.EnumAttributeMock=m.EnumAttributeMock;var v=o(23);e.LookupAttributeMock=v.LookupAttributeMock;var M=o(24);e.LookupValueMock=M.LookupValueMock;var k=o(25);e.NumberAttributeMock=k.NumberAttributeMock;var C=o(26);e.NumberControlMock=C.NumberControlMock;var P=o(27);e.OptionSetAttributeMock=P.OptionSetAttributeMock;var O=o(28);e.PageMock=O.PageMock;var L=o(29);e.ProcessMock=L.ProcessMock;var S=o(30);e.SectionMock=S.SectionMock;var A=o(31);e.StageMock=A.StageMock;var w=o(32);e.StandardControlMock=w.StandardControlMock;var V=o(33);e.StepMock=V.StepMock;var N=o(34);e.StringAttributeMock=N.StringAttributeMock;var _=o(35);e.StringControlMock=_.StringControlMock;var F=o(36);e.UiCanGetVisibleElementMock=F.UiCanGetVisibleElementMock;var E=o(37);e.UiFocusableMock=E.UiFocusableMock;var D=o(38);e.UiKeyPressable=D.UiKeyPressable;var U=o(39);e.UiLabelElementMock=U.UiLabelElementMock;var I=o(40);e.UiStandardElementMock=I.UiStandardElementMock;var q=o(41);e.OpenParametersMock=q.OpenParametersMock;var T=o(42);e.FormOpenParametersMock=T.FormOpenParametersMock;var x=o(43);e.UiMock=x.UiMock;var j=o(44);e.UtilityMock=j.UtilityMock;var R=o(45);e.WindowMock=R.WindowMock;var K=o(46);e.XrmStaticMock=K.XrmStaticMock},function(t,e,o){!function(e){"use strict";var n=o(0),r=function(){};r.prototype.createBlankForm=function(){return new n.FormItemMock({id:"{00000000-0000-0000-0000-000000000000}",label:"",formType:1,currentItem:!0})},t.exports=new r}()},function(t,e,o){!function(e){"use strict";var n=o(0),r=o(47),i=function(){},u=function(t,e){return new n.AttributeMock({name:t,value:e,isDirty:!1,submitMode:"dirty"})},s=function(t){Xrm.Page.data.entity.attributes.get().push(t)};i.prototype.createBool=function(t,e){var o=u(t||"",e||!1),r=new n.BooleanAttributeMock(o);return s(r)},i.prototype.createDate=function(t,e){var o=u(t||"",e||new Date),r=new n.DateAttributeMock({attribute:o,dateAttributeFormat:"date"});return s(r)},i.prototype.createDateTime=function(t,e){var o=u(t||"",e||new Date),r=new n.DateAttributeMock({attribute:o,dateAttributeFormat:"datetime"});return s(r)},i.prototype.createLookup=function(t,e){var o=u(t||"",[new n.LookupValueMock(e.id,e.entityType,e.name)]),r=new n.LookupAttributeMock(o,!1);return s(r)},i.prototype.createNumber=function(t,e,o,r,i){var a=u(t||"",e||0),c=new n.NumberAttributeMock(a,null,"none",o||0,r||0,i||1);return s(c)},i.prototype.createOptionSet=function(t,e){var o=[];if(e&&e.length>0)for(var r=0;r<e.length;r++){var i=e[r];o.push(new n.OptionSetValueMock(i.name,i.value))}var a=u(t,e[0]),c=new n.EnumAttributeMock(a),p=new n.OptionSetAttributeMock(c,o);return s(p)},i.prototype.createOptionSetOption=function(t,e){return new n.OptionSetValueMock(t,e)},i.prototype.createString=function(t,e,o,i,a,c,p){var l=u(t,e),f=new n.StringAttributeMock(l,i||"text",a||100);return s(f),r.createStringControl(t,o||"",c||!0,p||!1,l),f},t.exports=new i}()},function(t,e,o){!function(e){"use strict";var n=o(0),r=o(1),i=function(){};i.prototype.createUi=function(){return new n.UiMock({controls:new n.ItemCollectionMock([]),formSelector:new n.FormSelectorMock(new n.ItemCollectionMock([r.createBlankForm()]))})},i.prototype.createLabelElement=function(t){return new n.UiLabelElementMock(t)},i.prototype.createCanGetVisibleElement=function(t){return new n.UiCanGetVisibleElementMock(t)},i.prototype.createStandardElement=function(t,e){return new n.UiStandardElementMock(t,e)},t.exports=new i}()},function(t,e,o){!function(e){"use strict";var n=o(5);n.Attribute=o(2),t.exports=n}()},function(t,e,o){(function(e){!function(n){"use strict";var r=o(0),i=(o(1),o(2),o(3)),u=function(){};u.prototype.initialise=function(){var t=new r.XrmStaticMock({page:new r.PageMock({context:new r.ContextMock({userRoles:[]}),data:new r.DataMock(new r.EntityMock("{00000000-0000-0000-0000-000000000000}",new r.ItemCollectionMock([]))),ui:i.createUi()})});return e.Xrm=t},t.exports=new u}()}).call(e,o(6))},function(t,e){var o;o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.items=t}return t.prototype.getCurrentItem=function(){var t;return this.items.itemCollection&&this.items.itemCollection.length&&(t=this.items.itemCollection.filter(function(t){return t.currentItem})[0]||null),t},t}();e.FormSelectorMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.id=t.id,this.label=t.label,this.formType=t.formType,this.currentItem=t.currentItem}return t.prototype.getId=function(){return this.id},t.prototype.getLabel=function(){return this.label},t.prototype.navigate=function(){throw"form navigation not implemented"},t}();e.FormItemMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.client=t,this.clientState=e}return t.prototype.getClient=function(){return this.client},t.prototype.getClientState=function(){return this.clientState},t}();e.ClientContextMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.itemCollection=t||[]}return t.prototype.forEach=function(t){var e=this.itemCollection.map(t);this.itemCollection=e},t.prototype.get=function(t){if(void 0===t||null===t)return this.itemCollection;if("string"==typeof t){var e;for(var o in this.itemCollection){var n=this.itemCollection[o];if(void 0!==n.getName&&n.getName()===t){e=n;break}}return e}if("number"==typeof t)return this.itemCollection[t];if(void 0!==t)throw"get itemcollection as delegate not implemented"},t.prototype.getLength=function(){return this.itemCollection.length},t}();e.ItemCollectionMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.client=t.clientContext,this.clientUrl=t.clientUrl,this.currentTheme=t.currentTheme,this.isAutoSaveEnabled=t.isAutoSaveEnabled,this.orgLcid=t.orgLcid,this.orgUniqueName=t.orgUniqueName,this.timeZoneOffset=t.timeZoneOffset,this.userId=t.userId,this.userLcid=t.userLcid,this.userName=t.userName,this.userRoles=t.userRoles,this.version=t.version}return t.prototype.getClientUrl=function(){return this.clientUrl},t.prototype.getCurrentTheme=function(){return this.currentTheme},t.prototype.getIsAutoSaveEnabled=function(){return this.isAutoSaveEnabled},t.prototype.getOrgLcid=function(){return this.orgLcid},t.prototype.getOrgUniqueName=function(){return this.orgUniqueName},t.prototype.getQueryStringParameters=function(){throw"get query string parameters not implemented"},t.prototype.getTimeZoneOffsetMinutes=function(){return this.timeZoneOffset},t.prototype.getUserId=function(){return this.userId},t.prototype.getUserLcid=function(){return this.userLcid},t.prototype.getUserName=function(){return this.userName},t.prototype.getUserRoles=function(){return this.userRoles},t.prototype.getVersion=function(){return this.version},t.prototype.prependOrgName=function(t){return t+this.orgUniqueName},t}();e.ContextMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.entity=t,this.process=e}return t.prototype.refresh=function(t){throw"refresh not implemented"},t.prototype.save=function(t){throw"save not implemented"},t}();e.DataMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t}();e.ProcessDictionaryMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.enabledProcesses=t}return t.prototype.getActiveProcess=function(){return this.enabledProcesses.filter(function(t){return t.isRendered()})[0]||void 0},t.prototype.setActiveProcess=function(t,e){var o=this.getActiveProcess();if(o){var n=this.enabledProcesses.filter(function(e){return e.getId()===t})[0]||void 0;n&&(o.isRendered=function(){return!1},n.isRendered=function(){return!0})}},t.prototype.getActiveStage=function(){return this.getActiveProcess().getStages().forEach(function(t){return"active"===t.getStatus()})[0]||void 0},t.prototype.setActiveStage=function(t,e){return this.getActiveProcess().getStages().forEach(function(e){return e.getId()===t})[0]||void 0},t.prototype.getActivePath=function(){throw"get active path not implemented"},t.prototype.getEnabledProcesses=function(t){t(this.enabledProcesses)},t.prototype.getSelectedStage=function(){throw"get selected not implemented"},t.prototype.addOnStageChange=function(t){throw"add on stage change not implemented"},t.prototype.addOnStageSelected=function(t){throw"add on stage selected not implemented"},t.prototype.removeOnStageChange=function(t){throw"remove on stage change not implemented"},t.prototype.removeOnStageSelected=function(t){throw"remove on stage selected not implemented"},t.prototype.moveNext=function(t){throw"move next not implemented"},t.prototype.movePrevious=function(t){throw"move previous not implemented"},t}();e.ProcessManagerMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.eventHandlers=[],this.name=t.name,this.value=t.value,this.isDirty=t.isDirty,this.requiredLevel=t.requiredLevel,this.submitMode=t.submitMode,this.controls=t.controls}return t.prototype.addOnChange=function(t){this.eventHandlers.push(t)},t.prototype.fireOnChange=function(){if(this.eventHandlers.length)for(var t=0;t<this.eventHandlers.length;t++)this.eventHandlers[t].call(this)},t.prototype.getAttributeType=function(){return typeof this.value},t.prototype.getFormat=function(){return this.attributeFormat},t.prototype.getIsDirty=function(){return this.isDirty},t.prototype.getName=function(){return this.name},t.prototype.getParent=function(){throw"getParent not implemented"},t.prototype.getRequiredLevel=function(){return this.requiredLevel},t.prototype.getSubmitMode=function(){return this.submitMode},t.prototype.getUserPrivilege=function(){throw"getUserPrivilege not implemented"},t.prototype.removeOnChange=function(t){throw"removeOnChange not implemented"},t.prototype.setRequiredLevel=function(t){this.requiredLevel=t},t.prototype.setSubmitMode=function(t){this.submitMode=t},t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(t){this.value=t,this.fireOnChange(),this.isDirty=!0},t}();e.AttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.standardControl=t,this.uiKeyPressable=e}return t.prototype.getValue=function(){return this.standardControl.attribute.getValue()},t.prototype.hideAutoComplete=function(){throw"hide autocomplete not implemented"},t.prototype.showAutoComplete=function(t){throw"show autocomplete not implemented"},t.prototype.clearNotification=function(t){return this.standardControl.clearNotification()},t.prototype.getDisabled=function(){return this.standardControl.getDisabled()},t.prototype.setDisabled=function(t){this.standardControl.setDisabled(t)},t.prototype.setNotification=function(t,e){return this.standardControl.setNotification(t,e)},t.prototype.getAttribute=function(){return this.standardControl.getAttribute()},t.prototype.getControlType=function(){return this.standardControl.getControlType()},t.prototype.getName=function(){return this.standardControl.getName()},t.prototype.getParent=function(){return this.standardControl.getParent()},t.prototype.setVisible=function(t){this.standardControl.setVisible(t)},t.prototype.getLabel=function(){return this.standardControl.getLabel()},t.prototype.setLabel=function(t){this.standardControl.setLabel(t)},t.prototype.getVisible=function(){return this.standardControl.getVisible()},t.prototype.setFocus=function(){this.standardControl.setFocus()},t.prototype.addOnKeyPress=function(t){this.uiKeyPressable.addOnKeyPress(t)},t.prototype.fireOnKeyPress=function(){this.uiKeyPressable.fireOnKeyPress()},t.prototype.removeOnKeyPress=function(t){this.uiKeyPressable.removeOnKeyPress(t)},t}();e.AutoLookupControlMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.attribute=t,this.initialValue=t.getValue()}return t.prototype.getInitialValue=function(){return this.initialValue},t.prototype.getValue=function(){return this.attribute.getValue()},t.prototype.setValue=function(t){this.attribute.setValue(t)},t.prototype.getFormat=function(){return this.attribute.getFormat()},t.prototype.addOnChange=function(t){this.attribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.attribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.attribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.attribute.getIsDirty()},t.prototype.getName=function(){return this.attribute.getName()},t.prototype.getParent=function(){return this.attribute.getParent()},t.prototype.getRequiredLevel=function(){return this.attribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.attribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.attribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.attribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.attribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.attribute.setSubmitMode(t)},t}();e.BooleanAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.controlType=t.controlType,this.uiLabelElement=t.uiLabelElement,this.uiCanGetVisibleElement=t.uiCanGetVisibleElement,this.name=t.name,this.parent=t.parent}return t.prototype.getControlType=function(){return this.controlType},t.prototype.getName=function(){return this.name},t.prototype.getParent=function(){return this.parent},t.prototype.getLabel=function(){return this.uiLabelElement.getLabel()},t.prototype.setLabel=function(t){this.uiLabelElement.setLabel(t)},t.prototype.getVisible=function(){return this.uiCanGetVisibleElement.getVisible()},t}();e.ControlMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.attribute=t.attribute,this.dateAttributeFormat=t.dateAttributeFormat,this.controls=t.controls,this.attribute.attributeFormat=t.dateAttributeFormat}return t.prototype.getFormat=function(){return this.attribute.getFormat()},t.prototype.getValue=function(){return this.attribute.getValue()},t.prototype.setValue=function(t){this.attribute.setValue(t)},t.prototype.addOnChange=function(t){this.attribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.attribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.attribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.attribute.getIsDirty()},t.prototype.getName=function(){return this.attribute.getName()},t.prototype.getParent=function(){return this.attribute.getParent()},t.prototype.getRequiredLevel=function(){return this.attribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.attribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.attribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.attribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.attribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.attribute.setSubmitMode(t)},t}();e.DateAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.standardControl=t}return t.prototype.getShowTime=function(){return"datetime"===this.standardControl.getAttribute().getFormat()},t.prototype.setShowTime=function(t){this.standardControl.getAttribute()},t.prototype.clearNotification=function(t){return this.standardControl.clearNotification()},t.prototype.getDisabled=function(){return this.standardControl.getDisabled()},t.prototype.setDisabled=function(t){this.standardControl.setDisabled(t)},t.prototype.setNotification=function(t,e){return this.standardControl.setNotification(t,e)},t.prototype.getAttribute=function(){return this.standardControl.getAttribute()},t.prototype.getControlType=function(){return this.standardControl.getControlType()},t.prototype.getName=function(){return this.standardControl.getName()},t.prototype.getParent=function(){return this.standardControl.getParent()},t.prototype.setVisible=function(t){this.standardControl.setVisible(t)},t.prototype.getLabel=function(){return this.standardControl.getLabel()},t.prototype.setLabel=function(t){this.standardControl.setLabel(t)},t.prototype.getVisible=function(){return this.standardControl.getVisible()},t.prototype.setFocus=function(){this.standardControl.setFocus()},t}();e.DateControlMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.id=t,this.attributes=e}return t.prototype.addOnSave=function(t){throw"addOnSave not implemented"},t.prototype.getEntityName=function(){throw"getEntityName not implemented"},t.prototype.getDataXml=function(){throw"getDataXml not implemented"},t.prototype.getId=function(){return this.id},t.prototype.getIsDirty=function(){var t=!1;if(this.attributes)for(var e=0;e<this.attributes.getLength();e++){var o=this.attributes.get(e);if(o.getIsDirty()){t=!0;break}}return t},t.prototype.getPrimaryAttributeValue=function(){throw"getPrimaryAttributeValue not implemented"},t.prototype.removeOnSave=function(t){throw"removeOnSave not implemented"},t.prototype.save=function(t){throw"save not implemented"},t}();e.EntityMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.attribute=t,this.initialValue=t.getValue()}return t.prototype.getInitialValue=function(){return this.initialValue},t.prototype.getFormat=function(){return this.attribute.getFormat()},t.prototype.addOnChange=function(t){this.attribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.attribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.attribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.attribute.getIsDirty()},t.prototype.getName=function(){return this.attribute.getName()},t.prototype.getParent=function(){return this.attribute.getParent()},t.prototype.getRequiredLevel=function(){return this.attribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.attribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.attribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.attribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.attribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.attribute.setSubmitMode(t)},t.prototype.getValue=function(){return this.attribute.getValue()},t.prototype.setValue=function(t){this.attribute.setValue(t)},t}();e.EnumAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o){this.attribute=t,this.controls=o,this.isPartyList=e}return t.prototype.getFormat=function(){return this.attribute.getFormat()},t.prototype.getIsPartyList=function(){return this.isPartyList},t.prototype.getValue=function(){return this.attribute.getValue()},t.prototype.setValue=function(t){this.attribute.setValue(t)},t.prototype.addOnChange=function(t){this.attribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.attribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.attribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.attribute.getIsDirty()},t.prototype.getName=function(){return this.attribute.getName()},t.prototype.getParent=function(){return this.attribute.getParent()},t.prototype.getRequiredLevel=function(){return this.attribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.attribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.attribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.attribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.attribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.attribute.setSubmitMode(t)},t}();e.LookupAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o){this.id=t,this.entityType=e,this.name=o}return t}();e.LookupValueMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o,n,r,i){this.attribute=t,this.controls=e,this.integerAttributeFormat=o,this.min=n,this.max=r,this.precision=i,this.attribute.attributeFormat=o}return t.prototype.getFormat=function(){return this.attribute.getFormat()},t.prototype.getMax=function(){return this.max},t.prototype.getMin=function(){return this.min},t.prototype.getPrecision=function(){return this.precision},t.prototype.getValue=function(){return this.attribute.getValue()},t.prototype.setValue=function(t){if(null!==this.min&&this.min>t)throw"value cannot be below the min of "+this.min;if(this.max&&this.max<t)throw"value cannot be above the max of "+this.max;this.attribute.setValue(t)},t.prototype.addOnChange=function(t){this.attribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.attribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.attribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.attribute.getIsDirty()},t.prototype.getName=function(){return this.attribute.getName()},t.prototype.getParent=function(){return this.attribute.getParent()},t.prototype.getRequiredLevel=function(){return this.attribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.attribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.attribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.attribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.attribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.attribute.setSubmitMode(t)},t}();e.NumberAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.autoLookupControl=t}return t.prototype.getValue=function(){throw"get value not implemented"},t.prototype.hideAutoComplete=function(){throw"hide autocomplete not implemented"},t.prototype.showAutoComplete=function(t){throw"show autocomplete not implemented"},t.prototype.getAttribute=function(){return this.autoLookupControl.getAttribute()},t.prototype.clearNotification=function(t){return this.autoLookupControl.clearNotification()},t.prototype.getDisabled=function(){return this.autoLookupControl.getDisabled()},t.prototype.setDisabled=function(t){this.autoLookupControl.setDisabled(t)},t.prototype.setNotification=function(t,e){return this.autoLookupControl.setNotification(t,e)},t.prototype.getControlType=function(){return this.autoLookupControl.getControlType()},t.prototype.getName=function(){return this.autoLookupControl.getName()},t.prototype.getParent=function(){return this.autoLookupControl.getParent()},t.prototype.setVisible=function(t){this.autoLookupControl.setVisible(t)},t.prototype.getLabel=function(){return this.autoLookupControl.getLabel()},t.prototype.setLabel=function(t){this.autoLookupControl.setLabel(t)},t.prototype.getVisible=function(){return this.autoLookupControl.getVisible()},t.prototype.setFocus=function(){this.autoLookupControl.setFocus()},t.prototype.addOnKeyPress=function(t){this.autoLookupControl.addOnKeyPress(t)},t.prototype.fireOnKeyPress=function(){this.autoLookupControl.fireOnKeyPress()},t.prototype.removeOnKeyPress=function(t){this.autoLookupControl.removeOnKeyPress(t)},t}();e.NumberControlMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o){this.enumAttribute=t,this.options=e,this.optionSetAttributeFormat=o,this.selectedOption=this.getOption(t.getValue()),this.enumAttribute.attribute.attributeFormat=o}return t.prototype.getFormat=function(){return this.enumAttribute.getFormat()},t.prototype.getInitialValue=function(){return this.enumAttribute.getInitialValue()},t.prototype.getOption=function(t){return"string"==typeof t?this.options.filter(function(e){return e.text===t})[0]:"number"==typeof t?this.options.filter(function(e){return e.value===t})[0]:void 0},t.prototype.getOptions=function(){return this.options},t.prototype.getSelectedOption=function(){return this.selectedOption},t.prototype.getText=function(){return this.selectedOption.text},t.prototype.getValue=function(){return this.enumAttribute.getValue()},t.prototype.setValue=function(t){this.enumAttribute.setValue(t),this.selectedOption=this.getOption(t)},t.prototype.addOnChange=function(t){this.enumAttribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.enumAttribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.enumAttribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.enumAttribute.getIsDirty()},t.prototype.getName=function(){return this.enumAttribute.getName()},t.prototype.getParent=function(){return this.enumAttribute.getParent()},t.prototype.getRequiredLevel=function(){return this.enumAttribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.enumAttribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.enumAttribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.enumAttribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.enumAttribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.enumAttribute.setSubmitMode(t)},t}();e.OptionSetAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.context=t.context,this.data=t.data,this.ui=t.ui}return t.prototype.getAttribute=function(t){if(!arguments.length)return this.data.entity.attributes.get();if(t&&"string"==typeof t)return this.data.entity.attributes.get(t);if("number"==typeof t)return this.data.entity.attributes.get()[t];if(void 0!==t)throw"Xrm.Page.getAttribute(delegate) not implemented"},t.prototype.getControl=function(t){if(!arguments.length)return this.ui.controls.get();if("string"==typeof t)return this.ui.controls.get(t);if("number"==typeof t)return this.ui.controls.get()[t];if(void 0!==t)throw"getControl as delegate not implemented"},t}();e.PageMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.id=t.id,this.name=t.name,this.stages=t.stages,this.rendered=t.rendered}return t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getStages=function(){return this.stages},t.prototype.isRendered=function(){return this.rendered},t}();e.ProcessMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o,n){this.name=t,this.parent=e,this.uiStandardElement=o,this.controls=n}return t.prototype.getName=function(){return this.name},t.prototype.getParent=function(){return this.parent},t.prototype.setVisible=function(t){this.uiStandardElement.setVisible(t)},t.prototype.getVisible=function(){return this.uiStandardElement.getVisible()},t.prototype.getLabel=function(){return this.uiStandardElement.getLabel()},t.prototype.setLabel=function(t){this.uiStandardElement.setLabel(t)},t}();e.SectionMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o,n,r){this.id=t,this.name=e,this.status=o,this.category=n,this.steps=r}return t.prototype.getCategory=function(){return{getValue:function(){throw"get category value not implemented"}}},t.prototype.getEntityName=function(){throw"get entity name not implemented"},t.prototype.getId=function(){return this.id},t.prototype.getName=function(){return this.name},t.prototype.getStatus=function(){return this.status},t.prototype.getSteps=function(){return this.steps},t}();e.StageMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.control=t.control,this.disabled=t.disabled||!1,this.uiStandardElement=t.uiStandardElement,this.uiFocusable=t.uiFocusable,this.attribute=t.attribute}return t.prototype.clearNotification=function(t){throw"clear notification not implemented"},t.prototype.getDisabled=function(){return this.disabled},t.prototype.setDisabled=function(t){this.disabled=t},t.prototype.setNotification=function(t,e){throw"set notification not implemented"},t.prototype.getAttribute=function(){if(-1===["subgrid","iframe","webresource"].indexOf(this.control.getControlType()))return this.attribute;throw"control is not bound to an attribute because it is of type "+this.control.getControlType()},t.prototype.getControlType=function(){return this.control.controlType="standard",this.control.getControlType()},t.prototype.getName=function(){return this.control.getName()},t.prototype.getParent=function(){return this.control.getParent()},t.prototype.getLabel=function(){return this.uiStandardElement.getLabel()},t.prototype.setLabel=function(t){this.uiStandardElement.setLabel(t)},t.prototype.getVisible=function(){return this.uiStandardElement.getVisible()},t.prototype.setVisible=function(t){this.uiStandardElement.setVisible(t)},t.prototype.setFocus=function(){this.uiFocusable.setFocus()},t}();e.StandardControlMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o){this.name=t,this.attribute=e,this.required=o}return t.prototype.getAttribute=function(){return this.attribute},t.prototype.getName=function(){return this.name},t.prototype.isRequired=function(){return this.required},t}();e.StepMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o,n){this.attribute=t,this.stringAttributeFormat=e,this.maxLength=o,this.controls=n,t.attributeFormat=e}return t.prototype.getFormat=function(){return this.attribute.getFormat()},t.prototype.getMaxLength=function(){return this.maxLength},t.prototype.getValue=function(){return this.attribute.getValue()},t.prototype.setValue=function(t){if(this.maxLength&&t.length>this.maxLength)throw"value cannot be greater than "+this.maxLength;this.attribute.setValue(t)},t.prototype.addOnChange=function(t){this.attribute.addOnChange(t)},t.prototype.fireOnChange=function(){this.attribute.fireOnChange()},t.prototype.getAttributeType=function(){return this.attribute.getAttributeType()},t.prototype.getIsDirty=function(){return this.attribute.getIsDirty()},t.prototype.getName=function(){return this.attribute.getName()},t.prototype.getParent=function(){return this.attribute.getParent()},t.prototype.getRequiredLevel=function(){return this.attribute.getRequiredLevel()},t.prototype.getSubmitMode=function(){return this.attribute.getSubmitMode()},t.prototype.getUserPrivilege=function(){return this.attribute.getUserPrivilege()},t.prototype.removeOnChange=function(t){this.attribute.removeOnChange(t)},t.prototype.setRequiredLevel=function(t){this.attribute.setRequiredLevel(t)},t.prototype.setSubmitMode=function(t){this.attribute.setSubmitMode(t)},t}();e.StringAttributeMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.autoLookupControl=t}return t.prototype.getValue=function(){return this.autoLookupControl.getValue()},t.prototype.hideAutoComplete=function(){throw"hide autocomplete not implemented"},t.prototype.showAutoComplete=function(t){throw"show autocomplete not implemented"},t.prototype.getAttribute=function(){return this.autoLookupControl.getAttribute()},t.prototype.clearNotification=function(t){return this.autoLookupControl.clearNotification()},t.prototype.getDisabled=function(){return this.autoLookupControl.getDisabled()},t.prototype.setDisabled=function(t){this.autoLookupControl.setDisabled(t)},t.prototype.setNotification=function(t,e){return this.autoLookupControl.setNotification(t,e)},t.prototype.getControlType=function(){return this.autoLookupControl.getControlType()},t.prototype.getName=function(){return this.autoLookupControl.getName()},t.prototype.getParent=function(){return this.autoLookupControl.getParent()},t.prototype.setVisible=function(t){this.autoLookupControl.setVisible(t)},t.prototype.getLabel=function(){return this.autoLookupControl.getLabel()},t.prototype.setLabel=function(t){this.autoLookupControl.setLabel(t)},t.prototype.getVisible=function(){return this.autoLookupControl.getVisible()},t.prototype.setFocus=function(){this.autoLookupControl.setFocus()},t.prototype.addOnKeyPress=function(t){this.autoLookupControl.addOnKeyPress(t)},t.prototype.fireOnKeyPress=function(){this.autoLookupControl.fireOnKeyPress()},t.prototype.removeOnKeyPress=function(t){this.autoLookupControl.removeOnKeyPress(t)},t}();e.StringControlMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.isVisible=t}return t.prototype.getVisible=function(){return this.isVisible},t}();e.UiCanGetVisibleElementMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.prototype.setFocus=function(){this.isFocussed=!0},t}();e.UiFocusableMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.keyPressHandlers=t}return t.prototype.addOnKeyPress=function(t){this.keyPressHandlers.push(t)},t.prototype.fireOnKeyPress=function(t){this.keyPressHandlers.forEach(function(e){e(t)})},t.prototype.removeOnKeyPress=function(t){var e=this.keyPressHandlers.indexOf(t);e>-1&&this.keyPressHandlers.splice(e)},t}();e.UiKeyPressableMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.label=t}return t.prototype.getLabel=function(){return this.label},t.prototype.setLabel=function(t){this.label=t},t}();e.UiLabelElementMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.uiLabelElement=t,this.uiCanGetVisibleElement=e}return t.prototype.setVisible=function(t){this.uiCanGetVisibleElement.getVisible=function(){return t}},t.prototype.getVisible=function(){return this.uiCanGetVisibleElement.getVisible()},t.prototype.getLabel=function(){return this.uiLabelElement.getLabel()},t.prototype.setLabel=function(t){this.uiLabelElement.setLabel(t)},t}();e.UiStandardElementMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t}();e.OpenParametersMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e,o){this.formid=t,this.navbar=e,this.cmdbar=o}return t}();e.FormOpenParametersMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.process=t.process,this.controls=t.controls,this.formSelector=t.formSelector,this.navigation=t.navigation,this.tabs=t.tabs,this.quickForms=t.quickForms}return t.prototype.setFormNotification=function(t,e,o){var n=!1;return this.formNotifications&&this.formNotifications.length&&(n=function(t){var e=t.filter(function(t){return t.uniqueId===o});return!(!e||!e.length)}(this.formNotifications)),!n&&(this.formNotifications&&this.formNotifications.length?this.formNotifications.push({message:t,level:e,uniqueId:o}):this.formNotifications=[{message:t,level:e,uniqueId:o}],!0)},t.prototype.clearFormNotification=function(t){if(this.formNotifications&&this.formNotifications.length){var e=this.formNotifications.filter(function(e){return e.uniqueId===t});if(e&&e.length){var o=this.formNotifications.indexOf(e[0]);return this.formNotifications.splice(o,1),!0}return!1}return!1},t.prototype.close=function(){throw"close not implemented"},t.prototype.getFormType=function(){if(!this.formSelector)return 0;var t=this.formSelector.getCurrentItem();return t?t.formType:void 0},t.prototype.getViewPortHeight=function(){throw"getViewPortHeight not implemented"},t.prototype.getViewPortWidth=function(){throw"getViewPortWidth not implemented"},t.prototype.refreshRibbon=function(){throw"refreshRibbon not implemented"},t}();e.UiMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.prototype.alertDialog=function(t,e){alert(t),e()},t.prototype.confirmDialog=function(t,e,o){confirm(t)?e():o()},t.prototype.isActivityType=function(t){throw"is activity type not implemented"},t.prototype.openQuickCreate=function(t,e,o){throw"open quick create not implemented"},t.prototype.openEntityForm=function(t,e,o,n){throw"open entity form not implemented"},t.prototype.openWebResource=function(t,e,o,n){throw"open web resource not implemented"},t}();e.UtilityMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.Xrm=t}return t.prototype.GetGlobalContext=function(){throw"not implemented"},t}();e.WindowMock=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.Page=t.page,this.Utility=t.utility,this.Mobile=t.mobile,this.Panel=t.panel}return t}();e.XrmStaticMock=n},function(t,e,o){!function(e){"use strict";var n=o(0),r=o(3),i=function(){},u=function(t,e,o,i){new n.ControlMock({name:t,controlType:i,uiLabelElement:r.createLabelElement(e),uiCanGetVisibleElement:r.createCanGetVisibleElement(o)})},s=function(t){Xrm.Page.ui.controls.push(t)};i.prototype.createStringControl=function(t,e,o,i,a){var c=new n.StringControlMock(new n.AutoLookupControlMock(new n.StandardControlMock({control:u(t,e,o),attribute:a,disabled:i,uiStandardElement:r.createStandardElement(e,o)}),new n.UiKeyPressableMock));s(c)},t.exports=new i}()}]);