blob: 3dcee8b88628b72a9a59711e677dff0e0aa30f3d [file] [log] [blame]
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/flex-layout/core"),require("@angular/cdk/coercion"),require("rxjs/operators"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("@angular/flex-layout/extended",["exports","@angular/core","@angular/common","@angular/flex-layout/core","@angular/cdk/coercion","rxjs/operators","@angular/platform-browser"],e):e((t.ng=t.ng||{},t.ng.flexLayout=t.ng.flexLayout||{},t.ng.flexLayout.extended={}),t.ng.core,t.ng.common,t.ng.flexLayout.core,t.ng.cdk.coercion,t.rxjs.operators,t.ng.platformBrowser)}(this,function(t,e,r,n,s,l,i){"use strict";function a(t,e){function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var l=arguments[e],i=0,a=l.length;i<a;i++,s++)n[s]=l[i];return n}function c(t){var e=typeof t;return"object"===e?t.constructor===Array?"array":t.constructor===Set?"set":"object":e}function u(t,e){return void 0===e&&(e=";"),String(t).trim().split(e).map(function(t){return t.trim()}).filter(function(t){return""!==t})}function g(t,e){var r=function(t){return e&&(t.value=e(t.value)),t};return t.map(y).filter(function(t){return!!t}).map(r).reduce(p,{})}function f(t,e){var r=[];return"set"===c(t)?t.forEach(function(t){return r.push(t)}):Object.keys(t).forEach(function(e){r.push(e+":"+t[e])}),g(r,e)}function y(t){var e=t.split(":"),r=e[0],n=e.slice(1);return new V(r,n.join(":"))}function p(t,e){return e.key&&(t[e.key]=e.value),t}function d(t,e){var r=function(t){return e&&(t.value=e(t.value)),t};return t.map(y).filter(function(t){return!!t}).map(r).reduce(p,{})}var h=function(t,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},m=function(){return m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},m.apply(this,arguments)},x=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return a(r,t),r.prototype.buildStyles=function(t){return{content:t?"url("+t+")":""}},rprov=e.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],r}(n.StyleBuilder),S=function(t){function s(e,n,s,l,i,a){var o=t.call(this,e,n,s,l)||this;return o.platformId=i,o.serverModuleLoaded=a,o.DIRECTIVE_KEY="img-src",o.defaultSrc="",o.styleCache=v,o.init(),o.setValue(o.nativeElement.getAttribute("src")||"",""),r.isPlatformServer(o.platformId)&&o.serverModuleLoaded&&o.nativeElement.setAttribute("src",""),o}return a(s,t),Object.defineProperty(s.prototype,"src",{set:function(t){this.defaultSrc=t,this.setValue(this.defaultSrc,"")},enumerable:!1,configurable:!0}),s.prototype.updateWithValue=function(t){var e=t||this.defaultSrc;r.isPlatformServer(this.platformId)&&this.serverModuleLoaded?this.addStyles(e):this.nativeElement.setAttribute("src",e)},s.decorators=[{type:e.Directive}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:x},{type:n.StyleUtils},{type:n.MediaMarshaller},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:Boolean,decorators:[{type:e.Inject,args:[n.SERVER_TOKEN]}]}]},s.propDecorators={src:[{type:e.Input,args:["src"]}]},s}(n.BaseDirective2),v=new Map,C=["src.xs","src.sm","src.md","src.lg","src.xl","src.lt-sm","src.lt-md","src.lt-lg","src.lt-xl","src.gt-xs","src.gt-sm","src.gt-md","src.gt-lg"],I=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=C,e}return a(r,t),r.decorators=[{type:e.Directive,args:[{selector:"\n img[src.xs], img[src.sm], img[src.md], img[src.lg], img[src.xl],\n img[src.lt-sm], img[src.lt-md], img[src.lt-lg], img[src.lt-xl],\n img[src.gt-xs], img[src.gt-sm], img[src.gt-md], img[src.gt-lg]\n",inputs:C}]}],r}(S),E=function(t){function s(e,n,s,l,i,a,o){var c=t.call(this,e,null,n,s)||this;return c.ngClassInstance=o,c.DIRECTIVE_KEY="ngClass",c.ngClassInstance||(c.ngClassInstance=new r.NgClass(l,i,e,a)),c.init(),c.setValue("",""),c}return a(s,t),Object.defineProperty(s.prototype,"klass",{set:function(t){this.ngClassInstance.klass=t,this.setValue(t,"")},enumerable:!1,configurable:!0}),s.prototype.updateWithValue=function(t){this.ngClassInstance.ngClass=t,this.ngClassInstance.ngDoCheck()},s.prototype.ngDoCheck=function(){this.ngClassInstance.ngDoCheck()},s.decorators=[{type:e.Directive}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:n.StyleUtils},{type:n.MediaMarshaller},{type:e.IterableDiffers},{type:e.KeyValueDiffers},{type:e.Renderer2},{type:r.NgClass,decorators:[{type:e.Optional},{type:e.Self}]}]},s.propDecorators={klass:[{type:e.Input,args:["class"]}]},s}(n.BaseDirective2),w=["ngClass","ngClass.xs","ngClass.sm","ngClass.md","ngClass.lg","ngClass.xl","ngClass.lt-sm","ngClass.lt-md","ngClass.lt-lg","ngClass.lt-xl","ngClass.gt-xs","ngClass.gt-sm","ngClass.gt-md","ngClass.gt-lg"],D=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=w,e}return a(r,t),r.decorators=[{type:e.Directive,args:[{selector:"\n [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl],\n [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl],\n [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]\n",inputs:w}]}],r}(E),b=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return a(r,t),r.prototype.buildStyles=function(t,e){return{display:"true"===t?e.display||(e.isServer?"initial":""):"none"}},rprov=e.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],r}(n.StyleBuilder),H=function(t){function i(e,r,n,s,l,i,a){var o=t.call(this,e,r,n,s)||this;return o.layoutConfig=l,o.platformId=i,o.serverModuleLoaded=a,o.DIRECTIVE_KEY="show-hide",o.display="",o.hasLayout=!1,o.hasFlexChild=!1,o}return a(i,t),i.prototype.ngAfterViewInit=function(){this.trackExtraTriggers();for(var t=Array.from(this.nativeElement.children),e=0;e<t.length;e++)if(this.marshal.hasValue(t[e],"flex")){this.hasFlexChild=!0;break}j.has(this.nativeElement)?this.display=j.get(this.nativeElement):(this.display=this.getDisplayStyle(),j.set(this.nativeElement,this.display)),this.init();var r=this.marshal.getValue(this.nativeElement,this.DIRECTIVE_KEY,"");void 0===r||""===r?this.setValue(!0,""):this.triggerUpdate()},i.prototype.ngOnChanges=function(t){var e=this;Object.keys(t).forEach(function(r){if(-1!==e.inputs.indexOf(r)){var n=r.split("."),l=n.slice(1).join("."),i=t[r].currentValue,a=""===i||0!==i&&s.coerceBooleanProperty(i);"fxHide"===n[0]&&(a=!a),e.setValue(a,l)}})},i.prototype.trackExtraTriggers=function(){var t=this;this.hasLayout=this.marshal.hasValue(this.nativeElement,"layout"),["layout","layout-align"].forEach(function(e){t.marshal.trackValue(t.nativeElement,e).pipe(l.takeUntil(t.destroySubject)).subscribe(t.triggerUpdate.bind(t))})},i.prototype.getDisplayStyle=function(){return this.hasLayout||this.hasFlexChild&&this.layoutConfig.addFlexToParent?"flex":this.styler.lookupStyle(this.nativeElement,"display",!0)},i.prototype.updateWithValue=function(t){if(void 0===t&&(t=!0),""!==t){var e=r.isPlatformServer(this.platformId);this.addStyles(t?"true":"false",{display:this.display,isServer:e}),e&&this.serverModuleLoaded&&this.nativeElement.style.setProperty("display",""),this.marshal.triggerUpdate(this.parentElement,"layout-gap")}},i.decorators=[{type:e.Directive}],i.ctorParameters=function(){return[{type:e.ElementRef},{type:b},{type:n.StyleUtils},{type:n.MediaMarshaller},{type:void 0,decorators:[{type:e.Inject,args:[n.LAYOUT_CONFIG]}]},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:Boolean,decorators:[{type:e.Inject,args:[n.SERVER_TOKEN]}]}]},i}(n.BaseDirective2),j=new WeakMap,k=["fxShow","fxShow.print","fxShow.xs","fxShow.sm","fxShow.md","fxShow.lg","fxShow.xl","fxShow.lt-sm","fxShow.lt-md","fxShow.lt-lg","fxShow.lt-xl","fxShow.gt-xs","fxShow.gt-sm","fxShow.gt-md","fxShow.gt-lg","fxHide","fxHide.print","fxHide.xs","fxHide.sm","fxHide.md","fxHide.lg","fxHide.xl","fxHide.lt-sm","fxHide.lt-md","fxHide.lt-lg","fxHide.lt-xl","fxHide.gt-xs","fxHide.gt-sm","fxHide.gt-md","fxHide.gt-lg"],O=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=k,e}return a(r,t),r.decorators=[{type:e.Directive,args:[{selector:"\n [fxShow], [fxShow.print],\n [fxShow.xs], [fxShow.sm], [fxShow.md], [fxShow.lg], [fxShow.xl],\n [fxShow.lt-sm], [fxShow.lt-md], [fxShow.lt-lg], [fxShow.lt-xl],\n [fxShow.gt-xs], [fxShow.gt-sm], [fxShow.gt-md], [fxShow.gt-lg],\n [fxHide], [fxHide.print],\n [fxHide.xs], [fxHide.sm], [fxHide.md], [fxHide.lg], [fxHide.xl],\n [fxHide.lt-sm], [fxHide.lt-md], [fxHide.lt-lg], [fxHide.lt-xl],\n [fxHide.gt-xs], [fxHide.gt-sm], [fxHide.gt-md], [fxHide.gt-lg]\n",inputs:k}]}],r}(H),V=function(){function t(t,e,r){void 0===r&&(r=!0),this.key=t,this.value=e,this.key=r?t.replace(/['"]/g,"").trim():t.trim(),this.value=r?e.replace(/['"]/g,"").trim():e.trim(),this.value=this.value.replace(/;/,"")}return t}(),M=function(t){function s(e,n,s,l,i,a,o,c,u){var g=t.call(this,e,null,n,s)||this;g.sanitizer=l,g.ngStyleInstance=o,g.DIRECTIVE_KEY="ngStyle",g.ngStyleInstance||(g.ngStyleInstance=new r.NgStyle(e,i,a)),g.init();var f=g.nativeElement.getAttribute("style")||"";return g.fallbackStyles=g.buildStyleMap(f),g.isServer=c&&r.isPlatformServer(u),g}return a(s,t),s.prototype.updateWithValue=function(t){var e=this.buildStyleMap(t);this.ngStyleInstance.ngStyle=m(m({},this.fallbackStyles),e),this.isServer&&this.applyStyleToElement(e),this.ngStyleInstance.ngDoCheck()},s.prototype.clearStyles=function(){this.ngStyleInstance.ngStyle=this.fallbackStyles,this.ngStyleInstance.ngDoCheck()},s.prototype.buildStyleMap=function(t){var r=this,n=function(t){return r.sanitizer.sanitize(e.SecurityContext.STYLE,t)||""};if(t)switch(c(t)){case"string":return d(u(t),n);case"array":return d(t,n);case"set":default:return f(t,n)}return{}},s.prototype.ngDoCheck=function(){this.ngStyleInstance.ngDoCheck()},s.decorators=[{type:e.Directive}],s.ctorParameters=function(){return[{type:e.ElementRef},{type:n.StyleUtils},{type:n.MediaMarshaller},{type:i.DomSanitizer},{type:e.KeyValueDiffers},{type:e.Renderer2},{type:r.NgStyle,decorators:[{type:e.Optional},{type:e.Self}]},{type:Boolean,decorators:[{type:e.Inject,args:[n.SERVER_TOKEN]}]},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},s}(n.BaseDirective2),_=["ngStyle","ngStyle.xs","ngStyle.sm","ngStyle.md","ngStyle.lg","ngStyle.xl","ngStyle.lt-sm","ngStyle.lt-md","ngStyle.lt-lg","ngStyle.lt-xl","ngStyle.gt-xs","ngStyle.gt-sm","ngStyle.gt-md","ngStyle.gt-lg"],P=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=_,e}return a(r,t),r.decorators=[{type:e.Directive,args:[{selector:"\n [ngStyle],\n [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl],\n [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl],\n [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]\n",inputs:_}]}],r}(M),R=[O,D,P,I],L=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[n.CoreModule],declarations:o(R),exports:o(R)}]}],t}();t.ExtendedModule=L,t.ClassDirective=E,t.DefaultClassDirective=D,t.ImgSrcStyleBuilder=x,t.ImgSrcDirective=S,t.DefaultImgSrcDirective=I,t.ShowHideStyleBuilder=b,t.ShowHideDirective=H,t.DefaultShowHideDirective=O,t.StyleDirective=M,t.DefaultStyleDirective=P,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=flex-layout-extended.umd.min.js.map