source: trip-planner-front/node_modules/angular-material/modules/js/select/select.min.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 21.2 KB
Line 
1/*!
2 * AngularJS Material Design
3 * https://github.com/angular/material
4 * @license MIT
5 * v1.2.2-master-0a06f99
6 */
7!function(P,F,K){"use strict";e.$inject=["$mdSelect","$mdUtil","$mdConstant","$mdTheming","$mdAria","$parse","$sce"],t.$inject=["$parse","$mdUtil","$mdConstant","$mdTheming"],r.$inject=["$mdButtonInkRipple","$mdUtil","$mdTheming"],i.$inject=["$$interimElementProvider"],a.$inject=["$element"];var B=8,n=0,c=F.element('<div class="md-container"><div class="md-icon"></div></div>');function e(B,L,j,G,I,_,q){return{restrict:"E",require:["^?mdInputContainer","mdSelect","ngModel","?^form"],compile:function(e,t){var n=L.parseAttributeBoolean(t.multiple);e.addClass("md-auto-horizontal-margin");var r=F.element("<md-select-value><span></span></md-select-value>");r.append('<span class="md-select-icon" aria-hidden="true"></span>'),r.addClass("md-select-value"),r[0].hasAttribute("id")||r.attr("id","select_value_label_"+L.nextUid());var i=e.find("md-content");i.length||(e.append(F.element("<md-content>").append(e.contents())),i=e.find("md-content"));i.attr("role","listbox"),i.attr("tabindex","-1"),n?i.attr("aria-multiselectable","true"):i.attr("aria-multiselectable","false");t.mdOnOpen&&(e.find("md-content").prepend(F.element('<div> <md-progress-circular md-mode="indeterminate" ng-if="$$loadingAsyncDone === false" md-diameter="25px"></md-progress-circular></div>')),e.find("md-option").attr("ng-show","$$loadingAsyncDone"));if(t.name){var a=F.element('<select class="md-visually-hidden"></select>');a.attr({name:t.name,"aria-hidden":"true",tabindex:"-1"});var o=e.find("md-option");F.forEach(o,function(e){var t=F.element("<option>"+e.innerHTML+"</option>");e.hasAttribute("ng-value")?t.attr("ng-value",e.getAttribute("ng-value")):e.hasAttribute("value")&&t.attr("value",e.getAttribute("value")),a.append(t)}),a.append('<option ng-value="'+t.ngModel+'" selected></option>'),e.parent().append(a)}var l=n?"multiple":"",d=t.ngModelOptions?L.supplant('ng-model-options="{0}"',[t.ngModelOptions]):"",s='<div class="md-select-menu-container" aria-hidden="true" role="presentation"> <md-select-menu role="presentation" {0} {1}>{2}</md-select-menu></div>';s=L.supplant(s,[l,d,e.html()]),e.empty().append(r),e.append(s),t.tabindex||t.$set("tabindex",0);return function(i,a,o,e){var t,n,l,r,d,s,c=!0,u=e[0],f=e[1],p=e[2],m=e[3],h=a.find("md-select-value"),v=F.isDefined(o.readonly),g=L.parseAttributeBoolean(o.mdNoAsterisk),b=F.isDefined(o.ariaLabelledby),$=a.find("md-content"),y=a.attr("placeholder");if(g&&a.addClass("md-no-asterisk"),u){var M=u.isErrorGetter||function(){return p.$invalid&&(p.$touched||m&&m.$submitted)};if(u.input&&a.find("md-select-header").find("input")[0]!==u.input[0])throw new Error("<md-input-container> can only have *one* child <input>, <textarea>, or <select> element!");if(u.input=a,u.label)u.label.attr("aria-hidden","true"),$.attr("aria-label",u.label.text()),u.setHasPlaceholder(!!y);else{I.expect(a,"aria-label",y);var w=a.attr("aria-label");w=w||y,$.attr("aria-label",w)}var k=i.$watch(M,u.setInvalid)}s=F.element(a[0].querySelector(".md-select-menu-container")),r=i,o.mdContainerClass&&s.addClass(o.mdContainerClass),(d=s.find("md-select-menu").controller("mdSelectMenu")).init(p,o),a.on("$destroy",function(){s.remove()}),l=s,G(a);var A=p.$render;p.$render=function(){A(),T(),N()};var x=o.$observe("placeholder",p.$render),C=o.$observe("required",function(e){u&&u.label&&u.label.toggleClass("md-required",e&&!g),a.removeAttr("aria-required"),e?$.attr("aria-required","true"):$.removeAttr("aria-required")});if(f.setSelectValueText=function(e){var t=e===K||""===e,n=!1;if(f.setIsPlaceholder(!e),o.mdSelectedText&&o.mdSelectedHtml)throw Error("md-select cannot have both `md-selected-text` and `md-selected-html`");if(o.mdSelectedText||o.mdSelectedHtml)e=_(o.mdSelectedText||o.mdSelectedHtml)(i),n=!0;else if(t){e=o.placeholder||(u&&u.label?u.label.text():"")||"",n=!0}var r=h.children().eq(0);o.mdSelectedHtml?r.html(q.getTrustedHtml(e)):n?r.text(e):r.html(e),t?(h.attr("aria-hidden","true"),b||a.removeAttr("aria-labelledby")):(h.removeAttr("aria-hidden"),b||a.attr("aria-labelledby",a[0].id+" "+h[0].id))},f.setIsPlaceholder=function(e){e?(h.addClass("md-select-placeholder"),u&&u.label&&!a.attr("placeholder")&&u.label.addClass("md-placeholder")):(h.removeClass("md-select-placeholder"),u&&u.label&&!a.attr("placeholder")&&u.label.removeClass("md-placeholder"))},!v){a.on("focus",function(){u&&u.setFocused(!0)}),a.on("blur",function(e){c&&(c=!1,r._mdSelectIsOpen&&e.stopImmediatePropagation()),u&&u.setFocused(!1),N()})}f.triggerClose=function(){_(o.mdOnClose)(i)},i.$$postDigest(function(){!function(){var e=a.attr("aria-label")||a.attr("placeholder");!e&&u&&u.label&&(e=u.label.text());I.expect(a,"aria-label",e)}(),T()});var S=i.$watch(function(){return d.getSelectedLabels()},T);function T(){d=d||l.find("md-select-menu").controller("mdSelectMenu"),f.setSelectValueText(d.getSelectedLabels())}var O=o.$observe("mdMultiple",function(e){n&&n();var t=_(e);n=i.$watch(function(){return t(i)},function(e,t){var n=l.find("md-select-menu");if(e!==K||t!==K){if(e){var r={multiple:"multiple"};a.attr(r),n.attr(r)}else a.removeAttr("multiple"),n.removeAttr("multiple");a.find("md-content").attr("aria-multiselectable",e?"true":"false"),l&&(d.setMultiple(Boolean(e)),A=p.$render,p.$render=function(){A(),T(),N()},p.$render())}})}),E=o.$observe("disabled",function(e){F.isString(e)&&(e=!0),t!==K&&t===e||((t=e)?a.attr({"aria-disabled":"true"}).removeAttr("tabindex").removeAttr("aria-expanded").removeAttr("aria-haspopup").off("click",P).off("keydown",R):a.attr({tabindex:o.tabindex,"aria-haspopup":"listbox"}).removeAttr("aria-disabled").on("click",P).on("keydown",R))});o.hasOwnProperty("disabled")||o.hasOwnProperty("ngDisabled")||(a.attr({"aria-disabled":"false"}),a.on("click",P),a.on("keydown",R));var D={role:"button","aria-haspopup":"listbox"};a[0].hasAttribute("id")||(D.id="select_"+L.nextUid());var V="select_container_"+L.nextUid();l.attr("id",V);var H="select_listbox_"+L.nextUid();function N(){L.nextTick(function(){u&&u.setHasValue(0<d.getSelectedLabels().length||(a[0].validity||{}).badInput)})}function R(e){if(j.isNavigationKey(e))e.preventDefault(),P();else if(U(e,j)){e.preventDefault();var t=d.optNodeForKeyboardSearch(e);if(!t||t.hasAttribute("disabled"))return;var n=F.element(t).controller("mdOption");d.isMultiple||F.forEach(Object.keys(d.selected),function(e){d.deselect(e)}),d.select(n.hashKey,n.value),d.refreshViewValue()}}function P(){r._mdSelectIsOpen=!0,a.attr("aria-expanded","true"),B.show({scope:r,preserveScope:!0,skipCompile:!0,element:l,target:a[0],selectCtrl:f,preserveElement:!0,hasBackdrop:!0,loadingAsync:!!o.mdOnOpen&&(i.$eval(o.mdOnOpen)||!0)}).finally(function(){r._mdSelectIsOpen=!1,a.removeAttr("aria-expanded"),a.removeAttr("aria-activedescendant"),p.$setTouched()})}l.find("md-content").attr("id",H),a.find("md-select-menu").length||(D["aria-owns"]=H),a.attr(D),i.$on("$destroy",function(){C&&C(),E&&E(),n&&n(),O&&O(),S&&S(),x&&x(),k&&k(),a.off("focus"),a.off("blur"),B.destroy().finally(function(){u&&(u.setFocused(!1),u.setHasValue(!1),u.input=null),p.$setTouched()})})}},controller:function(){}}}function t(m,h,e,i){return{restrict:"E",require:["mdSelectMenu"],scope:!(t.$inject=["$scope","$attrs","$element"]),controller:t,link:{pre:function(a,e,t,n){var o=n[0];function r(e){var t=h.getClosest(e.target,"md-option"),n=t&&F.element(t).data("$mdOptionController");if(t&&n)if(t.hasAttribute("disabled"))e.stopImmediatePropagation();else{var r=o.hashGetter(n.value),i=F.isDefined(o.selected[r]);a.$apply(function(){o.isMultiple?i?o.deselect(r):o.select(r,n.value):i||(F.forEach(Object.keys(o.selected),function(e){o.deselect(e)}),o.select(r,n.value)),o.refreshViewValue()})}else e.target&&e.target.parentNode&&"MD-SELECT-HEADER"===e.target.parentNode.tagName&&e.stopImmediatePropagation()}e.addClass("_md"),i(e),e.on("click",r),e.on("keypress",function(e){13!==e.keyCode&&32!==e.keyCode||r(e)})}}};function t(a,i,o){var l,r,d,s,c=this,u="";function f(){var n=c.ngModel.$modelValue||c.ngModel.$viewValue||[];if(F.isArray(n)){var e=Object.keys(c.selected),t=n.map(c.hashGetter);e.filter(function(e){return-1===t.indexOf(e)}).forEach(c.deselect),t.forEach(function(e,t){c.select(e,n[t])})}}function p(){var e=c.ngModel.$viewValue||c.ngModel.$modelValue;Object.keys(c.selected).forEach(c.deselect),c.select(c.hashGetter(e),e)}c.isMultiple=F.isDefined(i.multiple),c.selected={},c.options={},a.$watchCollection(function(){return c.options},function(){c.ngModel.$render(),function(){var e,t;if(!o.find("md-optgroup").length)return;for(t=o.find("md-option"),e=0;e<t.length;e++)t[e].setAttribute("aria-setsize",t.length),t[e].setAttribute("aria-posinset",e+1)}()}),c.setMultiple=function(e){var t=c.ngModel;if(l=l||t.$isEmpty,c.isMultiple=e,c.isMultiple){var n=!1,r=function(e){n?f():h.nextTick(function(){f(),n=!0})};t.$validators["md-multiple"]=i,t.$render=r,a.$watchCollection(c.modelBinding,function(e){i(e)&&r()}),t.$isEmpty=function(e){return!e||0===e.length}}else delete t.$validators["md-multiple"],t.$render=p;function i(e,t){return F.isArray(e||t||[])}},c.optNodeForKeyboardSearch=function(e){var t,n;for(r&&clearTimeout(r),r=setTimeout(function(){u="",d=s=r=K},300),u+=e.key,t=new RegExp("^"+h.sanitize(u),"i"),d||(d=o.find("md-option"),s=new Array(d.length),F.forEach(d,function(e,t){s[t]=e.textContent.trim()})),n=0;n<s.length;++n)if(t.test(s[n]))return d[n]},c.init=function(e,t){function r(e){return F.isObject(e)&&!F.isArray(e)?"object_"+(e.$$mdSelectId||(e.$$mdSelectId=++n)):e+""}c.ngModel=e,c.modelBinding=t.ngModel,c.ngModel.$isEmpty=function(e){var t=c.options[c.hashGetter(e)]?c.options[c.hashGetter(e)].value:null;return!F.isDefined(t)||null===t||""===t||t!=t},i.ngModelOptions?c.hashGetter=function(e){var t=m(i.ngModelOptions)(a),n=t&&t.trackBy;return n?m(n)(a,{$value:e}):F.isObject(e)?r(e):e}:c.hashGetter=r,c.setMultiple(c.isMultiple),t.hasOwnProperty("mdSelectOnlyOption")&&h.nextTick(function(){var e=Object.keys(c.options);if(1===e.length){var t=c.options[e[0]];c.deselect(Object.keys(c.selected)[0]),c.select(c.hashGetter(t.value),t.value),c.refreshViewValue(),c.ngModel.$setPristine()}},!1)},c.setActiveDescendant=function(e){F.isDefined(e)?o.find("md-content").attr("aria-activedescendant",e):o.find("md-content").removeAttr("aria-activedescendant")},c.getSelectedLabels=function(e){var t,n=(e=e||{}).mode||"html",r=h.nodesToArray(o[0].querySelectorAll("md-option[selected]"));return r.length?("html"===n?t=function(e){if(e.hasAttribute("md-option-empty"))return"";var t=e.innerHTML,n=e.querySelector(".md-ripple-container");n&&(t=t.replace(n.outerHTML,""));var r=e.querySelector(".md-container");return r&&(t=t.replace(r.outerHTML,"")),t}:"aria"===n&&(t=function(e){return e.hasAttribute("aria-label")?e.getAttribute("aria-label"):e.textContent}),h.uniq(r.map(t)).join(", ")):""},c.select=function(e,t){var n=c.options[e];n&&n.setSelected(!0,c.isMultiple),c.selected[e]=t},c.deselect=function(e){var t=c.options[e];t&&t.setSelected(!1,c.isMultiple),delete c.selected[e]},c.addOption=function(e,t){if(F.isDefined(c.options[e]))throw new Error('Duplicate md-option values are not allowed in a select. Duplicate value "'+t.value+'" found.');c.options[e]=t,F.isDefined(c.selected[e])&&(c.select(e,t.value),F.isDefined(c.ngModel.$$rawModelValue)&&c.hashGetter(c.ngModel.$$rawModelValue)===e&&c.ngModel.$validate(),c.refreshViewValue())},c.removeOption=function(e){delete c.options[e]},c.refreshViewValue=function(){var e,t=[];for(var n in c.selected)(e=c.options[n])?t.push(e.value):t.push(c.selected[n]);var r=c.isMultiple?t:t[0];!function(e,t){{if(c.isMultiple){if(F.isArray(e)){if(e.length!==t.length)return!1;var n=e.map(function(e){return c.hashGetter(e)});return t.every(function(e){var t=c.hashGetter(e);return n.some(function(e){return e===t})})}return!1}return c.hashGetter(e)===c.hashGetter(t)}}(c.ngModel.$modelValue,r)&&(c.ngModel.$setViewValue(r),c.ngModel.$render())}}}function r(r,i,s){return{restrict:"E",require:["mdOption","^^mdSelectMenu"],controller:a,compile:function(e,t){e.append(F.element('<div class="md-text">').append(e.contents())),e.attr("tabindex",t.tabindex||"0"),function(e){var t=e.value,n=e.ngValue;return t||n}(t)||e.attr("md-option-empty","");return n}};function n(a,n,e,t){var o=t[0],l=t[1];function d(e,t,n){if(l.hashGetter){var r=l.hashGetter(t,a),i=l.hashGetter(e,a);o.hashKey=i,o.value=e,l.removeOption(r,o),l.addOption(i,o)}else n||a.$$postDigest(function(){d(e,t,!0)})}s(n),l.isMultiple&&(n.addClass("md-checkbox-enabled"),n.prepend(c.clone())),F.isDefined(e.ngValue)?a.$watch(e.ngValue,function(e,t){d(e,t),n.removeAttr("aria-checked")}):F.isDefined(e.value)?d(e.value):a.$watch(function(){return n.text().trim()},d),e.$observe("disabled",function(e){e?n.attr("tabindex","-1"):n.attr("tabindex","0")}),a.$$postDigest(function(){e.$observe("selected",function(e){F.isDefined(e)&&("string"==typeof e&&(e=!0),e?(l.isMultiple||l.deselect(Object.keys(l.selected)[0]),l.select(o.hashKey,o.value)):l.deselect(o.hashKey),l.refreshViewValue())})}),r.attach(a,n),function(){var e={role:"option"};l.isMultiple&&(e["aria-selected"]="false");n[0].hasAttribute("id")||(e.id="select_option_"+i.nextUid());n.attr(e)}(),a.$on("$destroy",function(){l.removeOption(o.hashKey,o)})}}function a(n){this.setSelected=function(e,t){e?n.attr({selected:"true","aria-selected":"true"}):e||(n.removeAttr("selected"),t?n.attr("aria-selected","false"):n.removeAttr("aria-selected"))}}function i(e){return t.$inject=["$mdSelect","$mdConstant","$mdUtil","$window","$q","$$rAF","$animateCss","$animate","$document"],e("$mdSelect").setDefaults({methods:["target"],options:t});function t(s,c,V,H,i,a,u,f,N){var p=V.dom.animator,m=c.KEY_CODE;return{parent:"body",themable:!0,onShow:function(n,o,l){return function(){l.loadingAsync&&!l.isRemoved&&(n.$$loadingAsyncDone=!1,i.when(l.loadingAsync).then(function(){n.$$loadingAsyncDone=!0,delete l.loadingAsync}).then(function(){a(r)}))}(),function(e,t){var n=o.find("md-select-menu");if(!t.target)throw new Error(V.supplant("$mdSelect.show() expected a target element in options.target but got '{0}'!",[t.target]));F.extend(t,{isRemoved:!1,target:F.element(t.target),parent:F.element(t.parent),selectEl:n,contentEl:o.find("md-content"),optionNodes:n[0].getElementsByTagName("md-option")})}(0,l),l.hideBackdrop=function(e,t,n){n.disableParentScroll&&!V.getClosest(n.target,"MD-DIALOG")?n.restoreScroll=V.disableScrollAround(n.element,n.parent):n.disableParentScroll=!1;n.hasBackdrop&&(n.backdrop=V.createBackdrop(e,"md-select-backdrop md-click-catcher"),f.enter(n.backdrop,N[0].body,null,{duration:0}));return function(){n.backdrop&&n.backdrop.remove(),n.disableParentScroll&&n.restoreScroll(),delete n.restoreScroll}}(n,0,l),function(e,n,t){t.parent!==n.parent()&&n.parent().attr("aria-owns",n.find("md-content").attr("id"));return t.parent.append(n),i(function(e,t){try{u(n,{removeClass:"md-leave",duration:0}).start().then(r).then(e)}catch(e){t(e)}})}(0,o,l).then(function(e){return o.attr("aria-hidden","false"),l.alreadyOpen=!0,l.cleanupInteraction=function(){if(l.isRemoved)return;var r=l.selectEl,a=r.controller("mdSelectMenu")||{};return o.addClass("md-clickable"),l.backdrop&&l.backdrop.on("click",e),r.on("keydown",t),r.on("click",i),function(){l.backdrop&&l.backdrop.off("click",e),r.off("keydown",t),r.off("click",i),o.removeClass("md-clickable"),l.isRemoved=!0};function e(e){e.preventDefault(),e.stopPropagation(),l.restoreFocus=!1,V.nextTick(s.hide,!0)}function t(e){switch(e.preventDefault(),e.stopPropagation(),e.keyCode){case m.UP_ARROW:return void n("prev");case m.DOWN_ARROW:return void n("next");case m.SPACE:case m.ENTER:l.focusedNode&&(r.triggerHandler({type:"click",target:l.focusedNode}),e.preventDefault()),i(e);break;case m.TAB:case m.ESCAPE:e.stopPropagation(),e.preventDefault(),l.restoreFocus=!0,V.nextTick(s.hide,!0);break;default:if(U(e,c)){var t=a.optNodeForKeyboardSearch(e);t&&!t.hasAttribute("disabled")&&d(l.focusedNode,t,a)}}}function n(e){for(var t,n=V.nodesToArray(l.optionNodes),r=n.indexOf(l.focusedNode),i=n[r];-1===r?r=0:"next"===e&&r<n.length-1?r++:"prev"===e&&0<r&&r--,(t=n[r]).hasAttribute("disabled")&&(t=null),!t&&r<n.length-1&&0<r;);d(i,t,a)}function i(n){n&&"click"===n.type&&n.currentTarget!==r[0]||function(){var e=!1;if(n&&0<n.currentTarget.children.length){var t=n.currentTarget.children[0];if(t.scrollHeight>t.clientHeight&&0<t.children.length)n.pageX-n.currentTarget.getBoundingClientRect().left>t.querySelector("md-option").offsetWidth&&(e=!0)}return e}()||l.focusedNode&&l.focusedNode.hasAttribute&&!l.focusedNode.hasAttribute("disabled")&&(n.preventDefault(),n.stopPropagation(),a.isMultiple||(l.restoreFocus=!0,V.nextTick(function(){s.hide(a.ngModel.$viewValue),l.focusedNode.classList.remove("md-focused")},!0)))}}(),l.cleanupResizing=function(){var e=function(r,i,a){return function(){if(!a.isRemoved){var e=h(r,i,a),t=e.container,n=e.dropDown;t.element.css(p.toCss(t.styles)),n.element.css(p.toCss(n.styles))}}}(n,o,l),t=F.element(H);return t.on("resize",e),t.on("orientationchange",e),function(){t.off("resize",e),t.off("orientationchange",e)}}(),l.contentEl[0].focus(),e},l.hideBackdrop);function r(){return i(function(e){if(l.isRemoved)return i.reject(!1);var t=h(n,o,l);t.container.element.css(p.toCss(t.container.styles)),t.dropDown.element.css(p.toCss(t.dropDown.styles)),a(function(){o.addClass("md-active"),t.dropDown.element.css(p.toCss({transform:""})),function(e){var t;e&&!e.hasAttribute("disabled")&&(t=l.selectEl.controller("mdSelectMenu"),d(null,e,t))}(l.focusedNode),e()})})}function d(e,t,n){var r=l.contentEl[0];if(t){if(e&&e.classList.remove("md-focused"),t.classList.add("md-focused"),n&&n.setActiveDescendant&&n.setActiveDescendant(t.id),r.scrollHeight>r.clientHeight){var i=r.clientHeight+r.scrollTop,a=t.offsetTop+t.offsetHeight;i<a?r.scrollTop=a-r.clientHeight:t.offsetTop<r.scrollTop&&(r.scrollTop=t.offsetTop)}l.focusedNode=t,n&&n.refreshViewValue&&n.refreshViewValue()}}},onRemove:function(e,t,n){var r=null,i=e.$on("$destroy",function(){r.end()});return(n=n||{}).cleanupInteraction(),n.cleanupResizing(),n.hideBackdrop(),!0===n.$destroy?a():function(){return(r=u(t,{addClass:"md-leave"})).start()}().then(a);function a(){i(),t.removeClass("md-active").attr("aria-hidden","true").css({display:"none",top:"",right:"",bottom:"",left:"","font-size":"","min-width":""}),function(e){var t=e.selectCtrl;if(t){var n=e.selectEl.controller("mdSelectMenu");t.setSelectValueText(n?n.getSelectedLabels():""),t.triggerClose()}}(n),n.$destroy||(n.restoreFocus?n.target.focus():V.nextTick(function(){n.target.triggerHandler("blur")},!0))}},hasBackdrop:!0,disableParentScroll:!0};function h(e,t,n){var r,i=t[0],a=n.target[0].children[0],o=N[0].body,l=n.selectEl[0],d=n.contentEl[0],s=o.getBoundingClientRect(),c=a.getBoundingClientRect(),u={left:s.left+B,top:B,bottom:s.height-B,right:s.width-B-(V.floatingScrollbars()?16:0)},f=c.top-u.top,p=(c.left,c.left,c.width,u.bottom-(c.top+c.height)),m=s.width-2*B,h=l.querySelector("md-option[selected]"),v=l.getElementsByTagName("md-option"),g=l.getElementsByTagName("md-optgroup"),b=function(e,t){var n=!1;try{var r=e[0].style.display;e[0].style.display="block",n=t.scrollHeight>t.offsetHeight,e[0].style.display=r}finally{}return n}(t,d);r=function(e){return e&&F.isFunction(e.then)}(n.loadingAsync)?d.firstElementChild||d:h||(g.length?g[0]:v.length?v[0]:d.firstElementChild||d),d.offsetWidth>m?d.style["max-width"]=m+"px":d.style.maxWidth=null,b&&l.classList.add("md-overflow");var $=r;"MD-OPTGROUP"===($.tagName||"").toUpperCase()&&(r=$=v[0]||d.firstElementChild||d),n.focusedNode=$,i.style.display="block";var y,M,w,k,A,x=l.getBoundingClientRect(),C=function(e){return e?{left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}:{left:0,top:0,width:0,height:0}}(r);if(r){var S=H.getComputedStyle(r);C.paddingLeft=parseInt(S.paddingLeft,10)||0,C.paddingRight=parseInt(S.paddingRight,10)||0}if(b){var T=d.offsetHeight/2;d.scrollTop=C.top+C.height/2-T,f<T?d.scrollTop=Math.min(C.top,d.scrollTop+T-f):p<T&&(d.scrollTop=Math.max(C.top+C.height-x.height,d.scrollTop-T+p))}y=c.left+C.left-C.paddingLeft,M=Math.floor(c.top+c.height/2-C.height/2-C.top+d.scrollTop)+2,w=C.left+c.width/2+"px "+(C.top+C.height/2-d.scrollTop)+"px 0px",k=Math.min(c.width+C.paddingLeft+C.paddingRight,m),A=P.getComputedStyle(a)["font-size"];var O=i.getBoundingClientRect(),E=Math.round(100*Math.min(c.width/x.width,1))/100,D=Math.round(100*Math.min(c.height/x.height,1))/100;return{container:{element:F.element(i),styles:{left:Math.floor(R(u.left,y,u.right-k)),top:Math.floor(R(u.top,M,u.bottom-O.height)),"min-width":k,"font-size":A}},dropDown:{element:F.element(l),styles:{transformOrigin:w,transform:n.alreadyOpen?"":V.supplant("scale({0},{1})",[E,D])}}}}}function R(e,t,n){return Math.max(e,Math.min(t,n))}}function U(e,t){var n=String.fromCharCode(e.keyCode),r=e.keyCode<=31;return n&&n.length&&!r&&!t.isMetaKey(e)&&!t.isFnLockKey(e)&&!t.hasModifierKey(e)}F.module("material.components.select",["material.core","material.components.backdrop"]).directive("mdSelect",e).directive("mdSelectMenu",t).directive("mdOption",r).directive("mdOptgroup",function(){return{restrict:"E",compile:function(t,n){t.parent().find("md-select-header").length||function(){var e=t.find("label");e.length||(e=F.element("<label>"),t.prepend(e));e.addClass("md-container-ignore"),e.attr("aria-hidden","true"),n.label&&e.text(n.label);t.attr("aria-label",e.text())}();t.attr("role","group")}}}).directive("mdSelectHeader",function(){return{restrict:"E"}}).provider("$mdSelect",i)}(window,window.angular);
Note: See TracBrowser for help on using the repository browser.