primeng-extensions
Version:
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] []() [![Dependency Status][daviddm-image]][daviddm-url] .push([[0],{VSng:function(t,e,i){var n=i("mrSG").__decorate,o=i("mrSG").__metadata;Object.defineProperty(e,"__esModule",{value:!0});var l=i("CcnG"),r=i("sdDj"),s=i("Ip0R"),a=function(){function t(t){this.el=t,this.iconPos="left",this.cornerStyleClass="ui-corner-all"}return t.prototype.ngAfterViewInit=function(){if(r.DomHandler.addMultipleClasses(this.el.nativeElement,this.getStyleClass()),this.icon){var t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=("right"==this.iconPos?"ui-button-icon-right":"ui-button-icon-left")+" ui-clickable "+this.icon,this.el.nativeElement.appendChild(t)}var e=document.createElement("span");e.className="ui-button-text ui-clickable",e.appendChild(document.createTextNode(this.label||"ui-btn")),this.el.nativeElement.appendChild(e),this.initialized=!0},t.prototype.getStyleClass=function(){return"ui-button ui-widget ui-state-default "+this.cornerStyleClass+(this.icon?null!=this.label&&null!=this.label?"left"==this.iconPos?" ui-button-text-icon-left":" ui-button-text-icon-right":" ui-button-icon-only":this.label?" ui-button-text-only":" ui-button-text-empty")},Object.defineProperty(t.prototype,"label",{get:function(){return this._label},set:function(t){this._label=t,this.initialized&&(r.DomHandler.findSingle(this.el.nativeElement,".ui-button-text").textContent=this._label,this.icon||(this._label?(r.DomHandler.removeClass(this.el.nativeElement,"ui-button-text-empty"),r.DomHandler.addClass(this.el.nativeElement,"ui-button-text-only")):(r.DomHandler.addClass(this.el.nativeElement,"ui-button-text-empty"),r.DomHandler.removeClass(this.el.nativeElement,"ui-button-text-only"))))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._icon},set:function(t){if(this._icon=t,this.initialized){var e="right"==this.iconPos?"ui-button-icon-right":"ui-button-icon-left";r.DomHandler.findSingle(this.el.nativeElement,".ui-clickable").className=e+" ui-clickable "+this.icon}},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){for(;this.el.nativeElement.hasChildNodes();)this.el.nativeElement.removeChild(this.el.nativeElement.lastChild);this.initialized=!1},n([l.Input(),o("design:type",String)],t.prototype,"iconPos",void 0),n([l.Input(),o("design:type",String)],t.prototype,"cornerStyleClass",void 0),n([l.Input(),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"label",null),n([l.Input(),o("design:type",String),o("design:paramtypes",[String])],t.prototype,"icon",null),n([l.Directive({selector:"[pButton]"})],t)}();e.ButtonDirective=a;var c=function(){function t(){this.iconPos="left",this.onClick=new l.EventEmitter,this.onFocus=new l.EventEmitter,this.onBlur=new l.EventEmitter}return n([l.Input(),o("design:type",String)],t.prototype,"type",void 0),n([l.Input(),o("design:type",String)],t.prototype,"iconPos",void 0),n([l.Input(),o("design:type",String)],t.prototype,"icon",void 0),n([l.Input(),o("design:type",String)],t.prototype,"label",void 0),n([l.Input(),o("design:type",Boolean)],t.prototype,"disabled",void 0),n([l.Input(),o("design:type",Object)],t.prototype,"style",void 0),n([l.Input(),o("design:type",String)],t.prototype,"styleClass",void 0),n([l.Output(),o("design:type",l.EventEmitter)],t.prototype,"onClick",void 0),n([l.Output(),o("design:type",l.EventEmitter)],t.prototype,"onFocus",void 0),n([l.Output(),o("design:type",l.EventEmitter)],t.prototype,"onBlur",void 0),n([l.Component({selector:"p-button",template:"\n <button [attr.type]=\"type\" [class]=\"styleClass\" [style]=\"style\" [disabled]=\"disabled\"\n [ngClass]=\"{'ui-button ui-widget ui-state-default ui-corner-all':true,\n 'ui-button-icon-only': (icon && !label),\n 'ui-button-text-icon-left': (icon && label && iconPos === 'left'),\n 'ui-button-text-icon-right': (icon && label && iconPos === 'right'),\n 'ui-button-text-only': (!icon && label),\n 'ui-button-text-empty': (!icon && !label),\n 'ui-state-disabled': disabled}\"\n (click)=\"onClick.emit($event)\" (focus)=\"onFocus.emit($event)\" (blur)=\"onBlur.emit($event)\">\n <ng-content></ng-content>\n <span [ngClass]=\"{'ui-clickable': true,\n 'ui-button-icon-left': (iconPos === 'left'), \n 'ui-button-icon-right': (iconPos === 'right')}\"\n [class]=\"icon\" *ngIf=\"icon\"></span>\n <span class=\"ui-button-text ui-clickable\">{{label||'ui-btn'}}</span>\n </button>\n "})],t)}();e.Button=c,e.ButtonModule=function(){return n([l.NgModule({imports:[s.CommonModule],exports:[a,c],declarations:[a,c]})],function(){})}()},sdDj:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DomHandler=function(){function t(){}return t.addClass=function(t,e){t.classList?t.classList.add(e):t.className+=" "+e},t.addMultipleClasses=function(t,e){if(t.classList)for(var i=e.split(" "),n=0;n<i.length;n++)t.classList.add(i[n]);else for(i=e.split(" "),n=0;n<i.length;n++)t.className+=" "+i[n]},t.removeClass=function(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")},t.hasClass=function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},t.siblings=function(t){return Array.prototype.filter.call(t.parentNode.children,function(e){return e!==t})},t.find=function(t,e){return Array.from(t.querySelectorAll(e))},t.findSingle=function(t,e){return t.querySelector(e)},t.index=function(t){for(var e=t.parentNode.childNodes,i=0,n=0;n<e.length;n++){if(e[n]==t)return i;1==e[n].nodeType&&i++}return-1},t.indexWithinGroup=function(t,e){for(var i=t.parentNode.childNodes,n=0,o=0;o<i.length;o++){if(i[o]==t)return n;i[o].attributes&&i[o].attributes[e]&&1==i[o].nodeType&&n++}return-1},t.relativePosition=function(t,e){var i,n,o=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t),l=e.offsetHeight,r=e.offsetWidth,s=e.getBoundingClientRect(),a=(this.getWindowScrollTop(),this.getViewport());s.top+l+o.height>a.height?s.top+(i=-1*o.height)<0&&(i=0):i=l,n=s.left+o.width>a.width?r-o.width:0,t.style.top=i+"px",t.style.left=n+"px"},t.absolutePosition=function(t,e){var i,n,o=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t),l=o.height,r=o.width,s=e.offsetHeight,a=e.offsetWidth,c=e.getBoundingClientRect(),u=this.getWindowScrollTop(),d=this.getWindowScrollLeft(),p=this.getViewport();c.top+s+l>p.height?(i=c.top+u-l)<0&&(i=0+u):i=s+c.top+u,n=c.left+a+r>p.width?c.left+d+a-r:c.left+d,t.style.top=i+"px",t.style.left=n+"px"},t.getHiddenElementOuterHeight=function(t){t.style.visibility="hidden",t.style.display="block";var e=t.offsetHeight;return t.style.display="none",t.style.visibility="visible",e},t.getHiddenElementOuterWidth=function(t){t.style.visibility="hidden",t.style.display="block";var e=t.offsetWidth;return t.style.display="none",t.style.visibility="visible",e},t.getHiddenElementDimensions=function(t){var e={};return t.style.visibility="hidden",t.style.display="block",e.width=t.offsetWidth,e.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible",e},t.scrollInView=function(t,e){var i=getComputedStyle(t).getPropertyValue("borderTopWidth"),n=i?parseFloat(i):0,o=getComputedStyle(t).getPropertyValue("paddingTop"),l=o?parseFloat(o):0,r=t.getBoundingClientRect(),s=e.getBoundingClientRect().top+document.body.scrollTop-(r.top+document.body.scrollTop)-n-l,a=t.scrollTop,c=t.clientHeight,u=this.getOuterHeight(e);s<0?t.scrollTop=a+s:s+u>c&&(t.scrollTop=a+s-c+u)},t.fadeIn=function(t,e){t.style.opacity=0;var i=+new Date,n=0,o=function(){n=+t.style.opacity.replace(",",".")+((new Date).getTime()-i)/e,t.style.opacity=n,i=+new Date,+n<1&&(window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,16))};o()},t.fadeOut=function(t,e){var i=1,n=50/e,o=setInterval(function(){(i-=n)<=0&&(i=0,clearInterval(o)),t.style.opacity=i},50)},t.getWindowScrollTop=function(){var t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)},t.getWindowScrollLeft=function(){var t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)},t.matches=function(t,e){var i=Element.prototype;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(t){return-1!==[].indexOf.call(document.querySelectorAll(t),this)}).call(t,e)},t.getOuterWidth=function(t,e){var i=t.offsetWidth;if(e){var n=getComputedStyle(t);i+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return i},t.getHorizontalPadding=function(t){var e=getComputedStyle(t);return parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)},t.getHorizontalMargin=function(t){var e=getComputedStyle(t);return parseFloat(e.marginLeft)+parseFloat(e.marginRight)},t.innerWidth=function(t){var e=t.offsetWidth,i=getComputedStyle(t);return e+(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight))},t.width=function(t){var e=t.offsetWidth,i=getComputedStyle(t);return e-(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight))},t.getInnerHeight=function(t){var e=t.offsetHeight,i=getComputedStyle(t);return e+(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom))},t.getOuterHeight=function(t,e){var i=t.offsetHeight;if(e){var n=getComputedStyle(t);i+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return i},t.getHeight=function(t){var e=t.offsetHeight,i=getComputedStyle(t);return e-(parseFloat(i.paddingTop)+parseFloat(i.paddingBottom)+parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth))},t.getWidth=function(t){var e=t.offsetWidth,i=getComputedStyle(t);return e-(parseFloat(i.paddingLeft)+parseFloat(i.paddingRight)+parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth))},t.getViewport=function(){var t=window,e=document,i=e.documentElement,n=e.getElementsByTagName("body")[0];return{width:t.innerWidth||i.clientWidth||n.clientWidth,height:t.innerHeight||i.clientHeight||n.clientHeight}},t.getOffset=function(t){var e=t.getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}},t.replaceElementWith=function(t,e){var i=t.parentNode;if(!i)throw"Can't replace element";return i.replaceChild(e,t)},t.getUserAgent=function(){return navigator.userAgent},t.isIE=function(){var t=window.navigator.userAgent;return t.indexOf("MSIE ")>0||(t.indexOf("Trident/")>0?(t.indexOf("rv:"),!0):t.indexOf("Edge/")>0)},t.appendChild=function(t,e){if(this.isElement(e))e.appendChild(t);else{if(!e.el||!e.el.nativeElement)throw"Cannot append "+e+" to "+t;e.el.nativeElement.appendChild(t)}},t.removeChild=function(t,e){if(this.isElement(e))e.removeChild(t);else{if(!e.el||!e.el.nativeElement)throw"Cannot remove "+t+" from "+e;e.el.nativeElement.removeChild(t)}},t.isElement=function(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName},t.calculateScrollbarWidth=function(){if(null!==this.calculatedScrollbarWidth)return this.calculatedScrollbarWidth;var t=document.createElement("div");t.className="ui-scrollbar-measure",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),this.calculatedScrollbarWidth=e,e},t.calculateScrollbarHeight=function(){if(null!==this.calculatedScrollbarHeight)return this.calculatedScrollbarHeight;var t=document.createElement("div");t.className="ui-scrollbar-measure",document.body.appendChild(t);var e=t.offsetHeight-t.clientHeight;return document.body.removeChild(t),this.calculatedScrollbarWidth=e,e},t.invokeElementMethod=function(t,e,i){t[e].apply(t,i)},t.clearSelection=function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch(t){}},t.getBrowser=function(){if(!this.browser){var t=this.resolveUserAgent();this.browser={},t.browser&&(this.browser[t.browser]=!0,this.browser.version=t.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser},t.resolveUserAgent=function(){var t=navigator.userAgent.toLowerCase(),e=/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},t.isInteger=function(t){return Number.isInteger?Number.isInteger(t):"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},t.isHidden=function(t){return null===t.offsetParent},t.zindex=1e3,t.calculatedScrollbarWidth=null,t.calculatedScrollbarHeight=null,t}()},xhcO:function(t,e,i){var n=i("mrSG").__decorate;Object.defineProperty(e,"__esModule",{value:!0});var o=i("CcnG"),l=i("Ip0R"),r=function(){function t(t){this.el=t}return t.prototype.ngAfterViewInit=function(){window.Prism&&window.Prism.highlightElement(this.el.nativeElement)},n([o.Directive({selector:"[pCode]"})],t)}();e.CodeHighlighter=r,e.CodeHighlighterModule=function(){return n([o.NgModule({imports:[l.CommonModule],exports:[r],declarations:[r]})],function(){})}()}}]);