(fix) updates for new packages

This commit is contained in:
Ludovic Marcotte 2015-08-28 14:09:20 -04:00
parent 431c53b84d
commit 624833eca9
16 changed files with 2168 additions and 558 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
* Angular Material Design * Angular Material Design
* https://github.com/angular/material * https://github.com/angular/material
* @license MIT * @license MIT
* v0.10.1-master-e4ca61f * v0.10.1-master-e26a275
*/ */
(function( window, angular, undefined ){ (function( window, angular, undefined ){
"use strict"; "use strict";
@ -2632,7 +2632,6 @@ function InterimElementProvider() {
"use strict"; "use strict";
(function () { (function () {
'use strict'; 'use strict';
/** /**
@ -2674,96 +2673,112 @@ function InterimElementProvider() {
* } * }
* ``` * ```
*/ */
angular.module('material.layout', [ ]) angular.module('material.layout', [ 'ng' ])
// Attribute directives with optional value(s) // Attribute directives with optional value(s)
.directive('layout' , attribute_withValue('layout' , true) ) .directive('layout' , attributeWithObserve('layout' , true) )
.directive('layoutSm' , attribute_withValue('layout-sm' , true) ) .directive('layoutSm' , attributeWithObserve('layout-sm' , true) )
.directive('layoutGtSm' , attribute_withValue('layout-gt-sm', true) ) .directive('layoutGtSm' , attributeWithObserve('layout-gt-sm', true) )
.directive('layoutMd' , attribute_withValue('layout-md' , true) ) .directive('layoutLtMd' , warnAttrNotSupported('layout-lt-md',true) )
.directive('layoutGtMd' , attribute_withValue('layout-gt-md', true) ) .directive('layoutMd' , attributeWithObserve('layout-md' , true) )
.directive('layoutLg' , attribute_withValue('layout-lg' , true) ) .directive('layoutGtMd' , attributeWithObserve('layout-gt-md', true) )
.directive('layoutGtLg' , attribute_withValue('layout-gt-lg', true) ) .directive('layoutLtLg' , warnAttrNotSupported('layout-lt-lg',true) )
.directive('layoutLg' , attributeWithObserve('layout-lg' , true) )
.directive('layoutGtLg' , attributeWithObserve('layout-gt-lg', true) )
.directive('flex' , attribute_withValue('flex' , true) ) .directive('flex' , attributeWithObserve('flex' , true) )
.directive('flexSm' , attribute_withValue('flex-sm' , true) ) .directive('flexSm' , attributeWithObserve('flex-sm' , true) )
.directive('flexGtSm' , attribute_withValue('flex-gt-sm' , true) ) .directive('flexGtSm' , attributeWithObserve('flex-gt-sm' , true) )
.directive('flexMd' , attribute_withValue('flex-md' , true) ) .directive('flexLtMd' , warnAttrNotSupported('flex-lt-md' ,true) )
.directive('flexGtMd' , attribute_withValue('flex-gt-md' , true) ) .directive('flexMd' , attributeWithObserve('flex-md' , true) )
.directive('flexLg' , attribute_withValue('flex-lg' , true) ) .directive('flexGtMd' , attributeWithObserve('flex-gt-md' , true) )
.directive('flexGtLg' , attribute_withValue('flex-gt-lg' , true) ) .directive('flexLtLg' , warnAttrNotSupported('flex-lt-lg' ,true) )
.directive('flexLg' , attributeWithObserve('flex-lg' , true) )
.directive('flexGtLg' , attributeWithObserve('flex-gt-lg' , true) )
// Attribute directives with optional value(s) but directiveName is NOT added as a class // Attribute directives with optional value(s) but directiveName is NOT added as a class
.directive('layoutAlign' , attribute_withValue('layout-align') ) .directive('layoutAlign' , attributeWithObserve('layout-align') )
.directive('layoutAlignSm' , attribute_withValue('layout-align-sm') ) .directive('layoutAlignSm' , attributeWithObserve('layout-align-sm') )
.directive('layoutAlignGtSm' , attribute_withValue('layout-align-gt-sm') ) .directive('layoutAlignGtSm' , attributeWithObserve('layout-align-gt-sm') )
.directive('layoutAlignMd' , attribute_withValue('layout-align-md') ) .directive('layoutAlignLtMd' , warnAttrNotSupported('layout-align-lt-md') )
.directive('layoutAlignGtMd' , attribute_withValue('layout-align-gt-md') ) .directive('layoutAlignMd' , attributeWithObserve('layout-align-md') )
.directive('layoutAlignLg' , attribute_withValue('layout-align-lg') ) .directive('layoutAlignGtMd' , attributeWithObserve('layout-align-gt-md') )
.directive('layoutAlignGtLg' , attribute_withValue('layout-align-gt-lg') ) .directive('layoutAlignLtLg' , warnAttrNotSupported('layout-align-lt-lg') )
.directive('layoutAlignLg' , attributeWithObserve('layout-align-lg') )
.directive('layoutAlignGtLg' , attributeWithObserve('layout-align-gt-lg') )
.directive('flexOrder' , attribute_withValue('flex-order') ) .directive('flexOrder' , attributeWithObserve('flex-order') )
.directive('flexOrderSm' , attribute_withValue('flex-order-sm') ) .directive('flexOrderSm' , attributeWithObserve('flex-order-sm') )
.directive('flexOrderGtSm' , attribute_withValue('flex-order-gt-sm') ) .directive('flexOrderGtSm' , attributeWithObserve('flex-order-gt-sm') )
.directive('flexOrderMd' , attribute_withValue('flex-order-md') ) .directive('flexOrderLtMd' , warnAttrNotSupported('flex-order-lt-md') )
.directive('flexOrderGtMd' , attribute_withValue('flex-order-gt-md') ) .directive('flexOrderMd' , attributeWithObserve('flex-order-md') )
.directive('flexOrderLg' , attribute_withValue('flex-order-lg') ) .directive('flexOrderGtMd' , attributeWithObserve('flex-order-gt-md') )
.directive('flexOrderGtLg' , attribute_withValue('flex-order-gt-lg') ) .directive('flexOrderLtLg' , warnAttrNotSupported('flex-order-lt-lg') )
.directive('flexOrderLg' , attributeWithObserve('flex-order-lg') )
.directive('flexOrderGtLg' , attributeWithObserve('flex-order-gt-lg') )
.directive('offset' , attribute_withValue('offset') ) .directive('offset' , attributeWithObserve('offset') )
.directive('offsetSm' , attribute_withValue('offset-sm') ) .directive('offsetSm' , attributeWithObserve('offset-sm') )
.directive('offsetGtSm' , attribute_withValue('offset-gt-sm') ) .directive('offsetGtSm' , attributeWithObserve('offset-gt-sm') )
.directive('offsetMd' , attribute_withValue('offset-md') ) .directive('offsetLtMd' , warnAttrNotSupported('offset-lt-md') )
.directive('offsetGtMd' , attribute_withValue('offset-gt-md') ) .directive('offsetMd' , attributeWithObserve('offset-md') )
.directive('offsetLg' , attribute_withValue('offset-lg') ) .directive('offsetGtMd' , attributeWithObserve('offset-gt-md') )
.directive('offsetGtLg' , attribute_withValue('offset-gt-lg') ) .directive('offsetLtLg' , warnAttrNotSupported('offset-lt-lg') )
.directive('offsetLg' , attributeWithObserve('offset-lg') )
.directive('offsetGtLg' , attributeWithObserve('offset-gt-lg') )
// Attribute directives with no value(s) // Attribute directives with no value(s)
.directive('layoutMargin' , attribute_noValue('layout-margin') ) .directive('layoutMargin' , attributeWithoutValue('layout-margin') )
.directive('layoutPadding' , attribute_noValue('layout-padding') ) .directive('layoutPadding' , attributeWithoutValue('layout-padding') )
.directive('layoutWrap' , attribute_noValue('layout-wrap') ) .directive('layoutWrap' , attributeWithoutValue('layout-wrap') )
.directive('layoutFill' , attribute_noValue('layout-fill') ) .directive('layoutFill' , attributeWithoutValue('layout-fill') )
.directive('hide' , attribute_noValue('hide') ) .directive('hide' , attributeWithoutValue('hide') )
.directive('hideSm' , attribute_noValue('hide-sm') ) .directive('hideSm' , attributeWithoutValue('hide-sm') )
.directive('hideGtSm' , attribute_noValue('hide-gt-sm') ) .directive('hideGtSm' , attributeWithoutValue('hide-gt-sm') )
.directive('hideMd' , attribute_noValue('hide-md') ) .directive('hideLtMd' , warnAttrNotSupported ('hide-lt-md') )
.directive('hideGtMd' , attribute_noValue('hide-gt-md') ) .directive('hideMd' , attributeWithoutValue('hide-md') )
.directive('hideLg' , attribute_noValue('hide-lg') ) .directive('hideGtMd' , attributeWithoutValue('hide-gt-md') )
.directive('hideGtLg' , attribute_noValue('hide-gt-lg') ) .directive('hideLtLg' , warnAttrNotSupported ('hide-lt-lg') )
.directive('show' , attribute_noValue('show') ) .directive('hideLg' , attributeWithoutValue('hide-lg') )
.directive('showSm' , attribute_noValue('show-sm') ) .directive('hideGtLg' , attributeWithoutValue('hide-gt-lg') )
.directive('showGtSm' , attribute_noValue('show-gt-sm') ) .directive('show' , attributeWithoutValue('show') )
.directive('showMd' , attribute_noValue('show-md') ) .directive('showSm' , attributeWithoutValue('show-sm') )
.directive('showGtMd' , attribute_noValue('show-gt-md') ) .directive('showGtSm' , attributeWithoutValue('show-gt-sm') )
.directive('showLg' , attribute_noValue('show-lg') ) .directive('showLtMd' , warnAttrNotSupported ('show-lt-md') )
.directive('showGtLg' , attribute_noValue('show-gt-lg') ); .directive('showMd' , attributeWithoutValue('show-md') )
.directive('showGtMd' , attributeWithoutValue('show-gt-md') )
.directive('showLtLg' , warnAttrNotSupported ('show-lt-lg') )
.directive('showLg' , attributeWithoutValue('show-lg') )
.directive('showGtLg' , attributeWithoutValue('show-gt-lg') );
/** /**
* Creates a registration function with for ngMaterial Layout attribute directive * These functions create registration functions for ngMaterial Layout attribute directives
* * This provides easy translation to switch ngMaterial attribute selectors to
* Note: This provides easy translation to switch ngMaterial * CLASS selectors and directives; which has huge performance implications
* attribute selectors to CLASS selectors and directives. * for IE Browsers
*
* !! This is important for IE Browser performance
*
* @param classname String attribute name; eg `layout-gt-md` with value ="row"
* @param addDirectiveAsClass Boolean
*/ */
function attribute_withValue(className, addDirectiveAsClass) {
return [function() { /**
* Creates a directive registration function where a possbile dynamic attribute value will
* be observed/watched.
* @param {string} className attribute name; eg `md-layout-gt-md` with value ="row"
* @param {boolean=} addDirectiveAsClass
*/
function attributeWithObserve(className, addDirectiveAsClass) {
return function() {
return { return {
compile: function(element, attr) { compile: function(element, attr) {
attributeValueToClass(null, element, attr); attributeValueToClass(null, element, attr);
// !! use for postLink to account for transforms after ng-transclude // Use for postLink to account for transforms after ng-transclude.
return attributeValueToClass; return attributeValueToClass;
} }
}; };
}]; };
/** /**
* Add as transformed class selector(s), then * Add as transformed class selector(s), then
@ -2773,32 +2788,60 @@ function InterimElementProvider() {
var directive = attr.$normalize(className); var directive = attr.$normalize(className);
// Add transformed class selector(s) // Add transformed class selector(s)
if (addDirectiveAsClass) element.addClass(className); if (addDirectiveAsClass) {
if (attr[directive]) element.addClass(className);
element.addClass(className + "-" + attr[directive].replace(/\s+/g, "-")); }
if (attr[directive]) {
element.addClass(className + "-" + attr[directive].replace(/\s+/g, "-"));
}
if ( scope ) {
/**
* After link-phase, do NOT remove deprecated layout attribute selector.
* Instead watch the attribute so interpolated data-bindings to layout
* selectors will continue to be supported.
*
* $observe the className and update with new class (after removing the last one)
*
* e.g. `layout="{{layoutDemo.direction}}"` will update...
*/
var lastClass;
attr.$observe(function() {
return attr[className];
}, function(newVal) {
element.removeClass(lastClass);
lastClass = className + "-" + String(newVal).replace(/\s+/g, "-");
element.addClass(lastClass);
});
}
try {
element.removeAttr(className);
} catch(e) { }
} }
} }
/** /**
* Creates a registration function with for ngMaterial Layout attribute directive * Creates a registration function with for ngMaterial Layout attribute directive.
* * This is a `simple` transpose of attribute usage to class usage
* Simple transpose of attribute usage to class usage
*/ */
function attribute_noValue(className) { function attributeWithoutValue(className) {
return [function() { return function() {
return { return {
compile: function(element, attr) { compile: function(element, attr) {
attributeToClass(null, element); attributeToClass(null, element);
// !! use for postLink to account for transforms after ng-transclude // Use for postLink to account for transforms after ng-transclude.
return attributeToClass; return attributeToClass;
} }
}; };
}]; };
/** /**
* Add as transformed class selector, then * Add as transformed class selector, then
@ -2806,11 +2849,26 @@ function InterimElementProvider() {
*/ */
function attributeToClass(scope, element) { function attributeToClass(scope, element) {
element.addClass(className); element.addClass(className);
try {
if ( scope ) {
// After link-phase, remove deprecated layout attribute selector
element.removeAttr(className); element.removeAttr(className);
} catch(e) { }
} }
} }
}
/**
* Provide console warning that this layout attribute has been deprecated
*/
function warnAttrNotSupported(className) {
var parts = className.split("-");
return ["$log", function($log) {
$log.warn( className + "has been deprecated. Please use a `" + parts[0] + "-gt-<xxx>` variant.");
return angular.noop;
}];
}
})(); })();
@ -3776,9 +3834,9 @@ angular.module('material.core.theming', ['material.core.theming.palette'])
.run(generateThemes); .run(generateThemes);
/** /**
* @ngdoc provider * @ngdoc service
* @name $mdThemingProvider * @name $mdThemingProvider
* @module material.core * @module material.core.theming
* *
* @description Provider to configure the `$mdTheming` service. * @description Provider to configure the `$mdTheming` service.
*/ */
@ -5125,7 +5183,8 @@ angular
* @description * @description
* BottomSheet * BottomSheet
*/ */
angular.module('material.components.bottomSheet', [ angular
.module('material.components.bottomSheet', [
'material.core', 'material.core',
'material.components.backdrop' 'material.components.backdrop'
]) ])
@ -5282,7 +5341,7 @@ function MdBottomSheetProvider($$interimElementProvider) {
$mdTheming.inherit(bottomSheet.element, options.parent); $mdTheming.inherit(bottomSheet.element, options.parent);
if (options.disableParentScroll) { if (options.disableParentScroll) {
options.restoreScroll = $mdUtil.disableScrollAround(options.parent); options.restoreScroll = $mdUtil.disableScrollAround(bottomSheet.element, options.parent);
} }
return $animate.enter(bottomSheet.element, options.parent) return $animate.enter(bottomSheet.element, options.parent)
@ -12668,7 +12727,8 @@ SelectProvider.$inject = ["$$interimElementProvider"];
* @description * @description
* A Sidenav QP component. * A Sidenav QP component.
*/ */
angular.module('material.components.sidenav', [ angular
.module('material.components.sidenav', [
'material.core', 'material.core',
'material.components.backdrop' 'material.components.backdrop'
]) ])
@ -12679,7 +12739,6 @@ angular.module('material.components.sidenav', [
/** /**
* @private
* @ngdoc service * @ngdoc service
* @name $mdSidenav * @name $mdSidenav
* @module material.components.sidenav * @module material.components.sidenav
@ -13478,21 +13537,21 @@ SliderDirective.$inject = ["$$rAF", "$window", "$mdAria", "$mdUtil", "$mdConstan
(function(){ (function(){
"use strict"; "use strict";
/* /**
* @ngdoc module * @ngdoc module
* @name material.components.sticky * @name material.components.sticky
* @description * @description
*
* Sticky effects for md * Sticky effects for md
*
*/ */
angular
angular.module('material.components.sticky', [ .module('material.components.sticky', [
'material.core', 'material.core',
'material.components.content' 'material.components.content'
]) ])
.factory('$mdSticky', MdSticky); .factory('$mdSticky', MdSticky);
/* /**
* @ngdoc service * @ngdoc service
* @name $mdSticky * @name $mdSticky
* @module material.components.sticky * @module material.components.sticky
@ -13507,7 +13566,6 @@ angular.module('material.components.sticky', [
* when the user starts scrolling past the original element. * when the user starts scrolling past the original element.
* If not provided, it will use the result of `element.clone()`. * If not provided, it will use the result of `element.clone()`.
*/ */
function MdSticky($document, $mdConstant, $$rAF, $mdUtil) { function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
var browserStickySupport = checkStickySupport(); var browserStickySupport = checkStickySupport();
@ -13614,7 +13672,6 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
setCurrentItem(item); setCurrentItem(item);
} }
/*************** /***************
* Private * Private
***************/ ***************/
@ -13639,7 +13696,6 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
} }
} }
// As we scroll, push in and select the correct sticky element. // As we scroll, push in and select the correct sticky element.
function onScroll() { function onScroll() {
var scrollTop = contentEl.prop('scrollTop'); var scrollTop = contentEl.prop('scrollTop');
@ -13687,7 +13743,7 @@ function MdSticky($document, $mdConstant, $$rAF, $mdUtil) {
} }
// If the next item is close to the current one, pull the current one down into view // If the next item is close to the current one, pull the current one down into view
if (self.next && scrollTop >= self.next.top - self.current.height) { if (self.next && self.current && (scrollTop >= (self.next.top - self.current.height))) {
translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height)); translate(self.current, scrollTop + (self.next.top - scrollTop - self.current.height));
return; return;
} }
@ -13824,7 +13880,8 @@ MdSticky.$inject = ["$document", "$mdConstant", "$$rAF", "$mdUtil"];
* > To improve the visual grouping of content, use the system color for your subheaders. * > To improve the visual grouping of content, use the system color for your subheaders.
* *
*/ */
angular.module('material.components.subheader', [ angular
.module('material.components.subheader', [
'material.core', 'material.core',
'material.components.sticky' 'material.components.sticky'
]) ])
@ -20230,7 +20287,7 @@ angular
* @ngInject * @ngInject
*/ */
function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipple, function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipple,
$mdUtil, $animate, $attrs, $compile, $mdTheming) { $mdUtil, $animateCss, $attrs, $compile, $mdTheming) {
// define private properties // define private properties
var ctrl = this, var ctrl = this,
locked = false, locked = false,
@ -20859,15 +20916,39 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
newHeight = contentHeight + tabsHeight, newHeight = contentHeight + tabsHeight,
currentHeight = $element.prop('clientHeight'); currentHeight = $element.prop('clientHeight');
if (currentHeight === newHeight) return; if (currentHeight === newHeight) return;
// Lock during animation so the user can't change tabs
locked = true; locked = true;
$animate
.animate( var fromHeight = { height: currentHeight + 'px'},
$element, toHeight = { height: newHeight + 'px' };
{ height: currentHeight + 'px' },
{ height: newHeight + 'px' } // Set the height to the current, specific pixel height to fix a bug on iOS where the height
) // first animates to 0, then back to the proper height causing a visual glitch
.then(function () { $element.css(fromHeight);
$element.css('height', '');
// Animate the height from the old to the new
$animateCss($element, {
from: fromHeight,
to: toHeight,
easing: 'cubic-bezier(0.35, 0, 0.25, 1)',
duration: 0.5
}).start().done(function () {
// Then (to fix the same iOS issue as above), disable transitions and remove the specific
// pixel height so the height can size with browser width/content changes, etc.
$element.css({
transition: 'none',
height: ''
});
// In the next tick, re-allow transitions (if we do it all at once, $element.css is "smart"
// enough to batch it for us instead of doing it immediately, which undoes the original
// transition: none)
$mdUtil.nextTick(function() {
$element.css('transition', '');
});
// And unlock so tab changes can occur
locked = false; locked = false;
}); });
} }
@ -20938,7 +21019,7 @@ function MdTabsController ($scope, $element, $window, $mdConstant, $mdTabInkRipp
$mdTabInkRipple.attach(scope, element, options); $mdTabInkRipple.attach(scope, element, options);
} }
} }
MdTabsController.$inject = ["$scope", "$element", "$window", "$mdConstant", "$mdTabInkRipple", "$mdUtil", "$animate", "$attrs", "$compile", "$mdTheming"]; MdTabsController.$inject = ["$scope", "$element", "$window", "$mdConstant", "$mdTabInkRipple", "$mdUtil", "$animateCss", "$attrs", "$compile", "$mdTheming"];
})(); })();
(function(){ (function(){

File diff suppressed because one or more lines are too long