(js/css) Update generated files

pull/203/head
InverseBot 2016-03-15 02:29:27 -04:00
parent e7b0119ab1
commit 9878569478
2 changed files with 158 additions and 112 deletions

View File

@ -2,7 +2,7 @@
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.6-master-06e4ef9
* v1.0.6-master-a653122
*/
(function( window, angular, undefined ){
"use strict";
@ -5041,27 +5041,61 @@ function ThemingProvider($mdColorPalette) {
*/
/* @ngInject */
function ThemingService($rootScope, $log) {
// Allow us to be invoked via a linking function signature.
var applyTheme = function (scope, el) {
if (el === undefined) { el = scope; scope = undefined; }
if (scope === undefined) { scope = $rootScope; }
applyTheme.inherit(el, el);
};
applyTheme.inherit = function(el, parent) {
applyTheme.THEMES = angular.extend({}, THEMES);
applyTheme.inherit = inheritTheme;
applyTheme.registered = registered;
applyTheme.defaultTheme = function() { return defaultTheme; };
applyTheme.generateTheme = function(name) { generateTheme(name, nonce); };
return applyTheme;
/**
* Determine is specified theme name is a valid, registered theme
*/
function registered(themeName) {
if (themeName === undefined || themeName === '') return true;
return applyTheme.THEMES[themeName] !== undefined;
}
/**
* Get theme name for the element, then update with Theme CSS class
*/
function inheritTheme (el, parent) {
var ctrl = parent.controller('mdTheme');
var attrThemeValue = el.attr('md-theme-watch');
if ( (alwaysWatchTheme || angular.isDefined(attrThemeValue)) && attrThemeValue != 'false') {
var deregisterWatch = $rootScope.$watch(function() {
return ctrl && ctrl.$mdTheme || (defaultTheme == 'default' ? '' : defaultTheme);
}, changeTheme);
el.on('$destroy', deregisterWatch);
} else {
var theme = ctrl && ctrl.$mdTheme || (defaultTheme == 'default' ? '' : defaultTheme);
changeTheme(theme);
var watchTheme = (alwaysWatchTheme || angular.isDefined(attrThemeValue)) && attrThemeValue != 'false';
updateThemeClass(lookupThemeName());
el.on('$destroy', watchTheme ? $rootScope.$watch(lookupThemeName, updateThemeClass) : angular.noop );
/**
* Find the theme name from the parent controller or element data
*/
function lookupThemeName() {
// As a few components (dialog) add their controllers later, we should also watch for a controller init.
ctrl = parent.controller('mdTheme') || el.data('$mdThemeController');
return ctrl && ctrl.$mdTheme || (defaultTheme == 'default' ? '' : defaultTheme);
}
function changeTheme(theme) {
/**
* Remove old theme class and apply a new one
* NOTE: if not a valid theme name, then the current name is not changed
*/
function updateThemeClass(theme) {
if (!theme) return;
if (!registered(theme)) {
$log.warn('Attempted to use unregistered theme \'' + theme + '\'. ' +
'Register it with $mdThemingProvider.theme().');
}
var oldTheme = el.data('$mdThemeName');
if (oldTheme) el.removeClass('md-' + oldTheme +'-theme');
el.addClass('md-' + theme + '-theme');
@ -5070,31 +5104,8 @@ function ThemingProvider($mdColorPalette) {
el.data('$mdThemeController', ctrl);
}
}
};
applyTheme.THEMES = angular.extend({}, THEMES);
applyTheme.defaultTheme = function() { return defaultTheme; };
applyTheme.registered = registered;
applyTheme.generateTheme = function(name) { generateTheme(name, nonce); };
return applyTheme;
function registered(themeName) {
if (themeName === undefined || themeName === '') return true;
return applyTheme.THEMES[themeName] !== undefined;
}
function applyTheme(scope, el) {
// Allow us to be invoked via a linking function signature.
if (el === undefined) {
el = scope;
scope = undefined;
}
if (scope === undefined) {
scope = $rootScope;
}
applyTheme.inherit(el, el);
}
}
}
ThemingProvider.$inject = ["$mdColorPalette"];
@ -8614,6 +8625,10 @@ function iosScrollFix(node) {
this.calendarPane.classList.remove('md-pane-open');
this.calendarPane.classList.remove('md-datepicker-pos-adjusted');
if (this.isCalendarOpen) {
this.$mdUtil.enableScrolling();
}
if (this.calendarPane.parentNode) {
// Use native DOM removal because we do not want any of the angular state of this element
// to be disposed.
@ -8657,11 +8672,10 @@ function iosScrollFix(node) {
/** Close the floating calendar pane. */
DatePickerCtrl.prototype.closeCalendarPane = function() {
if (this.isCalendarOpen) {
this.isCalendarOpen = false;
this.detachCalendarPane();
this.isCalendarOpen = false;
this.calendarPaneOpenedFrom.focus();
this.calendarPaneOpenedFrom = null;
this.$mdUtil.enableScrolling();
this.ngModelCtrl.$setTouched();
@ -11973,7 +11987,7 @@ function labelDirective() {
*
*/
function inputTextareaDirective($mdUtil, $window, $mdAria) {
function inputTextareaDirective($mdUtil, $window, $mdAria, $timeout) {
return {
restrict: 'E',
require: ['^?mdInputContainer', '?ngModel'],
@ -12088,84 +12102,81 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
}
function setupTextarea() {
if (angular.isDefined(element.attr('md-no-autogrow'))) {
if (attr.hasOwnProperty('mdNoAutogrow')) {
return;
}
var node = element[0];
var container = containerCtrl.element[0];
var min_rows = NaN;
var lineHeight = null;
// can't check if height was or not explicity set,
// Can't check if height was or not explicity set,
// so rows attribute will take precedence if present
if (node.hasAttribute('rows')) {
min_rows = parseInt(node.getAttribute('rows'));
}
var minRows = attr.hasOwnProperty('rows') ? parseInt(attr.rows) : NaN;
var lineHeight = null;
var node = element[0];
var onChangeTextarea = $mdUtil.debounce(growTextarea, 1);
// This timeout is necessary, because the browser needs a little bit
// of time to calculate the `clientHeight` and `scrollHeight`.
$timeout(function() {
$mdUtil.nextTick(growTextarea);
}, 10, false);
function pipelineListener(value) {
onChangeTextarea();
return value;
}
if (ngModelCtrl) {
ngModelCtrl.$formatters.push(pipelineListener);
ngModelCtrl.$viewChangeListeners.push(pipelineListener);
// We can hook into Angular's pipeline, instead of registering a new listener.
// Note that we should use `$parsers`, as opposed to `$viewChangeListeners` which
// was used before, because `$viewChangeListeners` don't fire if the input is
// invalid.
if (hasNgModel) {
ngModelCtrl.$formatters.unshift(pipelineListener);
ngModelCtrl.$parsers.unshift(pipelineListener);
} else {
onChangeTextarea();
}
element.on('keydown input', onChangeTextarea);
if (isNaN(min_rows)) {
element.attr('rows', '1');
element.on('scroll', onScroll);
// Note that it's safe to use the `input` event since we're not supporting IE9 and below.
element.on('input', growTextarea);
}
angular.element($window).on('resize', onChangeTextarea);
if (!minRows) {
element
.attr('rows', 1)
.on('scroll', onScroll);
}
angular.element($window).on('resize', growTextarea);
scope.$on('$destroy', function() {
angular.element($window).off('resize', onChangeTextarea);
angular.element($window).off('resize', growTextarea);
});
function growTextarea() {
// sets the md-input-container height to avoid jumping around
container.style.height = container.offsetHeight + 'px';
// temporarily disables element's flex so its height 'runs free'
element.addClass('md-no-flex');
if (isNaN(min_rows)) {
node.style.height = "auto";
node.scrollTop = 0;
var height = getHeight();
if (height) node.style.height = height + 'px';
} else {
node.setAttribute("rows", 1);
element
.addClass('md-no-flex')
.attr('rows', 1);
if (minRows) {
if (!lineHeight) {
node.style.minHeight = '0';
node.style.minHeight = 0;
lineHeight = element.prop('clientHeight');
node.style.minHeight = null;
}
var rows = Math.min(min_rows, Math.round(node.scrollHeight / lineHeight));
node.setAttribute("rows", rows);
node.style.height = lineHeight * rows + "px";
var newRows = Math.round( Math.round(getHeight() / lineHeight) );
var rowsToSet = Math.min(newRows, minRows);
element
.css('height', lineHeight * rowsToSet + 'px')
.attr('rows', rowsToSet)
.toggleClass('_md-textarea-scrollable', newRows >= minRows);
} else {
element.css('height', 'auto');
node.scrollTop = 0;
var height = getHeight();
if (height) element.css('height', height + 'px');
}
// reset everything back to normal
element.removeClass('md-no-flex');
container.style.height = 'auto';
}
function getHeight() {
var line = node.scrollHeight - node.offsetHeight;
return node.offsetHeight + (line > 0 ? line : 0);
var offsetHeight = node.offsetHeight;
var line = node.scrollHeight - offsetHeight;
return offsetHeight + (line > 0 ? line : 0);
}
function onScroll(e) {
@ -12176,8 +12187,13 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
node.style.height = height + 'px';
}
function pipelineListener(value) {
growTextarea();
return value;
}
// Attach a watcher to detect when the textarea gets shown.
if (angular.isDefined(element.attr('md-detect-hidden'))) {
if (attr.hasOwnProperty('mdDetectHidden')) {
var handleHiddenChange = function() {
var wasHidden = false;
@ -12203,7 +12219,7 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
}
}
}
inputTextareaDirective.$inject = ["$mdUtil", "$window", "$mdAria"];
inputTextareaDirective.$inject = ["$mdUtil", "$window", "$mdAria", "$timeout"];
function mdMaxlengthDirective($animate, $mdUtil) {
return {
@ -12342,7 +12358,7 @@ placeholderDirective.$inject = ["$log"];
*
* </hljs>
*/
function mdSelectOnFocusDirective() {
function mdSelectOnFocusDirective($timeout) {
return {
restrict: 'A',
@ -12352,18 +12368,44 @@ function mdSelectOnFocusDirective() {
function postLink(scope, element, attr) {
if (element[0].nodeName !== 'INPUT' && element[0].nodeName !== "TEXTAREA") return;
element.on('focus', onFocus);
var preventMouseUp = false;
element
.on('focus', onFocus)
.on('mouseup', onMouseUp);
scope.$on('$destroy', function() {
element.off('focus', onFocus);
element
.off('focus', onFocus)
.off('mouseup', onMouseUp);
});
function onFocus() {
// Use HTMLInputElement#select to fix firefox select issues
element[0].select();
preventMouseUp = true;
$timeout(function() {
// Use HTMLInputElement#select to fix firefox select issues.
// The debounce is here for Edge's sake, otherwise the selection doesn't work.
element[0].select();
// This should be reset from inside the `focus`, because the event might
// have originated from something different than a click, e.g. a keyboard event.
preventMouseUp = false;
}, 1, false);
}
// Prevents the default action of the first `mouseup` after a focus.
// This is necessary, because browsers fire a `mouseup` right after the element
// has been focused. In some browsers (Firefox in particular) this can clear the
// selection. There are examples of the problem in issue #7487.
function onMouseUp(event) {
if (preventMouseUp) {
event.preventDefault();
}
}
}
}
mdSelectOnFocusDirective.$inject = ["$timeout"];
var visibilityDirectives = ['ngIf', 'ngShow', 'ngHide', 'ngSwitchWhen', 'ngSwitchDefault'];
function ngMessagesDirective() {
@ -12433,7 +12475,7 @@ function mdInputInvalidMessagesAnimation($q, $animateCss) {
}
// NOTE: We do not need the removeClass method, because the message ng-leave animation will fire
}
};
}
mdInputInvalidMessagesAnimation.$inject = ["$q", "$animateCss"];
@ -14796,7 +14838,7 @@ function SelectProvider($$interimElementProvider) {
var mdSelect = opts.selectCtrl;
if (mdSelect) {
var menuController = opts.selectEl.controller('mdSelectMenu');
mdSelect.setLabelText(menuController.selectedLabels());
mdSelect.setLabelText(menuController ? menuController.selectedLabels() : '');
mdSelect.triggerClose();
}
}
@ -20288,7 +20330,7 @@ MdChipsCtrl.prototype.inputKeydown = function(event) {
event.preventDefault();
// Only append the chip and reset the chip buffer if the max chips limit isn't reached.
if (this.items.length >= this.maxChips) return;
if (this.hasMaxChipsReached()) return;
this.appendChip(chipBuffer);
this.resetChipBuffer();
@ -20507,7 +20549,7 @@ MdChipsCtrl.prototype.resetChipBuffer = function() {
}
};
MdChipsCtrl.prototype.hasMaxChips = function() {
MdChipsCtrl.prototype.hasMaxChipsReached = function() {
if (angular.isString(this.maxChips)) this.maxChips = parseInt(this.maxChips, 10) || 0;
return this.maxChips > 0 && this.items.length >= this.maxChips;
@ -20517,7 +20559,7 @@ MdChipsCtrl.prototype.hasMaxChips = function() {
* Updates the validity properties for the ngModel.
*/
MdChipsCtrl.prototype.validateModel = function() {
this.ngModelCtrl.$setValidity('md-max-chips', !this.hasMaxChips());
this.ngModelCtrl.$setValidity('md-max-chips', !this.hasMaxChipsReached());
};
/**
@ -20653,10 +20695,14 @@ MdChipsCtrl.prototype.configureUserInput = function(inputElement) {
};
MdChipsCtrl.prototype.configureAutocomplete = function(ctrl) {
if ( ctrl ){
if ( ctrl ) {
this.hasAutocomplete = true;
ctrl.registerSelectedItemWatcher(angular.bind(this, function (item) {
if (item) {
// Only append the chip and reset the chip buffer if the max chips limit isn't reached.
if (this.hasMaxChipsReached()) return;
this.appendChip(item);
this.resetChipBuffer();
}
@ -25249,4 +25295,4 @@ angular.module("material.core").constant("$MD_THEME_CSS", "/* Only used with Th
})();
})(window, window.angular);;window.ngMaterial={version:{full: "1.0.6-master-06e4ef9"}};
})(window, window.angular);;window.ngMaterial={version:{full: "1.0.6-master-a653122"}};

File diff suppressed because one or more lines are too long