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