UNPKG

@angular/flex-layout

Version:
10 lines (9 loc) 22.8 kB
/** * @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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/flex-layout/core"),require("@angular/cdk/bidi"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@angular/flex-layout/flex",["exports","@angular/core","@angular/flex-layout/core","@angular/cdk/bidi","rxjs","rxjs/operators"],t):t((e.ng=e.ng||{},e.ng.flexLayout=e.ng.flexLayout||{},e.ng.flexLayout.flex={}),e.ng.core,e.ng.flexLayout.core,e.ng.cdk.bidi,e.rxjs,e.rxjs.operators)}(this,function(e,t,r,n,l,i){"use strict";function a(e,t){function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function o(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),l=0,t=0;t<r;t++)for(var i=arguments[t],a=0,o=i.length;a<o;a++,l++)n[l]=i[a];return n}function s(e){var t=u(e);return c(t[0],t[1],t[2])}function u(e){e=e?e.toLowerCase():"";var t=e.split(" "),r=t[0],n=t[1],l=t[2];return b.find(function(e){return e===r})||(r=b[0]),n===F&&(n=l!==F?l:"",l=F),[r,x(n),!!l]}function f(e){return u(e)[0].indexOf("row")>-1}function x(e){if(e)switch(e.toLowerCase()){case"reverse":case"wrap-reverse":case"reverse-wrap":e="wrap-reverse";break;case"no":case"none":case"nowrap":e="nowrap";break;default:e="wrap"}return e}function c(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=!1),{display:r?"inline-flex":"flex","box-sizing":"border-box","flex-direction":e,"flex-wrap":t||null}}function y(e,t){var r="0px",n=e,l="0px";return"rtl"===t?l=e:r=e,{padding:"0px "+r+" "+n+" "+l}}function p(e,t){var r="0px",n="-"+e,l="0px";return"rtl"===t?l="-"+e:r="-"+e,{margin:"0px "+r+" "+n+" "+l}}function d(e,t){switch(t){case"column":return"margin-bottom";case"column-reverse":return"margin-top";case"row":return"rtl"===e?"margin-left":"margin-right";case"row-reverse":return"rtl"===e?"margin-right":"margin-left";default:return"rtl"===e?"margin-left":"margin-right"}}function g(e,t){var r=d(t.directionality,t.layout),n=v({},D);return n[r]=e,n}function h(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(null==e)throw TypeError("Cannot convert undefined or null to object");for(var n=0,l=t;n<l.length;n++){var i=l[n];if(null!=i)for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}return e}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},v=function(){return v=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},v.apply(this,arguments)},F="inline",b=["row","column","row-reverse","column-reverse"],w=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return a(r,e),r.prototype.buildStyles=function(e){return s(e)},r.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],r.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r}(r.StyleBuilder),L=["fxLayout","fxLayout.xs","fxLayout.sm","fxLayout.md","fxLayout.lg","fxLayout.xl","fxLayout.lt-sm","fxLayout.lt-md","fxLayout.lt-lg","fxLayout.lt-xl","fxLayout.gt-xs","fxLayout.gt-sm","fxLayout.gt-md","fxLayout.gt-lg"],O=function(e){function n(t,r,n,l){var i=e.call(this,t,n,r,l)||this;return i.DIRECTIVE_KEY="layout",i.styleCache=A,i.init(),i}return a(n,e),n.decorators=[{type:t.Directive}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:r.StyleUtils},{type:w},{type:r.MediaMarshaller}]},n}(r.BaseDirective2),S=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=L,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{selector:"\n [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],\n [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],\n [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],\n [fxLayout.gt-md], [fxLayout.gt-lg]\n",inputs:L}]}],r}(O),A=new Map,D={"margin-left":null,"margin-right":null,"margin-top":null,"margin-bottom":null},k=function(e){function n(t){var r=e.call(this)||this;return r._styler=t,r}return a(n,e),n.prototype.buildStyles=function(e,t){return e.endsWith(U)?(e=e.slice(0,e.indexOf(U)),p(e,t.directionality)):{}},n.prototype.sideEffect=function(e,t,r){var n=r.items;if(e.endsWith(U)){e=e.slice(0,e.indexOf(U));var l=y(e,r.directionality);this._styler.applyStyleToElements(l,r.items)}else{var i=n.pop(),a=g(e,r);this._styler.applyStyleToElements(a,n),this._styler.applyStyleToElements(D,[i])}},n.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],n.ctorParameters=function(){return[{type:r.StyleUtils}]},n.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(r.StyleUtils))},token:n,providedIn:"root"}),n}(r.StyleBuilder),I=["fxLayoutGap","fxLayoutGap.xs","fxLayoutGap.sm","fxLayoutGap.md","fxLayoutGap.lg","fxLayoutGap.xl","fxLayoutGap.lt-sm","fxLayoutGap.lt-md","fxLayoutGap.lt-lg","fxLayoutGap.lt-xl","fxLayoutGap.gt-xs","fxLayoutGap.gt-sm","fxLayoutGap.gt-md","fxLayoutGap.gt-lg"],j=function(e){function o(t,r,n,a,o,s){var u=e.call(this,t,o,a,s)||this;u.zone=r,u.directionality=n,u.styleUtils=a,u.layout="row",u.DIRECTIVE_KEY="layout-gap",u.observerSubject=new l.Subject;var f=[u.directionality.change,u.observerSubject.asObservable()];return u.init(f),u.marshal.trackValue(u.nativeElement,"layout").pipe(i.takeUntil(u.destroySubject)).subscribe(u.onLayoutChange.bind(u)),u}return a(o,e),Object.defineProperty(o.prototype,"childrenNodes",{get:function(){for(var e=this.nativeElement.children,t=[],r=e.length;r--;)t[r]=e[r];return t},enumerable:!0,configurable:!0}),o.prototype.ngAfterContentInit=function(){this.buildChildObservable(),this.triggerUpdate()},o.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this.observer&&this.observer.disconnect()},o.prototype.onLayoutChange=function(e){var t=this,r=e.value,n=r.split(" ");this.layout=n[0],b.find(function(e){return e===t.layout})||(this.layout="row"),this.triggerUpdate()},o.prototype.updateWithValue=function(e){var t=this,r=this.childrenNodes.filter(function(e){return 1===e.nodeType&&t.willDisplay(e)}).sort(function(e,r){var n=+t.styler.lookupStyle(e,"order"),l=+t.styler.lookupStyle(r,"order");return isNaN(n)||isNaN(l)||n===l?0:n>l?1:-1});if(r.length>0){var n=this.directionality.value,l=this.layout;"row"===l&&"rtl"===n?this.styleCache=E:"row"===l&&"rtl"!==n?this.styleCache=G:"column"===l&&"rtl"===n?this.styleCache=M:"column"===l&&"rtl"!==n&&(this.styleCache=B),this.addStyles(e,{directionality:n,items:r,layout:l})}},o.prototype.clearStyles=function(){var t,r=Object.keys(this.mru).length>0,n=r?"padding":d(this.directionality.value,this.layout);r&&e.prototype.clearStyles.call(this),this.styleUtils.applyStyleToElements((t={},t[n]="",t),this.childrenNodes)},o.prototype.willDisplay=function(e){var t=this.marshal.getValue(e,"show-hide");return!0===t||void 0===t&&"none"!==this.styleUtils.lookupStyle(e,"display")},o.prototype.buildChildObservable=function(){var e=this;this.zone.runOutsideAngular(function(){"undefined"!=typeof MutationObserver&&(e.observer=new MutationObserver(function(t){var r=function(e){return e.addedNodes&&e.addedNodes.length>0||e.removedNodes&&e.removedNodes.length>0};t.some(r)&&e.observerSubject.next()}),e.observer.observe(e.nativeElement,{childList:!0}))})},o.decorators=[{type:t.Directive}],o.ctorParameters=function(){return[{type:t.ElementRef},{type:t.NgZone},{type:n.Directionality},{type:r.StyleUtils},{type:k},{type:r.MediaMarshaller}]},o}(r.BaseDirective2),C=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=I,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{selector:"\n [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md],\n [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md],\n [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm],\n [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]\n",inputs:I}]}],r}(j),E=new Map,M=new Map,G=new Map,B=new Map,U=" grid",_=function(e){function n(t){var r=e.call(this)||this;return r.layoutConfig=t,r}return a(n,e),n.prototype.buildStyles=function(e,t){var r=e.split(" "),n=r[0],l=r[1],i=r.slice(2),a=i.join(" "),o=t.direction.indexOf("column")>-1?"column":"row",s=f(o)?"max-width":"max-height",u=f(o)?"min-width":"min-height",x=String(a).indexOf("calc")>-1,c=x||"auto"===a,y=String(a).indexOf("%")>-1&&!x,p=String(a).indexOf("px")>-1||String(a).indexOf("rem")>-1||String(a).indexOf("em")>-1||String(a).indexOf("vw")>-1||String(a).indexOf("vh")>-1,d=x||p;n="0"==n?0:n,l="0"==l?0:l;var g=!n&&!l,m={},v={"max-width":null,"max-height":null,"min-width":null,"min-height":null};switch(a||""){case"":var F=!1!==this.layoutConfig.useColumnBasisZero;a="row"===o?"0%":F?"0.000000001px":"auto";break;case"initial":case"nogrow":n=0,a="auto";break;case"grow":a="100%";break;case"noshrink":l=0,a="auto";break;case"auto":break;case"none":n=0,l=0,a="auto";break;default:d||y||isNaN(a)||(a+="%"),"0%"===a&&(d=!0),"0px"===a&&(a="0%"),m=x?h(v,{"flex-grow":n,"flex-shrink":l,"flex-basis":d?a:"100%"}):h(v,{flex:n+" "+l+" "+(d?a:"100%")})}return m.flex||m["flex-grow"]||(m=x?h(v,{"flex-grow":n,"flex-shrink":l,"flex-basis":a}):h(v,{flex:n+" "+l+" "+a})),"0%"!==a&&"0px"!==a&&"0.000000001px"!==a&&"auto"!==a&&(m[u]=g||d&&n?a:null,m[s]=g||!c&&l?a:null),m[u]||m[s]?t.hasWrap&&(m[x?"flex-basis":"flex"]=m[s]?x?m[s]:n+" "+l+" "+m[s]:x?m[u]:n+" "+l+" "+m[u]):m=x?h(v,{"flex-grow":n,"flex-shrink":l,"flex-basis":a}):h(v,{flex:n+" "+l+" "+a}),h(m,{"box-sizing":"border-box"})},n.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],n.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[r.LAYOUT_CONFIG]}]}]},n.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new n(t.ɵɵinject(r.LAYOUT_CONFIG))},token:n,providedIn:"root"}),n}(r.StyleBuilder),R=["fxFlex","fxFlex.xs","fxFlex.sm","fxFlex.md","fxFlex.lg","fxFlex.xl","fxFlex.lt-sm","fxFlex.lt-md","fxFlex.lt-lg","fxFlex.lt-xl","fxFlex.gt-xs","fxFlex.gt-sm","fxFlex.gt-md","fxFlex.gt-lg"],N=function(e){function n(t,r,n,l,a){var o=e.call(this,t,l,r,a)||this;return o.layoutConfig=n,o.DIRECTIVE_KEY="flex",o.direction="",o.wrap=!1,o.flexGrow="1",o.flexShrink="1",o.init(),o.parentElement&&(o.marshal.trackValue(o.parentElement,"layout").pipe(i.takeUntil(o.destroySubject)).subscribe(o.onLayoutChange.bind(o)),o.marshal.trackValue(o.nativeElement,"layout-align").pipe(i.takeUntil(o.destroySubject)).subscribe(o.triggerReflow.bind(o))),o}return a(n,e),Object.defineProperty(n.prototype,"shrink",{get:function(){return this.flexShrink},set:function(e){this.flexShrink=e||"1",this.triggerReflow()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"grow",{get:function(){return this.flexGrow},set:function(e){this.flexGrow=e||"1",this.triggerReflow()},enumerable:!0,configurable:!0}),n.prototype.onLayoutChange=function(e){var t=e.value,r=t.split(" ");this.direction=r[0],this.wrap=void 0!==r[1]&&"wrap"===r[1],this.triggerUpdate()},n.prototype.updateWithValue=function(e){var t=!1!==this.layoutConfig.addFlexToParent;this.direction||(this.direction=this.getFlexFlowDirection(this.parentElement,t));var n=this.direction,l=n.startsWith("row"),i=this.wrap;l&&i?this.styleCache=Y:l&&!i?this.styleCache=V:!l&&i?this.styleCache=W:l||i||(this.styleCache=T);var a=String(e).replace(";",""),o=r.validateBasis(a,this.flexGrow,this.flexShrink);this.addStyles(o.join(" "),{direction:n,hasWrap:i})},n.prototype.triggerReflow=function(){var e=this.activatedValue;if(void 0!==e){var t=r.validateBasis(e+"",this.flexGrow,this.flexShrink);this.marshal.updateElement(this.nativeElement,this.DIRECTIVE_KEY,t.join(" "))}},n.decorators=[{type:t.Directive}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:r.StyleUtils},{type:void 0,decorators:[{type:t.Inject,args:[r.LAYOUT_CONFIG]}]},{type:_},{type:r.MediaMarshaller}]},n.propDecorators={shrink:[{type:t.Input,args:["fxShrink"]}],grow:[{type:t.Input,args:["fxGrow"]}]},n}(r.BaseDirective2),P=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=R,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{inputs:R,selector:"\n [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md],\n [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md],\n [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm],\n [fxFlex.gt-md], [fxFlex.gt-lg]\n"}]}],r}(N),V=new Map,T=new Map,Y=new Map,W=new Map,K=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return a(r,e),r.prototype.buildStyles=function(e){return{order:e&&parseInt(e,10)||""}},r.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],r.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r}(r.StyleBuilder),q=["fxFlexOrder","fxFlexOrder.xs","fxFlexOrder.sm","fxFlexOrder.md","fxFlexOrder.lg","fxFlexOrder.xl","fxFlexOrder.lt-sm","fxFlexOrder.lt-md","fxFlexOrder.lt-lg","fxFlexOrder.lt-xl","fxFlexOrder.gt-xs","fxFlexOrder.gt-sm","fxFlexOrder.gt-md","fxFlexOrder.gt-lg"],z=function(e){function n(t,r,n,l){var i=e.call(this,t,n,r,l)||this;return i.DIRECTIVE_KEY="flex-order",i.styleCache=Z,i.init(),i}return a(n,e),n.decorators=[{type:t.Directive}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:r.StyleUtils},{type:K},{type:r.MediaMarshaller}]},n}(r.BaseDirective2),Z=new Map,H=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=q,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{selector:"\n [fxFlexOrder], [fxFlexOrder.xs], [fxFlexOrder.sm], [fxFlexOrder.md],\n [fxFlexOrder.lg], [fxFlexOrder.xl], [fxFlexOrder.lt-sm], [fxFlexOrder.lt-md],\n [fxFlexOrder.lt-lg], [fxFlexOrder.lt-xl], [fxFlexOrder.gt-xs], [fxFlexOrder.gt-sm],\n [fxFlexOrder.gt-md], [fxFlexOrder.gt-lg]\n",inputs:q}]}],r}(z),J=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return a(r,e),r.prototype.buildStyles=function(e,t){var r;""===e&&(e="0");var n=String(e).indexOf("%")>-1;String(e).indexOf("px")>-1||n||isNaN(+e)||(e+="%");var l=t.isRtl?"margin-right":"margin-left";return f(t.layout)?(r={},r[l]=""+e,r):{"margin-top":""+e}},r.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],r.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r}(r.StyleBuilder),Q=["fxFlexOffset","fxFlexOffset.xs","fxFlexOffset.sm","fxFlexOffset.md","fxFlexOffset.lg","fxFlexOffset.xl","fxFlexOffset.lt-sm","fxFlexOffset.lt-md","fxFlexOffset.lt-lg","fxFlexOffset.lt-xl","fxFlexOffset.gt-xs","fxFlexOffset.gt-sm","fxFlexOffset.gt-md","fxFlexOffset.gt-lg"],X=function(e){function l(t,r,n,l,a){var o=e.call(this,t,n,a,l)||this;return o.directionality=r,o.DIRECTIVE_KEY="flex-offset",o.init([o.directionality.change]),o.parentElement&&o.marshal.trackValue(o.parentElement,"layout-gap").pipe(i.takeUntil(o.destroySubject)).subscribe(o.triggerUpdate.bind(o)),o}return a(l,e),l.prototype.updateWithValue=function(e){void 0===e&&(e="");var t=this.getFlexFlowDirection(this.parentElement,!0),r="rtl"===this.directionality.value;"row"===t&&r?this.styleCache=ee:"row"!==t||r?"column"===t&&r?this.styleCache=te:"column"!==t||r||(this.styleCache=ne):this.styleCache=re,this.addStyles(e+"",{layout:t,isRtl:r})},l.decorators=[{type:t.Directive}],l.ctorParameters=function(){return[{type:t.ElementRef},{type:n.Directionality},{type:J},{type:r.MediaMarshaller},{type:r.StyleUtils}]},l}(r.BaseDirective2),$=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=Q,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{selector:"\n [fxFlexOffset], [fxFlexOffset.xs], [fxFlexOffset.sm], [fxFlexOffset.md],\n [fxFlexOffset.lg], [fxFlexOffset.xl], [fxFlexOffset.lt-sm], [fxFlexOffset.lt-md],\n [fxFlexOffset.lt-lg], [fxFlexOffset.lt-xl], [fxFlexOffset.gt-xs], [fxFlexOffset.gt-sm],\n [fxFlexOffset.gt-md], [fxFlexOffset.gt-lg]\n",inputs:Q}]}],r}(X),ee=new Map,te=new Map,re=new Map,ne=new Map,le=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return a(r,e),r.prototype.buildStyles=function(e){e=e||"stretch";var t={};switch(e){case"start":t["align-self"]="flex-start";break;case"end":t["align-self"]="flex-end";break;default:t["align-self"]=e}return t},r.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],r.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r}(r.StyleBuilder),ie=["fxFlexAlign","fxFlexAlign.xs","fxFlexAlign.sm","fxFlexAlign.md","fxFlexAlign.lg","fxFlexAlign.xl","fxFlexAlign.lt-sm","fxFlexAlign.lt-md","fxFlexAlign.lt-lg","fxFlexAlign.lt-xl","fxFlexAlign.gt-xs","fxFlexAlign.gt-sm","fxFlexAlign.gt-md","fxFlexAlign.gt-lg"],ae=function(e){function n(t,r,n,l){var i=e.call(this,t,n,r,l)||this;return i.DIRECTIVE_KEY="flex-align",i.styleCache=oe,i.init(),i}return a(n,e),n.decorators=[{type:t.Directive}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:r.StyleUtils},{type:le},{type:r.MediaMarshaller}]},n}(r.BaseDirective2),oe=new Map,se=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=ie,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{selector:"\n [fxFlexAlign], [fxFlexAlign.xs], [fxFlexAlign.sm], [fxFlexAlign.md],\n [fxFlexAlign.lg], [fxFlexAlign.xl], [fxFlexAlign.lt-sm], [fxFlexAlign.lt-md],\n [fxFlexAlign.lt-lg], [fxFlexAlign.lt-xl], [fxFlexAlign.gt-xs], [fxFlexAlign.gt-sm],\n [fxFlexAlign.gt-md], [fxFlexAlign.gt-lg]\n",inputs:ie}]}],r}(ae),ue={margin:0,width:"100%",height:"100%","min-width":"100%","min-height":"100%"},fe=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return a(r,e),r.prototype.buildStyles=function(e){return ue},r.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],r.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r}(r.StyleBuilder),xe=function(e){function n(t,r,n,l){var i=e.call(this,t,n,r,l)||this;return i.styleCache=ce,i.addStyles(""),i}return a(n,e),n.decorators=[{type:t.Directive,args:[{selector:"[fxFill], [fxFlexFill]"}]}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:r.StyleUtils},{type:fe},{type:r.MediaMarshaller}]},n}(r.BaseDirective2),ce=new Map,ye=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return a(r,e),r.prototype.buildStyles=function(e,t){var r={},n=e.split(" "),l=n[0],i=n[1];switch(l){case"center":r["justify-content"]="center";break;case"space-around":r["justify-content"]="space-around";break;case"space-between":r["justify-content"]="space-between";break;case"space-evenly":r["justify-content"]="space-evenly";break;case"end":case"flex-end":r["justify-content"]="flex-end";break;case"start":case"flex-start":default:r["justify-content"]="flex-start"}switch(i){case"start":case"flex-start":r["align-items"]=r["align-content"]="flex-start";break;case"center":r["align-items"]=r["align-content"]="center";break;case"end":case"flex-end":r["align-items"]=r["align-content"]="flex-end";break;case"space-between":r["align-content"]="space-between",r["align-items"]="stretch";break;case"space-around":r["align-content"]="space-around",r["align-items"]="stretch";break;case"baseline":r["align-content"]="stretch",r["align-items"]="baseline";break;case"stretch":default:r["align-items"]=r["align-content"]="stretch"}return h(r,{display:t.inline?"inline-flex":"flex","flex-direction":t.layout,"box-sizing":"border-box","max-width":"stretch"===i?f(t.layout)?null:"100%":null,"max-height":"stretch"===i&&f(t.layout)?"100%":null})},r.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],r.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new r},token:r,providedIn:"root"}),r}(r.StyleBuilder),pe=["fxLayoutAlign","fxLayoutAlign.xs","fxLayoutAlign.sm","fxLayoutAlign.md","fxLayoutAlign.lg","fxLayoutAlign.xl","fxLayoutAlign.lt-sm","fxLayoutAlign.lt-md","fxLayoutAlign.lt-lg","fxLayoutAlign.lt-xl","fxLayoutAlign.gt-xs","fxLayoutAlign.gt-sm","fxLayoutAlign.gt-md","fxLayoutAlign.gt-lg"],de=function(e){function n(t,r,n,l){var a=e.call(this,t,n,r,l)||this;return a.DIRECTIVE_KEY="layout-align",a.layout="row",a.inline=!1,a.init(),a.marshal.trackValue(a.nativeElement,"layout").pipe(i.takeUntil(a.destroySubject)).subscribe(a.onLayoutChange.bind(a)),a}return a(n,e),n.prototype.updateWithValue=function(e){var t=this.layout||"row",r=this.inline;"row"===t&&r?this.styleCache=be:"row"!==t||r?"row-reverse"===t&&r?this.styleCache=Le:"row-reverse"!==t||r?"column"===t&&r?this.styleCache=we:"column"!==t||r?"column-reverse"===t&&r?this.styleCache=Oe:"column-reverse"!==t||r||(this.styleCache=Fe):this.styleCache=me:this.styleCache=ve:this.styleCache=he,this.addStyles(e,{layout:t,inline:r})},n.prototype.onLayoutChange=function(e){var t=this,r=e.value.split(" ");this.layout=r[0],this.inline=e.value.includes("inline"),b.find(function(e){return e===t.layout})||(this.layout="row"),this.triggerUpdate()},n.decorators=[{type:t.Directive}],n.ctorParameters=function(){return[{type:t.ElementRef},{type:r.StyleUtils},{type:ye},{type:r.MediaMarshaller}]},n}(r.BaseDirective2),ge=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.inputs=pe,t}return a(r,e),r.decorators=[{type:t.Directive,args:[{selector:"\n [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md],\n [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md],\n [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm],\n [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]\n",inputs:pe}]}],r}(de),he=new Map,me=new Map,ve=new Map,Fe=new Map,be=new Map,we=new Map,Le=new Map,Oe=new Map,Se=[S,C,ge,H,$,xe,se,P],Ae=function(){function e(){}return e.decorators=[{type:t.NgModule,args:[{imports:[r.CoreModule,n.BidiModule],declarations:o(Se),exports:o(Se)}]}],e}();e.FlexModule=Ae,e.FlexStyleBuilder=_,e.FlexDirective=N,e.DefaultFlexDirective=P,e.FlexAlignStyleBuilder=le,e.FlexAlignDirective=ae,e.DefaultFlexAlignDirective=se,e.FlexFillStyleBuilder=fe,e.FlexFillDirective=xe,e.FlexOffsetStyleBuilder=J,e.FlexOffsetDirective=X,e.DefaultFlexOffsetDirective=$,e.FlexOrderStyleBuilder=K,e.FlexOrderDirective=z,e.DefaultFlexOrderDirective=H,e.LayoutStyleBuilder=w,e.LayoutDirective=O,e.DefaultLayoutDirective=S,e.LayoutAlignStyleBuilder=ye,e.LayoutAlignDirective=de,e.DefaultLayoutAlignDirective=ge,e.LayoutGapStyleBuilder=k,e.LayoutGapDirective=j,e.DefaultLayoutGapDirective=C,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=flex-layout-flex.umd.min.js.map