-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path43-es2015.0149678948629abe01dd.js
1 lines (1 loc) · 13.9 KB
/
43-es2015.0149678948629abe01dd.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{Dh3D:function(t,e,r){"use strict";r.d(e,"a",function(){return f}),r.d(e,"b",function(){return C}),r.d(e,"c",function(){return k});var i=r("fXoL"),a=r("8LU1"),s=r("FKr1"),o=r("FtGj"),c=r("XNiG"),n=r("VRyK"),d=r("R0Ic"),h=r("ofXK"),b=r("u47x");const l=["mat-sort-header",""];function m(t,e){if(1&t){const t=i.fc();i.ec(0,"div",3),i.lc("@arrowPosition.start",function(){return i.Gc(t),i.pc()._disableViewStateAnimation=!0})("@arrowPosition.done",function(){return i.Gc(t),i.pc()._disableViewStateAnimation=!1}),i.Zb(1,"div",4),i.ec(2,"div",5),i.Zb(3,"div",6),i.Zb(4,"div",7),i.Zb(5,"div",8),i.dc(),i.dc()}if(2&t){const t=i.pc();i.vc("@arrowOpacity",t._getArrowViewState())("@arrowPosition",t._getArrowViewState())("@allowChildren",t._getArrowDirectionState()),i.Mb(2),i.vc("@indicator",t._getArrowDirectionState()),i.Mb(1),i.vc("@leftPointer",t._getArrowDirectionState()),i.Mb(1),i.vc("@rightPointer",t._getArrowDirectionState())}}const O=["*"];class u{}const j=Object(s.D)(Object(s.B)(u));let f=(()=>{class t extends j{constructor(){super(...arguments),this.sortables=new Map,this._stateChanges=new c.a,this.start="asc",this._direction="",this.sortChange=new i.s}get direction(){return this._direction}set direction(t){this._direction=t}get disableClear(){return this._disableClear}set disableClear(t){this._disableClear=Object(a.c)(t)}register(t){this.sortables.set(t.id,t)}deregister(t){this.sortables.delete(t.id)}sort(t){this.active!=t.id?(this.active=t.id,this.direction=t.start?t.start:this.start):this.direction=this.getNextSortDirection(t),this.sortChange.emit({active:this.active,direction:this.direction})}getNextSortDirection(t){if(!t)return"";let e=function(t,e){let r=["asc","desc"];return"desc"==t&&r.reverse(),e||r.push(""),r}(t.start||this.start,null!=t.disableClear?t.disableClear:this.disableClear),r=e.indexOf(this.direction)+1;return r>=e.length&&(r=0),e[r]}ngOnInit(){this._markInitialized()}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}}return t.\u0275fac=function(e){return p(e||t)},t.\u0275dir=i.Tb({type:t,selectors:[["","matSort",""]],hostAttrs:[1,"mat-sort"],inputs:{disabled:["matSortDisabled","disabled"],start:["matSortStart","start"],direction:["matSortDirection","direction"],disableClear:["matSortDisableClear","disableClear"],active:["matSortActive","active"]},outputs:{sortChange:"matSortChange"},exportAs:["matSort"],features:[i.Jb,i.Kb]}),t})();const p=i.gc(f),_=s.b.ENTERING+" "+s.a.STANDARD_CURVE,g={indicator:Object(d.m)("indicator",[Object(d.j)("active-asc, asc",Object(d.k)({transform:"translateY(0px)"})),Object(d.j)("active-desc, desc",Object(d.k)({transform:"translateY(10px)"})),Object(d.l)("active-asc <=> active-desc",Object(d.e)(_))]),leftPointer:Object(d.m)("leftPointer",[Object(d.j)("active-asc, asc",Object(d.k)({transform:"rotate(-45deg)"})),Object(d.j)("active-desc, desc",Object(d.k)({transform:"rotate(45deg)"})),Object(d.l)("active-asc <=> active-desc",Object(d.e)(_))]),rightPointer:Object(d.m)("rightPointer",[Object(d.j)("active-asc, asc",Object(d.k)({transform:"rotate(45deg)"})),Object(d.j)("active-desc, desc",Object(d.k)({transform:"rotate(-45deg)"})),Object(d.l)("active-asc <=> active-desc",Object(d.e)(_))]),arrowOpacity:Object(d.m)("arrowOpacity",[Object(d.j)("desc-to-active, asc-to-active, active",Object(d.k)({opacity:1})),Object(d.j)("desc-to-hint, asc-to-hint, hint",Object(d.k)({opacity:.54})),Object(d.j)("hint-to-desc, active-to-desc, desc, hint-to-asc, active-to-asc, asc, void",Object(d.k)({opacity:0})),Object(d.l)("* => asc, * => desc, * => active, * => hint, * => void",Object(d.e)("0ms")),Object(d.l)("* <=> *",Object(d.e)(_))]),arrowPosition:Object(d.m)("arrowPosition",[Object(d.l)("* => desc-to-hint, * => desc-to-active",Object(d.e)(_,Object(d.g)([Object(d.k)({transform:"translateY(-25%)"}),Object(d.k)({transform:"translateY(0)"})]))),Object(d.l)("* => hint-to-desc, * => active-to-desc",Object(d.e)(_,Object(d.g)([Object(d.k)({transform:"translateY(0)"}),Object(d.k)({transform:"translateY(25%)"})]))),Object(d.l)("* => asc-to-hint, * => asc-to-active",Object(d.e)(_,Object(d.g)([Object(d.k)({transform:"translateY(25%)"}),Object(d.k)({transform:"translateY(0)"})]))),Object(d.l)("* => hint-to-asc, * => active-to-asc",Object(d.e)(_,Object(d.g)([Object(d.k)({transform:"translateY(0)"}),Object(d.k)({transform:"translateY(-25%)"})]))),Object(d.j)("desc-to-hint, asc-to-hint, hint, desc-to-active, asc-to-active, active",Object(d.k)({transform:"translateY(0)"})),Object(d.j)("hint-to-desc, active-to-desc, desc",Object(d.k)({transform:"translateY(-25%)"})),Object(d.j)("hint-to-asc, active-to-asc, asc",Object(d.k)({transform:"translateY(25%)"}))]),allowChildren:Object(d.m)("allowChildren",[Object(d.l)("* <=> *",[Object(d.h)("@*",Object(d.f)(),{optional:!0})])])};let w=(()=>{class t{constructor(){this.changes=new c.a,this.sortButtonLabel=t=>"Change sorting for "+t}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=Object(i.Ub)({factory:function(){return new t},token:t,providedIn:"root"}),t})();const v={provide:w,deps:[[new i.J,new i.T,w]],useFactory:function(t){return t||new w}};class S{}const D=Object(s.B)(S);let C=(()=>{class t extends D{constructor(t,e,r,i,a,s){super(),this._intl=t,this._sort=r,this._columnDef=i,this._focusMonitor=a,this._elementRef=s,this._showIndicatorHint=!1,this._arrowDirection="",this._disableViewStateAnimation=!1,this.arrowPosition="after",this._rerenderSubscription=Object(n.a)(r.sortChange,r._stateChanges,t.changes).subscribe(()=>{this._isSorted()&&this._updateArrowDirection(),!this._isSorted()&&this._viewState&&"active"===this._viewState.toState&&(this._disableViewStateAnimation=!1,this._setAnimationTransitionState({fromState:"active",toState:this._arrowDirection})),e.markForCheck()})}get disableClear(){return this._disableClear}set disableClear(t){this._disableClear=Object(a.c)(t)}ngOnInit(){!this.id&&this._columnDef&&(this.id=this._columnDef.name),this._updateArrowDirection(),this._setAnimationTransitionState({toState:this._isSorted()?"active":this._arrowDirection}),this._sort.register(this)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(t=>this._setIndicatorHintVisible(!!t))}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._sort.deregister(this),this._rerenderSubscription.unsubscribe()}_setIndicatorHintVisible(t){this._isDisabled()&&t||(this._showIndicatorHint=t,this._isSorted()||(this._updateArrowDirection(),this._setAnimationTransitionState(this._showIndicatorHint?{fromState:this._arrowDirection,toState:"hint"}:{fromState:"hint",toState:this._arrowDirection})))}_setAnimationTransitionState(t){this._viewState=t,this._disableViewStateAnimation&&(this._viewState={toState:t.toState})}_toggleOnInteraction(){this._sort.sort(this),"hint"!==this._viewState.toState&&"active"!==this._viewState.toState||(this._disableViewStateAnimation=!0);const t=this._isSorted()?{fromState:this._arrowDirection,toState:"active"}:{fromState:"active",toState:this._arrowDirection};this._setAnimationTransitionState(t),this._showIndicatorHint=!1}_handleClick(){this._isDisabled()||this._toggleOnInteraction()}_handleKeydown(t){this._isDisabled()||t.keyCode!==o.o&&t.keyCode!==o.g||(t.preventDefault(),this._toggleOnInteraction())}_isSorted(){return this._sort.active==this.id&&("asc"===this._sort.direction||"desc"===this._sort.direction)}_getArrowDirectionState(){return`${this._isSorted()?"active-":""}${this._arrowDirection}`}_getArrowViewState(){const t=this._viewState.fromState;return(t?t+"-to-":"")+this._viewState.toState}_updateArrowDirection(){this._arrowDirection=this._isSorted()?this._sort.direction:this.start||this._sort.start}_isDisabled(){return this._sort.disabled||this.disabled}_getAriaSortAttribute(){return this._isSorted()?"asc"==this._sort.direction?"ascending":"descending":"none"}_renderArrow(){return!this._isDisabled()||this._isSorted()}}return t.\u0275fac=function(e){return new(e||t)(i.Yb(w),i.Yb(i.i),i.Yb(f,8),i.Yb("MAT_SORT_HEADER_COLUMN_DEF",8),i.Yb(b.h),i.Yb(i.p))},t.\u0275cmp=i.Sb({type:t,selectors:[["","mat-sort-header",""]],hostAttrs:[1,"mat-sort-header"],hostVars:3,hostBindings:function(t,e){1&t&&i.lc("click",function(){return e._handleClick()})("keydown",function(t){return e._handleKeydown(t)})("mouseenter",function(){return e._setIndicatorHintVisible(!0)})("mouseleave",function(){return e._setIndicatorHintVisible(!1)}),2&t&&(i.Nb("aria-sort",e._getAriaSortAttribute()),i.Qb("mat-sort-header-disabled",e._isDisabled()))},inputs:{disabled:"disabled",arrowPosition:"arrowPosition",disableClear:"disableClear",id:["mat-sort-header","id"],start:"start"},exportAs:["matSortHeader"],features:[i.Jb],attrs:l,ngContentSelectors:O,decls:4,vars:6,consts:[["role","button",1,"mat-sort-header-container","mat-focus-indicator"],[1,"mat-sort-header-content"],["class","mat-sort-header-arrow",4,"ngIf"],[1,"mat-sort-header-arrow"],[1,"mat-sort-header-stem"],[1,"mat-sort-header-indicator"],[1,"mat-sort-header-pointer-left"],[1,"mat-sort-header-pointer-right"],[1,"mat-sort-header-pointer-middle"]],template:function(t,e){1&t&&(i.uc(),i.ec(0,"div",0),i.ec(1,"div",1),i.tc(2),i.dc(),i.Qc(3,m,6,6,"div",2),i.dc()),2&t&&(i.Qb("mat-sort-header-sorted",e._isSorted())("mat-sort-header-position-before","before"==e.arrowPosition),i.Nb("tabindex",e._isDisabled()?null:0),i.Mb(3),i.vc("ngIf",e._renderArrow()))},directives:[h.t],styles:[".mat-sort-header-container{display:flex;cursor:pointer;align-items:center;letter-spacing:normal;outline:0}[mat-sort-header].cdk-keyboard-focused .mat-sort-header-container,[mat-sort-header].cdk-program-focused .mat-sort-header-container{border-bottom:solid 1px currentColor}.mat-sort-header-disabled .mat-sort-header-container{cursor:default}.mat-sort-header-content{text-align:center;display:flex;align-items:center}.mat-sort-header-position-before{flex-direction:row-reverse}.mat-sort-header-arrow{height:12px;width:12px;min-width:12px;position:relative;display:flex;opacity:0}.mat-sort-header-arrow,[dir=rtl] .mat-sort-header-position-before .mat-sort-header-arrow{margin:0 0 0 6px}.mat-sort-header-position-before .mat-sort-header-arrow,[dir=rtl] .mat-sort-header-arrow{margin:0 6px 0 0}.mat-sort-header-stem{background:currentColor;height:10px;width:2px;margin:auto;display:flex;align-items:center}.cdk-high-contrast-active .mat-sort-header-stem{width:0;border-left:solid 2px}.mat-sort-header-indicator{width:100%;height:2px;display:flex;align-items:center;position:absolute;top:0;left:0}.mat-sort-header-pointer-middle{margin:auto;height:2px;width:2px;background:currentColor;transform:rotate(45deg)}.cdk-high-contrast-active .mat-sort-header-pointer-middle{width:0;height:0;border-top:solid 2px;border-left:solid 2px}.mat-sort-header-pointer-left,.mat-sort-header-pointer-right{background:currentColor;width:6px;height:2px;position:absolute;top:0}.cdk-high-contrast-active .mat-sort-header-pointer-left,.cdk-high-contrast-active .mat-sort-header-pointer-right{width:0;height:0;border-left:solid 6px;border-top:solid 2px}.mat-sort-header-pointer-left{transform-origin:right;left:0}.mat-sort-header-pointer-right{transform-origin:left;right:0}\n"],encapsulation:2,data:{animation:[g.indicator,g.leftPointer,g.rightPointer,g.arrowOpacity,g.arrowPosition,g.allowChildren]},changeDetection:0}),t})(),k=(()=>{class t{}return t.\u0275mod=i.Wb({type:t}),t.\u0275inj=i.Vb({factory:function(e){return new(e||t)},providers:[v],imports:[[h.c,s.j]]}),t})()},iM0R:function(t,e,r){"use strict";r.r(e),r.d(e,"SortExamplesModule",function(){return d}),r.d(e,"SortOverviewExample",function(){return c});var i=r("ofXK"),a=r("fXoL"),s=r("Dh3D");function o(t,e){if(1&t&&(Object(a.ec)(0,"tr"),Object(a.ec)(1,"td"),Object(a.Sc)(2),Object(a.dc)(),Object(a.ec)(3,"td"),Object(a.Sc)(4),Object(a.dc)(),Object(a.ec)(5,"td"),Object(a.Sc)(6),Object(a.dc)(),Object(a.ec)(7,"td"),Object(a.Sc)(8),Object(a.dc)(),Object(a.ec)(9,"td"),Object(a.Sc)(10),Object(a.dc)(),Object(a.dc)()),2&t){const t=e.$implicit;Object(a.Mb)(2),Object(a.Tc)(t.name),Object(a.Mb)(2),Object(a.Tc)(t.calories),Object(a.Mb)(2),Object(a.Tc)(t.fat),Object(a.Mb)(2),Object(a.Tc)(t.carbs),Object(a.Mb)(2),Object(a.Tc)(t.protein)}}let c=(()=>{class t{constructor(){this.desserts=[{name:"Frozen yogurt",calories:159,fat:6,carbs:24,protein:4},{name:"Ice cream sandwich",calories:237,fat:9,carbs:37,protein:4},{name:"Eclair",calories:262,fat:16,carbs:24,protein:6},{name:"Cupcake",calories:305,fat:4,carbs:67,protein:4},{name:"Gingerbread",calories:356,fat:16,carbs:49,protein:4}],this.sortedData=this.desserts.slice()}sortData(t){const e=this.desserts.slice();this.sortedData=t.active&&""!==t.direction?e.sort((e,r)=>{const i="asc"===t.direction;switch(t.active){case"name":return n(e.name,r.name,i);case"calories":return n(e.calories,r.calories,i);case"fat":return n(e.fat,r.fat,i);case"carbs":return n(e.carbs,r.carbs,i);case"protein":return n(e.protein,r.protein,i);default:return 0}}):e}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=Object(a.Sb)({type:t,selectors:[["sort-overview-example"]],decls:13,vars:1,consts:[["matSort","",3,"matSortChange"],["mat-sort-header","name"],["mat-sort-header","calories"],["mat-sort-header","fat"],["mat-sort-header","carbs"],["mat-sort-header","protein"],[4,"ngFor","ngForOf"]],template:function(t,e){1&t&&(Object(a.ec)(0,"table",0),Object(a.lc)("matSortChange",function(t){return e.sortData(t)}),Object(a.ec)(1,"tr"),Object(a.ec)(2,"th",1),Object(a.Sc)(3,"Dessert (100g)"),Object(a.dc)(),Object(a.ec)(4,"th",2),Object(a.Sc)(5,"Calories"),Object(a.dc)(),Object(a.ec)(6,"th",3),Object(a.Sc)(7,"Fat (g)"),Object(a.dc)(),Object(a.ec)(8,"th",4),Object(a.Sc)(9,"Carbs (g)"),Object(a.dc)(),Object(a.ec)(10,"th",5),Object(a.Sc)(11,"Protein (g)"),Object(a.dc)(),Object(a.dc)(),Object(a.Qc)(12,o,11,5,"tr",6),Object(a.dc)()),2&t&&(Object(a.Mb)(12),Object(a.vc)("ngForOf",e.sortedData))},directives:[s.a,s.b,i.s],styles:[".mat-sort-header-container[_ngcontent-%COMP%] {\n align-items: center;\n}"]}),t})();function n(t,e,r){return(t<e?-1:1)*(r?1:-1)}let d=(()=>{class t{}return t.\u0275mod=Object(a.Wb)({type:t}),t.\u0275inj=Object(a.Vb)({factory:function(e){return new(e||t)},imports:[[i.c,s.c]]}),t})()}}]);