/.test(t.substr(i.position,6))?(i.emitBlock(),i.mono=!0,i.modStack.unshift("mono"),i.position+=5):!i.mono&&"bold"===i.mod()&&/<\/b>/.test(t.substr(i.position,4))?(i.emitBlock(),i.bold=!1,i.modStack.shift(),i.position+=3):!i.mono&&"ital"===i.mod()&&/<\/i>/.test(t.substr(i.position,4))?(i.emitBlock(),i.ital=!1,i.modStack.shift(),i.position+=3):"mono"===i.mod()&&/<\/code>/.test(t.substr(i.position,7))?(i.emitBlock(),i.mono=!1,i.modStack.shift(),i.position+=6):i.add(o):(i.emitBlock(),i.ital=!0,i.modStack.unshift("ital"),i.position+=2):(i.emitBlock(),i.bold=!0,i.modStack.unshift("bold"),i.position+=2):/&/.test(o)?/</.test(t.substr(i.position,4))?(i.add("<"),i.position+=3):/&/.test(t.substr(i.position,5))?(i.add("&"),i.position+=4):i.add("&"):i.add(o),i.position++}return i.emitBlock(),e}},{key:"splitMarkdownBlocks",value:function(t){var e=[],i={bold:!1,ital:!1,mono:!1,beginable:!0,spacing:!1,position:0,buffer:"",modStack:[]};for(i.mod=function(){return 0===this.modStack.length?"normal":this.modStack[0]},i.modName=function(){return 0===this.modStack.length?"normal":"mono"===this.modStack[0]?"mono":i.bold&&i.ital?"boldital":i.bold?"bold":i.ital?"ital":void 0},i.emitBlock=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.spacing&&(this.add(" "),this.spacing=!1),this.buffer.length>0&&(e.push({text:this.buffer,mod:this.modName()}),this.buffer="")},i.add=function(t){" "===t&&(i.spacing=!0),i.spacing&&(this.buffer+=" ",this.spacing=!1)," "!=t&&(this.buffer+=t)};i.positionthis.parent.fontOptions.maxWdt}},{key:"getLongestFit",value:function(t){for(var e="",i=0;i1&&void 0!==arguments[1]?arguments[1]:"normal",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=t.replace(/^( +)/g,"$1\r"),t=t.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");for(var o=t.split("\r");o.length>0;){var n=this.getLongestFit(o);if(0===n){var s=o[0],r=this.getLongestFitWord(s);this.lines.newLine(s.slice(0,r),e),o[0]=s.slice(r)}else{var a=n;" "===o[n-1]?n--:" "===o[a]&&a++;var h=o.slice(0,n).join("");n==o.length&&i?this.lines.append(h,e):this.lines.newLine(h,e),o=o.slice(a)}}}}]),t}();e.default=l},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(90),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=function(){function t(e){(0,a.default)(this,t),this.measureText=e,this.current=0,this.width=0,this.height=0,this.lines=[]}return(0,d.default)(t,[{key:"_add",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";void 0===this.lines[t]&&(this.lines[t]={width:0,height:0,blocks:[]});var o=e;void 0!==e&&""!==e||(o=" ");var n=this.measureText(o,i),r=(0,s.default)({},n.values);r.text=e,r.width=n.width,r.mod=i,void 0!==e&&""!==e||(r.width=0),this.lines[t].blocks.push(r),this.lines[t].width+=r.width}},{key:"curWidth",value:function(){var t=this.lines[this.current];return void 0===t?0:t.width}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e)}},{key:"newLine",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";this._add(this.current,t,e),this.current++}},{key:"determineLineHeights",value:function(){for(var t=0;tt&&(t=o.width),e+=o.height}this.width=t,this.height=e}},{key:"removeEmptyBlocks",value:function(){for(var t=[],e=0;e1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var o=this.getDimensionsFromLabel(t,e,i);this.width=o.width+this.margin.right+this.margin.left,this.height=o.height+this.margin.top+this.margin.bottom,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this.initContextForDraw(t,s),t.roundRect(this.left,this.top,this.width,this.height,s.borderRadius),this.performFill(t,s),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"updateBoundingBox",value:function(t,e,i,o,n){this._updateBoundingBox(t,e,i,o,n);var s=this.options.shapeProperties.borderRadius;this._addBoundingBoxMargin(s)}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=this.options.borderWidth;return Math.min(Math.abs(this.width/2/Math.cos(e)),Math.abs(this.height/2/Math.sin(e)))+i}}]),e}(m.default);e.default=v},function(t,e,i){i(195),t.exports=i(7).Object.getPrototypeOf},function(t,e,i){var o=i(41),n=i(85);i(87)("getPrototypeOf",function(){return function(t){return n(o(t))}})},function(t,e,i){t.exports={default:i(197),__esModule:!0}},function(t,e,i){i(198),t.exports=i(7).Object.setPrototypeOf},function(t,e,i){var o=i(17);o(o.S,"Object",{setPrototypeOf:i(199).set})},function(t,e,i){var o=i(32),n=i(27),s=function(t,e){if(n(t),!o(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,o){try{o=i(80)(Function.call,i(89).f(Object.prototype,"__proto__").set,2),o(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,i){return s(t,i),e?t.__proto__=i:o(t,i),t}}({},!1):void 0),check:s}},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(73),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var o=this.getDimensionsFromLabel(t,e,i),n=Math.max(o.width+this.margin.right+this.margin.left,o.height+this.margin.top+this.margin.bottom);this.options.size=n/2,this.width=n,this.height=n,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,s),this.updateBoundingBox(e,i),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,i,o,n)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),.5*this.width}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(73),m=o(f),v=function(t){function e(t,i,o,n,r){(0,a.default)(this,e);var h=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return h.setImages(n,r),h}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var o=2*this.options.size;return this.width=o,this.height=o,void(this.radius=.5*this.width)}this.needsRefresh(e,i)&&this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n,s){this.switchImages(o),this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,this._drawRawCircle(t,e,i,s),t.save(),t.clip(),this._drawImageAtPosition(t,s),t.restore(),this._drawImageLabel(t,e,i,o,n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.boundingBox.top=e-this.options.size,this.boundingBox.left=t-this.options.size,this.boundingBox.right=t+this.options.size,this.boundingBox.bottom=e+this.options.size,this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),.5*this.width}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(23),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i){if(this.needsRefresh(e,i)){var o=this.getDimensionsFromLabel(t,e,i),n=o.width+this.margin.right+this.margin.left;this.width=n,this.height=n,this.radius=this.width/2}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this.initContextForDraw(t,s),t.database(e-this.width/2,i-this.height/2,this.width,this.height),this.performFill(t,s),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"diamond",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"circle",2,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this.resize(t),this.options.size}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(23),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(this.needsRefresh(e,i)){var o=this.getDimensionsFromLabel(t,e,i);this.height=2*o.height,this.width=o.width+o.height,this.radius=.5*this.width}}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-.5*this.width,this.top=i-.5*this.height,this.initContextForDraw(t,s),t.ellipse_vis(this.left,this.top,this.width,this.height),this.performFill(t,s),this.updateBoundingBox(e,i,t,o,n),this.labelModule.draw(t,e,i,o,n)}},{key:"distanceToBorder",value:function(t,e){this.resize(t);var i=.5*this.width,o=.5*this.height,n=Math.sin(e)*i,s=Math.cos(e)*o;return i*o/Math.sqrt(n*n+s*s)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(23),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i){this.needsRefresh(e,i)&&(this.iconSize={width:Number(this.options.icon.size),height:Number(this.options.icon.size)},this.width=this.iconSize.width+this.margin.right+this.margin.left,this.height=this.iconSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(t,e,i,o,n,s){if(this.resize(t,o,n),this.options.icon.size=this.options.icon.size||50,this.left=e-this.width/2,this.top=i-this.height/2,this._icon(t,e,i,o,n,s),void 0!==this.options.label){this.labelModule.draw(t,this.left+this.iconSize.width/2+this.margin.left,i+this.height/2+5,o)}this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){if(this.boundingBox.top=e-.5*this.options.icon.size,this.boundingBox.left=t-.5*this.options.icon.size,this.boundingBox.right=t+.5*this.options.icon.size,this.boundingBox.bottom=e+.5*this.options.icon.size,void 0!==this.options.label&&this.labelModule.size.width>0){this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelModule.size.height+5)}}},{key:"_icon",value:function(t,e,i,o,n,s){var r=Number(this.options.icon.size);void 0!==this.options.icon.code?(t.font=(o?"bold ":"")+r+"px "+this.options.icon.face,t.fillStyle=this.options.icon.color||"black",t.textAlign="center",t.textBaseline="middle",this.enableShadow(t,s),t.fillText(this.options.icon.code,e,i),this.disableShadow(t,s)):console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.")}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(73),m=o(f),v=function(t){function e(t,i,o,n,r){(0,a.default)(this,e);var h=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return h.setImages(n,r),h}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.selected,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.hover;if(void 0===this.imageObj.src||void 0===this.imageObj.width||void 0===this.imageObj.height){var o=2*this.options.size;return this.width=o,void(this.height=o)}this.needsRefresh(e,i)&&this._resizeImage()}},{key:"draw",value:function(t,e,i,o,n,s){if(this.switchImages(o),this.resize(),this.left=e-this.width/2,this.top=i-this.height/2,!0===this.options.shapeProperties.useBorderWithImage){var r=this.options.borderWidth,a=this.options.borderWidthSelected||2*this.options.borderWidth,h=(o?a:r)/this.body.view.scale;t.lineWidth=Math.min(this.width,h),t.beginPath(),t.strokeStyle=o?this.options.color.highlight.border:n?this.options.color.hover.border:this.options.color.border,t.fillStyle=o?this.options.color.highlight.background:n?this.options.color.hover.background:this.options.color.background,t.rect(this.left-.5*t.lineWidth,this.top-.5*t.lineWidth,this.width+t.lineWidth,this.height+t.lineWidth),t.fill(),this.performStroke(t,s),t.closePath()}this._drawImageAtPosition(t,s),this._drawImageLabel(t,e,i,o,n),this.updateBoundingBox(e,i)}},{key:"updateBoundingBox",value:function(t,e){this.resize(),this._updateBoundingBox(t,e),void 0!==this.options.label&&this.labelModule.size.width>0&&(this.boundingBox.left=Math.min(this.boundingBox.left,this.labelModule.size.left),this.boundingBox.right=Math.max(this.boundingBox.right,this.labelModule.size.left+this.labelModule.size.width),this.boundingBox.bottom=Math.max(this.boundingBox.bottom,this.boundingBox.bottom+this.labelOffset))}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}
}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"square",2,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"hexagon",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"star",4,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(23),m=o(f),v=function(t){function e(t,i,o){(0,a.default)(this,e);var n=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o));return n._setMargins(o),n}return(0,p.default)(e,t),(0,d.default)(e,[{key:"resize",value:function(t,e,i){this.needsRefresh(e,i)&&(this.textSize=this.labelModule.getTextSize(t,e,i),this.width=this.textSize.width+this.margin.right+this.margin.left,this.height=this.textSize.height+this.margin.top+this.margin.bottom,this.radius=.5*this.width)}},{key:"draw",value:function(t,e,i,o,n,s){this.resize(t,o,n),this.left=e-this.width/2,this.top=i-this.height/2,this.enableShadow(t,s),this.labelModule.draw(t,this.left+this.textSize.width/2+this.margin.left,this.top+this.textSize.height/2+this.margin.top,o,n),this.disableShadow(t,s),this.updateBoundingBox(e,i,t,o,n)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"triangle",3,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(24),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"draw",value:function(t,e,i,o,n,s){this._drawShape(t,"triangleDown",3,e,i,o,n,s)}},{key:"distanceToBorder",value:function(t,e){return this._distanceToBorder(t,e)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),s=o(n),r=i(1),a=o(r),h=i(2),d=i(11),l=i(12),u=i(74).default,c=function(){function t(e,i,o){var n=this;(0,s.default)(this,t),this.body=e,this.images=i,this.groups=o,this.body.functions.createEdge=this.create.bind(this),this.edgesListeners={add:function(t,e){n.add(e.items)},update:function(t,e){n.update(e.items)},remove:function(t,e){n.remove(e.items)}},this.options={},this.defaultOptions={arrows:{to:{enabled:!1,scaleFactor:1,type:"arrow"},middle:{enabled:!1,scaleFactor:1,type:"arrow"},from:{enabled:!1,scaleFactor:1,type:"arrow"}},arrowStrikethrough:!0,color:{color:"#848484",highlight:"#848484",hover:"#848484",inherit:"from",opacity:1},dashes:!1,font:{color:"#343434",size:14,face:"arial",background:"none",strokeWidth:2,strokeColor:"#ffffff",align:"horizontal",multi:!1,vadjust:0,bold:{mod:"bold"},boldital:{mod:"bold italic"},ital:{mod:"italic"},mono:{mod:"",size:15,face:"courier new",vadjust:2}},hidden:!1,hoverWidth:1.5,label:void 0,labelHighlightBold:!0,length:void 0,physics:!0,scaling:{min:1,max:15,label:{enabled:!0,min:14,max:30,maxVisible:30,drawThreshold:5},customScalingFunction:function(t,e,i,o){if(e===t)return.5;var n=1/(e-t);return Math.max(0,(o-t)*n)}},selectionWidth:1.5,selfReferenceSize:20,shadow:{enabled:!1,color:"rgba(0,0,0,0.5)",size:10,x:5,y:5},smooth:{enabled:!0,type:"dynamic",forceDirection:"none",roundness:.5},title:void 0,width:1,value:void 0},h.deepExtend(this.options,this.defaultOptions),this.bindEventListeners()}return(0,a.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("_forceDisableDynamicCurves",function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];"dynamic"===e&&(e="continuous");var o=!1;for(var n in t.body.edges)if(t.body.edges.hasOwnProperty(n)){var s=t.body.edges[n],r=t.body.data.edges._data[n];if(void 0!==r){var a=r.smooth;void 0!==a&&!0===a.enabled&&"dynamic"===a.type&&(void 0===e?s.setOptions({smooth:!1}):s.setOptions({smooth:{type:e}}),o=!0)}}!0===i&&!0===o&&t.body.emitter.emit("_dataChanged")}),this.body.emitter.on("_dataUpdated",function(){t.reconnectEdges()}),this.body.emitter.on("refreshEdges",this.refresh.bind(this)),this.body.emitter.on("refresh",this.refresh.bind(this)),this.body.emitter.on("destroy",function(){h.forEach(t.edgesListeners,function(e,i){t.body.data.edges&&t.body.data.edges.off(i,e)}),delete t.body.functions.createEdge,delete t.edgesListeners.add,delete t.edgesListeners.update,delete t.edgesListeners.remove,delete t.edgesListeners})}},{key:"setOptions",value:function(t){if(void 0!==t){u.parseOptions(this.options,t,!0,this.defaultOptions,!0);var e=!1;if(void 0!==t.smooth)for(var i in this.body.edges)this.body.edges.hasOwnProperty(i)&&(e=this.body.edges[i].updateEdgeType()||e);if(void 0!==t.font)for(var o in this.body.edges)this.body.edges.hasOwnProperty(o)&&this.body.edges[o].updateLabelModule();void 0===t.hidden&&void 0===t.physics&&!0!==e||this.body.emitter.emit("_dataChanged")}}},{key:"setData",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.body.data.edges;if(t instanceof d||t instanceof l)this.body.data.edges=t;else if(Array.isArray(t))this.body.data.edges=new d,this.body.data.edges.add(t);else{if(t)throw new TypeError("Array or DataSet expected");this.body.data.edges=new d}if(o&&h.forEach(this.edgesListeners,function(t,e){o.off(e,t)}),this.body.edges={},this.body.data.edges){h.forEach(this.edgesListeners,function(t,i){e.body.data.edges.on(i,t)});var n=this.body.data.edges.getIds();this.add(n,!0)}this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"),!1===i&&this.body.emitter.emit("_dataChanged")}},{key:"add",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.edges,o=this.body.data.edges,n=0;n1&&void 0!==arguments[1])||arguments[1];if(0!==t.length){var i=this.body.edges;h.forEach(t,function(t){var e=i[t];void 0!==e&&e.remove()}),e&&this.body.emitter.emit("_dataChanged")}}},{key:"refresh",value:function(){var t=this;h.forEach(this.body.edges,function(e,i){var o=t.body.data.edges._data[i];void 0!==o&&e.setOptions(o)})}},{key:"create",value:function(t){return new u(t,this.body,this.options,this.defaultOptions)}},{key:"reconnectEdges",value:function(){var t,e=this.body.nodes,i=this.body.edges;for(t in e)e.hasOwnProperty(t)&&(e[t].edges=[]);for(t in i)if(i.hasOwnProperty(t)){var o=i[t];o.from=null,o.to=null,o.connect()}}},{key:"getConnectedNodes",value:function(t){var e=[];if(void 0!==this.body.edges[t]){var i=this.body.edges[t];void 0!==i.fromId&&e.push(i.fromId),void 0!==i.toId&&e.push(i.toId)}return e}},{key:"_updateState",value:function(){this._addMissingEdges(),this._removeInvalidEdges()}},{key:"_removeInvalidEdges",value:function(){var t=this,e=[];h.forEach(this.body.edges,function(i,o){var n=t.body.nodes[i.toId],s=t.body.nodes[i.fromId];void 0!==n&&!0===n.isCluster||void 0!==s&&!0===s.isCluster||void 0!==n&&void 0!==s||e.push(o)}),this.remove(e,!1)}},{key:"_addMissingEdges",value:function(){var t=this.body.edges,e=this.body.data.edges,i=[];e.forEach(function(e,o){void 0===t[o]&&i.push(o)}),this.add(i,!0)}}]),t}();e.default=c},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(30),s=o(n),r=i(3),a=o(r),h=i(0),d=o(h),l=i(1),u=o(l),c=i(4),p=o(c),f=i(5),m=o(f),v=i(216),g=o(v),y=function(t){function e(t,i,o){return(0,d.default)(this,e),(0,p.default)(this,(e.__proto__||(0,a.default)(e)).call(this,t,i,o))}return(0,m.default)(e,t),(0,u.default)(e,[{key:"_line",value:function(t,e,i){var o=i[0],n=i[1];this._bezierCurve(t,e,o,n)}},{key:"_getViaCoordinates",value:function(){var t=this.from.x-this.to.x,e=this.from.y-this.to.y,i=void 0,o=void 0,n=void 0,s=void 0,r=this.options.smooth.roundness;return(Math.abs(t)>Math.abs(e)||!0===this.options.smooth.forceDirection||"horizontal"===this.options.smooth.forceDirection)&&"vertical"!==this.options.smooth.forceDirection?(o=this.from.y,s=this.to.y,i=this.from.x-r*t,n=this.to.x+r*t):(o=this.from.y-r*e,s=this.to.y+r*e,i=this.from.x,n=this.to.x),[{x:i,y:o},{x:n,y:s}]}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,r){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates(),h=(0,s.default)(a,2),d=h[0],l=h[1];return this._getDistanceToBezierEdge(t,e,i,o,n,r,d,l)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=(0,s.default)(e,2),o=i[0],n=i[1],r=t,a=[];return a[0]=Math.pow(1-r,3),a[1]=3*r*Math.pow(1-r,2),a[2]=3*Math.pow(r,2)*(1-r),a[3]=Math.pow(r,3),{x:a[0]*this.fromPoint.x+a[1]*o.x+a[2]*n.x+a[3]*this.toPoint.x,y:a[0]*this.fromPoint.y+a[1]*o.y+a[2]*n.y+a[3]*this.toPoint.y}}}]),e}(g.default);e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(75),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_getDistanceToBezierEdge",value:function(t,e,i,o,n,s,r,a){var h=1e9,d=void 0,l=void 0,u=void 0,c=void 0,p=void 0,f=t,m=e,v=[0,0,0,0];for(l=1;l<10;l++)u=.1*l,v[0]=Math.pow(1-u,3),v[1]=3*u*Math.pow(1-u,2),v[2]=3*Math.pow(u,2)*(1-u),v[3]=Math.pow(u,3),c=v[0]*t+v[1]*r.x+v[2]*a.x+v[3]*i,p=v[0]*e+v[1]*r.y+v[2]*a.y+v[3]*o,l>0&&(d=this._getDistanceToLine(f,m,c,p,n,s),h=d1&&void 0!==arguments[1]?arguments[1]:this.via,i=t,o=void 0,n=void 0;if(this.from===this.to){var r=this._getCircleData(this.from),a=(0,s.default)(r,3),h=a[0],d=a[1],l=a[2],u=2*Math.PI*(1-i);o=h+l*Math.sin(u),n=d+l-l*(1-Math.cos(u))}else o=Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,n=Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y;return{x:o,y:n}}},{key:"_findBorderPosition",value:function(t,e){return this._findBorderPositionBezier(t,e,this.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToBezierEdge(t,e,i,o,n,s,this.via)}}]),e}(g.default);e.default=y},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(75),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_line",value:function(t,e,i){this._bezierCurve(t,e,i)}},{key:"getViaNode",value:function(){return this._getViaCoordinates()}},{key:"_getViaCoordinates",value:function(){var t=void 0,e=void 0,i=this.options.smooth.roundness,o=this.options.smooth.type,n=Math.abs(this.from.x-this.to.x),s=Math.abs(this.from.y-this.to.y);if("discrete"===o||"diagonalCross"===o){var r=void 0,a=void 0;r=a=n<=s?i*s:i*n,this.from.x>this.to.x&&(r=-r),this.from.y>=this.to.y&&(a=-a),t=this.from.x+r,e=this.from.y+a,"discrete"===o&&(n<=s?t=nthis.to.x&&(_=-_),this.from.y>=this.to.y&&(w=-w),t=this.from.x+_,e=this.from.y+w,n<=s?t=this.from.x<=this.to.x?this.to.xt?this.to.x:t:e=this.from.y>=this.to.y?this.to.y>e?this.to.y:e:this.to.y2&&void 0!==arguments[2]?arguments[2]:{};return this._findBorderPositionBezier(t,e,i.via)}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){var r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:this._getViaCoordinates();return this._getDistanceToBezierEdge(t,e,i,o,n,s,r)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._getViaCoordinates(),i=t;return{x:Math.pow(1-i,2)*this.fromPoint.x+2*i*(1-i)*e.x+Math.pow(i,2)*this.toPoint.x,y:Math.pow(1-i,2)*this.fromPoint.y+2*i*(1-i)*e.y+Math.pow(i,2)*this.toPoint.y}}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(118),m=o(f),v=function(t){function e(t,i,o){return(0,a.default)(this,e),(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o))}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_line",value:function(t,e){t.beginPath(),t.moveTo(this.fromPoint.x,this.fromPoint.y),t.lineTo(this.toPoint.x,this.toPoint.y),this.enableShadow(t,e),t.stroke(),this.disableShadow(t,e)}},{key:"getViaNode",value:function(){}},{key:"getPoint",value:function(t){return{x:(1-t)*this.fromPoint.x+t*this.toPoint.x,y:(1-t)*this.fromPoint.y+t*this.toPoint.y}}},{key:"_findBorderPosition",value:function(t,e){var i=this.to,o=this.from;t.id===this.from.id&&(i=this.from,o=this.to);var n=Math.atan2(i.y-o.y,i.x-o.x),s=i.x-o.x,r=i.y-o.y,a=Math.sqrt(s*s+r*r),h=t.distanceToBorder(e,n),d=(a-h)/a,l={};return l.x=(1-d)*o.x+d*i.x,l.y=(1-d)*o.y+d*i.y,l}},{key:"_getDistanceToEdge",value:function(t,e,i,o,n,s){return this._getDistanceToLine(t,e,i,o,n,s)}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(8),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(120).default,u=i(221).default,c=i(222).default,p=i(223).default,f=i(224).default,m=i(121).default,v=i(225).default,g=i(226).default,y=i(2),b=i(119).default,_=function(){function t(e){(0,a.default)(this,t),this.body=e,this.physicsBody={physicsNodeIndices:[],physicsEdgeIndices:[],forces:{},velocities:{}},this.physicsEnabled=!0,this.simulationInterval=1e3/60,this.requiresTimeout=!0,this.previousStates={},this.referenceState={},this.freezeCache={},this.renderTimer=void 0,this.adaptiveTimestep=!1,this.adaptiveTimestepEnabled=!1,this.adaptiveCounter=0,this.adaptiveInterval=3,this.stabilized=!1,this.startedStabilization=!1,this.stabilizationIterations=0,this.ready=!1,this.options={},this.defaultOptions={enabled:!0,barnesHut:{theta:.5,gravitationalConstant:-2e3,centralGravity:.3,springLength:95,springConstant:.04,damping:.09,avoidOverlap:0},forceAtlas2Based:{theta:.5,gravitationalConstant:-50,centralGravity:.01,springConstant:.08,springLength:100,damping:.4,avoidOverlap:0},repulsion:{centralGravity:.2,springLength:200,springConstant:.05,nodeDistance:100,damping:.09,avoidOverlap:0},hierarchicalRepulsion:{centralGravity:0,springLength:100,springConstant:.01,nodeDistance:120,damping:.09},maxVelocity:50,minVelocity:.75,solver:"barnesHut",stabilization:{enabled:!0,iterations:1e3,updateInterval:50,onlyDynamicEdges:!1,fit:!0},timestep:.5,adaptiveTimestep:!0},y.extend(this.options,this.defaultOptions),this.timestep=.5,this.layoutFailed=!1,this.bindEventListeners()}return(0,d.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("initPhysics",function(){t.initPhysics()}),this.body.emitter.on("_layoutFailed",function(){t.layoutFailed=!0}),this.body.emitter.on("resetPhysics",function(){t.stopSimulation(),t.ready=!1}),this.body.emitter.on("disablePhysics",function(){t.physicsEnabled=!1,t.stopSimulation()}),this.body.emitter.on("restorePhysics",function(){t.setOptions(t.options),!0===t.ready&&t.startSimulation()}),this.body.emitter.on("startSimulation",function(){!0===t.ready&&t.startSimulation()}),this.body.emitter.on("stopSimulation",function(){t.stopSimulation()}),this.body.emitter.on("destroy",function(){t.stopSimulation(!1),t.body.emitter.off()}),this.body.emitter.on("_dataChanged",function(){t.updatePhysicsData()})}},{key:"setOptions",value:function(t){void 0!==t&&(!1===t?(this.options.enabled=!1,this.physicsEnabled=!1,this.stopSimulation()):!0===t?(this.options.enabled=!0,this.physicsEnabled=!0,this.startSimulation()):(this.physicsEnabled=!0,y.selectiveNotDeepExtend(["stabilization"],this.options,t),y.mergeOptions(this.options,t,"stabilization"),void 0===t.enabled&&(this.options.enabled=!0),!1===this.options.enabled&&(this.physicsEnabled=!1,this.stopSimulation()),this.timestep=this.options.timestep)),this.init()}},{key:"init",value:function(){var t;"forceAtlas2Based"===this.options.solver?(t=this.options.forceAtlas2Based,this.nodesSolver=new v(this.body,this.physicsBody,t),this.edgesSolver=new p(this.body,this.physicsBody,t),this.gravitySolver=new g(this.body,this.physicsBody,t)):"repulsion"===this.options.solver?(t=this.options.repulsion,this.nodesSolver=new u(this.body,this.physicsBody,t),this.edgesSolver=new p(this.body,this.physicsBody,t),this.gravitySolver=new m(this.body,this.physicsBody,t)):"hierarchicalRepulsion"===this.options.solver?(t=this.options.hierarchicalRepulsion,this.nodesSolver=new c(this.body,this.physicsBody,t),this.edgesSolver=new f(this.body,this.physicsBody,t),this.gravitySolver=new m(this.body,this.physicsBody,t)):(t=this.options.barnesHut,this.nodesSolver=new l(this.body,this.physicsBody,t),this.edgesSolver=new p(this.body,this.physicsBody,t),this.gravitySolver=new m(this.body,this.physicsBody,t)),this.modelOptions=t}},{key:"initPhysics",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?!0===this.options.stabilization.enabled?this.stabilize():(this.stabilized=!1,this.ready=!0,this.body.emitter.emit("fit",{},this.layoutFailed),this.startSimulation()):(this.ready=!0,this.body.emitter.emit("fit"))}},{key:"startSimulation",value:function(){!0===this.physicsEnabled&&!0===this.options.enabled?(this.stabilized=!1,this.adaptiveTimestep=!1,this.body.emitter.emit("_resizeNodes"),void 0===this.viewFunction&&(this.viewFunction=this.simulationStep.bind(this),this.body.emitter.on("initRedraw",this.viewFunction),this.body.emitter.emit("_startRendering"))):this.body.emitter.emit("_redraw")}},{key:"stopSimulation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.stabilized=!0,!0===t&&this._emitStabilized(),void 0!==this.viewFunction&&(this.body.emitter.off("initRedraw",this.viewFunction),this.viewFunction=void 0,!0===t&&this.body.emitter.emit("_stopRendering"))}},{key:"simulationStep",value:function(){var t=Date.now();this.physicsTick(),(Date.now()-t<.4*this.simulationInterval||!0===this.runDoubleSpeed)&&!1===this.stabilized&&(this.physicsTick(),this.runDoubleSpeed=!0),!0===this.stabilized&&this.stopSimulation()}},{key:"_emitStabilized",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stabilizationIterations;(this.stabilizationIterations>1||!0===this.startedStabilization)&&setTimeout(function(){t.body.emitter.emit("stabilized",{iterations:e}),t.startedStabilization=!1,t.stabilizationIterations=0},0)}},{key:"physicsStep",value:function(){this.gravitySolver.solve(),this.nodesSolver.solve(),this.edgesSolver.solve(),this.moveNodes()}},{key:"adjustTimeStep",value:function(){!0===this._evaluateStepQuality()?this.timestep=1.2*this.timestep:this.timestep/1.2.3))return!1;return!0}},{key:"moveNodes",value:function(){for(var t=this.physicsBody.physicsNodeIndices,e=0,i=0,o=0;oo&&(t=t>0?o:-o),t}},{key:"_performStep",value:function(t){var e=this.body.nodes[t],i=this.physicsBody.forces[t],o=this.physicsBody.velocities[t];return this.previousStates[t]={x:e.x,y:e.y,vx:o.x,vy:o.y},!1===e.options.fixed.x?(o.x=this.calculateComponentVelocity(o.x,i.x,e.options.mass),e.x+=o.x*this.timestep):(i.x=0,o.x=0),!1===e.options.fixed.y?(o.y=this.calculateComponentVelocity(o.y,i.y,e.options.mass),e.y+=o.y*this.timestep):(i.y=0,o.y=0),Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2))}},{key:"_freezeNodes",value:function(){var t=this.body.nodes;for(var e in t)if(t.hasOwnProperty(e)&&t[e].x&&t[e].y){var i=t[e].options.fixed;this.freezeCache[e]={x:i.x,y:i.y},i.x=!0,i.y=!0}}},{key:"_restoreFrozenNodes",value:function(){var t=this.body.nodes;for(var e in t)t.hasOwnProperty(e)&&void 0!==this.freezeCache[e]&&(t[e].options.fixed.x=this.freezeCache[e].x,t[e].options.fixed.y=this.freezeCache[e].y);this.freezeCache={}}},{key:"stabilize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.stabilization.iterations;if("number"!=typeof e&&(e=this.options.stabilization.iterations,console.log("The stabilize method needs a numeric amount of iterations. Switching to default: ",e)),0===this.physicsBody.physicsNodeIndices.length)return void(this.ready=!0);this.adaptiveTimestep=this.options.adaptiveTimestep,this.body.emitter.emit("_resizeNodes"),this.stopSimulation(),this.stabilized=!1,this.body.emitter.emit("_blockRedraw"),this.targetIterations=e,!0===this.options.stabilization.onlyDynamicEdges&&this._freezeNodes(),this.stabilizationIterations=0,setTimeout(function(){return t._stabilizationBatch()},0)}},{key:"_startStabilizing",value:function(){return!0!==this.startedStabilization&&(this.body.emitter.emit("startStabilizing"),this.startedStabilization=!0,!0)}},{key:"_stabilizationBatch",value:function(){var t=this,e=function(){return!1===t.stabilized&&t.stabilizationIterations0){var s=n.edges.length+1,r=this.options.centralGravity*s*n.options.mass;o[n.id].x=e*r,o[n.id].y=i*r}}}]),e}(m.default);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(8),s=o(n),r=i(6),a=o(r),h=i(0),d=o(h),l=i(1),u=o(l),c=i(2),p=i(76).default,f=i(228).default,m=i(74).default,v=i(47).default,g=function(){function t(e){var i=this;(0,d.default)(this,t),this.body=e,this.clusteredNodes={},this.clusteredEdges={},this.options={},this.defaultOptions={},c.extend(this.options,this.defaultOptions),this.body.emitter.on("_resetData",function(){i.clusteredNodes={},i.clusteredEdges={}})}return(0,u.default)(t,[{key:"clusterByHubsize",value:function(t,e){void 0===t?t=this._getHubSize():"object"===(void 0===t?"undefined":(0,a.default)(t))&&(e=this._checkOptions(t),t=this._getHubSize());for(var i=[],o=0;o=t&&i.push(n.id)}for(var s=0;s0&&void 0!==arguments[0]?arguments[0]:{},i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(void 0===e.joinCondition)throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");e=this._checkOptions(e);var o={},n={};c.forEach(this.body.nodes,function(i,s){var r=p.cloneOptions(i);!0===e.joinCondition(r)&&(o[s]=i,c.forEach(i.edges,function(e){void 0===t.clusteredEdges[e.id]&&(n[e.id]=e)}))}),this._cluster(o,n,e,i)}},{key:"clusterByEdgeCount",value:function(t,e){var i=this,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e=this._checkOptions(e);for(var n=[],r={},a=void 0,h=void 0,d=void 0,l=0;l0&&(0,s.default)(m).length>0&&!0===b)if(c=function(){for(var t=0;t1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(1,t,e)}},{key:"clusterBridges",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clusterByEdgeCount(2,t,e)}},{key:"clusterByConnection",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No nodeId supplied to clusterByConnection!");if(void 0===this.body.nodes[t])throw new Error("The nodeId given to clusterByConnection does not exist!");var o=this.body.nodes[t];e=this._checkOptions(e,o),void 0===e.clusterNodeProperties.x&&(e.clusterNodeProperties.x=o.x),void 0===e.clusterNodeProperties.y&&(e.clusterNodeProperties.y=o.y),void 0===e.clusterNodeProperties.fixed&&(e.clusterNodeProperties.fixed={},e.clusterNodeProperties.fixed.x=o.options.fixed.x,e.clusterNodeProperties.fixed.y=o.options.fixed.y);var n={},r={},a=o.id,h=p.cloneOptions(o);n[a]=o;for(var d=0;d-1&&(r[g.id]=g)}this._cluster(n,r,e,i)}},{key:"_createClusterEdges",value:function(t,e,i,o){for(var n=void 0,r=void 0,a=void 0,h=void 0,d=void 0,l=void 0,u=(0,s.default)(t),c=[],p=0;p0&&void 0!==arguments[0]?arguments[0]:{};return void 0===t.clusterEdgeProperties&&(t.clusterEdgeProperties={}),void 0===t.clusterNodeProperties&&(t.clusterNodeProperties={}),t}},{key:"_cluster",value:function(t,e,i){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(0!=(0,s.default)(t).length&&(1!=(0,s.default)(t).length||1==i.clusterNodeProperties.allowSingleNodeCluster)){for(var n in t)if(t.hasOwnProperty(n)&&void 0!==this.clusteredNodes[n])return;var r=c.deepExtend({},i.clusterNodeProperties);if(void 0!==i.processProperties){var a=[];for(var h in t)if(t.hasOwnProperty(h)){var d=p.cloneOptions(t[h]);a.push(d)}var l=[];for(var u in e)if(e.hasOwnProperty(u)&&"clusterEdge:"!==u.substr(0,12)){var m=p.cloneOptions(e[u],"edge");l.push(m)}if(!(r=i.processProperties(r,a,l)))throw new Error("The processProperties function does not return properties!")}void 0===r.id&&(r.id="cluster:"+c.randomUUID());var v=r.id;void 0===r.label&&(r.label="cluster");var g=void 0;void 0===r.x&&(g=this._getClusterPosition(t),r.x=g.x),void 0===r.y&&(void 0===g&&(g=this._getClusterPosition(t)),r.y=g.y),r.id=v;var y=this.body.functions.createNode(r,f);y.containedNodes=t,y.containedEdges=e,y.clusterEdgeProperties=i.clusterEdgeProperties,this.body.nodes[r.id]=y,this._clusterEdges(t,e,r,i.clusterEdgeProperties),r.id=void 0,!0===o&&this.body.emitter.emit("_dataChanged")}}},{key:"_backupEdgeOptions",value:function(t){void 0===this.clusteredEdges[t.id]&&(this.clusteredEdges[t.id]={physics:t.options.physics})}},{key:"_restoreEdge",value:function(t){var e=this.clusteredEdges[t.id];void 0!==e&&(t.setOptions({physics:e.physics}),delete this.clusteredEdges[t.id])}},{key:"isCluster",value:function(t){return void 0!==this.body.nodes[t]?!0===this.body.nodes[t].isCluster:(console.log("Node does not exist."),!1)}},{key:"_getClusterPosition",value:function(t){for(var e=(0,s.default)(t),i=t[e[0]].x,o=t[e[0]].x,n=t[e[0]].y,r=t[e[0]].y,a=void 0,h=1;ho?a.x:o,n=a.yr?a.y:r;return{x:.5*(i+o),y:.5*(n+r)}}},{key:"openCluster",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t)throw new Error("No clusterNodeId supplied to openCluster.");var o=this.body.nodes[t];if(void 0===o)throw new Error("The clusterNodeId supplied to openCluster does not exist.");if(!0!==o.isCluster||void 0===o.containedNodes||void 0===o.containedEdges)throw new Error("The node:"+t+" is not a valid cluster.");var n=this.findNode(t),s=n.indexOf(t)-1;if(s>=0){var r=n[s];return this.body.nodes[r]._openChildCluster(t),delete this.body.nodes[t],void(!0===i&&this.body.emitter.emit("_dataChanged"))}var a=o.containedNodes,h=o.containedEdges;if(void 0!==e&&void 0!==e.releaseFunction&&"function"==typeof e.releaseFunction){var d={},l={x:o.x,y:o.y};for(var u in a)if(a.hasOwnProperty(u)){var p=this.body.nodes[u];d[u]={x:p.x,y:p.y}}var f=e.releaseFunction(l,d);for(var m in a)if(a.hasOwnProperty(m)){var v=this.body.nodes[m];void 0!==f[m]&&(v.x=void 0===f[m].x?o.x:f[m].x,v.y=void 0===f[m].y?o.y:f[m].y)}}else c.forEach(a,function(t){!1===t.options.fixed.x&&(t.x=o.x),!1===t.options.fixed.y&&(t.y=o.y)});for(var g in a)if(a.hasOwnProperty(g)){var y=this.body.nodes[g];y.vx=o.vx,y.vy=o.vy,y.setOptions({physics:!0}),delete this.clusteredNodes[g]}for(var b=[],_=0;_0&&n<100;){var s=e.pop();if(void 0!==s){var r=this.body.edges[s];if(void 0!==r){n++;var a=r.clusteringEdgeReplacingIds;if(void 0===a)o.push(s);else for(var h=0;ho&&(o=s.edges.length),t+=s.edges.length,e+=Math.pow(s.edges.length,2),i+=1}t/=i,e/=i;var r=e-Math.pow(t,2),a=Math.sqrt(r),h=Math.floor(t+2*a);return h>o&&(h=o),h}},{key:"_createClusteredEdge",value:function(t,e,i,o,n){var s=p.cloneOptions(i,"edge");c.deepExtend(s,o),s.from=t,s.to=e,s.id="clusterEdge:"+c.randomUUID(),void 0!==n&&c.deepExtend(s,n);var r=this.body.functions.createEdge(s);return r.clusteringEdgeReplacingIds=[i.id],r.connect(),this.body.edges[r.id]=r,r}},{key:"_clusterEdges",value:function(t,e,i,o){if(e instanceof m){var n=e,s={};s[n.id]=n,e=s}if(t instanceof v){var r=t,a={};a[r.id]=r,t=a}if(void 0===i||null===i)throw new Error("_clusterEdges: parameter clusterNode required");void 0===o&&(o=i.clusterEdgeProperties),this._createClusterEdges(t,e,i,o);for(var h in e)if(e.hasOwnProperty(h)&&void 0!==this.body.edges[h]){var d=this.body.edges[h];this._backupEdgeOptions(d),d.setOptions({physics:!1})}for(var l in t)t.hasOwnProperty(l)&&(this.clusteredNodes[l]={clusterId:i.id,node:this.body.nodes[l]},this.body.nodes[l].setOptions({physics:!1}))}},{key:"_getClusterNodeForNode",value:function(t){if(void 0!==t){var e=this.clusteredNodes[t];if(void 0!==e){var i=e.clusterId;if(void 0!==i)return this.body.nodes[i]}}}},{key:"_filter",value:function(t,e){var i=[];return c.forEach(t,function(t){e(t)&&i.push(t)}),i}},{key:"_updateState",value:function(){var t=this,e=void 0,i=[],o=[],n=function(e){c.forEach(t.body.nodes,function(t){!0===t.isCluster&&e(t)})};for(e in this.clusteredNodes)if(this.clusteredNodes.hasOwnProperty(e)){var r=this.body.nodes[e];void 0===r&&i.push(e)}n(function(t){for(var e=0;e0}e.endPointsValid()&&n||o.push(i)}),n(function(e){c.forEach(o,function(i){delete e.containedEdges[i],c.forEach(e.edges,function(n,s){if(n.id===i)return void(e.edges[s]=null);n.clusteringEdgeReplacingIds=t._filter(n.clusteringEdgeReplacingIds,function(t){return-1===o.indexOf(t)})}),e.edges=t._filter(e.edges,function(t){return null!==t})})}),c.forEach(o,function(e){delete t.clusteredEdges[e]}),c.forEach(o,function(e){delete t.body.edges[e]});var h=(0,s.default)(this.body.edges);c.forEach(h,function(e){var i=t.body.edges[e],o=t._isClusteredNode(i.fromId)||t._isClusteredNode(i.toId);if(o!==t._isClusteredEdge(i.id)){if(!o)throw new Error("remove edge from clustering not implemented!");var n=t._getClusterNodeForNode(i.fromId);void 0!==n&&t._clusterEdges(t.body.nodes[i.fromId],i,n);var s=t._getClusterNodeForNode(i.toId);void 0!==s&&t._clusterEdges(t.body.nodes[i.toId],i,s)}});for(var d=!1,l=!0;l;)!function(){var e=[];n(function(t){var i=(0,s.default)(t.containedNodes).length,o=!0===t.options.allowSingleNodeCluster;(o&&i<1||!o&&i<2)&&e.push(t.id)});for(var i=0;i0,d=d||l}();d&&this._updateState()}},{key:"_isClusteredNode",value:function(t){return void 0!==this.clusteredNodes[t]}},{key:"_isClusteredEdge",value:function(t){return void 0!==this.clusteredEdges[t]}}]),t}();e.default=g},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),s=o(n),r=i(0),a=o(r),h=i(1),d=o(h),l=i(4),u=o(l),c=i(5),p=o(c),f=i(2),m=i(47).default,v=function(t){function e(t,i,o,n,r,h){(0,a.default)(this,e);var d=(0,u.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t,i,o,n,r,h));return d.isCluster=!0,d.containedNodes={},d.containedEdges={},d}return(0,p.default)(e,t),(0,d.default)(e,[{key:"_openChildCluster",value:function(t){var e=this,i=this.body.nodes[t];if(void 0===this.containedNodes[t])throw new Error("node with id: "+t+" not in current cluster");if(!i.isCluster)throw new Error("node with id: "+t+" is not a cluster");delete this.containedNodes[t],f.forEach(i.edges,function(t){delete e.containedEdges[t.id]}),f.forEach(i.containedNodes,function(t,i){e.containedNodes[i]=t}),i.containedNodes={},f.forEach(i.containedEdges,function(t,i){e.containedEdges[i]=t}),i.containedEdges={},f.forEach(i.edges,function(t){f.forEach(e.edges,function(i){var o=i.clusteringEdgeReplacingIds.indexOf(t.id);-1!==o&&(f.forEach(t.clusteringEdgeReplacingIds,function(t){i.clusteringEdgeReplacingIds.push(t),e.body.edges[t].edgeReplacedById=i.id}),i.clusteringEdgeReplacingIds.splice(o,1))})}),i.edges=[]}}]),e}(m);e.default=v},function(t,e,i){function o(t){return t&&t.__esModule?t:{default:t}}function n(){var t;void 0!==window&&(t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame),window.requestAnimationFrame=void 0===t?function(t){t()}:t}Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),r=o(s),a=i(1),h=o(a),d=i(2),l=function(){function t(e,i){(0,r.default)(this,t),n(),this.body=e,this.canvas=i,this.redrawRequested=!1,this.renderTimer=void 0,this.requiresTimeout=!0,this.renderingActive=!1,this.renderRequests=0,this.allowRedraw=!0,this.dragging=!1,this.options={},this.defaultOptions={hideEdgesOnDrag:!1,hideNodesOnDrag:!1},d.extend(this.options,this.defaultOptions),this._determineBrowserMethod(),this.bindEventListeners()}return(0,h.default)(t,[{key:"bindEventListeners",value:function(){var t=this;this.body.emitter.on("dragStart",function(){t.dragging=!0}),this.body.emitter.on("dragEnd",function(){t.dragging=!1}),this.body.emitter.on("_resizeNodes",function(){t._resizeNodes()}),this.body.emitter.on("_redraw",function(){!1===t.renderingActive&&t._redraw()}),this.body.emitter.on("_blockRedraw",function(){t.allowRedraw=!1}),this.body.emitter.on("_allowRedraw",function(){t.allowRedraw=!0,t.redrawRequested=!1}),this.body.emitter.on("_requestRedraw",this._requestRedraw.bind(this)),this.body.emitter.on("_startRendering",function(){t.renderRequests+=1,t.renderingActive=!0,t._startRendering()}),this.body.emitter.on("_stopRendering",function(){t.renderRequests-=1,t.renderingActive=t.renderRequests>0,t.renderTimer=void 0}),this.body.emitter.on("destroy",function(){t.renderRequests=0,t.allowRedraw=!1,t.renderingActive=!1,!0===t.requiresTimeout?clearTimeout(t.renderTimer):window.cancelAnimationFrame(t.renderTimer),t.body.emitter.off()})}},{key:"setOptions",value:function(t){if(void 0!==t){var e=["hideEdgesOnDrag","hideNodesOnDrag"];d.selectiveDeepExtend(e,this.options,t)}}},{key:"_requestNextFrame",value:function(t,e){if("undefined"!=typeof window){var i=void 0,o=window;return!0===this.requiresTimeout?i=o.setTimeout(t,e):o.requestAnimationFrame&&(i=o.requestAnimationFrame(t)),i}}},{key:"_startRendering",value:function(){!0===this.renderingActive&&void 0===this.renderTimer&&(this.renderTimer=this._requestNextFrame(this._renderStep.bind(this),this.simulationInterval))}},{key:"_renderStep",value:function(){!0===this.renderingActive&&(this.renderTimer=void 0,!0===this.requiresTimeout&&this._startRendering(),this._redraw(),!1===this.requiresTimeout&&this._startRendering())}},{key:"redraw",value:function(){this.body.emitter.emit("setSize"),this._redraw()}},{key:"_requestRedraw",value:function(){var t=this;!0!==this.redrawRequested&&!1===this.renderingActive&&!0===this.allowRedraw&&(this.redrawRequested=!0,this._requestNextFrame(function(){t._redraw(!1)},0))}},{key:"_redraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===this.allowRedraw){this.body.emitter.emit("initRedraw"),this.redrawRequested=!1,0!==this.canvas.frame.canvas.width&&0!==this.canvas.frame.canvas.height||this.canvas.setSize(),this.canvas.setTransform();var e=this.canvas.getContext(),i=this.canvas.frame.canvas.clientWidth,o=this.canvas.frame.canvas.clientHeight;if(e.clearRect(0,0,i,o),0===this.canvas.frame.clientWidth)return;e.save(),e.translate(this.body.view.translation.x,this.body.view.translation.y),e.scale(this.body.view.scale,this.body.view.scale),e.beginPath(),this.body.emitter.emit("beforeDrawing",e),e.closePath(),!1===t&&(!1===this.dragging||!0===this.dragging&&!1===this.options.hideEdgesOnDrag)&&this._drawEdges(e),(!1===this.dragging||!0===this.dragging&&!1===this.options.hideNodesOnDrag)&&this._drawNodes(e,t),e.beginPath(),this.body.emitter.emit("afterDrawing",e),e.closePath(),e.restore(),!0===t&&e.clearRect(0,0,i,o)}}},{key:"_resizeNodes",value:function(){this.canvas.setTransform();var t=this.canvas.getContext();t.save(),t.translate(this.body.view.translation.x,this.body.view.translation.y),t.scale(this.body.view.scale,this.body.view.scale);var e=this.body.nodes,i=void 0;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],i.resize(t),i.updateBoundingBox(t,i.selected));t.restore()}},{key:"_drawNodes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.body.nodes,o=this.body.nodeIndices,n=void 0,s=[],r=this.canvas.DOMtoCanvas({x:-20,y:-20}),a=this.canvas.DOMtoCanvas({x:this.canvas.frame.canvas.clientWidth+20,y:this.canvas.frame.canvas.clientHeight+20}),h={top:r.y,left:r.x,bottom:a.y,right:a.x},d=0;d0&&void 0!==arguments[0]?arguments[0]:this.pixelRatio;!0===this.initialized&&(this.cameraState.previousWidth=this.frame.canvas.width/t,this.cameraState.previousHeight=this.frame.canvas.height/t,this.cameraState.scale=this.body.view.scale,this.cameraState.position=this.DOMtoCanvas({x:.5*this.frame.canvas.width/t,y:.5*this.frame.canvas.height/t}))}},{key:"_setCameraState",value:function(){if(void 0!==this.cameraState.scale&&0!==this.frame.canvas.clientWidth&&0!==this.frame.canvas.clientHeight&&0!==this.pixelRatio&&this.cameraState.previousWidth>0){var t=this.frame.canvas.width/this.pixelRatio/this.cameraState.previousWidth,e=this.frame.canvas.height/this.pixelRatio/this.cameraState.previousHeight,i=this.cameraState.scale;1!=t&&1!=e?i=.5*this.cameraState.scale*(t+e):1!=t?i=this.cameraState.scale*t:1!=e&&(i=this.cameraState.scale*e),this.body.view.scale=i;var o=this.DOMtoCanvas({x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight}),n={x:o.x-this.cameraState.position.x,y:o.y-this.cameraState.position.y};this.body.view.translation.x+=n.x*this.body.view.scale,this.body.view.translation.y+=n.y*this.body.view.scale}}},{key:"_prepareValue",value:function(t){if("number"==typeof t)return t+"px";if("string"==typeof t){if(-1!==t.indexOf("%")||-1!==t.indexOf("px"))return t;if(-1===t.indexOf("%"))return t+"px"}throw new Error("Could not use the value supplied for width or height:"+t)}},{key:"_create",value:function(){for(;this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild);if(this.frame=document.createElement("div"),this.frame.className="vis-network",this.frame.style.position="relative",this.frame.style.overflow="hidden",this.frame.tabIndex=900,this.frame.canvas=document.createElement("canvas"),this.frame.canvas.style.position="relative",this.frame.appendChild(this.frame.canvas),this.frame.canvas.getContext)this._setPixelRatio(),this.setTransform();else{var t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.frame.canvas.appendChild(t)}this.body.container.appendChild(this.frame),this.body.view.scale=1,this.body.view.translation={x:.5*this.frame.canvas.clientWidth,y:.5*this.frame.canvas.clientHeight},this._bindHammer()}},{key:"_bindHammer",value:function(){var t=this;void 0!==this.hammer&&this.hammer.destroy(),this.drag={},this.pinch={},this.hammer=new h(this.frame.canvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.get("pan").set({threshold:5,direction:h.DIRECTION_ALL}),d.onTouch(this.hammer,function(e){t.body.eventListeners.onTouch(e)}),this.hammer.on("tap",function(e){t.body.eventListeners.onTap(e)}),this.hammer.on("doubletap",function(e){t.body.eventListeners.onDoubleTap(e)}),this.hammer.on("press",function(e){t.body.eventListeners.onHold(e)}),this.hammer.on("panstart",function(e){t.body.eventListeners.onDragStart(e)}),this.hammer.on("panmove",function(e){t.body.eventListeners.onDrag(e)}),this.hammer.on("panend",function(e){t.body.eventListeners.onDragEnd(e)}),this.hammer.on("pinch",function(e){t.body.eventListeners.onPinch(e)}),this.frame.canvas.addEventListener("mousewheel",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("DOMMouseScroll",function(e){t.body.eventListeners.onMouseWheel(e)}),this.frame.canvas.addEventListener("mousemove",function(e){t.body.eventListeners.onMouseMove(e)}),this.frame.canvas.addEventListener("contextmenu",function(e){t.body.eventListeners.onContext(e)}),this.hammerFrame=new h(this.frame),d.onRelease(this.hammerFrame,function(e){t.body.eventListeners.onRelease(e)})}},{key:"setSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.width,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.height;t=this._prepareValue(t),e=this._prepareValue(e);var i=!1,o=this.frame.canvas.width,n=this.frame.canvas.height,s=this.pixelRatio;if(this._setPixelRatio(),t!=this.options.width||e!=this.options.height||this.frame.style.width!=t||this.frame.style.height!=e)this._getCameraState(s),this.frame.style.width=t,this.frame.style.height=e,this.frame.canvas.style.width="100%",this.frame.canvas.style.height="100%",this.frame.canvas.width=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),this.frame.canvas.height=Math.round(this.frame.canvas.clientHeight*this.pixelRatio),this.options.width=t,this.options.height=e,this.canvasViewCenter={x:.5*this.frame.clientWidth,y:.5*this.frame.clientHeight},i=!0;else{var r=Math.round(this.frame.canvas.clientWidth*this.pixelRatio),a=Math.round(this.frame.canvas.clientHeight*this.pixelRatio);this.frame.canvas.width===r&&this.frame.canvas.height===a||this._getCameraState(s),
diff --git a/src/resources/js/search/lunr.min.js b/src/resources/js/search/lunr.min.js
index f45a81eb..34b279da 100644
--- a/src/resources/js/search/lunr.min.js
+++ b/src/resources/js/search/lunr.min.js
@@ -1 +1,6 @@
-!function(){var t,l,c,e,r,h,d,f,p,y,m,g,x,v,w,Q,k,S,E,L,b,P,T,O,I,i,n,s,z=function(e){var t=new z.Builder;return t.pipeline.add(z.trimmer,z.stopWordFilter,z.stemmer),t.searchPipeline.add(z.stemmer),e.call(t,t),t.build()};z.version="2.3.5",z.utils={},z.utils.warn=(t=this,function(e){t.console&&console.warn&&console.warn(e)}),z.utils.asString=function(e){return null==e?"":e.toString()},z.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i=this.length)return z.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},z.QueryLexer.prototype.width=function(){return this.pos-this.start},z.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},z.QueryLexer.prototype.backup=function(){this.pos-=1},z.QueryLexer.prototype.acceptDigitRun=function(){for(var e,t;47<(t=(e=this.next()).charCodeAt(0))&&t<58;);e!=z.QueryLexer.EOS&&this.backup()},z.QueryLexer.prototype.more=function(){return this.pos0){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}();
diff --git a/src/templates/partials/block-accessors.hbs b/src/templates/partials/block-accessors.hbs
index 63ba0307..66583b7c 100644
--- a/src/templates/partials/block-accessors.hbs
+++ b/src/templates/partials/block-accessors.hbs
@@ -43,9 +43,13 @@
{{t "name" }}
- {{t "type" }}
+ {{#one-parameter-has tags 'type'}}
+ {{t "type" }}
+ {{/one-parameter-has}}
{{t "optional" }}
- {{t "description" }}
+ {{#one-parameter-has tags 'comment'}}
+ {{t "description" }}
+ {{/one-parameter-has}}
@@ -54,11 +58,15 @@
{{#if name}}
{{name}}
{{/if}}
-
- {{#if type}}
- {{> link-type type=type }}
- {{/if}}
-
+
+ {{#one-parameter-has ../tags 'type'}}
+
+ {{#if type}}
+ {{> link-type type=type }}
+ {{/if}}
+
+ {{/one-parameter-has}}
+
{{#if optional}}
{{t "yes" }}
@@ -66,7 +74,14 @@
{{t "no" }}
{{/if}}
- {{{comment}}}
+
+ {{#one-parameter-has ../tags 'comment'}}
+
+ {{#if comment}}
+ {{{comment}}}
+ {{/if}}
+
+ {{/one-parameter-has}}
{{/each}}
diff --git a/src/templates/partials/block-input.hbs b/src/templates/partials/block-input.hbs
index ebdbced0..d30df9f2 100644
--- a/src/templates/partials/block-input.hbs
+++ b/src/templates/partials/block-input.hbs
@@ -35,7 +35,7 @@
{{#if inheritance}}
- {{t "defined-in" }} {{inheritance.file}}:{{{line}}}
+ {{t "defined-in" }} {{> link-type type=inheritance.file withline=true }}
{{else}}
{{t "defined-in" }} {{../element.file}}:{{{line}}}
{{/if}}
diff --git a/src/templates/partials/block-method.hbs b/src/templates/partials/block-method.hbs
index 376915e7..8ca33292 100644
--- a/src/templates/partials/block-method.hbs
+++ b/src/templates/partials/block-method.hbs
@@ -1,196 +1,195 @@
{{#ifString title}}{{title}}
{{else}}
-
- {{t "methods" }}
-
+
+ {{t "methods" }}
+
{{/ifString}}
{{#each methods}}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{{#each modifierKind}}
- {{modifKind this}}
+ {{modifKind this}}
{{/each}}
{{#if optional}}
- {{t "optional" }}
+ {{t "optional" }}
{{/if}}
{{name}}
-
-
-
-
-
- {{#if ../file-path}}
-
-
- {{file}}
-
-
- {{/if}}
- {{#if argsDecorator}}
-
-
- {{t "arguments" }} : {{#each argsDecorator}}'{{this}}' {{/each}}
-
-
- {{/if}}
-
-
- {{#if modifierKind}}
-
- {{/if}}{{{functionSignature this}}}
-
-
+
+
+
+
+
+ {{#if ../file-path}}
+
+
+ {{file}}
+
+
+ {{/if}}
+ {{#if argsDecorator}}
+
+
+ {{t "arguments" }} : {{#each argsDecorator}}'{{this}}' {{/each}}
+
+
+ {{/if}}
+
+
+ {{#if modifierKind}}
+
+ {{/if}}{{{functionSignature this}}}
+
+
- {{#if decorators}}
-
-
- {{t "decorators" }} :
-
-
- {{#each decorators}}{{#if stringifiedArguments}}@{{name}}({{stringifiedArguments}}){{else}}@{{name}}(){{/if}}
{{/each}}
-
-
-
- {{/if}}
+ {{#if decorators}}
+
+
+ {{t "decorators" }} :
+
+ {{#each decorators}}{{#if stringifiedArguments}}@{{name}}({{stringifiedArguments}}){{else}}@{{name}}(){{/if}}
{{/each}}
+
+
+ {{/if}}
- {{#if line}}
- {{#isTabEnabled ../navTabs "source"}}
- {{#if inheritance}}
-
-
- {{t "inherited-from" }} {{> link-type type=inheritance.file }}
-
-
- {{/if}}
-
-
- {{#if inheritance}}
- {{t "defined-in" }} {{inheritance.file}}:{{{line}}}
- {{else}}
- {{t "defined-in" }} {{../file}}:{{{line}}}
- {{/if}}
-
-
- {{/isTabEnabled}}
- {{/if}}
+ {{#if line}}
+ {{#isTabEnabled ../navTabs "source"}}
+ {{#if inheritance}}
+
+
+ {{t "inherited-from" }} {{> link-type type=inheritance.file }}
+
+
+ {{/if}}
+
+
+ {{#if inheritance}}
+ {{t "defined-in" }} {{> link-type type=inheritance.file withline=true }}
+ {{else}}
+ {{t "defined-in" }} {{../file}}:{{{line}}}
+ {{/if}}
+
+
+ {{/isTabEnabled}}
+ {{/if}}
- {{#if typeParameters}}
- {{#compare typeParameters.length ">" 0}}
-
-
- {{t "type-parameters" }} :
-
- {{#each typeParameters}}
- - {{this}}
- {{/each}}
-
-
-
- {{/compare}}
- {{/if}}
+ {{#if typeParameters}}
+ {{#compare typeParameters.length ">" 0}}
+
+
+ {{t "type-parameters" }} :
+
+ {{#each typeParameters}}
+ - {{this}}
+ {{/each}}
+
+
+
+ {{/compare}}
+ {{/if}}
- {{#or jsdoctags returnType description}}
-
-
- {{#if description}}
- {{{parseDescription description ../depth}}}
- {{/if}}
+ {{#or jsdoctags returnType description}}
+
+
+ {{#if description}}
+ {{{parseDescription description ../depth}}}
+ {{/if}}
- {{#if jsdoctags}}
- {{#jsdoc-params-valid jsdoctags}}
-
- {{#jsdoc-params jsdoctags}}
- {{t "parameters" }} :
-
-
-
- {{t "name" }}
- {{#one-parameter-has tags 'type'}}
- {{t "type" }}
- {{/one-parameter-has}}
- {{t "optional" }}
- {{#one-parameter-has tags 'defaultValue'}}
- {{t "default-value" }}
- {{/one-parameter-has}}
- {{#one-parameter-has tags 'comment'}}
- {{t "description" }}
- {{/one-parameter-has}}
-
-
-
- {{#each tags}}
-
- {{#if name}}
- {{name}}
- {{/if}}
- {{#one-parameter-has ../tags 'type'}}
-
- {{#if type}}
- {{> link-type type=type }}
- {{/if}}
-
- {{/one-parameter-has}}
-
-
- {{#if optional}}
- {{t "yes" }}
- {{else}}
- {{t "no" }}
- {{/if}}
-
-
- {{#one-parameter-has ../tags 'defaultValue'}}
-
- {{#if defaultValue}}
- {{defaultValue}}
- {{/if}}
-
- {{/one-parameter-has}}
+ {{#if jsdoctags}}
+ {{#jsdoc-params-valid jsdoctags}}
+
+ {{#jsdoc-params jsdoctags}}
+ {{t "parameters" }} :
+
+
+
+ {{t "name" }}
+ {{#one-parameter-has tags 'type'}}
+ {{t "type" }}
+ {{/one-parameter-has}}
+ {{t "optional" }}
+ {{#one-parameter-has tags 'defaultValue'}}
+ {{t "default-value" }}
+ {{/one-parameter-has}}
+ {{#one-parameter-has tags 'comment'}}
+ {{t "description" }}
+ {{/one-parameter-has}}
+
+
+
+ {{#each tags}}
+
+ {{#if name}}
+ {{name}}
+ {{/if}}
+ {{#one-parameter-has ../tags 'type'}}
+
+ {{#if type}}
+ {{> link-type type=type }}
+ {{/if}}
+
+ {{/one-parameter-has}}
- {{#one-parameter-has ../tags 'comment'}}
-
- {{#if comment}}
- {{{comment}}}
- {{/if}}
-
- {{/one-parameter-has}}
-
- {{/each}}
-
-
- {{/jsdoc-params}}
-
- {{/jsdoc-params-valid}}
-
- {{#jsdoc-code-example jsdoctags}}
- {{t "example" }} :
- {{#each tags}}
-
- {{{comment}}}
-
- {{/each}}
- {{/jsdoc-code-example}}
-
- {{/if}}
- {{#if returnType}}
-
- {{t "returns" }} : {{> link-type type=returnType }}
-
- {{#if jsdoctags}}
-
- {{{jsdoc-returns-comment jsdoctags}}}
-
- {{/if}}
- {{/if}}
-
-
- {{/or}}
-
-
+
+ {{#if optional}}
+ {{t "yes" }}
+ {{else}}
+ {{t "no" }}
+ {{/if}}
+
+
+ {{#one-parameter-has ../tags 'defaultValue'}}
+
+ {{#if defaultValue}}
+ {{defaultValue}}
+ {{/if}}
+
+ {{/one-parameter-has}}
+
+ {{#one-parameter-has ../tags 'comment'}}
+
+ {{#if comment}}
+ {{{comment}}}
+ {{/if}}
+
+ {{/one-parameter-has}}
+
+ {{/each}}
+
+
+ {{/jsdoc-params}}
+
+ {{/jsdoc-params-valid}}
+
+ {{#jsdoc-code-example jsdoctags}}
+ {{t "example" }} :
+ {{#each tags}}
+
+ {{{comment}}}
+
+ {{/each}}
+ {{/jsdoc-code-example}}
+
+ {{/if}}
+ {{#if returnType}}
+
+ {{t "returns" }} : {{> link-type type=returnType }}
+
+ {{#if jsdoctags}}
+
+ {{{jsdoc-returns-comment jsdoctags}}}
+
+ {{/if}}
+ {{/if}}
+
+
+ {{/or}}
+
+
{{/each}}
-
+
\ No newline at end of file
diff --git a/src/templates/partials/block-output.hbs b/src/templates/partials/block-output.hbs
index 7af61336..956c5096 100644
--- a/src/templates/partials/block-output.hbs
+++ b/src/templates/partials/block-output.hbs
@@ -28,7 +28,7 @@
{{#if inheritance}}
- {{t "defined-in" }} {{inheritance.file}}:{{{line}}}
+ {{t "defined-in" }} {{> link-type type=inheritance.file withline=true }}
{{else}}
{{t "defined-in" }} {{../element.file}}:{{{line}}}
{{/if}}
diff --git a/src/templates/partials/block-property.hbs b/src/templates/partials/block-property.hbs
index e169989e..a3dfd17e 100644
--- a/src/templates/partials/block-property.hbs
+++ b/src/templates/partials/block-property.hbs
@@ -67,7 +67,7 @@
{{#if inheritance}}
- {{t "defined-in" }} {{inheritance.file}}:{{{line}}}
+ {{t "defined-in" }} {{> link-type type=inheritance.file withline=true }}
{{else}}
{{t "defined-in" }} {{../file}}:{{{line}}}
{{/if}}
diff --git a/src/templates/partials/injectable.hbs b/src/templates/partials/injectable.hbs
index 87413a55..f7cc9154 100644
--- a/src/templates/partials/injectable.hbs
+++ b/src/templates/partials/injectable.hbs
@@ -30,6 +30,15 @@
{{/if}}
+ {{#if injectable.extends}}
+
+
{{t "extends" }}
+
+
+ {{> link-type type=injectable.extends }}
+
+ {{/if}}
+
{{#if injectable.jsdoctags}}
{{t "example" }}
diff --git a/src/templates/partials/link-type.hbs b/src/templates/partials/link-type.hbs
index 1b83b438..aedf4e2d 100644
--- a/src/templates/partials/link-type.hbs
+++ b/src/templates/partials/link-type.hbs
@@ -1,5 +1,9 @@
{{#linkType type}}
- {{type.raw}}
+ {{#if withline}}
+ {{type.raw}}:{{{line}}}
+ {{else}}
+ {{type.raw}}
+ {{/if}}
{{else}}
{{type}}
{{/linkType}}
diff --git a/src/templates/partials/menu.hbs b/src/templates/partials/menu.hbs
index 2f0fd533..9d08577b 100644
--- a/src/templates/partials/menu.hbs
+++ b/src/templates/partials/menu.hbs
@@ -23,7 +23,7 @@ customElements.define('compodoc-menu', class extends HTMLElement {
{{#if customLogo}}
-
+
{{else}}
{{documentationMainName}}
diff --git a/src/utils/basic-type.util.ts b/src/utils/basic-type.util.ts
index b8da1e95..55df59cc 100644
--- a/src/utils/basic-type.util.ts
+++ b/src/utils/basic-type.util.ts
@@ -28,7 +28,7 @@ export class BasicTypeUtil {
* @param type The type to check
*/
public isJavascriptType(type: string): boolean {
- if (typeof type !== 'undefined') {
+ if (typeof type !== 'undefined' && type.toLowerCase) {
return type.toLowerCase() in BasicTypes;
} else {
return false;
@@ -41,7 +41,7 @@ export class BasicTypeUtil {
* @param type The type to check
*/
public isTypeScriptType(type: string): boolean {
- if (typeof type !== 'undefined') {
+ if (typeof type !== 'undefined' && type.toLowerCase) {
return type.toLowerCase() in BasicTypeScriptTypes;
} else {
return false;
diff --git a/src/utils/extends-merger.util.ts b/src/utils/extends-merger.util.ts
index 9c11426b..acb2680b 100644
--- a/src/utils/extends-merger.util.ts
+++ b/src/utils/extends-merger.util.ts
@@ -6,6 +6,7 @@ import Configuration from '../app/configuration';
export class ExtendsMerger {
private components;
private classes;
+ private injectables;
private static instance: ExtendsMerger;
private constructor() {}
@@ -19,117 +20,146 @@ export class ExtendsMerger {
public merge(deps) {
this.components = deps.components;
this.classes = deps.classes;
+ this.injectables = deps.injectables;
this.components.forEach(component => {
let ext;
if (typeof component.extends !== 'undefined') {
ext = this.findInDependencies(component.extends);
if (ext) {
- // From class to component
- if (typeof ext.methods !== 'undefined' && ext.methods.length > 0) {
- let newMethods = cloneDeep(ext.methods);
- newMethods = this.markInheritance(newMethods, ext);
- if (typeof component.methodsClass !== 'undefined') {
- component.methodsClass = [...component.methodsClass, ...newMethods];
+ let recursiveScanWithInheritance = cls => {
+ // From class to component
+ if (typeof cls.methods !== 'undefined' && cls.methods.length > 0) {
+ let newMethods = cloneDeep(cls.methods);
+ newMethods = this.markInheritance(newMethods, cls);
+ if (typeof component.methodsClass !== 'undefined') {
+ component.methodsClass = [...component.methodsClass, ...newMethods];
+ }
}
- }
- if (typeof ext.properties !== 'undefined' && ext.properties.length > 0) {
- let newProperties = cloneDeep(ext.properties);
- newProperties = this.markInheritance(newProperties, ext);
- if (typeof component.propertiesClass !== 'undefined') {
- component.propertiesClass = [
- ...component.propertiesClass,
- ...newProperties
- ];
+ if (typeof cls.properties !== 'undefined' && cls.properties.length > 0) {
+ let newProperties = cloneDeep(cls.properties);
+ newProperties = this.markInheritance(newProperties, cls);
+ if (typeof component.propertiesClass !== 'undefined') {
+ component.propertiesClass = [
+ ...component.propertiesClass,
+ ...newProperties
+ ];
+ }
}
- }
- // From component to component
- if (typeof ext.inputsClass !== 'undefined' && ext.inputsClass.length > 0) {
- let newInputs = cloneDeep(ext.inputsClass);
- newInputs = this.markInheritance(newInputs, ext);
- if (typeof component.inputsClass !== 'undefined') {
- component.inputsClass = [...component.inputsClass, ...newInputs];
+ // From component to component
+ if (typeof cls.inputsClass !== 'undefined' && cls.inputsClass.length > 0) {
+ let newInputs = cloneDeep(cls.inputsClass);
+ newInputs = this.markInheritance(newInputs, cls);
+ if (typeof component.inputsClass !== 'undefined') {
+ component.inputsClass = [...component.inputsClass, ...newInputs];
+ }
}
- }
- if (typeof ext.outputsClass !== 'undefined' && ext.outputsClass.length > 0) {
- let newOutputs = cloneDeep(ext.outputsClass);
- newOutputs = this.markInheritance(newOutputs, ext);
- if (typeof component.outputsClass !== 'undefined') {
- component.outputsClass = [...component.outputsClass, ...newOutputs];
+ if (
+ typeof cls.outputsClass !== 'undefined' &&
+ cls.outputsClass.length > 0
+ ) {
+ let newOutputs = cloneDeep(cls.outputsClass);
+ newOutputs = this.markInheritance(newOutputs, cls);
+ if (typeof component.outputsClass !== 'undefined') {
+ component.outputsClass = [...component.outputsClass, ...newOutputs];
+ }
}
- }
- if (typeof ext.methodsClass !== 'undefined' && ext.methodsClass.length > 0) {
- let newMethods = cloneDeep(ext.methodsClass);
- newMethods = this.markInheritance(newMethods, ext);
- if (typeof component.methodsClass !== 'undefined') {
- component.methodsClass = [...component.methodsClass, ...newMethods];
+ if (
+ typeof cls.methodsClass !== 'undefined' &&
+ cls.methodsClass.length > 0
+ ) {
+ let newMethods = cloneDeep(cls.methodsClass);
+ newMethods = this.markInheritance(newMethods, cls);
+ if (typeof component.methodsClass !== 'undefined') {
+ component.methodsClass = [...component.methodsClass, ...newMethods];
+ }
}
- }
- if (
- typeof ext.propertiesClass !== 'undefined' &&
- ext.propertiesClass.length > 0
- ) {
- let newProperties = cloneDeep(ext.propertiesClass);
- newProperties = this.markInheritance(newProperties, ext);
- if (typeof component.propertiesClass !== 'undefined') {
- component.propertiesClass = [
- ...component.propertiesClass,
- ...newProperties
- ];
+ if (
+ typeof cls.propertiesClass !== 'undefined' &&
+ cls.propertiesClass.length > 0
+ ) {
+ let newProperties = cloneDeep(cls.propertiesClass);
+ newProperties = this.markInheritance(newProperties, cls);
+ if (typeof component.propertiesClass !== 'undefined') {
+ component.propertiesClass = [
+ ...component.propertiesClass,
+ ...newProperties
+ ];
+ }
}
- }
- if (typeof ext.hostBindings !== 'undefined' && ext.hostBindings.length > 0) {
- let newHostBindings = cloneDeep(ext.hostBindings);
- newHostBindings = this.markInheritance(newHostBindings, ext);
- if (typeof component.hostBindings !== 'undefined') {
- component.hostBindings = [
- ...component.hostBindings,
- ...newHostBindings
- ];
+ if (
+ typeof cls.hostBindings !== 'undefined' &&
+ cls.hostBindings.length > 0
+ ) {
+ let newHostBindings = cloneDeep(cls.hostBindings);
+ newHostBindings = this.markInheritance(newHostBindings, cls);
+ if (typeof component.hostBindings !== 'undefined') {
+ component.hostBindings = [
+ ...component.hostBindings,
+ ...newHostBindings
+ ];
+ }
}
- }
- if (typeof ext.hostListeners !== 'undefined' && ext.hostListeners.length > 0) {
- let newHostListeners = cloneDeep(ext.hostListeners);
- newHostListeners = this.markInheritance(newHostListeners, ext);
- if (typeof component.hostListeners !== 'undefined') {
- component.hostListeners = [
- ...component.hostListeners,
- ...newHostListeners
- ];
+ if (
+ typeof cls.hostListeners !== 'undefined' &&
+ cls.hostListeners.length > 0
+ ) {
+ let newHostListeners = cloneDeep(cls.hostListeners);
+ newHostListeners = this.markInheritance(newHostListeners, cls);
+ if (typeof component.hostListeners !== 'undefined') {
+ component.hostListeners = [
+ ...component.hostListeners,
+ ...newHostListeners
+ ];
+ }
}
- }
- if (Configuration.mainData.disableLifeCycleHooks) {
- component.methodsClass = cleanLifecycleHooksFromMethods(
- component.methodsClass
- );
- }
+ if (Configuration.mainData.disableLifeCycleHooks) {
+ component.methodsClass = cleanLifecycleHooksFromMethods(
+ component.methodsClass
+ );
+ }
+ if (cls.extends) {
+ recursiveScanWithInheritance(this.findInDependencies(cls.extends));
+ }
+ };
+ // From class to class
+ recursiveScanWithInheritance(ext);
}
}
});
- this.classes.forEach(cla => {
+ const mergeExtendedClasses = el => {
let ext;
- if (typeof cla.extends !== 'undefined') {
- ext = this.findInDependencies(cla.extends);
+ if (typeof el.extends !== 'undefined') {
+ ext = this.findInDependencies(el.extends);
if (ext) {
- // From class to class
- if (typeof ext.methods !== 'undefined' && ext.methods.length > 0) {
- let newMethods = cloneDeep(ext.methods);
- newMethods = this.markInheritance(newMethods, ext);
- if (typeof cla.methods !== 'undefined') {
- cla.methods = [...cla.methods, ...newMethods];
+ let recursiveScanWithInheritance = cls => {
+ if (typeof cls.methods !== 'undefined' && cls.methods.length > 0) {
+ let newMethods = cloneDeep(cls.methods);
+ newMethods = this.markInheritance(newMethods, cls);
+ if (typeof el.methods !== 'undefined') {
+ el.methods = [...el.methods, ...newMethods];
+ }
}
- }
- if (typeof ext.properties !== 'undefined' && ext.properties.length > 0) {
- let newProperties = cloneDeep(ext.properties);
- newProperties = this.markInheritance(newProperties, ext);
- if (typeof cla.properties !== 'undefined') {
- cla.properties = [...cla.properties, ...newProperties];
+ if (typeof cls.properties !== 'undefined' && cls.properties.length > 0) {
+ let newProperties = cloneDeep(cls.properties);
+ newProperties = this.markInheritance(newProperties, cls);
+ if (typeof el.properties !== 'undefined') {
+ el.properties = [...el.properties, ...newProperties];
+ }
}
- }
+ if (cls.extends) {
+ recursiveScanWithInheritance(this.findInDependencies(cls.extends));
+ }
+ };
+ // From elss to elss
+ recursiveScanWithInheritance(ext);
}
}
- });
+ };
+
+ this.classes.forEach(mergeExtendedClasses);
+ this.injectables.forEach(mergeExtendedClasses);
return deps;
}
@@ -145,7 +175,7 @@ export class ExtendsMerger {
}
private findInDependencies(name: string) {
- let mergedData = concat([], this.components, this.classes);
+ let mergedData = concat([], this.components, this.classes, this.injectables);
let result = find(mergedData, { name: name } as any);
return result || false;
}
diff --git a/src/utils/object-literal-expression.util.ts b/src/utils/object-literal-expression.util.ts
index 8d3ac77c..9d916bc3 100644
--- a/src/utils/object-literal-expression.util.ts
+++ b/src/utils/object-literal-expression.util.ts
@@ -11,6 +11,10 @@ export function StringifyObjectLiteralExpression(ole) {
if (property.initializer) {
if (property.initializer.kind === SyntaxKind.StringLiteral) {
returnedString += `'` + property.initializer.text + `'`;
+ } else if (property.initializer.kind === SyntaxKind.TrueKeyword) {
+ returnedString += `true`;
+ } else if (property.initializer.kind === SyntaxKind.FalseKeyword) {
+ returnedString += `false`;
} else {
returnedString += property.initializer.text;
}
diff --git a/test/saucelabs/mocha.spec.ts b/test/saucelabs/mocha.spec.ts
index 8797b7a0..44080d87 100644
--- a/test/saucelabs/mocha.spec.ts
+++ b/test/saucelabs/mocha.spec.ts
@@ -7,10 +7,10 @@ const request = require('request');
let username = process.env.SAUCE_USERNAME;
let accessKey = process.env.SAUCE_ACCESS_KEY;
let capabilities: any = {
- 'platform': 'WIN7'
+ platform: 'WIN7'
};
let server = '';
-let startDriver = function (cb, pageUrl) {
+let startDriver = function(cb, pageUrl) {
if (process.env.MODE_LOCAL === '0') {
capabilities.username = username;
capabilities.accessKey = accessKey;
@@ -32,15 +32,15 @@ let startDriver = function (cb, pageUrl) {
.usingServer(server)
.build();
- driver.getSession().then(function (sessionid) {
+ driver.getSession().then(function(sessionid) {
driver.sessionID = sessionid.id_;
});
- driver.get(pageUrl).then(function () {
+ driver.get(pageUrl).then(function() {
cb();
});
};
-let handleStatus = function (tests) {
+let handleStatus = function(tests) {
let status = false;
for (let i = 0; i < tests.length; i++) {
if (tests[i].state === 'passed') {
@@ -49,36 +49,43 @@ let handleStatus = function (tests) {
}
return status;
};
-let writeScreenshot = function (data, name) {
- fs.writeFile('out.png', data, 'base64', function (err) {
- if (err) { console.log(err); }
+let writeScreenshot = function(data, name) {
+ fs.writeFile('out.png', data, 'base64', function(err) {
+ if (err) {
+ console.log(err);
+ }
});
};
-let endTests = function (context, cb) {
+let endTests = function(context, cb) {
if (process.env.MODE_LOCAL === '0') {
let result = handleStatus(context.test.parent.tests);
- request({
- method: 'PUT',
- uri: `https://${process.env.SAUCE_USERNAME}:${process.env.SAUCE_ACCESS_KEY}@saucelabs.com/rest/v1/${process.env.SAUCE_USERNAME}/jobs/${driver.sessionID}`,
- json: {
- passed: result
+ request(
+ {
+ method: 'PUT',
+ uri: `https://${process.env.SAUCE_USERNAME}:${
+ process.env.SAUCE_ACCESS_KEY
+ }@saucelabs.com/rest/v1/${process.env.SAUCE_USERNAME}/jobs/${driver.sessionID}`,
+ json: {
+ passed: result
+ }
+ },
+ function(error, response, body) {
+ driver.quit().then(cb);
}
- }, function (error, response, body) {
- driver.quit().then(cb);
- });
+ );
} else {
driver.quit().then(cb);
}
};
-let testSearchBarWithResults = function (cb) {
+let testSearchBarWithResults = function(cb) {
let searchBox;
driver
.findElements(webdriver.By.xpath("//div[@id='book-search-input']/input"))
- .then(function (elems) {
+ .then(function(elems) {
searchBox = elems[1]; // First one is the mobile one hidden;
searchBox.sendKeys('exampleInput');
driver.sleep(1000).then(function() {
- searchBox.getAttribute('value').then(function (value) {
+ searchBox.getAttribute('value').then(function(value) {
expect(value).to.equal('exampleInput');
/*driver.takeScreenshot().then(function (data) {
@@ -88,7 +95,7 @@ let testSearchBarWithResults = function (cb) {
driver.sleep(1000).then(function() {
driver
.findElements(webdriver.By.className('search-results-item'))
- .then(function (elems) {
+ .then(function(elems) {
expect(elems.length).to.equal(1);
driver.sleep(1000).then(function() {
cb();
@@ -99,22 +106,22 @@ let testSearchBarWithResults = function (cb) {
});
});
};
-let testSearchBarWithNoResults = function (cb) {
+let testSearchBarWithNoResults = function(cb) {
let searchBox;
driver
.findElements(webdriver.By.xpath("//div[@id='book-search-input']/input"))
- .then(function (elems) {
+ .then(function(elems) {
searchBox = elems[1]; // First one is the mobile one hidden;
searchBox.clear();
driver.sleep(1000).then(function() {
searchBox.sendKeys('waza');
driver.sleep(1000).then(function() {
- searchBox.getAttribute('value').then(function (value) {
+ searchBox.getAttribute('value').then(function(value) {
expect(value).to.equal('waza');
driver.sleep(4000).then(function() {
driver
.findElements(webdriver.By.className('search-results-item'))
- .then(function (elems1) {
+ .then(function(elems1) {
expect(elems1.length).to.equal(0);
driver.sleep(1000).then(function() {
cb();
@@ -132,67 +139,62 @@ let driver;
* WIN 10
*/
-describe('WIN 10 | Edge | Compodoc page', function () {
- before(function (done) {
+describe('WIN 10 | Edge 18 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 10';
capabilities.browserName = 'MicrosoftEdge';
- capabilities.version = '17.17134';
+ capabilities.version = '18.17763';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
-describe('WIN 10 | Edge | Compodoc page', function () {
- before(function (done) {
+describe('WIN 10 | Edge 17 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 10';
capabilities.browserName = 'MicrosoftEdge';
- capabilities.version = '16.16299';
+ capabilities.version = '17.17134';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
-describe('WIN 10 | Firefox | Compodoc page', function () {
-
- before(function (done) {
+describe('WIN 10 | Edge 16 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 10';
- capabilities.browserName = 'firefox';
- capabilities.version = '60.0';
-
+ capabilities.browserName = 'MicrosoftEdge';
+ capabilities.version = '16.16299';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
-
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
-
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
-
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
@@ -218,27 +220,98 @@ describe('WIN 10 | IE | Compodoc page', function () {
});
});*/
-describe('WIN 10 | Chrome | Compodoc page', function () {
+describe('WIN 10 | Firefox 65 | Compodoc page', function() {
+ before(function(done) {
+ capabilities.platform = 'Windows 10';
+ capabilities.browserName = 'firefox';
+ capabilities.version = '65.0';
- before(function (done) {
+ startDriver(done, 'http://localhost:4000/components/FooComponent.html');
+ });
+
+ // Test search bar
+ it('should have a search bar, and handle results', function(done) {
+ testSearchBarWithResults(done);
+ });
+
+ it('should have a search bar, and handle results empty', function(done) {
+ testSearchBarWithNoResults(done);
+ });
+
+ // TODO : test routing
+ after(function(done) {
+ endTests(this, done);
+ });
+});
+
+describe('WIN 10 | Firefox 62 | Compodoc page', function() {
+ before(function(done) {
+ capabilities.platform = 'Windows 10';
+ capabilities.browserName = 'firefox';
+ capabilities.version = '62.0';
+
+ startDriver(done, 'http://localhost:4000/components/FooComponent.html');
+ });
+
+ // Test search bar
+ it('should have a search bar, and handle results', function(done) {
+ testSearchBarWithResults(done);
+ });
+
+ it('should have a search bar, and handle results empty', function(done) {
+ testSearchBarWithNoResults(done);
+ });
+
+ // TODO : test routing
+ after(function(done) {
+ endTests(this, done);
+ });
+});
+
+describe('WIN 10 | Chrome 72 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 10';
capabilities.browserName = 'chrome';
- capabilities.version = '66.0';
+ capabilities.version = '72.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
+ endTests(this, done);
+ });
+});
+
+describe('WIN 10 | Chrome 48 | Compodoc page', function() {
+ before(function(done) {
+ capabilities.platform = 'Windows 10';
+ capabilities.browserName = 'chrome';
+ capabilities.version = '48.0';
+
+ startDriver(done, 'http://localhost:4000/components/FooComponent.html');
+ });
+
+ // Test search bar
+ it('should have a search bar, and handle results', function(done) {
+ testSearchBarWithResults(done);
+ });
+
+ it('should have a search bar, and handle results empty', function(done) {
+ testSearchBarWithNoResults(done);
+ });
+
+ // TODO : test routing
+ after(function(done) {
endTests(this, done);
});
});
@@ -247,52 +320,50 @@ describe('WIN 10 | Chrome | Compodoc page', function () {
* WIN 8
*/
-describe('WIN 8 | Chrome | Compodoc page', function () {
-
- before(function (done) {
+describe('WIN 8 | Chrome 72 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 8';
capabilities.browserName = 'chrome';
- capabilities.version = '66.0';
+ capabilities.version = '72.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
-describe('WIN 8 | Firefox | Compodoc page', function () {
-
- before(function (done) {
+describe('WIN 8 | Firefox 65 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 8';
capabilities.browserName = 'firefox';
- capabilities.version = '60.0';
+ capabilities.version = '65.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
@@ -301,35 +372,34 @@ describe('WIN 8 | Firefox | Compodoc page', function () {
* WIN 7
*/
-describe('WIN 7 | Chrome | Compodoc page', function () {
-
- before(function (done) {
+describe('WIN 7 | Chrome 72 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Windows 7';
capabilities.browserName = 'chrome';
- capabilities.version = '66.0';
+ capabilities.version = '72.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
-describe('WIN 7 | Firefox | Compodoc page', function() {
+describe('WIN 7 | Firefox 65 | Compodoc page', function() {
before(function(done) {
capabilities.browserName = 'firefox';
- capabilities.version = '60.0';
+ capabilities.version = '65.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
@@ -345,7 +415,6 @@ describe('WIN 7 | Firefox | Compodoc page', function() {
});
});
-
/*describe('WIN 7 | IE | Compodoc page', function() {
before(function(done) {
capabilities.browserName = 'internet explorer';
@@ -370,9 +439,8 @@ describe('WIN 7 | Firefox | Compodoc page', function() {
* LINUX
*/
-describe('Linux | Firefox | Compodoc page', function () {
-
- before(function (done) {
+describe('Linux | Firefox 45 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Linux';
capabilities.browserName = 'firefox';
capabilities.version = '45.0';
@@ -381,23 +449,22 @@ describe('Linux | Firefox | Compodoc page', function () {
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
-describe('Linux | Chrome | Compodoc page', function () {
-
- before(function (done) {
+describe('Linux | Chrome 48 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'Linux';
capabilities.browserName = 'chrome';
capabilities.version = '48.0';
@@ -406,16 +473,16 @@ describe('Linux | Chrome | Compodoc page', function () {
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
@@ -424,7 +491,7 @@ describe('Linux | Chrome | Compodoc page', function () {
* Mac High Sierra
*/
-describe('Mac High Sierra | Safari | Compodoc page', function() {
+describe('Mac High Sierra | Safari 11.1 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'macOS 10.13';
capabilities.browserName = 'safari';
@@ -444,11 +511,11 @@ describe('Mac High Sierra | Safari | Compodoc page', function() {
});
});
-describe('Mac High Sierra | Firefox | Compodoc page', function() {
+describe('Mac High Sierra | Firefox 65 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'macOS 10.13';
capabilities.browserName = 'firefox';
- capabilities.version = '60.0';
+ capabilities.version = '65.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
@@ -464,11 +531,11 @@ describe('Mac High Sierra | Firefox | Compodoc page', function() {
});
});
-describe('Mac High Sierra | Chrome | Compodoc page', function() {
+describe('Mac High Sierra | Chrome 72 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'macOS 10.13';
capabilities.browserName = 'chrome';
- capabilities.version = '66.0';
+ capabilities.version = '72.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
@@ -488,7 +555,7 @@ describe('Mac High Sierra | Chrome | Compodoc page', function() {
* Mac Sierra
*/
-describe('Mac Sierra | Safari | Compodoc page', function() {
+describe('Mac Sierra | Safari 11 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'macOS 10.12';
capabilities.browserName = 'safari';
@@ -508,12 +575,11 @@ describe('Mac Sierra | Safari | Compodoc page', function() {
});
});
-describe('Mac Sierra | Firefox | Compodoc page', function() {
-
+describe('Mac Sierra | Firefox 65 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'macOS 10.12';
capabilities.browserName = 'firefox';
- capabilities.version = '60.0';
+ capabilities.version = '65.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
@@ -533,27 +599,26 @@ describe('Mac Sierra | Firefox | Compodoc page', function() {
});
});
-describe('Mac Sierra | Chrome | Compodoc page', function () {
-
- before(function (done) {
+describe('Mac Sierra | Chrome 72 | Compodoc page', function() {
+ before(function(done) {
capabilities.platform = 'macOS 10.12';
capabilities.browserName = 'chrome';
- capabilities.version = '66.0';
+ capabilities.version = '72.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
- it('should have a search bar, and handle results', function (done) {
+ it('should have a search bar, and handle results', function(done) {
testSearchBarWithResults(done);
});
- it('should have a search bar, and handle results empty', function (done) {
+ it('should have a search bar, and handle results empty', function(done) {
testSearchBarWithNoResults(done);
});
// TODO : test routing
- after(function (done) {
+ after(function(done) {
endTests(this, done);
});
});
@@ -562,7 +627,7 @@ describe('Mac Sierra | Chrome | Compodoc page', function () {
* Mac El Capitan
*/
-describe('Mac El Capitan | Safari | Compodoc page', function() {
+describe('Mac El Capitan | Safari 10 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'OS X 10.11';
capabilities.browserName = 'safari';
@@ -582,11 +647,11 @@ describe('Mac El Capitan | Safari | Compodoc page', function() {
});
});
-describe('Mac El Capitan | Chrome | Compodoc page', function() {
+describe('Mac El Capitan | Chrome 72 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'OS X 10.11';
capabilities.browserName = 'chrome';
- capabilities.version = '66.0';
+ capabilities.version = '72.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
@@ -602,11 +667,11 @@ describe('Mac El Capitan | Chrome | Compodoc page', function() {
});
});
-describe('Mac El Capitan | Firefox | Compodoc page', function() {
+describe('Mac El Capitan | Firefox 65 | Compodoc page', function() {
before(function(done) {
capabilities.platform = 'OS X 10.11';
capabilities.browserName = 'chrome';
- capabilities.version = '60.0';
+ capabilities.version = '65.0';
startDriver(done, 'http://localhost:4000/components/FooComponent.html');
});
// Test search bar
@@ -620,4 +685,4 @@ describe('Mac El Capitan | Firefox | Compodoc page', function() {
after(function(done) {
endTests(this, done);
});
-});
\ No newline at end of file
+});
diff --git a/test/src/cli/cli-coverage.spec.ts b/test/src/cli/cli-coverage.spec.ts
index 767ba66b..7e1a7efe 100644
--- a/test/src/cli/cli-coverage.spec.ts
+++ b/test/src/cli/cli-coverage.spec.ts
@@ -408,4 +408,39 @@ describe('CLI coverage report', () => {
expect(coverageFile).to.contain('variable ');
});
});
+
+ describe('coverage test per file command under with one file through --files', () => {
+ let stdoutString = undefined;
+ before(function(done) {
+ tmp.create(distFolder);
+ let ls = shell('node', [
+ './bin/index-cli.js',
+ '--files',
+ './test/src/sample-files/bar.directive.ts',
+ '--files',
+ './test/src/sample-files/bar.service.ts',
+ '--coverageMinimumPerFile',
+ '1',
+ '-d',
+ distFolder
+ ]);
+
+ if (ls.stderr.toString() !== '') {
+ console.error(`shell error: ${ls.stderr.toString()}`);
+ done('error');
+ }
+ stdoutString = ls.stdout.toString();
+ done();
+ });
+ after(() => tmp.clean(distFolder));
+
+ it('it should be under threshold for files', () => {
+ expect(stdoutString).to.contain(
+ 'test/src/sample-files/bar.directive.ts - BarDirective - under minimum per file'
+ );
+ expect(stdoutString).to.contain(
+ 'test/src/sample-files/bar.service.ts - BarService - under minimum per file'
+ );
+ });
+ });
});
diff --git a/test/src/cli/cli-custom-logo.spec.ts b/test/src/cli/cli-custom-logo.spec.ts
index 78ff36d7..647ceb26 100644
--- a/test/src/cli/cli-custom-logo.spec.ts
+++ b/test/src/cli/cli-custom-logo.spec.ts
@@ -11,7 +11,7 @@ describe('CLI custom logo', () => {
const distFolder = tmp.name + '-logo';
- describe('when specifying a custom logo', () => {
+ describe('when specifying a custom logo png image', () => {
before(function (done) {
tmp.create(distFolder);
let ls = shell('node', [
@@ -38,4 +38,54 @@ describe('CLI custom logo', () => {
});
});
+ describe('when specifying a custom logo svg image', () => {
+ before(function (done) {
+ tmp.create(distFolder);
+ let ls = shell('node', [
+ './bin/index-cli.js',
+ '-p', './test/src/todomvc-ng2/src/tsconfig.json',
+ '-d', distFolder,
+ '--customLogo', './test/src/todomvc-ng2/logo.svg']);
+
+ if (ls.stderr.toString() !== '') {
+ console.error(`shell error: ${ls.stderr.toString()}`);
+ done('error');
+ }
+
+ done();
+ });
+ after(() => tmp.clean(distFolder));
+
+ it('should have copied the customLogo', () => {
+ let isFileExists = exists(`${distFolder}/images/logo.svg`);
+ expect(isFileExists).to.be.true;
+ let originalFileSize = (stats('test/src/todomvc-ng2/logo.svg') as Image).size,
+ copiedFileSize = (stats(`${distFolder}/images/logo.svg`) as Image).size;
+ expect(originalFileSize).to.equal(copiedFileSize);
+ });
+ });
+
+ describe('when not specifying a custom logo svg image', () => {
+ before(function (done) {
+ tmp.create(distFolder);
+ let ls = shell('node', [
+ './bin/index-cli.js',
+ '-p', './test/src/todomvc-ng2/src/tsconfig.json',
+ '-d', distFolder
+ ]);
+
+ if (ls.stderr.toString() !== '') {
+ console.error(`shell error: ${ls.stderr.toString()}`);
+ done('error');
+ }
+
+ done();
+ });
+ after(() => tmp.clean(distFolder));
+
+ it('should not have copied the customLogo', () => {
+ let isFileExists = exists(`${distFolder}/images/logo.svg`);
+ expect(isFileExists).to.not.be.true;
+ });
+ });
});
\ No newline at end of file
diff --git a/test/src/cli/cli-disable-options.spec.ts b/test/src/cli/cli-disable-options.spec.ts
index 901ca04d..bdefbfe6 100644
--- a/test/src/cli/cli-disable-options.spec.ts
+++ b/test/src/cli/cli-disable-options.spec.ts
@@ -126,6 +126,11 @@ describe('CLI disable flags', () => {
it('should display lifecyle hooks', () => {
expect(componentFile).to.contain('ngOnInit');
});
+
+ it('correct supports @internal + link', () => {
+ let file = read(distFolder + '/directives/QueryParamNameDirective.html');
+ expect(file).to.contain('code>constructor(groupService: QueryParamGroupService');
+ });
});
describe('disabling excluding methods with --disableLifeCycleHooks', () => {
diff --git a/test/src/cli/cli-export.spec.ts b/test/src/cli/cli-export.spec.ts
index 8a6516b9..e6283da3 100644
--- a/test/src/cli/cli-export.spec.ts
+++ b/test/src/cli/cli-export.spec.ts
@@ -1,23 +1,26 @@
import * as chai from 'chai';
-import {temporaryDir, shell, pkg, exists, exec, read, shellAsync} from '../helpers';
+import { exists, read, readPDF, shell, temporaryDir } from '../helpers';
+const fs = require('fs-extra');
const expect = chai.expect,
- tmp = temporaryDir();
+ tmp = temporaryDir();
describe('CLI Export', () => {
-
const distFolder = tmp.name + '-export';
describe('when specified JSON', () => {
-
let stdoutString = undefined;
- before(function (done) {
+ before(function(done) {
tmp.create(distFolder);
let ls = shell('node', [
'./bin/index-cli.js',
- '-p', './test/src/todomvc-ng2/src/tsconfig.json',
- '-d', distFolder,
- '-e', 'json']);
+ '-p',
+ './test/src/todomvc-ng2/src/tsconfig.json',
+ '-d',
+ distFolder,
+ '-e',
+ 'json'
+ ]);
if (ls.stderr.toString() !== '') {
console.error(`shell error: ${ls.stderr.toString()}`);
@@ -55,17 +58,68 @@ describe('CLI Export', () => {
});
});
- describe('when specified not supported format', () => {
+ describe('when specified PDF', () => {
+ let stdoutString = undefined;
+
+ const title = 'Documentation in pdf';
+
+ before(function(done) {
+ tmp.create(distFolder);
+ let ls = shell('node', [
+ './bin/index-cli.js',
+ '-p',
+ './test/src/todomvc-ng2/src/tsconfig.json',
+ '-d',
+ distFolder,
+ '-n',
+ title,
+ '-e',
+ 'pdf'
+ ]);
+
+ if (ls.stderr.toString() !== '') {
+ console.error(`shell error: ${ls.stderr.toString()}`);
+ done('error');
+ }
+ stdoutString = ls.stdout.toString();
+ done();
+ });
+ after(() => tmp.clean(distFolder));
+
+ it('should display generated message', () => {
+ expect(stdoutString).to.contain('Documentation generated');
+ });
+ it('should create pdf file', () => {
+ let isFileExists = exists(`${distFolder}/documentation.pdf`);
+ expect(isFileExists).to.be.true;
+ });
+
+ it('pdf file should have some data', () => {
+ let pdfDataBuffer = fs.readFileSync(`${distFolder}/documentation.pdf`);
+ return readPDF(pdfDataBuffer).then(function(data) {
+ // console.log(data);
+ expect(data.text).to.contain(
+ 'AboutModule\nFilename : test/src/todomvc-ng2/src/app/about/about.module.ts'
+ );
+ });
+ });
+ });
+
+ describe('when specified not supported format', () => {
let stdoutString = undefined;
- before(function (done) {
+ before(function(done) {
tmp.create();
let ls = shell('node', [
'./bin/index-cli.js',
- '-p', './test/src/todomvc-ng2/src/tsconfig.json',
- '-d', distFolder,
- '-e', 'xml']);
+ '-p',
+ './test/src/todomvc-ng2/src/tsconfig.json',
+ '-d',
+ distFolder,
+ '-e',
+ 'xml'
+ ]);
if (ls.stderr.toString() !== '') {
console.error(`shell error: ${ls.stderr.toString()}`);
@@ -80,5 +134,4 @@ describe('CLI Export', () => {
expect(stdoutString).to.contain('Exported format not supported');
});
});
-
});
diff --git a/test/src/cli/cli-extends.spec.ts b/test/src/cli/cli-extends.spec.ts
index 72991dc4..8ea339cf 100644
--- a/test/src/cli/cli-extends.spec.ts
+++ b/test/src/cli/cli-extends.spec.ts
@@ -43,4 +43,17 @@ describe('CLI simple generation - extends app', () => {
expect(myInitialClassFile).to.contain('meh');
expect(myInitialClassFile).to.contain('myproperty');
});
+
+ it('FirstClass extends BSecondClass extends AThirdClass', () => {
+ const FirstClassFile = read(`${distFolder}/classes/FirstClass.html`);
+ expect(FirstClassFile).to.contain('BSecondClass:4');
+ expect(FirstClassFile).to.contain('AThirdClass:2');
+ });
+
+ it('CharactersService extends AbstractService', () => {
+ let file = read(distFolder + '/injectables/CharactersService.html');
+ expect(file).to.contain(
+ 'code>AbstractService'
+ );
+ });
});
diff --git a/test/src/cli/cli-generation-big-app.spec.ts b/test/src/cli/cli-generation-big-app.spec.ts
index 3848d324..f3e8bcc4 100644
--- a/test/src/cli/cli-generation-big-app.spec.ts
+++ b/test/src/cli/cli-generation-big-app.spec.ts
@@ -700,7 +700,7 @@ describe('CLI simple generation - big app', () => {
it('should support Type parameters', () => {
let file = read(distFolder + '/components/AppComponent.html');
expect(file).to.contain(
- `\n - T
\n - K
\n
`
+ `\n - T
\n - K
\n
`
);
});
@@ -774,4 +774,14 @@ describe('CLI simple generation - big app', () => {
let file = read(distFolder + '/classes/Todo.html');
expect(file).to.contain('() => {...}
');
});
+
+ it('correct supports 1000 as PollingSpeed for decorator arguments', () => {
+ let file = read(distFolder + '/classes/SomeFeature.html');
+ expect(file).to.contain('code>@throttle(1000 as PollingSpeed');
+ });
+
+ it('correct supports JSdoc without comment for accessor', () => {
+ let file = read(distFolder + '/classes/Tidi.html');
+ expect(file).to.contain('b>emailAddress');
+ });
});
diff --git a/test/src/cli/cli-options.spec.ts b/test/src/cli/cli-options.spec.ts
index 8d6996e1..b5d549a4 100644
--- a/test/src/cli/cli-options.spec.ts
+++ b/test/src/cli/cli-options.spec.ts
@@ -1,13 +1,12 @@
import * as chai from 'chai';
const expect = chai.expect;
-import {shell, pkg} from '../helpers';
+import { shell, pkg } from '../helpers';
describe('CLI Options', () => {
-
let runHelp = undefined;
- before( () => {
+ before(() => {
runHelp = shell('node', ['./bin/index-cli.js', '-h']);
});
@@ -21,7 +20,6 @@ describe('CLI Options', () => {
});
describe('should display options in help', () => {
-
it(`-p`, () => {
expect(runHelp.stdout.toString()).to.contain('-p, --tsconfig [config]');
expect(runHelp.stdout.toString()).to.contain('A tsconfig.json file');
@@ -29,7 +27,9 @@ describe('CLI Options', () => {
it(`-d`, () => {
expect(runHelp.stdout.toString()).to.contain('-d, --output [folder]');
- expect(runHelp.stdout.toString()).to.contain('Where to store the generated documentation');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Where to store the generated documentation'
+ );
});
it(`-y`, () => {
@@ -39,7 +39,9 @@ describe('CLI Options', () => {
it(`--theme`, () => {
expect(runHelp.stdout.toString()).to.contain('--theme [theme]');
- expect(runHelp.stdout.toString()).to.contain('Choose one of available themes, default is \'gitbook\' (laravel, original, material, postmark, readthedocs, stripe, vagrant)');
+ expect(runHelp.stdout.toString()).to.contain(
+ "Choose one of available themes, default is 'gitbook' (laravel, original, material, postmark, readthedocs, stripe, vagrant)"
+ );
});
it(`-n`, () => {
@@ -49,7 +51,9 @@ describe('CLI Options', () => {
it(`-a`, () => {
expect(runHelp.stdout.toString()).to.contain('-a, --assetsFolder [folder]');
- expect(runHelp.stdout.toString()).to.contain('External assets folder to copy in generated documentation folder');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'External assets folder to copy in generated documentation folder'
+ );
});
it(`-o`, () => {
@@ -59,7 +63,9 @@ describe('CLI Options', () => {
it(`-t`, () => {
expect(runHelp.stdout.toString()).to.contain('-t, --silent');
- expect(runHelp.stdout.toString()).to.contain('In silent mode, log messages aren\'t logged in the console');
+ expect(runHelp.stdout.toString()).to.contain(
+ "In silent mode, log messages aren't logged in the console"
+ );
});
it(`-s`, () => {
@@ -74,51 +80,70 @@ describe('CLI Options', () => {
it(`-w`, () => {
expect(runHelp.stdout.toString()).to.contain('-w, --watch');
- expect(runHelp.stdout.toString()).to.contain('Watch source files after serve and force documentation rebuild');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Watch source files after serve and force documentation rebuild'
+ );
});
it(`-e`, () => {
expect(runHelp.stdout.toString()).to.contain('-e, --exportFormat [format]');
- expect(runHelp.stdout.toString()).to.contain('Export in specified format (json, html)');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Export in specified format (json, html, pdf)'
+ );
});
it(`--hideGenerator`, () => {
expect(runHelp.stdout.toString()).to.contain('--hideGenerator');
- expect(runHelp.stdout.toString()).to.contain('Do not print the Compodoc link at the bottom of the page');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Do not print the Compodoc link at the bottom of the page'
+ );
});
it(`--navTabConfig`, () => {
expect(runHelp.stdout.toString()).to.contain('--navTabConfig');
expect(runHelp.stdout.toString()).to.contain(
-`List navigation tab objects in the desired order with two string properties ("id" and "label"). \
+ `List navigation tab objects in the desired order with two string properties ("id" and "label"). \
Double-quotes must be escaped with '\\'. \
Available tab IDs are "info", "readme", "source", "templateData", "styleData", "tree", and "example". \
-Note: Certain tabs will only be shown if applicable to a given dependency`);
+Note: Certain tabs will only be shown if applicable to a given dependency`
+ );
});
it(`--includes`, () => {
expect(runHelp.stdout.toString()).to.contain('--includes [path]');
- expect(runHelp.stdout.toString()).to.contain('Path of external markdown files to include');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Path of external markdown files to include'
+ );
});
it(`--includesName`, () => {
expect(runHelp.stdout.toString()).to.contain('--includesName [name]');
- expect(runHelp.stdout.toString()).to.contain('Name of item menu of externals markdown files');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Name of item menu of externals markdown files'
+ );
});
it(`--coverageTest`, () => {
expect(runHelp.stdout.toString()).to.contain('--coverageTest');
- expect(runHelp.stdout.toString()).to.contain('Test command of documentation coverage with a threshold');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Test command of documentation coverage with a threshold'
+ );
});
it(`--coverageMinimumPerFile`, () => {
expect(runHelp.stdout.toString()).to.contain('--coverageMinimumPerFile');
- expect(runHelp.stdout.toString()).to.contain('Test command of documentation coverage per file with a minimum (default 0)');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Test command of documentation coverage per file with a minimum (default 0)'
+ );
});
it(`--coverageTestThresholdFail`, () => {
- expect(runHelp.stdout.toString()).to.contain('--coverageTestThresholdFail [true|false]');
- expect(runHelp.stdout.toString()).to.contain('Test command of documentation coverage (global or per file) will fail with error or just warn user (true: error, false: warn)');
+ expect(runHelp.stdout.toString()).to.contain(
+ '--coverageTestThresholdFail [true|false]'
+ );
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Test command of documentation coverage (global or per file) will fail with error or just warn user (true: error, false: warn)'
+ );
});
it(`--disableSourceCode`, () => {
@@ -143,27 +168,37 @@ Note: Certain tabs will only be shown if applicable to a given dependency`);
it(`--disableCoverage`, () => {
expect(runHelp.stdout.toString()).to.contain('--disableCoverage');
- expect(runHelp.stdout.toString()).to.contain('Do not add the documentation coverage report');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Do not add the documentation coverage report'
+ );
});
it(`--disablePrivate`, () => {
expect(runHelp.stdout.toString()).to.contain('--disablePrivate');
- expect(runHelp.stdout.toString()).to.contain('Do not show private in generated documentation');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Do not show private in generated documentation'
+ );
});
it(`--disableProtected`, () => {
expect(runHelp.stdout.toString()).to.contain('--disableProtected');
- expect(runHelp.stdout.toString()).to.contain('Do not show protected in generated documentation');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Do not show protected in generated documentation'
+ );
});
it(`--disableInternal`, () => {
expect(runHelp.stdout.toString()).to.contain('--disableInternal');
- expect(runHelp.stdout.toString()).to.contain('Do not show @internal in generated documentation');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Do not show @internal in generated documentation'
+ );
});
it(`--disableLifeCycleHooks`, () => {
expect(runHelp.stdout.toString()).to.contain('--disableLifeCycleHooks');
- expect(runHelp.stdout.toString()).to.contain('Do not show Angular lifecycle hooks in generated documentation');
+ expect(runHelp.stdout.toString()).to.contain(
+ 'Do not show Angular lifecycle hooks in generated documentation'
+ );
});
it(`--customFavicon`, () => {
@@ -175,7 +210,5 @@ Note: Certain tabs will only be shown if applicable to a given dependency`);
expect(runHelp.stdout.toString()).to.contain('--customLogo [path]');
expect(runHelp.stdout.toString()).to.contain('Use a custom logo');
});
-
});
-
});
diff --git a/test/src/helpers.ts b/test/src/helpers.ts
index 3490dac5..7d9cb009 100644
--- a/test/src/helpers.ts
+++ b/test/src/helpers.ts
@@ -1,3 +1,5 @@
+const PDFJS = require('pdfjs-dist');
+
export const shell = require('child_process').spawnSync;
export const spawn = require('child_process').spawn;
export const exec = require('child_process').exec;
@@ -28,11 +30,11 @@ export function copy(source: string, dest: string): boolean {
export function temporaryDir() {
let name = '.tmp-compodoc-test';
- let cleanUp = (cleanUpName) => {
- if( fs.existsSync(cleanUpName) ) {
- fs.readdirSync(cleanUpName).forEach((file) => {
+ let cleanUp = cleanUpName => {
+ if (fs.existsSync(cleanUpName)) {
+ fs.readdirSync(cleanUpName).forEach(file => {
const curdir = path.join(cleanUpName, file);
- if(fs.statSync(curdir).isDirectory()) {
+ if (fs.statSync(curdir).isDirectory()) {
cleanUp(curdir);
} else {
fs.unlinkSync(curdir);
@@ -62,3 +64,139 @@ export function temporaryDir() {
}
};
}
+
+interface PdfResult {
+ numpages: number;
+ numrender: number;
+ info: any;
+ metadata: any;
+ text: string;
+ version: any;
+}
+
+/**
+ * Copyright https://gitlab.com/autokent/pdf-parse , converted to ES6 promise for Node.js 6 support
+ */
+export function readPDF(dataBuffer, options?): Promise {
+ let isDebugMode = false;
+
+ let ret = {
+ numpages: 0,
+ numrender: 0,
+ info: null,
+ metadata: null,
+ text: '',
+ version: null
+ };
+
+ function render_page(pageData) {
+ let render_options = {
+ //replaces all occurrences of whitespace with standard spaces (0x20). The default value is `false`.
+ normalizeWhitespace: false,
+ //do not attempt to combine same line TextItem's. The default value is `false`.
+ disableCombineTextItems: false
+ };
+
+ return pageData.getTextContent(render_options).then(function(textContent) {
+ let lastY,
+ text = '';
+ for (let item of textContent.items) {
+ if (lastY == item.transform[5] || !lastY) {
+ text += item.str;
+ } else {
+ text += '\n' + item.str;
+ }
+ lastY = item.transform[5];
+ }
+ return text;
+ });
+ }
+
+ const DEFAULT_OPTIONS = {
+ pagerender: render_page,
+ max: 0,
+ version: 'v2.1.266'
+ };
+
+ if (typeof options === 'undefined') {
+ options = DEFAULT_OPTIONS;
+ }
+ if (typeof options.pagerender !== 'function') {
+ options.pagerender = DEFAULT_OPTIONS.pagerender;
+ }
+ if (typeof options.max !== 'number') {
+ options.max = DEFAULT_OPTIONS.max;
+ }
+ if (typeof options.version !== 'string') {
+ options.version = DEFAULT_OPTIONS.version;
+ }
+ if (options.version === 'default') {
+ options.version = DEFAULT_OPTIONS.version;
+ }
+
+ ret.version = PDFJS.version;
+
+ // Disable workers to avoid yet another cross-origin issue (workers need
+ // the URL of the script to be loaded, and dynamically loading a cross-origin
+ // script does not work).
+ PDFJS.disableWorker = true;
+ let doc;
+
+ return new Promise((resolve, reject) => {
+ PDFJS.getDocument(dataBuffer)
+ .then(document => {
+ doc = document;
+ ret.numpages = doc.numPages;
+
+ let metaData;
+
+ doc.getMetadata()
+ .then(metadata => {
+ metaData = metadata;
+ ret.info = metaData ? metaData.info : undefined;
+ ret.metadata = metaData ? metaData.metadata : undefined;
+
+ let counter = options.max <= 0 ? doc.numPages : options.max;
+ counter = counter > doc.numPages ? doc.numPages : counter;
+
+ ret.text = '';
+
+ let i = 1;
+
+ let loop = () => {
+ return new Promise((resolveRead, rejectRead) => {
+ if (i <= counter) {
+ doc.getPage(i)
+ .then(pageData => options.pagerender(pageData))
+ .then(pageText => {
+ i++;
+ ret.text = `${ret.text}\n\n${pageText}`;
+ resolveRead(loop());
+ })
+ .catch(err => {
+ rejectRead(err);
+ });
+ } else {
+ resolveRead();
+ }
+ });
+ };
+ loop()
+ .then(() => {
+ ret.numrender = counter;
+ doc.destroy();
+ resolve(ret);
+ })
+ .catch(function(err) {
+ reject(err);
+ });
+ })
+ .catch(function(err) {
+ reject(err);
+ });
+ })
+ .catch(err => {
+ reject(err);
+ });
+ });
+}
diff --git a/test/src/sample-files-extends/src/app/abstract.service.ts b/test/src/sample-files-extends/src/app/abstract.service.ts
new file mode 100644
index 00000000..4f5bec26
--- /dev/null
+++ b/test/src/sample-files-extends/src/app/abstract.service.ts
@@ -0,0 +1,30 @@
+import { Injectable } from '@angular/core';
+import { Response } from '@angular/http';
+
+import { API_ENDPOINT } from '../../../environments/environment';
+
+@Injectable()
+export abstract class AbstractService {
+ protected ENDPOINT: string;
+ protected WS_ENDPOINT: string;
+
+ parentProperty: string;
+
+ constructor() {
+ this.ENDPOINT = `https://${API_ENDPOINT}`;
+ this.WS_ENDPOINT = `wss://${API_ENDPOINT}front`;
+ }
+
+ protected handleError(error: Response | any): Promise {
+ let errMsg: string;
+ if (error instanceof Response) {
+ const body = error.json() || '';
+ const err = body.error || JSON.stringify(body);
+ errMsg = `${error.status} - ${error.statusText || ''} ${err}`;
+ } else {
+ errMsg = error.message ? error.message : error.toString();
+ }
+ console.error(errMsg);
+ return Promise.reject(errMsg);
+ }
+}
diff --git a/test/src/sample-files-extends/src/app/characters.service.ts b/test/src/sample-files-extends/src/app/characters.service.ts
new file mode 100644
index 00000000..65029b3d
--- /dev/null
+++ b/test/src/sample-files-extends/src/app/characters.service.ts
@@ -0,0 +1,77 @@
+import { GameCharacterInterface } from './../models/characters.model';
+import { Http, Response } from '@angular/http';
+import { Injectable } from '@angular/core';
+
+import { AbstractService } from './abstract.service';
+import { ActionInterface } from '../models/action.model';
+
+@Injectable()
+export class CharactersService extends AbstractService {
+ /**
+ * List of characters availables in the game
+ */
+ characters: GameCharacterInterface[] = [];
+
+ constructor(private http: Http) {
+ super();
+ }
+
+ loadCharacters(): any {
+ return this.http
+ .get(`${this.ENDPOINT}gameCharacters`)
+ .toPromise()
+ .then((res: Response) => {
+ let body = res.json();
+ if (body._embedded.gameCharacters) {
+ this.characters = body._embedded.gameCharacters;
+ }
+
+ return this.characters;
+ })
+ .catch(this.handleError);
+ }
+
+ getCharacter(characterId: number): Promise {
+ if (this.characters.length > 0) {
+ return Promise.resolve(this.characters.find(c => c.id === characterId));
+ } else {
+ return this.loadCharacters()
+ .then((characters: GameCharacterInterface[]) => {
+ return characters.find(c => c.id === characterId);
+ })
+ .catch(this.handleError);
+ }
+ }
+
+ getActions(characterId: number): Promise {
+ let character = this.characters.find(c => c.id === characterId);
+ if (character.actions) {
+ return Promise.resolve(character.actions);
+ } else {
+ return this.http
+ .get(`${this.ENDPOINT}gameCharacters/${characterId}/actions`)
+ .toPromise()
+ .then((res: Response) => {
+ let body = res.json(),
+ actions = body._embedded.actions;
+ character.actions = actions;
+ return actions;
+ })
+ .catch(this.handleError);
+ }
+ }
+
+ submitAction(gameToken, playerKey, actionName): void {
+ this.http
+ .post(
+ `${this.ENDPOINT}fights/${gameToken}/players/${playerKey}/actions/${actionName}`,
+ {}
+ )
+ .toPromise()
+ .then((res: Response) => {
+ let body = res.json();
+ console.log(res);
+ })
+ .catch(this.handleError);
+ }
+}
diff --git a/test/src/sample-files-extends/src/app/mutiple-inheritance/first-class.ts b/test/src/sample-files-extends/src/app/mutiple-inheritance/first-class.ts
new file mode 100644
index 00000000..efcc6df8
--- /dev/null
+++ b/test/src/sample-files-extends/src/app/mutiple-inheritance/first-class.ts
@@ -0,0 +1,5 @@
+import { BSecondClass } from './second-class';
+
+export class FirstClass extends BSecondClass {
+ name: string;
+}
diff --git a/test/src/sample-files-extends/src/app/mutiple-inheritance/multi-component.ts b/test/src/sample-files-extends/src/app/mutiple-inheritance/multi-component.ts
new file mode 100644
index 00000000..3121627c
--- /dev/null
+++ b/test/src/sample-files-extends/src/app/mutiple-inheritance/multi-component.ts
@@ -0,0 +1,14 @@
+import { Component, Input, OnInit } from '@angular/core';
+
+import { FirstClass } from './first-class';
+
+/**
+ * Empty component for inheritance demo
+ */
+@Component({
+ selector: 'cp-multi',
+ template: 'empty component'
+})
+export class MultiComponent extends FirstClass {
+ @Input() public emptyInput: string;
+}
diff --git a/test/src/sample-files-extends/src/app/mutiple-inheritance/second-class.ts b/test/src/sample-files-extends/src/app/mutiple-inheritance/second-class.ts
new file mode 100644
index 00000000..c524bd7f
--- /dev/null
+++ b/test/src/sample-files-extends/src/app/mutiple-inheritance/second-class.ts
@@ -0,0 +1,5 @@
+import { AThirdClass } from './third-class';
+
+export class BSecondClass extends AThirdClass {
+ age: number;
+}
diff --git a/test/src/sample-files-extends/src/app/mutiple-inheritance/third-class.ts b/test/src/sample-files-extends/src/app/mutiple-inheritance/third-class.ts
new file mode 100644
index 00000000..0c1ede7b
--- /dev/null
+++ b/test/src/sample-files-extends/src/app/mutiple-inheritance/third-class.ts
@@ -0,0 +1,3 @@
+export class AThirdClass {
+ adress: string;
+}
diff --git a/test/src/sample-files/query-param-group.service.ts b/test/src/sample-files/query-param-group.service.ts
new file mode 100644
index 00000000..c0e02195
--- /dev/null
+++ b/test/src/sample-files/query-param-group.service.ts
@@ -0,0 +1,402 @@
+import { Inject, Injectable, isDevMode, OnDestroy, Optional } from '@angular/core';
+import { Params } from '@angular/router';
+import { EMPTY, from, Observable, Subject } from 'rxjs';
+import {
+ catchError,
+ concatMap,
+ debounceTime,
+ distinctUntilChanged,
+ filter,
+ map,
+ startWith,
+ switchMap,
+ takeUntil,
+ tap
+} from 'rxjs/operators';
+import { compareParamMaps, filterParamMap, isMissing, isPresent, NOP } from '../util';
+import { Unpack } from '../types';
+import { QueryParamGroup } from '../model/query-param-group';
+import { QueryParam } from '../model/query-param';
+import {
+ NGQP_ROUTER_ADAPTER,
+ NGQP_ROUTER_OPTIONS,
+ RouterAdapter,
+ RouterOptions
+} from '../router-adapter/router-adapter.interface';
+import { QueryParamAccessor } from './query-param-accessor.interface';
+
+/** @internal */
+function isMultiQueryParam(
+ queryParam: QueryParam | QueryParam
+): queryParam is QueryParam {
+ return queryParam.multi;
+}
+
+/** @internal */
+function hasArrayValue(
+ queryParam: QueryParam | QueryParam,
+ value: T | T[]
+): value is T[] {
+ return isMultiQueryParam(queryParam);
+}
+
+/** @internal */
+function hasArraySerialization(
+ queryParam: QueryParam,
+ values: string | string[] | null
+): values is string[] {
+ return isMultiQueryParam(queryParam);
+}
+
+/** @internal */
+class NavigationData {
+ constructor(public params: Params, public synthetic: boolean = false) {}
+}
+
+/**
+ * Service implementing the synchronization logic
+ *
+ * This service is the key to the synchronization process by binding a {@link QueryParamGroup}
+ * to the router.
+ *
+ * @internal
+ */
+@Injectable()
+export class QueryParamGroupService implements OnDestroy {
+ /** The {@link QueryParamGroup} to bind. */
+ private queryParamGroup: QueryParamGroup;
+
+ /** List of {@link QueryParamAccessor} registered to this service. */
+ private directives = new Map();
+
+ /**
+ * Queue of navigation parameters
+ *
+ * A queue is used for navigations as we need to make sure all parameter changes
+ * are executed in sequence as otherwise navigations might overwrite each other.
+ */
+ private queue$ = new Subject();
+
+ /** @ignore */
+ private synchronizeRouter$ = new Subject();
+
+ /** @ignore */
+ private destroy$ = new Subject();
+
+ constructor(
+ @Inject(NGQP_ROUTER_ADAPTER) private routerAdapter: RouterAdapter,
+ @Optional() @Inject(NGQP_ROUTER_OPTIONS) private globalRouterOptions: RouterOptions
+ ) {
+ this.setupNavigationQueue();
+ }
+
+ /** @ignore */
+ public ngOnDestroy() {
+ this.destroy$.next();
+ this.destroy$.complete();
+
+ this.synchronizeRouter$.complete();
+
+ if (this.queryParamGroup) {
+ this.queryParamGroup._clearChangeFunctions();
+ }
+ }
+
+ /**
+ * Uses the given {@link QueryParamGroup} for synchronization.
+ */
+ public setQueryParamGroup(queryParamGroup: QueryParamGroup): void {
+ // FIXME: If this is called when we already have a group, we probably need to do
+ // some cleanup first.
+ if (this.queryParamGroup) {
+ throw new Error(
+ `A QueryParamGroup has already been setup. Changing the group is currently not supported.`
+ );
+ }
+
+ this.queryParamGroup = queryParamGroup;
+ this.startSynchronization();
+ }
+
+ /**
+ * Registers a {@link QueryParamAccessor}.
+ */
+ public registerQueryParamDirective(directive: QueryParamAccessor): void {
+ // Capture the name here, particularly for the queue below to avoid re-evaluating
+ // it as it might change over time.
+ const queryParamName = directive.name;
+
+ const queryParam: QueryParam = this.queryParamGroup.get(queryParamName);
+ if (!queryParam) {
+ throw new Error(
+ `Could not find query param with name ${queryParamName}. Did you forget to add it to your QueryParamGroup?`
+ );
+ }
+ if (!directive.valueAccessor) {
+ throw new Error(
+ `No value accessor found for the form control. Please make sure to implement ControlValueAccessor on this component.`
+ );
+ }
+
+ // Chances are that we read the initial route before a directive has been registered here.
+ // The value in the model will be correct, but we need to sync it to the view once initially.
+ directive.valueAccessor.writeValue(queryParam.value);
+
+ // Proxy updates from the view to debounce them (if needed).
+ const debouncedQueue$ = new Subject();
+ debouncedQueue$
+ .pipe(
+ // Do not synchronize while the param is detached from the group
+ filter(() => !!this.queryParamGroup.get(queryParamName)),
+
+ isPresent(queryParam.debounceTime) ? debounceTime(queryParam.debounceTime) : tap(),
+ map((newValue: any) => this.getParamsForValue(queryParam, newValue)),
+ takeUntil(this.destroy$)
+ )
+ .subscribe(params => this.enqueueNavigation(new NavigationData(params)));
+
+ directive.valueAccessor.registerOnChange((newValue: any) => debouncedQueue$.next(newValue));
+
+ this.directives.set(queryParamName, [
+ ...(this.directives.get(queryParamName) || []),
+ directive
+ ]);
+ }
+
+ /**
+ * Deregisters a {@link QueryParamAccessor} by referencing its name.
+ */
+ public deregisterQueryParamDirective(queryParamName: string): void {
+ if (!queryParamName) {
+ return;
+ }
+
+ const directives = this.directives.get(queryParamName);
+ if (!directives) {
+ return;
+ }
+
+ directives.forEach(directive => {
+ directive.valueAccessor.registerOnChange(NOP);
+ directive.valueAccessor.registerOnTouched(NOP);
+ });
+
+ this.directives.delete(queryParamName);
+ const queryParam: QueryParam = this.queryParamGroup.get(queryParamName);
+ if (queryParam) {
+ queryParam._clearChangeFunctions();
+ }
+ }
+
+ private startSynchronization() {
+ this.setupGroupChangeListener();
+ this.setupParamChangeListeners();
+ this.setupRouterListener();
+
+ this.watchNewParams();
+ }
+
+ /** Listens for programmatic changes on group level and synchronizes to the router. */
+ private setupGroupChangeListener(): void {
+ this.queryParamGroup._registerOnChange((newValue: Record) => {
+ let params: Params = {};
+ Object.keys(newValue).forEach(queryParamName => {
+ const queryParam: QueryParam = this.queryParamGroup.get(queryParamName);
+ if (isMissing(queryParam)) {
+ return;
+ }
+
+ params = {
+ ...params,
+ ...this.getParamsForValue(queryParam, newValue[queryParamName])
+ };
+ });
+
+ this.enqueueNavigation(new NavigationData(params, true));
+ });
+ }
+
+ /** Listens for programmatic changes on parameter level and synchronizes to the router. */
+ private setupParamChangeListeners(): void {
+ Object.keys(this.queryParamGroup.queryParams).forEach(queryParamName =>
+ this.setupParamChangeListener(queryParamName)
+ );
+ }
+
+ private setupParamChangeListener(queryParamName: string): void {
+ const queryParam: QueryParam = this.queryParamGroup.get(queryParamName);
+ if (!queryParam) {
+ throw new Error(`No param in group found for name ${queryParamName}`);
+ }
+
+ queryParam._registerOnChange((newValue: any) =>
+ this.enqueueNavigation(
+ new NavigationData(this.getParamsForValue(queryParam, newValue), true)
+ )
+ );
+ }
+
+ /** Listens for changes in the router and synchronizes to the model. */
+ private setupRouterListener(): void {
+ this.synchronizeRouter$
+ .pipe(
+ startWith(undefined),
+ switchMap(() =>
+ this.routerAdapter.queryParamMap.pipe(
+ // We want to ignore changes to query parameters which aren't related to this
+ // particular group; however, we do need to react if one of our parameters has
+ // vanished when it was set before.
+ distinctUntilChanged((previousMap, currentMap) => {
+ const keys = Object.values(this.queryParamGroup.queryParams).map(
+ queryParam => queryParam.urlParam
+ );
+
+ // It is important that we filter the maps only here so that both are filtered
+ // with the same set of keys; otherwise, e.g. removing a parameter from the group
+ // would interfere.
+ return compareParamMaps(
+ filterParamMap(previousMap, keys),
+ filterParamMap(currentMap, keys)
+ );
+ })
+ )
+ ),
+ takeUntil(this.destroy$)
+ )
+ .subscribe(queryParamMap => {
+ const synthetic = this.isSyntheticNavigation();
+ const groupValue: Record = {};
+
+ Object.keys(this.queryParamGroup.queryParams).forEach(queryParamName => {
+ const queryParam: QueryParam = this.queryParamGroup.get(queryParamName);
+ const newValue = queryParam.multi
+ ? this.deserialize(queryParam, queryParamMap.getAll(queryParam.urlParam))
+ : this.deserialize(queryParam, queryParamMap.get(queryParam.urlParam));
+
+ const directives = this.directives.get(queryParamName);
+ if (directives) {
+ directives.forEach(directive =>
+ directive.valueAccessor.writeValue(newValue)
+ );
+ }
+
+ groupValue[queryParamName] = newValue;
+ });
+
+ this.queryParamGroup.setValue(groupValue, {
+ emitEvent: !synthetic,
+ emitModelToViewChange: false
+ });
+ });
+ }
+
+ /** Listens for newly added parameters and starts synchronization for them. */
+ private watchNewParams(): void {
+ this.queryParamGroup.queryParamAdded$
+ .pipe(takeUntil(this.destroy$))
+ .subscribe(queryParamName => {
+ this.setupParamChangeListener(queryParamName);
+ this.synchronizeRouter$.next();
+ });
+ }
+
+ /** Returns true if the current navigation is synthetic. */
+ private isSyntheticNavigation(): boolean {
+ const navigation = this.routerAdapter.getCurrentNavigation();
+ if (!navigation || navigation.trigger !== 'imperative') {
+ // When using the back / forward buttons, the state is passed along with it, even though
+ // for us it's now a navigation initiated by the user. Therefore, a navigation can only
+ // be synthetic if it has been triggered imperatively.
+ // See https://github.com/angular/angular/issues/28108.
+ return false;
+ }
+
+ return navigation.extras && navigation.extras.state && navigation.extras.state['synthetic'];
+ }
+
+ /** Subscribes to the parameter queue and executes navigations in sequence. */
+ private setupNavigationQueue() {
+ this.queue$
+ .pipe(
+ takeUntil(this.destroy$),
+ concatMap(data => this.navigateSafely(data))
+ )
+ .subscribe();
+ }
+
+ private navigateSafely(data: NavigationData): Observable {
+ return from(
+ this.routerAdapter.navigate(data.params, {
+ ...this.routerOptions,
+ state: { synthetic: data.synthetic }
+ })
+ ).pipe(
+ catchError((err: any) => {
+ if (isDevMode()) {
+ console.error(`There was an error while navigating`, err);
+ }
+
+ return EMPTY;
+ })
+ );
+ }
+
+ /** Sends a change of parameters to the queue. */
+ private enqueueNavigation(data: NavigationData): void {
+ this.queue$.next(data);
+ }
+
+ /**
+ * Returns the full set of parameters given a value for a parameter model.
+ *
+ * This consists mainly of properly serializing the model value and ensuring to take
+ * side effect changes into account that may have been configured.
+ */
+ private getParamsForValue(queryParam: QueryParam, value: T | undefined | null): Params {
+ const newValue = this.serialize(queryParam, value);
+
+ const combinedParams: Params = isMissing(queryParam.combineWith)
+ ? {}
+ : queryParam.combineWith(value);
+
+ // Note that we list the side-effect parameters first so that our actual parameter can't be
+ // overridden by it.
+ return {
+ ...(combinedParams || {}),
+ [queryParam.urlParam]: newValue
+ };
+ }
+
+ private serialize(queryParam: QueryParam, value: T): string | string[] {
+ if (hasArrayValue(queryParam, value)) {
+ return (value || []).map(queryParam.serialize);
+ } else {
+ return queryParam.serialize(value);
+ }
+ }
+
+ private deserialize(
+ queryParam: QueryParam,
+ values: string | string[]
+ ): Unpack | Unpack[] {
+ if (hasArraySerialization(queryParam, values)) {
+ return values.map(queryParam.deserialize);
+ } else {
+ return queryParam.deserialize(values);
+ }
+ }
+
+ /**
+ * Returns the current set of options to pass to the router.
+ *
+ * This merges the global configuration with the group specific configuration.
+ */
+ private get routerOptions(): RouterOptions {
+ const groupOptions = this.queryParamGroup ? this.queryParamGroup.routerOptions : {};
+
+ return {
+ ...(this.globalRouterOptions || {}),
+ ...groupOptions
+ };
+ }
+}
diff --git a/test/src/sample-files/query-param-name.directive.ts b/test/src/sample-files/query-param-name.directive.ts
new file mode 100644
index 00000000..72959359
--- /dev/null
+++ b/test/src/sample-files/query-param-name.directive.ts
@@ -0,0 +1,70 @@
+import {
+ Directive,
+ Inject,
+ Input,
+ OnChanges,
+ OnDestroy,
+ Optional,
+ Self,
+ SimpleChanges
+} from '@angular/core';
+import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
+import { QueryParamGroupService } from './query-param-group.service';
+import { QueryParamAccessor } from './query-param-accessor.interface';
+import { selectValueAccessor } from '../accessors/util';
+
+/**
+ * Binds a {@link QueryParam} to a DOM element.
+ *
+ * This directive accepts the name of a {@link QueryParam} inside its parent {@link QueryParamGroup}.
+ * It binds this parameter to the host element, which is required to have a [ControlValueAccessor]
+ * {@link https://angular.io/api/forms/ControlValueAccessor}.
+ */
+@Directive({
+ selector: '[queryParamName]'
+})
+export class QueryParamNameDirective implements QueryParamAccessor, OnChanges, OnDestroy {
+ /**
+ * The name of the {@link QueryParam} inside its parent {@link QueryParamGroup}.
+ * Note that this does not refer to the [parameter name]{@link QueryParam#urlParam}.
+ */
+ @Input('queryParamName')
+ public name: string;
+
+ /** @internal */
+ public valueAccessor: ControlValueAccessor | null = null;
+
+ constructor(
+ @Optional() private groupService: QueryParamGroupService,
+ @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[]
+ ) {
+ if (!this.groupService) {
+ throw new Error(
+ `No parent configuration found. Did you forget to add [queryParamGroup]?`
+ );
+ }
+
+ this.valueAccessor = selectValueAccessor(valueAccessors);
+ }
+
+ /** @ignore */
+ public ngOnChanges(changes: SimpleChanges) {
+ const nameChange = changes['name'];
+ if (nameChange) {
+ if (!nameChange.firstChange) {
+ this.groupService.deregisterQueryParamDirective(nameChange.previousValue);
+ }
+
+ if (nameChange.currentValue) {
+ this.groupService.registerQueryParamDirective(this);
+ }
+ }
+ }
+
+ /** @ignore */
+ public ngOnDestroy() {
+ if (this.groupService) {
+ this.groupService.deregisterQueryParamDirective(this.name);
+ }
+ }
+}
diff --git a/test/src/todomvc-ng2/logo.svg b/test/src/todomvc-ng2/logo.svg
new file mode 100644
index 00000000..49a0c80d
--- /dev/null
+++ b/test/src/todomvc-ng2/logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/test/src/todomvc-ng2/src/app/shared/miscellaneous/some-feature.ts b/test/src/todomvc-ng2/src/app/shared/miscellaneous/some-feature.ts
new file mode 100644
index 00000000..55adeb93
--- /dev/null
+++ b/test/src/todomvc-ng2/src/app/shared/miscellaneous/some-feature.ts
@@ -0,0 +1,10 @@
+import { throttle } from 'lodash-decorators';
+
+import { PollingSpeed } from './util.const.ts';
+
+export class SomeFeature {
+ @throttle(1000 as PollingSpeed, { leading: true })
+ doSomething() {
+ // do something throttled
+ }
+}
diff --git a/test/src/todomvc-ng2/src/app/shared/miscellaneous/util.const.ts b/test/src/todomvc-ng2/src/app/shared/miscellaneous/util.const.ts
new file mode 100644
index 00000000..a8c2dcb5
--- /dev/null
+++ b/test/src/todomvc-ng2/src/app/shared/miscellaneous/util.const.ts
@@ -0,0 +1,4 @@
+export const enum PollingSpeed {
+ Low = 1000,
+ High = 100
+}
diff --git a/test/src/todomvc-ng2/src/app/shared/models/tidi.model.ts b/test/src/todomvc-ng2/src/app/shared/models/tidi.model.ts
index 36c14335..19fe2063 100644
--- a/test/src/todomvc-ng2/src/app/shared/models/tidi.model.ts
+++ b/test/src/todomvc-ng2/src/app/shared/models/tidi.model.ts
@@ -9,7 +9,13 @@ import { LogMethod, LogProperty, LogPropertyWithArgs, LogClass } from '../decora
export class Tidi {
completed: boolean;
afunc(a: string, b: string): { passwordMismatch: boolean } | null {
- return (true)
- ? { 'passwordMismatch': true } : null;
+ return true ? { passwordMismatch: true } : null;
+ }
+
+ /**
+ * @param {string} value
+ */
+ public get emailAddress(): string {
+ return 'email';
}
}
diff --git a/tools/ngd-graphs.js b/tools/ngd-graphs.js
new file mode 100644
index 00000000..c53f90e3
--- /dev/null
+++ b/tools/ngd-graphs.js
@@ -0,0 +1,356 @@
+const process = require('process'),
+ helpers = require('../test/dist/helpers.js'),
+ rimraf = require('rimraf'),
+ exec = helpers.exec,
+ fs = helpers.fs,
+ tmp = helpers.temporaryDir();
+
+const TEST_FOLDER = 'ngd-tests',
+ GIT_REPOSITORIES = [
+ {
+ name: 'batcave',
+ maintainer: 'hsbalar',
+ tsconfig_path: './',
+ failedAccepted: true
+ },
+ {
+ name: 'angular2-image-gallery',
+ maintainer: 'BenjaminBrandmeier',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'pinterest',
+ maintainer: 'aviabird',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'Movies-Finder',
+ maintainer: 'Lazhari',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'memory',
+ maintainer: 'MurhafSousli',
+ tsconfig_path: './src/'
+ },
+ {
+ name: '8puzzle',
+ maintainer: 'MurhafSousli',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'angular2-quiz-app',
+ maintainer: 'fabiandev',
+ tsconfig_path: './'
+ },
+ {
+ name: 'Angular-2-Github-Search-Profile',
+ maintainer: 'tahaipek',
+ tsconfig_path: './'
+ },
+ {
+ name: 'soundcloud-ngrx',
+ maintainer: 'r-park',
+ tsconfig_path: './'
+ },
+ {
+ name: 'angular2-university-domains-list',
+ maintainer: 'tahaipek',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'angular2-hn',
+ maintainer: 'housseindjirdeh',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'angular2-youtube',
+ maintainer: 'dlizarra',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'Preserver',
+ maintainer: 'hsbalar',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ng-logo',
+ maintainer: 'dweitz43',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'ng2-chess',
+ maintainer: 'shlomiassaf',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ngx-uploader',
+ maintainer: 'jkuri',
+ tsconfig_path: './'
+ },
+ {
+ name: 'a2gtm',
+ maintainer: 'mrf28',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'angular2-rxjs-chat',
+ maintainer: 'ng-book',
+ tsconfig_path: './'
+ },
+ {
+ name: 'angular2-grid',
+ maintainer: 'BTMorton',
+ tsconfig_path: './projects/angular2-grid/',
+ tsconfig_file: 'tsconfig.lib.json'
+ },
+ {
+ name: 'todo-angular2-firebase',
+ maintainer: 'r-park',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ng2-image-lazy-load',
+ maintainer: 'NathanWalker',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ng2-dragula',
+ maintainer: 'valor-software',
+ tsconfig_path: './'
+ },
+ {
+ name: 'angular2-tv-tracker',
+ maintainer: 'mattlewis92',
+ tsconfig_path: './'
+ },
+ {
+ name: 'youtube-trends',
+ maintainer: 'jasodeep',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'PianoPlay',
+ maintainer: 'deanmalone',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'ng-snotify',
+ maintainer: 'artemsky',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ngx-youtube-player',
+ maintainer: 'SamirHodzic',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'angular2-instagram',
+ maintainer: 'JayKan',
+ tsconfig_path: './'
+ },
+ {
+ name: 'runman',
+ maintainer: 'MurhafSousli',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'ng-math',
+ maintainer: 'coryrylan',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ng2-minesweeper',
+ maintainer: 'DanielYKPan',
+ tsconfig_path: './'
+ },
+ {
+ name: 'ngx-snake',
+ maintainer: 'SamirHodzic',
+ tsconfig_path: './src/'
+ },
+ {
+ name: 'ng-pokedex',
+ maintainer: 'coryrylan',
+ tsconfig_path: './'
+ },
+ {
+ name: 'codegreen',
+ maintainer: 'artusvranken',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'ng2-finance',
+ maintainer: 'mpetkov',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'echoes-player',
+ maintainer: 'orizens',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'todo-angular-firebase',
+ maintainer: 'r-park',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ },
+ {
+ name: 'Angular-JumpStart',
+ maintainer: 'DanWahlin',
+ tsconfig_path: './src/',
+ tsconfig_file: 'tsconfig.app.json'
+ }
+ ],
+ len = GIT_REPOSITORIES.length;
+
+tmp.clean(TEST_FOLDER);
+tmp.create(TEST_FOLDER);
+
+let i = 0,
+ failedRepositories = [],
+ clone = repo => {
+ return new Promise(function(resolve, reject) {
+ exec(
+ 'git clone https://github.com/' + repo.maintainer + '/' + repo.name,
+ (error, stdout, stderr) => {
+ if (error) {
+ console.error(`exec error: ${error}`);
+ reject();
+ } else {
+ resolve();
+ }
+ }
+ );
+ });
+ },
+ generateGraph = repo => {
+ return new Promise(function(resolve, reject) {
+ var tsconfig = 'tsconfig.json';
+ if (repo.tsconfig_file) {
+ tsconfig = repo.tsconfig_file;
+ }
+
+ process.chdir(repo.name);
+
+ exec(
+ 'ngd -p ' + repo.tsconfig_path + tsconfig + ' -t svg',
+ {
+ maxBuffer: 1000 * 1024
+ },
+ (error, stdout, stderr) => {
+ if (error) {
+ console.error(`ngd error: ${error}`);
+ process.chdir('../');
+ if (repo.failedAccepted) {
+ resolve(stdout, stderr);
+ } else {
+ reject(stdout, stderr);
+ }
+ } else {
+ process.chdir('../');
+ if (stdout.indexOf('done') !== -1) {
+ fs.copySync(
+ repo.name + '/documentation/dependencies.svg',
+ repo.name + '.svg'
+ );
+ fs.removeSync(repo.name);
+ resolve(stdout, stderr);
+ } else {
+ if (repo.failedAccepted) {
+ resolve(stdout, stderr);
+ } else {
+ reject(stdout, stderr);
+ }
+ }
+ }
+ }
+ );
+ });
+ },
+ printStat = function(stdout) {
+ let statsRaw = stdout.match(regStat),
+ stats,
+ statModules,
+ statComponents;
+
+ if (statsRaw && statsRaw.length > 0) {
+ stats = statsRaw[0];
+ statModules = stats.match(regStatModules);
+ statComponents = stats.match(regStatComponents);
+
+ console.log(` ${stdout.match(reg).length} files`);
+ console.log('');
+ if (statModules) {
+ statModules = statModules[2];
+ console.log(` ${statModules} modules`);
+ }
+ if (statComponents) {
+ statComponents = statComponents[2];
+ console.log(` ${statComponents} components`);
+ }
+ }
+ };
+
+let reg = /parsing/gm,
+ regStat = /(statistics)[\s\S]*-----/gm,
+ regStatModules = /(module : )(\d+)/,
+ regStatComponents = /(component : )(\d+)/,
+ loop = () => {
+ if (i < len) {
+ clone(GIT_REPOSITORIES[i]).then(() => {
+ console.log(`Repository ${GIT_REPOSITORIES[i].name} cloned`);
+ generateGraph(GIT_REPOSITORIES[i]).then(
+ (stdout, stderr) => {
+ console.log('');
+ console.log(` Graph ${GIT_REPOSITORIES[i].name} OK`);
+ if (stdout && stdout.match(reg)) {
+ printStat(stdout);
+ GIT_REPOSITORIES[i].filesLength = stdout.match(reg).length;
+ }
+ console.log('');
+ i++;
+ loop();
+ },
+ (stdout, stderr) => {
+ console.log('');
+ console.error(` Graph ${GIT_REPOSITORIES[i].name} KO`);
+ if (stdout && stdout.match(reg)) {
+ printStat(stdout);
+ GIT_REPOSITORIES[i].filesLength = stdout.match(reg).length;
+ }
+ console.log('');
+ failedRepositories.push(GIT_REPOSITORIES[i].name);
+ i++;
+ loop();
+ }
+ );
+ });
+ } else {
+ console.log('End processing projects');
+ console.log('');
+
+ if (failedRepositories.length > 0) {
+ console.log('Failed repositories: ', failedRepositories);
+ console.log('');
+ process.exit(1);
+ } else {
+ process.exit(0);
+ }
+ }
+ };
+
+try {
+ process.chdir(TEST_FOLDER);
+ console.log('Start processing projects');
+ console.log('');
+ loop();
+} catch (err) {
+ console.error(`chdir: ${err}`);
+}
diff --git a/tslint.json b/tslint.json
index 17edb622..7f2a84fa 100644
--- a/tslint.json
+++ b/tslint.json
@@ -30,7 +30,7 @@
"no-reference": true,
"no-require-imports": false,
"no-shadowed-variable": true,
- "no-string-literal": true,
+ "no-string-literal": false,
"no-switch-case-fall-through": true,
"no-unused-expression": true,
"no-use-before-declare": true,