blob: 0140713016cb30fa41c261246b40e56117a03726 [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,n,r,s,l,i){"use strict";function a(t,e){function n(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function o(t){var e=typeof t;return"object"===e?t.constructor===Array?"array":t.constructor===Set?"set":"object":e}function c(t,e){return void 0===e&&(e=";"),String(t).trim().split(e).map(function(t){return t.trim()}).filter(function(t){return""!==t})}function u(t,e){var n=function(t){return e&&(t.value=e(t.value)),t};return t.map(f).filter(function(t){return!!t}).map(n).reduce(p,{})}function g(t,e){var n=[];return"set"===o(t)?t.forEach(function(t){return n.push(t)}):Object.keys(t).forEach(function(e){n.push(e+":"+t[e])}),u(n,e)}function f(t){var e=t.split(":"),n=e[0],r=e.slice(1);return new M(n,r.join(":"))}function p(t,e){return e.key&&(t[e.key]=e.value),t}function y(t,e){var n=function(t){return e&&(t.value=e(t.value)),t};return t.map(f).filter(function(t){return!!t}).map(n).reduce(p,{})}var d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},h=function(){return h=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])}return t},h.apply(this,arguments)},m=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.buildStyles=function(t){return{content:t?"url("+t+")":""}},n.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],n.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n}(r.StyleBuilder),x=function(t){function s(e,r,s,l,i,a){var o=t.call(this,e,r,s,l)||this;return o.elementRef=e,o.styleBuilder=r,o.styler=s,o.marshal=l,o.platformId=i,o.serverModuleLoaded=a,o.DIRECTIVE_KEY="img-src",o.defaultSrc="",o.styleCache=S,o.init(),o.setValue(o.nativeElement.getAttribute("src")||"",""),n.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:!0,configurable:!0}),s.prototype.updateWithValue=function(t){var e=t||this.defaultSrc;n.isPlatformServer(this.platformId)&&this.serverModuleLoaded?this.addStyles(e):this.nativeElement.setAttribute("src",e)},s.ctorParameters=function(){return[{type:e.ElementRef},{type:m},{type:r.StyleUtils},{type:r.MediaMarshaller},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:Boolean,decorators:[{type:e.Inject,args:[r.SERVER_TOKEN]}]}]},s.propDecorators={src:[{type:e.Input,args:["src"]}]},s}(r.BaseDirective2),S=new Map,v=["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"],C=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=v,e}return a(n,t),n.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:v}]}],n}(x),I=function(t){function s(e,r,s,l,i){var a=t.call(this,e,null,r,s)||this;return a.elementRef=e,a.styler=r,a.marshal=s,a.delegate=l,a.ngClassInstance=i,a.DIRECTIVE_KEY="ngClass",a.ngClassInstance||(a.ngClassInstance=new n.NgClass(a.delegate)),a.init(),a.setValue("",""),a}return a(s,t),Object.defineProperty(s.prototype,"klass",{set:function(t){this.ngClassInstance.klass=t,this.setValue(t,"")},enumerable:!0,configurable:!0}),s.prototype.updateWithValue=function(t){this.ngClassInstance.ngClass=t,this.ngClassInstance.ngDoCheck()},s.prototype.ngDoCheck=function(){this.ngClassInstance.ngDoCheck()},s.ctorParameters=function(){return[{type:e.ElementRef},{type:r.StyleUtils},{type:r.MediaMarshaller},{type:nNgClassImpl},{type:n.NgClass,decorators:[{type:e.Optional},{type:e.Self}]}]},s.propDecorators={klass:[{type:e.Input,args:["class"]}]},s}(r.BaseDirective2),E=["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"],w={provide:nNgClassImpl,useClass:nNgClassR2Impl},b=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=E,e}return a(n,t),n.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:E,providers:[w]}]}],n}(I),D=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return a(n,t),n.prototype.buildStyles=function(t,e){return{display:"true"===t?e.display:"none"}},n.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],n.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n}(r.StyleBuilder),j=function(t){function i(e,n,r,s,l,i,a){var o=t.call(this,e,n,r,s)||this;return o.elementRef=e,o.styleBuilder=n,o.styler=r,o.marshal=s,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}H.has(this.nativeElement)?this.display=H.get(this.nativeElement):(this.display=this.getDisplayStyle(),H.set(this.nativeElement,this.display)),this.init();var n=this.marshal.getValue(this.nativeElement,this.DIRECTIVE_KEY,"");void 0===n||""===n?this.setValue(!0,""):this.triggerUpdate()},i.prototype.ngOnChanges=function(t){var e=this;Object.keys(t).forEach(function(n){if(-1!==e.inputs.indexOf(n)){var r=n.split("."),l=r.slice(1).join("."),i=t[n].currentValue,a=""===i||0!==i&&s.coerceBooleanProperty(i);"fxHide"===r[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){void 0===t&&(t=!0),""!==t&&(this.addStyles(t?"true":"false",{display:this.display}),n.isPlatformServer(this.platformId)&&this.serverModuleLoaded&&this.nativeElement.style.setProperty("display",""),this.marshal.triggerUpdate(this.parentElement,"layout-gap"))},i.ctorParameters=function(){return[{type:e.ElementRef},{type:D},{type:r.StyleUtils},{type:r.MediaMarshaller},{type:void 0,decorators:[{type:e.Inject,args:[r.LAYOUT_CONFIG]}]},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:Boolean,decorators:[{type:e.Optional},{type:e.Inject,args:[r.SERVER_TOKEN]}]}]},i}(r.BaseDirective2),H=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 n(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=k,e}return a(n,t),n.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}]}],n}(j),M=function(){function t(t,e,n){void 0===n&&(n=!0),this.key=t,this.value=e,this.key=n?t.replace(/['"]/g,"").trim():t.trim(),this.value=n?e.replace(/['"]/g,"").trim():e.trim(),this.value=this.value.replace(/;/,"")}return t}(),R=function(t){function s(e,r,s,l,i,a,o,c){var u=t.call(this,e,null,r,s)||this;u.elementRef=e,u.styler=r,u.marshal=s,u.delegate=l,u.sanitizer=i,u.ngStyleInstance=a,u.DIRECTIVE_KEY="ngStyle",u.ngStyleInstance||(u.ngStyleInstance=new n.NgStyle(u.delegate)),u.init();var g=u.nativeElement.getAttribute("style")||"";return u.fallbackStyles=u.buildStyleMap(g),u.isServer=o&&n.isPlatformServer(c),u}return a(s,t),s.prototype.updateWithValue=function(t){var e=this.buildStyleMap(t);this.ngStyleInstance.ngStyle=h({},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 n=this,r=function(t){return n.sanitizer.sanitize(e.SecurityContext.STYLE,t)||""};if(t)switch(o(t)){case"string":return y(c(t),r);case"array":return y(t,r);case"set":default:return g(t,r)}return{}},s.prototype.ngDoCheck=function(){this.ngStyleInstance.ngDoCheck()},s.ctorParameters=function(){return[{type:e.ElementRef},{type:r.StyleUtils},{type:r.MediaMarshaller},{type:nNgStyleImpl},{type:i.DomSanitizer},{type:n.NgStyle,decorators:[{type:e.Optional},{type:e.Self}]},{type:Boolean,decorators:[{type:e.Optional},{type:e.Inject,args:[r.SERVER_TOKEN]}]},{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},s}(r.BaseDirective2),V=["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={provide:nNgStyleImpl,useClass:nNgStyleR2Impl},_=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.inputs=V,e}return a(n,t),n.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:V,providers:[P]}]}],n}(R),L=[O,b,_,C],N=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[r.CoreModule],declarations:L.slice(),exports:L.slice()}]}],t}();t.ExtendedModule=N,t.ClassDirective=I,t.LayoutNgClassImplProvider=w,t.DefaultClassDirective=b,t.ImgSrcStyleBuilder=m,t.ImgSrcDirective=x,t.DefaultImgSrcDirective=C,t.ShowHideStyleBuilder=D,t.ShowHideDirective=j,t.DefaultShowHideDirective=O,t.StyleDirective=R,t.LayoutNgStyleImplProvider=P,t.DefaultStyleDirective=_,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=flex-layout-extended.umd.min.js.map