From 97d62d8dca7df2cf187b25a070f44d0874e93c80 Mon Sep 17 00:00:00 2001 From: Ben Rubin Date: Fri, 15 Jul 2016 00:04:31 -0500 Subject: [PATCH] new version --- bower.json | 2 +- dist/md-expansion-panel.css | 5 ++++- dist/md-expansion-panel.js | 13 ++++++++----- dist/md-expansion-panel.min.css | 2 +- dist/md-expansion-panel.min.js | 2 +- package.json | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index fddb43a..a42ad0d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-material-expansion-panel", - "version": "0.4.5", + "version": "0.4.6", "description": "Material Design Expansion Panels.", "main": [ "dist/md-expansion-panel.js", diff --git a/dist/md-expansion-panel.css b/dist/md-expansion-panel.css index 1bf624f..f805b97 100644 --- a/dist/md-expansion-panel.css +++ b/dist/md-expansion-panel.css @@ -129,7 +129,10 @@ md-expansion-panel-header { line-height: 48px; padding: 0 24px; box-sizing: border-box; - border-bottom: 1px solid; } + border-bottom: 1px solid; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; } md-expansion-panel-header.md-stick .md-expansion-panel-header-container { position: fixed; z-index: 2; diff --git a/dist/md-expansion-panel.js b/dist/md-expansion-panel.js index 9a6373d..6f701b0 100644 --- a/dist/md-expansion-panel.js +++ b/dist/md-expansion-panel.js @@ -297,7 +297,8 @@ function expansionPanelDirective() { // listen to window scroll events angular.element($window) .on('scroll', debouncedUpdateScroll) - .on('resize', debouncedUpdateScroll); + .on('resize', debouncedUpdateScroll) + .on('resize', debouncedUpdateResize); } @@ -322,7 +323,8 @@ function expansionPanelDirective() { angular.element($window) .off('scroll', debouncedUpdateScroll) - .off('resize', debouncedUpdateScroll); + .off('resize', debouncedUpdateScroll) + .off('resize', debouncedUpdateResize); } @@ -361,7 +363,8 @@ function expansionPanelDirective() { } - function updateResize(value) { + function updateResize() { + var value = $element[0].offsetWidth; if (footerCtrl && footerCtrl.noSticky === false) { footerCtrl.onResize(value); } if (headerCtrl && headerCtrl.noSticky === false) { headerCtrl.onResize(value); } } @@ -1108,7 +1111,7 @@ function expansionPanelHeaderDirective() { if (panelbottom < 0) { offset += panelbottom; } - + // set container width because element becomes postion fixed container.css('width', element[0].offsetWidth + 'px'); container.css('top', offset + 'px'); @@ -1126,7 +1129,7 @@ function expansionPanelHeaderDirective() { function onResize(width) { if (isStuck === false) { return; } - element.css('width', width + 'px'); + container.css('width', width + 'px'); } diff --git a/dist/md-expansion-panel.min.css b/dist/md-expansion-panel.min.css index 7bddd5c..e028e38 100644 --- a/dist/md-expansion-panel.min.css +++ b/dist/md-expansion-panel.min.css @@ -1 +1 @@ -md-expansion-panel,md-expansion-panel .md-expansion-panel-footer-container,md-expansion-panel .md-expansion-panel-header-container,md-expansion-panel md-expansion-panel-collapsed{background:#fff}md-expansion-panel .md-expansion-panel-footer-container .md-summary,md-expansion-panel .md-expansion-panel-footer-container .md-title,md-expansion-panel .md-expansion-panel-header-container .md-summary,md-expansion-panel .md-expansion-panel-header-container .md-title,md-expansion-panel md-expansion-panel-collapsed .md-summary,md-expansion-panel md-expansion-panel-collapsed .md-title{color:#333}md-expansion-panel md-expansion-panel-footer .md-expansion-panel-footer-container,md-expansion-panel md-expansion-panel-header .md-expansion-panel-header-container{border-color:#ddd}md-expansion-panel .md-expansion-panel-icon-container .md-expansion-panel-icon{color:#999}md-expansion-panel[disabled] md-expansion-panel-collapsed{color:#ddd}md-expansion-panel:not(.md-open):not([disabled]):focus,md-expansion-panel:not(.md-open):not([disabled]):focus md-expansion-panel-collapsed{background:#eee}.layout-padding>md-expansion-panel-group{padding:0}md-expansion-panel{display:block;position:relative;outline:none;margin-top:0;margin-bottom:0;padding:0;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24)}md-expansion-panel.md-open{margin-top:16px;margin-bottom:16px}md-expansion-panel.md-open:first-of-type{margin-top:0}md-expansion-panel.md-close{overflow:hidden}md-expansion-panel.md-open{-webkit-transition:margin-top .12s cubic-bezier(.25,.8,.25,1),margin-bottom .12s cubic-bezier(.25,.8,.25,1);transition:margin-top .12s cubic-bezier(.25,.8,.25,1),margin-bottom .12s cubic-bezier(.25,.8,.25,1)}md-expansion-panel.md-close{-webkit-transition:margin-top .08s cubic-bezier(.25,.8,.25,1),margin-bottom .08s cubic-bezier(.25,.8,.25,1);transition:margin-top .08s cubic-bezier(.25,.8,.25,1),margin-bottom .08s cubic-bezier(.25,.8,.25,1)}md-expansion-panel-collapsed .md-title,md-expansion-panel-header .md-title{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:16px;font-weight:600;min-width:80px;max-width:184px;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}md-expansion-panel-collapsed .md-summary,md-expansion-panel-header .md-summary{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:13px;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}md-expansion-panel-collapsed{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;opacity:1;z-index:1;box-sizing:border-box}md-expansion-panel-collapsed.md-absolute{position:absolute}md-expansion-panel-collapsed.md-show{-webkit-transition:opacity .03s linear;transition:opacity .03s linear;-webkit-transition-delay:.03s;transition-delay:.03s}md-expansion-panel-collapsed.md-hide{-webkit-transition:opacity .1s cubic-bezier(.25,.8,.25,1);transition:opacity .1s cubic-bezier(.25,.8,.25,1);opacity:0}md-expansion-panel-expanded{display:none;min-height:48px}md-expansion-panel-expanded.md-show{-webkit-transition:max-height .12s cubic-bezier(.25,.8,.25,1),opacity .12s cubic-bezier(.25,.8,.25,1);transition:max-height .12s cubic-bezier(.25,.8,.25,1),opacity .12s cubic-bezier(.25,.8,.25,1)}md-expansion-panel-expanded.md-hide{-webkit-transition:max-height .08s cubic-bezier(.25,.8,.25,1),opacity .08s cubic-bezier(.25,.8,.25,1);transition:max-height .08s cubic-bezier(.25,.8,.25,1),opacity .08s cubic-bezier(.25,.8,.25,1)}md-expansion-panel-expanded.md-hide,md-expansion-panel-expanded.md-show{display:block}md-expansion-panel-expanded.md-scroll-y{overflow-y:auto}md-expansion-panel-expanded.md-overflow{overflow:hidden}md-expansion-panel-expanded md-expansion-panel-content{display:block;padding:16px 24px}md-expansion-panel-header{display:block;position:relative;outline:none}md-expansion-panel-header .md-expansion-panel-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;box-sizing:border-box;border-bottom:1px solid}md-expansion-panel-header.md-stick .md-expansion-panel-header-container{position:fixed;z-index:1;-webkit-animation:a .3s ease-out both;animation:a .3s ease-out both}md-expansion-panel-header.md-no-stick .md-expansion-panel-header-container{-webkit-animation:b .3s ease-out both;animation:b .3s ease-out both}md-expansion-panel-footer{display:block;position:relative}md-expansion-panel-footer.md-hide,md-expansion-panel-footer.md-show{display:block}md-expansion-panel-footer .md-expansion-panel-footer-container{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;border-top:1px solid;box-sizing:border-box}md-expansion-panel-footer.md-stick .md-expansion-panel-footer-container{position:fixed;z-index:1}md-expansion-panel .md-expansion-panel-icon-container:first-child{padding-right:12px}md-expansion-panel .md-expansion-panel-icon-container .md-expansion-panel-icon:after{font-family:mdMaterialIcons;font-size:18px;font-weight:600;display:block;content:'\e315';position:relative;speak:none;-webkit-transform:rotate(0deg);transform:rotate(0deg);-webkit-transition:-webkit-transform .4s cubic-bezier(.25,.8,.25,1);transition:-webkit-transform .4s cubic-bezier(.25,.8,.25,1);transition:transform .4s cubic-bezier(.25,.8,.25,1);transition:transform .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1)}md-expansion-panel.md-open>md-expansion-panel-collasped .md-expansion-panel-icon-container .md-expansion-panel-icon:after,md-expansion-panel.md-open>md-expansion-panel-header .md-expansion-panel-icon-container .md-expansion-panel-icon:after{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@-webkit-keyframes a{0%{box-shadow:0 0 0 0 transparent}to{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@keyframes a{0%{box-shadow:0 0 0 0 transparent}to{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@-webkit-keyframes b{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}to{box-shadow:0 0 0 0 transparent}}@keyframes b{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}to{box-shadow:0 0 0 0 transparent}} \ No newline at end of file +md-expansion-panel,md-expansion-panel .md-expansion-panel-footer-container,md-expansion-panel .md-expansion-panel-header-container,md-expansion-panel md-expansion-panel-collapsed{background:#fff}md-expansion-panel .md-expansion-panel-footer-container .md-summary,md-expansion-panel .md-expansion-panel-footer-container .md-title,md-expansion-panel .md-expansion-panel-header-container .md-summary,md-expansion-panel .md-expansion-panel-header-container .md-title,md-expansion-panel md-expansion-panel-collapsed .md-summary,md-expansion-panel md-expansion-panel-collapsed .md-title{color:#333}md-expansion-panel md-expansion-panel-footer .md-expansion-panel-footer-container,md-expansion-panel md-expansion-panel-header .md-expansion-panel-header-container{border-color:#ddd}md-expansion-panel .md-expansion-panel-icon-container .md-expansion-panel-icon{color:#999}md-expansion-panel[disabled] md-expansion-panel-collapsed{color:#ddd}md-expansion-panel:not(.md-open):not([disabled]):focus,md-expansion-panel:not(.md-open):not([disabled]):focus md-expansion-panel-collapsed{background:#eee}.layout-padding>md-expansion-panel-group{padding:0}md-expansion-panel{display:block;position:relative;outline:none;margin-top:0;margin-bottom:0;padding:0;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24)}md-expansion-panel.md-open{margin-top:16px;margin-bottom:16px}md-expansion-panel.md-open:first-of-type{margin-top:0}md-expansion-panel.md-close{overflow:hidden}md-expansion-panel.md-open{-webkit-transition:margin-top .12s cubic-bezier(.25,.8,.25,1),margin-bottom .12s cubic-bezier(.25,.8,.25,1);transition:margin-top .12s cubic-bezier(.25,.8,.25,1),margin-bottom .12s cubic-bezier(.25,.8,.25,1)}md-expansion-panel.md-close{-webkit-transition:margin-top .08s cubic-bezier(.25,.8,.25,1),margin-bottom .08s cubic-bezier(.25,.8,.25,1);transition:margin-top .08s cubic-bezier(.25,.8,.25,1),margin-bottom .08s cubic-bezier(.25,.8,.25,1)}md-expansion-panel-collapsed .md-title,md-expansion-panel-header .md-title{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:16px;font-weight:600;min-width:80px;max-width:184px;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}md-expansion-panel-collapsed .md-summary,md-expansion-panel-header .md-summary{-webkit-box-flex:1;-ms-flex:1;flex:1;font-size:13px;overflow:hidden;text-overflow:ellipsis;text-align:left;white-space:nowrap}md-expansion-panel-collapsed{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;opacity:1;z-index:1;box-sizing:border-box}md-expansion-panel-collapsed.md-absolute{position:absolute}md-expansion-panel-collapsed.md-show{-webkit-transition:opacity .03s linear;transition:opacity .03s linear;-webkit-transition-delay:.03s;transition-delay:.03s}md-expansion-panel-collapsed.md-hide{-webkit-transition:opacity .1s cubic-bezier(.25,.8,.25,1);transition:opacity .1s cubic-bezier(.25,.8,.25,1);opacity:0}md-expansion-panel-expanded{display:none;min-height:48px}md-expansion-panel-expanded.md-show{-webkit-transition:max-height .12s cubic-bezier(.25,.8,.25,1),opacity .12s cubic-bezier(.25,.8,.25,1);transition:max-height .12s cubic-bezier(.25,.8,.25,1),opacity .12s cubic-bezier(.25,.8,.25,1)}md-expansion-panel-expanded.md-hide{-webkit-transition:max-height .08s cubic-bezier(.25,.8,.25,1),opacity .08s cubic-bezier(.25,.8,.25,1);transition:max-height .08s cubic-bezier(.25,.8,.25,1),opacity .08s cubic-bezier(.25,.8,.25,1)}md-expansion-panel-expanded.md-hide,md-expansion-panel-expanded.md-show{display:block}md-expansion-panel-expanded.md-scroll-y{overflow-y:auto}md-expansion-panel-expanded.md-overflow{overflow:hidden}md-expansion-panel-expanded md-expansion-panel-content{display:block;padding:16px 24px}md-expansion-panel-header{display:block;position:relative;outline:none}md-expansion-panel-header .md-expansion-panel-header-container{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;box-sizing:border-box;border-bottom:1px solid;-webkit-box-align:center;-ms-flex-align:center;align-items:center}md-expansion-panel-header.md-stick .md-expansion-panel-header-container{position:fixed;z-index:1;-webkit-animation:a .3s ease-out both;animation:a .3s ease-out both}md-expansion-panel-header.md-no-stick .md-expansion-panel-header-container{-webkit-animation:b .3s ease-out both;animation:b .3s ease-out both}md-expansion-panel-footer{display:block;position:relative}md-expansion-panel-footer.md-hide,md-expansion-panel-footer.md-show{display:block}md-expansion-panel-footer .md-expansion-panel-footer-container{display:-webkit-box;display:-ms-flexbox;display:flex;min-height:48px;line-height:48px;padding:0 24px;border-top:1px solid;box-sizing:border-box}md-expansion-panel-footer.md-stick .md-expansion-panel-footer-container{position:fixed;z-index:1}md-expansion-panel .md-expansion-panel-icon-container:first-child{padding-right:12px}md-expansion-panel .md-expansion-panel-icon-container .md-expansion-panel-icon:after{font-family:mdMaterialIcons;font-size:18px;font-weight:600;display:block;content:'\e315';position:relative;speak:none;-webkit-transform:rotate(0deg);transform:rotate(0deg);-webkit-transition:-webkit-transform .4s cubic-bezier(.25,.8,.25,1);transition:-webkit-transform .4s cubic-bezier(.25,.8,.25,1);transition:transform .4s cubic-bezier(.25,.8,.25,1);transition:transform .4s cubic-bezier(.25,.8,.25,1),-webkit-transform .4s cubic-bezier(.25,.8,.25,1)}md-expansion-panel.md-open>md-expansion-panel-collasped .md-expansion-panel-icon-container .md-expansion-panel-icon:after,md-expansion-panel.md-open>md-expansion-panel-header .md-expansion-panel-icon-container .md-expansion-panel-icon:after{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@-webkit-keyframes a{0%{box-shadow:0 0 0 0 transparent}to{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@keyframes a{0%{box-shadow:0 0 0 0 transparent}to{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}}@-webkit-keyframes b{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}to{box-shadow:0 0 0 0 transparent}}@keyframes b{0%{box-shadow:0 2px 4px 0 rgba(0,0,0,.16)}to{box-shadow:0 0 0 0 transparent}} \ No newline at end of file diff --git a/dist/md-expansion-panel.min.js b/dist/md-expansion-panel.min.js index f96d6c7..c361a52 100644 --- a/dist/md-expansion-panel.min.js +++ b/dist/md-expansion-panel.min.js @@ -1 +1 @@ -!function(){"use strict";angular.module("material.components.expansionPanels",["material.core"])}(),function(){"use strict";function e(){function e(e,n){var o="Invalid HTML for md-expansion-panel: ";if(e.attr("tabindex",n.tabindex||"0"),null===e[0].querySelector("md-expansion-panel-collapsed"))throw Error(o+"Expected a child element of `md-epxansion-panel-collapsed`");if(null===e[0].querySelector("md-expansion-panel-expanded"))throw Error(o+"Expected a child element of `md-epxansion-panel-expanded`");return function(e,n,o,t){var r=t[0],i=t[1];i&&(r.epxansionPanelGroupCtrl=i,i.addPanel(r.componentId,{expand:r.expand,collapse:r.collapse,remove:r.remove,onRemove:r.onRemove,destroy:r.destroy}))}}function o(e,o,t,r,i,a,s,c,l,d,u){function p(e){var n=a.KEY_CODE;switch(e.keyCode){case n.ENTER:m();break;case n.ESCAPE:f()}}function m(){if(z!==!0&&T!==!0){z=!0;var e=d.defer();return O.epxansionPanelGroupCtrl&&O.epxansionPanelGroupCtrl.expandPanel(O.componentId),o.removeClass("md-close"),o.addClass("md-open"),C(),R.hide(),b.show(),S&&S.show(),I&&I.show(),l(function(){e.resolve()},n),e.promise}}function f(){if(z!==!1){z=!1;var e=d.defer();return o.addClass("md-close"),o.removeClass("md-open"),$(),R.show(),b.hide(),S&&S.hide(),I&&I.hide(),l(function(){e.resolve()},n),e.promise}}function h(t){var r=d.defer();return O.epxansionPanelGroupCtrl&&O.epxansionPanelGroupCtrl.removePanel(O.componentId),"function"==typeof N&&(N(),N=void 0),t===!0||z===!1?(e.$destroy(),o.remove(),r.resolve(),g()):(f(),l(function(){e.$destroy(),o.remove(),r.resolve(),g()},n)),r.promise}function v(e){H=e}function g(){"function"==typeof H&&(H(),H=void 0)}function x(){e.$destroy()}function C(){(I&&I.noSticky!==!0||S&&S.noSticky!==!0)&&(G=e.$watch(function(){return o[0].offsetTop},U,!0),j=e.$watch(function(){return o[0].offsetWidth},F,!0),q=s.getNearestContentElement(o),"MD-CONTENT"===q.nodeName?(A=y(q),angular.element(q).on("scroll",U)):A=void 0,b.setHeight===!0&&b.$element.on("scroll",U),angular.element(r).on("scroll",U).on("resize",U))}function $(){"function"==typeof G&&(G(),G=void 0),"function"==typeof j&&(j(),j=void 0),q&&"MD-CONTENT"===q.nodeName&&angular.element(q).off("scroll",U),b.setHeight===!0&&b.$element.off("scroll",U),angular.element(r).off("scroll",U).off("resize",U)}function y(e){for(var n=e.parentNode;n;){if(s.hasComputedStyle(angular.element(n),"transform"))return n;n=n.parentNode}}function E(e){var n,o,t;t=b.setHeight===!0?b.$element[0].getBoundingClientRect():q.getBoundingClientRect();var r=A?A.getBoundingClientRect().top:0;n=Math.max(t.top,0),o=n+t.height,I&&I.noSticky===!1&&I.onScroll(n,o,r),S&&S.noSticky===!1&&S.onScroll(n,o,r)}function w(e){I&&I.noSticky===!1&&I.onResize(e),S&&S.noSticky===!1&&S.onResize(e)}function P(n){B=s.createBackdrop(e),B[0].tabIndex=-1,"function"==typeof n&&B.on("click",n),u.enter(B,o.parent(),null,{duration:0}),o.css("z-index",60)}function k(){B&&(B.remove(),B.off("click"),B=void 0,o.css("z-index",""))}var R,b,S,I,N,q,G,j,H,A,B,O=this,z=!1,T=!1,U=i.throttle(E),F=i.throttle(w);O.registerCollapsed=function(e){R=e},O.registerExpanded=function(e){b=e},O.registerHeader=function(e){S=e},O.registerFooter=function(e){I=e},O.$element=o,O.componentId=t.mdComponentId,O.expand=m,O.collapse=f,O.remove=h,O.destroy=x,O.onRemove=v,t.$observe("disabled",function(e){T="string"==typeof e&&"false"!==e,T===!0?o.attr("tabindex","-1"):o.attr("tabindex","0")}),o.on("focus",function(e){o.on("keydown",p)}).on("blur",function(e){o.off("keydown",p)}),e.$panel={collapse:f,expand:m,remove:h},e.$on("$destroy",function(){k(),"function"==typeof N&&(N(),N=void 0),$()}),t.mdComponentId&&(N=c.register({expand:m,collapse:f,remove:h,onRemove:v,addClickCatcher:P,removeClickCatcher:k,componentId:t.mdComponentId},t.mdComponentId))}var t={restrict:"E",require:["mdExpansionPanel","?^^mdExpansionPanelGroup"],scope:!0,compile:e,controller:["$scope","$element","$attrs","$window","$$rAF","$mdConstant","$mdUtil","$mdComponentRegistry","$timeout","$q","$animate",o]};return t}angular.module("material.components.expansionPanels").directive("mdExpansionPanel",e);var n=180}(),function(){"use strict";function e(e,n,o){function t(t){var r=e.get(t);return r?r:void o.error(n.supplant(i,[t||""]))}function r(n){return e.when(n)["catch"](o.error)}var i="ExpansionPanel '{0}' is not available! Did you use md-component-id='{0}'?",a={find:t,waitFor:r};return function(e){return void 0===e?a:t(e)}}angular.module("material.components.expansionPanels").factory("$mdExpansionPanel",e),e.$inject=["$mdComponentRegistry","$mdUtil","$log"]}(),function(){"use strict";function e(e){function n(n,o,t,r){function i(){o.css("width",o[0].offsetWidth+"px"),r.$element.css("min-height",o[0].offsetHeight+"px"),e(o,{addClass:"md-absolute md-hide",from:{opacity:1},to:{opacity:0}}).start().then(function(){o.removeClass("md-hide"),o.css("display","none")})}function a(){o.css("display",""),o.css("width",o[0].parentNode.offsetWidth+"px"),e(o,{addClass:"md-show",from:{opacity:0},to:{opacity:1}}).start().then(function(){o.removeClass("md-absolute md-show"),o.css("width",""),r.$element.css("min-height","")})}r.registerCollapsed({show:a,hide:i}),o.on("click",function(){r.expand()})}var o={restrict:"E",require:"^^mdExpansionPanel",link:n};return o}angular.module("material.components.expansionPanels").directive("mdExpansionPanelCollapsed",e),e.$inject=["$animateCss"]}(),function(){"use strict";function e(e){function n(n,o,t,r){function i(){var n=s?s:o[0].scrollHeight+"px";o.addClass("md-hide md-overflow"),o.removeClass("md-show md-scroll-y"),e(o,{from:{"max-height":n,opacity:1},to:{"max-height":"48px",opacity:0}}).start().then(function(){o.css("display","none"),o.removeClass("md-hide")})}function a(){o.css("display",""),o.addClass("md-show md-overflow");var n=s?s:o[0].scrollHeight+"px";e(o,{from:{"max-height":"48px",opacity:0},to:{"max-height":n,opacity:1}}).start().then(function(){void 0!==s?o.addClass("md-scroll-y"):o.css("max-height","none"),o.removeClass("md-overflow")})}var s=t.height||void 0;void 0!==s&&(s=s.replace("px","")+"px"),r.registerExpanded({show:a,hide:i,setHeight:void 0!==s,$element:o})}var o={restrict:"E",require:"^^mdExpansionPanel",link:n};return o}angular.module("material.components.expansionPanels").directive("mdExpansionPanelExpanded",e),e.$inject=["$animateCss"]}(),function(){"use strict";function e(){function e(e,n,o,t){function r(){}function i(){c()}function a(e,o,r){var i,a,s=n[0].getBoundingClientRect();s.bottom>o?(i=u[0].offsetHeight,a=o-i-r,a',require:"^^mdExpansionPanel",link:e};return n}angular.module("material.components.expansionPanels").directive("mdExpansionPanelFooter",e)}(),function(){"use strict";function e(){function e(e,n,o,t){function r(e){return C.push(e),function(){C.splice(C.indexOf(e),1)}}function i(){var e=u();C.forEach(function(n){n(e)})}function a(e,n){x[e]=n,y===!0&&(n.expand(),p(e)),i()}function s(e){p(e)}function c(e,n){return x[e].remove(n)}function l(e){Object.keys(x).forEach(function(n){x[n].remove(e)})}function d(e){delete x[e],i()}function u(){return Object.keys(x).length}function p(e){$===!1&&Object.keys(x).forEach(function(n){n!==e&&x[n].collapse()})}function m(e,n){if(void 0!==g[e])throw Error('$mdExpansionPanelGroup.register() The name "'+e+'" has already been registered');g[e]=n}function f(e){if(void 0===g[e])throw Error('$mdExpansionPanelGroup.addPanel() Cannot find Panel with name of "'+e+'"');return g[e]}var h,v=this,g={},x={},C=[],$=void 0!==n.mdMultiple||void 0!==n.multiple,y=void 0!==n.mdAutoExpand||void 0!==n.autoExpand;h=t.register({$element:o,register:m,getRegistered:f,remove:c,removeAll:l,onChange:r,count:u},n.mdComponentId),v.addPanel=a,v.expandPanel=s,v.removePanel=d,e.$on("$destroy",function(){"function"==typeof h&&(h(),h=void 0),Object.keys(x).forEach(function(e){x[e].destroy()})})}var n={restrict:"E",controller:["$scope","$attrs","$element","$mdComponentRegistry",e]};return n}angular.module("material.components.expansionPanels").directive("mdExpansionPanelGroup",e)}(),function(){"use strict";function e(e,n,o,t,r,i,a,s,c){function l(o){var t=e.get(o);return t?u(t):void c.error(n.supplant(p,[o||""]))}function d(n){var o=s.defer();return e.when(n).then(function(e){o.resolve(u(e))})["catch"](function(e){o.reject(),c.error(e)}),o.promise}function u(e){function c(n,o){if("string"!=typeof n)throw Error("$mdExpansionPanelGroup.register() Expects name to be a string");f(o),e.register(n,o)}function l(n){return e.remove(n)}function d(n){e.removeAll(n)}function u(n){return e.onChange(n)}function p(){return e.count()}function m(t,c){if(c=c||{},"string"==typeof t)return m(e.getRegistered(t),c);if(f(t),t.componentId&&e.isPanelActive(t.componentId))return s.reject('panel with componentId "'+t.componentId+'" is currently active');var l=s.defer(),d=r.$new();return angular.extend(d,t.scope),h(t,function(r){var s=angular.element(r),u=t.componentId||s.attr("md-component-id")||"_panelComponentId_"+n.nextUid(),p=o().waitFor(u);s.attr("md-component-id",u);var m=i(s);if(t.controller){angular.extend(c,t.locals||{}),c.$scope=d,c.$panel=p;var f=a(t.controller,c,!0),h=f();s.data("$ngControllerController",h),s.children().data("$ngControllerController",h),t.controllerAs&&(d[t.controllerAs]=h)}e.$element.append(s),m(d),p.then(function(e){l.resolve(e)})}),l.promise}function f(e){if("object"!=typeof e||null===e)throw Error("$mdExapnsionPanelGroup.add()/.register() : Requires an options object to be passed in");if(!e.template&&!e.templateUrl)throw Error("$mdExapnsionPanelGroup.add()/.register() : Is missing required paramters to create. Required One of the following: template, templateUrl")}function h(e,n){void 0!==e.templateUrl?t(e.templateUrl).then(function(e){n(e)}):n(e.template)}var v={add:m,register:c,remove:l,removeAll:d,onChange:u,count:p};return v}var p="ExpansionPanelGroup '{0}' is not available! Did you use md-component-id='{0}'?",m={find:l,waitFor:d};return function(e){return void 0===e?m:l(e)}}angular.module("material.components.expansionPanels").factory("$mdExpansionPanelGroup",e),e.$inject=["$mdComponentRegistry","$mdUtil","$mdExpansionPanel","$templateRequest","$rootScope","$compile","$controller","$q","$log"]}(),function(){"use strict";function e(){function e(e,n,o,t){function r(){}function i(){c()}function a(e,o,t){var r,i,a=n[0].getBoundingClientRect();a.top',require:"^^mdExpansionPanel",link:e};return n}angular.module("material.components.expansionPanels").directive("mdExpansionPanelHeader",e),e.$inject=[]}(); \ No newline at end of file +!function(){"use strict";angular.module("material.components.expansionPanels",["material.core"])}(),function(){"use strict";function e(){function e(e,n){var o="Invalid HTML for md-expansion-panel: ";if(e.attr("tabindex",n.tabindex||"0"),null===e[0].querySelector("md-expansion-panel-collapsed"))throw Error(o+"Expected a child element of `md-epxansion-panel-collapsed`");if(null===e[0].querySelector("md-expansion-panel-expanded"))throw Error(o+"Expected a child element of `md-epxansion-panel-expanded`");return function(e,n,o,t){var r=t[0],i=t[1];i&&(r.epxansionPanelGroupCtrl=i,i.addPanel(r.componentId,{expand:r.expand,collapse:r.collapse,remove:r.remove,onRemove:r.onRemove,destroy:r.destroy}))}}function o(e,o,t,r,i,a,s,c,l,d,u){function p(e){var n=a.KEY_CODE;switch(e.keyCode){case n.ENTER:m();break;case n.ESCAPE:f()}}function m(){if(O!==!0&&T!==!0){O=!0;var e=d.defer();return B.epxansionPanelGroupCtrl&&B.epxansionPanelGroupCtrl.expandPanel(B.componentId),o.removeClass("md-close"),o.addClass("md-open"),C(),R.hide(),b.show(),S&&S.show(),I&&I.show(),l(function(){e.resolve()},n),e.promise}}function f(){if(O!==!1){O=!1;var e=d.defer();return o.addClass("md-close"),o.removeClass("md-open"),$(),R.show(),b.hide(),S&&S.hide(),I&&I.hide(),l(function(){e.resolve()},n),e.promise}}function h(t){var r=d.defer();return B.epxansionPanelGroupCtrl&&B.epxansionPanelGroupCtrl.removePanel(B.componentId),"function"==typeof N&&(N(),N=void 0),t===!0||O===!1?(e.$destroy(),o.remove(),r.resolve(),g()):(f(),l(function(){e.$destroy(),o.remove(),r.resolve(),g()},n)),r.promise}function v(e){H=e}function g(){"function"==typeof H&&(H(),H=void 0)}function x(){e.$destroy()}function C(){(I&&I.noSticky!==!0||S&&S.noSticky!==!0)&&(G=e.$watch(function(){return o[0].offsetTop},U,!0),j=e.$watch(function(){return o[0].offsetWidth},F,!0),q=s.getNearestContentElement(o),"MD-CONTENT"===q.nodeName?(z=y(q),angular.element(q).on("scroll",U)):z=void 0,b.setHeight===!0&&b.$element.on("scroll",U),angular.element(r).on("scroll",U).on("resize",U).on("resize",F))}function $(){"function"==typeof G&&(G(),G=void 0),"function"==typeof j&&(j(),j=void 0),q&&"MD-CONTENT"===q.nodeName&&angular.element(q).off("scroll",U),b.setHeight===!0&&b.$element.off("scroll",U),angular.element(r).off("scroll",U).off("resize",U).off("resize",F)}function y(e){for(var n=e.parentNode;n;){if(s.hasComputedStyle(angular.element(n),"transform"))return n;n=n.parentNode}}function E(e){var n,o,t;t=b.setHeight===!0?b.$element[0].getBoundingClientRect():q.getBoundingClientRect();var r=z?z.getBoundingClientRect().top:0;n=Math.max(t.top,0),o=n+t.height,I&&I.noSticky===!1&&I.onScroll(n,o,r),S&&S.noSticky===!1&&S.onScroll(n,o,r)}function w(){var e=o[0].offsetWidth;I&&I.noSticky===!1&&I.onResize(e),S&&S.noSticky===!1&&S.onResize(e)}function P(n){A=s.createBackdrop(e),A[0].tabIndex=-1,"function"==typeof n&&A.on("click",n),u.enter(A,o.parent(),null,{duration:0}),o.css("z-index",60)}function k(){A&&(A.remove(),A.off("click"),A=void 0,o.css("z-index",""))}var R,b,S,I,N,q,G,j,H,z,A,B=this,O=!1,T=!1,U=i.throttle(E),F=i.throttle(w);B.registerCollapsed=function(e){R=e},B.registerExpanded=function(e){b=e},B.registerHeader=function(e){S=e},B.registerFooter=function(e){I=e},B.$element=o,B.componentId=t.mdComponentId,B.expand=m,B.collapse=f,B.remove=h,B.destroy=x,B.onRemove=v,t.$observe("disabled",function(e){T="string"==typeof e&&"false"!==e,T===!0?o.attr("tabindex","-1"):o.attr("tabindex","0")}),o.on("focus",function(e){o.on("keydown",p)}).on("blur",function(e){o.off("keydown",p)}),e.$panel={collapse:f,expand:m,remove:h},e.$on("$destroy",function(){k(),"function"==typeof N&&(N(),N=void 0),$()}),t.mdComponentId&&(N=c.register({expand:m,collapse:f,remove:h,onRemove:v,addClickCatcher:P,removeClickCatcher:k,componentId:t.mdComponentId},t.mdComponentId))}var t={restrict:"E",require:["mdExpansionPanel","?^^mdExpansionPanelGroup"],scope:!0,compile:e,controller:["$scope","$element","$attrs","$window","$$rAF","$mdConstant","$mdUtil","$mdComponentRegistry","$timeout","$q","$animate",o]};return t}angular.module("material.components.expansionPanels").directive("mdExpansionPanel",e);var n=180}(),function(){"use strict";function e(e,n,o){function t(t){var r=e.get(t);return r?r:void o.error(n.supplant(i,[t||""]))}function r(n){return e.when(n)["catch"](o.error)}var i="ExpansionPanel '{0}' is not available! Did you use md-component-id='{0}'?",a={find:t,waitFor:r};return function(e){return void 0===e?a:t(e)}}angular.module("material.components.expansionPanels").factory("$mdExpansionPanel",e),e.$inject=["$mdComponentRegistry","$mdUtil","$log"]}(),function(){"use strict";function e(e){function n(n,o,t,r){function i(){o.css("width",o[0].offsetWidth+"px"),r.$element.css("min-height",o[0].offsetHeight+"px"),e(o,{addClass:"md-absolute md-hide",from:{opacity:1},to:{opacity:0}}).start().then(function(){o.removeClass("md-hide"),o.css("display","none")})}function a(){o.css("display",""),o.css("width",o[0].parentNode.offsetWidth+"px"),e(o,{addClass:"md-show",from:{opacity:0},to:{opacity:1}}).start().then(function(){o.removeClass("md-absolute md-show"),o.css("width",""),r.$element.css("min-height","")})}r.registerCollapsed({show:a,hide:i}),o.on("click",function(){r.expand()})}var o={restrict:"E",require:"^^mdExpansionPanel",link:n};return o}angular.module("material.components.expansionPanels").directive("mdExpansionPanelCollapsed",e),e.$inject=["$animateCss"]}(),function(){"use strict";function e(e){function n(n,o,t,r){function i(){var n=s?s:o[0].scrollHeight+"px";o.addClass("md-hide md-overflow"),o.removeClass("md-show md-scroll-y"),e(o,{from:{"max-height":n,opacity:1},to:{"max-height":"48px",opacity:0}}).start().then(function(){o.css("display","none"),o.removeClass("md-hide")})}function a(){o.css("display",""),o.addClass("md-show md-overflow");var n=s?s:o[0].scrollHeight+"px";e(o,{from:{"max-height":"48px",opacity:0},to:{"max-height":n,opacity:1}}).start().then(function(){void 0!==s?o.addClass("md-scroll-y"):o.css("max-height","none"),o.removeClass("md-overflow")})}var s=t.height||void 0;void 0!==s&&(s=s.replace("px","")+"px"),r.registerExpanded({show:a,hide:i,setHeight:void 0!==s,$element:o})}var o={restrict:"E",require:"^^mdExpansionPanel",link:n};return o}angular.module("material.components.expansionPanels").directive("mdExpansionPanelExpanded",e),e.$inject=["$animateCss"]}(),function(){"use strict";function e(){function e(e,n,o,t){function r(){}function i(){c()}function a(e,o,r){var i,a,s=n[0].getBoundingClientRect();s.bottom>o?(i=u[0].offsetHeight,a=o-i-r,a',require:"^^mdExpansionPanel",link:e};return n}angular.module("material.components.expansionPanels").directive("mdExpansionPanelFooter",e)}(),function(){"use strict";function e(){function e(e,n,o,t){function r(e){return C.push(e),function(){C.splice(C.indexOf(e),1)}}function i(){var e=u();C.forEach(function(n){n(e)})}function a(e,n){x[e]=n,y===!0&&(n.expand(),p(e)),i()}function s(e){p(e)}function c(e,n){return x[e].remove(n)}function l(e){Object.keys(x).forEach(function(n){x[n].remove(e)})}function d(e){delete x[e],i()}function u(){return Object.keys(x).length}function p(e){$===!1&&Object.keys(x).forEach(function(n){n!==e&&x[n].collapse()})}function m(e,n){if(void 0!==g[e])throw Error('$mdExpansionPanelGroup.register() The name "'+e+'" has already been registered');g[e]=n}function f(e){if(void 0===g[e])throw Error('$mdExpansionPanelGroup.addPanel() Cannot find Panel with name of "'+e+'"');return g[e]}var h,v=this,g={},x={},C=[],$=void 0!==n.mdMultiple||void 0!==n.multiple,y=void 0!==n.mdAutoExpand||void 0!==n.autoExpand;h=t.register({$element:o,register:m,getRegistered:f,remove:c,removeAll:l,onChange:r,count:u},n.mdComponentId),v.addPanel=a,v.expandPanel=s,v.removePanel=d,e.$on("$destroy",function(){"function"==typeof h&&(h(),h=void 0),Object.keys(x).forEach(function(e){x[e].destroy()})})}var n={restrict:"E",controller:["$scope","$attrs","$element","$mdComponentRegistry",e]};return n}angular.module("material.components.expansionPanels").directive("mdExpansionPanelGroup",e)}(),function(){"use strict";function e(e,n,o,t,r,i,a,s,c){function l(o){var t=e.get(o);return t?u(t):void c.error(n.supplant(p,[o||""]))}function d(n){var o=s.defer();return e.when(n).then(function(e){o.resolve(u(e))})["catch"](function(e){o.reject(),c.error(e)}),o.promise}function u(e){function c(n,o){if("string"!=typeof n)throw Error("$mdExpansionPanelGroup.register() Expects name to be a string");f(o),e.register(n,o)}function l(n){return e.remove(n)}function d(n){e.removeAll(n)}function u(n){return e.onChange(n)}function p(){return e.count()}function m(t,c){if(c=c||{},"string"==typeof t)return m(e.getRegistered(t),c);if(f(t),t.componentId&&e.isPanelActive(t.componentId))return s.reject('panel with componentId "'+t.componentId+'" is currently active');var l=s.defer(),d=r.$new();return angular.extend(d,t.scope),h(t,function(r){var s=angular.element(r),u=t.componentId||s.attr("md-component-id")||"_panelComponentId_"+n.nextUid(),p=o().waitFor(u);s.attr("md-component-id",u);var m=i(s);if(t.controller){angular.extend(c,t.locals||{}),c.$scope=d,c.$panel=p;var f=a(t.controller,c,!0),h=f();s.data("$ngControllerController",h),s.children().data("$ngControllerController",h),t.controllerAs&&(d[t.controllerAs]=h)}e.$element.append(s),m(d),p.then(function(e){l.resolve(e)})}),l.promise}function f(e){if("object"!=typeof e||null===e)throw Error("$mdExapnsionPanelGroup.add()/.register() : Requires an options object to be passed in");if(!e.template&&!e.templateUrl)throw Error("$mdExapnsionPanelGroup.add()/.register() : Is missing required paramters to create. Required One of the following: template, templateUrl")}function h(e,n){void 0!==e.templateUrl?t(e.templateUrl).then(function(e){n(e)}):n(e.template)}var v={add:m,register:c,remove:l,removeAll:d,onChange:u,count:p};return v}var p="ExpansionPanelGroup '{0}' is not available! Did you use md-component-id='{0}'?",m={find:l,waitFor:d};return function(e){return void 0===e?m:l(e)}}angular.module("material.components.expansionPanels").factory("$mdExpansionPanelGroup",e),e.$inject=["$mdComponentRegistry","$mdUtil","$mdExpansionPanel","$templateRequest","$rootScope","$compile","$controller","$q","$log"]}(),function(){"use strict";function e(){function e(e,n,o,t){function r(){}function i(){c()}function a(e,o,t){var r,i,a=n[0].getBoundingClientRect();a.top',require:"^^mdExpansionPanel",link:e};return n}angular.module("material.components.expansionPanels").directive("mdExpansionPanelHeader",e),e.$inject=[]}(); \ No newline at end of file diff --git a/package.json b/package.json index 6621d9a..60a7f38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-material-expansion-panel", - "version": "0.4.5", + "version": "0.4.6", "author": "Ben Rubin", "description": "Material Design Expansion Panels.", "keywords": "material, material-design, design, angular, component, expansion, panel, panels",