todo_rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/todo_rails/version.rb +1 -1
- data/vendor/assets/bower.json +8 -0
- data/vendor/assets/bower_components/angular-animate/README.md +68 -0
- data/vendor/assets/bower_components/angular-animate/angular-animate.js +3721 -0
- data/vendor/assets/bower_components/angular-animate/angular-animate.min.js +52 -0
- data/vendor/assets/bower_components/angular-animate/angular-animate.min.js.map +8 -0
- data/vendor/assets/bower_components/angular-animate/bower.json +9 -0
- data/vendor/assets/bower_components/angular-animate/index.js +2 -0
- data/vendor/assets/bower_components/angular-animate/package.json +26 -0
- data/vendor/assets/bower_components/angular-aria/README.md +67 -0
- data/vendor/assets/bower_components/angular-aria/angular-aria.js +393 -0
- data/vendor/assets/bower_components/angular-aria/angular-aria.min.js +13 -0
- data/vendor/assets/bower_components/angular-aria/angular-aria.min.js.map +8 -0
- data/vendor/assets/bower_components/angular-aria/bower.json +9 -0
- data/vendor/assets/bower_components/angular-aria/index.js +2 -0
- data/vendor/assets/bower_components/angular-aria/package.json +27 -0
- data/vendor/assets/bower_components/angular-material/CHANGELOG.md +1599 -0
- data/vendor/assets/bower_components/angular-material/LICENSE +21 -0
- data/vendor/assets/bower_components/angular-material/README.md +211 -0
- data/vendor/assets/bower_components/angular-material/angular-material-mocks.js +77 -0
- data/vendor/assets/bower_components/angular-material/angular-material.css +7183 -0
- data/vendor/assets/bower_components/angular-material/angular-material.js +15406 -0
- data/vendor/assets/bower_components/angular-material/angular-material.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/angular-material.min.js +14 -0
- data/vendor/assets/bower_components/angular-material/bower.json +14 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/copy.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/copy2.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/facebook.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/hangout.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/mail.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/message.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/print.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/share-arrow.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/twitter.svg +2 -0
- data/vendor/assets/bower_components/angular-material/demos/bottomSheet/demoBasicUsage/img/icons/upload.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/chips/demoBasicUsage/style.scss +39 -0
- data/vendor/assets/bower_components/angular-material/demos/chips/demoContactChips/style.scss +47 -0
- data/vendor/assets/bower_components/angular-material/demos/gridList/demoBasicUsage/style.scss +75 -0
- data/vendor/assets/bower_components/angular-material/demos/gridList/demoDynamicTiles/style.scss +78 -0
- data/vendor/assets/bower_components/angular-material/demos/gridList/demoResponsiveUsage/style.scss +0 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoLoadSvgIconsFromUrl/img/icons/addShoppingCart.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoLoadSvgIconsFromUrl/img/icons/android.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoLoadSvgIconsFromUrl/img/icons/cake.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoSvgIconSets/assets/cake.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoSvgIconSets/assets/core-icons.svg +26 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoSvgIconSets/assets/social-icons.svg +26 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoSvgIconsFromURL/img/icons/addShoppingCart.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoSvgIconsFromURL/img/icons/android.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoSvgIconsFromURL/img/icons/cake.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoUsingTemplateCache/assets/android.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoUsingTemplateCache/assets/cake.svg +1 -0
- data/vendor/assets/bower_components/angular-material/demos/icon/demoUsingTemplateCache/assets/core-icons.svg +26 -0
- data/vendor/assets/bower_components/angular-material/demos/input/demoIcons/icons/ic_email_24px.svg +4 -0
- data/vendor/assets/bower_components/angular-material/demos/input/demoIcons/icons/ic_person_24px.svg +4 -0
- data/vendor/assets/bower_components/angular-material/demos/input/demoIcons/icons/ic_phone_24px.svg +4 -0
- data/vendor/assets/bower_components/angular-material/demos/input/demoIcons/icons/ic_place_24px.svg +4 -0
- data/vendor/assets/bower_components/angular-material/demos/input/demoIcons/style.scss +18 -0
- data/vendor/assets/bower_components/angular-material/demos/list/demoListControls/img/100-0.jpeg +0 -0
- data/vendor/assets/bower_components/angular-material/demos/list/demoListControls/img/100-1.jpeg +0 -0
- data/vendor/assets/bower_components/angular-material/demos/list/demoListControls/img/100-2.jpeg +0 -0
- data/vendor/assets/bower_components/angular-material/demos/tabs/demoDynamicHeight/style.scss +13 -0
- data/vendor/assets/bower_components/angular-material/demos/tabs/demoDynamicTabs/style.scss +44 -0
- data/vendor/assets/bower_components/angular-material/demos/tabs/demoStaticTabs/style.scss +25 -0
- data/vendor/assets/bower_components/angular-material/demos/toolbar/demoBasicUsage/img/icons/favorite.svg +4 -0
- data/vendor/assets/bower_components/angular-material/demos/toolbar/demoBasicUsage/img/icons/menu.svg +4 -0
- data/vendor/assets/bower_components/angular-material/demos/toolbar/demoBasicUsage/img/icons/more_vert.svg +4 -0
- data/vendor/assets/bower_components/angular-material/index.js +12 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/autocomplete/autocomplete-default-theme.css +24 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/autocomplete/autocomplete.css +220 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/autocomplete/autocomplete.js +951 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/backdrop/backdrop-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/backdrop/backdrop.css +59 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/backdrop/backdrop.js +38 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet-default-theme.css +16 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.css +170 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.js +267 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/button/button-default-theme.css +94 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/button/button.css +158 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/button/button.js +135 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/card/card-default-theme.css +12 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/card/card.css +34 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/card/card.js +84 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css +47 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/checkbox/checkbox.css +124 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/checkbox/checkbox.js +166 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/chips/chips-default-theme.css +24 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/chips/chips.css +131 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/chips/chips.js +949 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/content/content-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/content/content.css +20 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/content/content.js +84 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/core/core.css +2594 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/core/core.js +3772 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/core/default-theme.js +4 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/dialog/dialog-default-theme.css +12 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/dialog/dialog.css +111 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/dialog/dialog.js +713 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/divider/divider-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/divider/divider.css +14 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/divider/divider.js +45 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/fabActions/fabActions.js +57 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/fabSpeedDial/fabSpeedDial.css +100 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/fabSpeedDial/fabSpeedDial.js +236 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/fabToolbar/fabToolbar.css +74 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/fabToolbar/fabToolbar.js +218 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/fabTrigger/fabTrigger.js +54 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/gridList/gridList-default-theme.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/gridList/gridList.css +68 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/gridList/gridList.js +762 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/icon/icon-default-theme.css +15 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/icon/icon.css +20 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/icon/icon.js +783 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/input/input-default-theme.css +46 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/input/input.css +162 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/input/input.js +371 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/list/list-default-theme.css +23 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/list/list.css +147 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/list/list.js +273 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/menu/menu-default-theme.css +11 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/menu/menu.css +121 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/menu/menu.js +620 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/progressCircular/progressCircular-default-theme.css +36 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/progressCircular/progressCircular.css +1409 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/progressCircular/progressCircular.js +109 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/progressLinear/progressLinear-default-theme.css +27 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/progressLinear/progressLinear.css +287 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/progressLinear/progressLinear.js +126 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/radioButton/radioButton-default-theme.css +47 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/radioButton/radioButton.css +91 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/radioButton/radioButton.js +312 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/select/select-default-theme.css +42 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/select/select.css +170 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/select/select.js +1055 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/sidenav/sidenav-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/sidenav/sidenav.css +99 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/sidenav/sidenav.js +424 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/slider/slider-default-theme.css +56 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/slider/slider.css +220 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/slider/slider.js +403 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/sticky/sticky.css +21 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/sticky/sticky.js +315 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/subheader/subheader-default-theme.css +16 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/subheader/subheader.css +63 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/subheader/subheader.js +93 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/swipe/swipe.js +72 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/switch/switch-default-theme.css +33 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/switch/switch.css +110 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/switch/switch.js +169 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tabs/tabs-arrow.svg +7 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tabs/tabs-default-theme.css +82 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tabs/tabs.css +274 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tabs/tabs.js +1060 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/textField/textField-default-theme.css +30 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/textField/textField.css +111 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/textField/textField.js +145 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/toast/toast-default-theme.css +18 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/toast/toast.css +119 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/toast/toast.js +265 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/toolbar/toolbar-default-theme.css +20 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/toolbar/toolbar.css +83 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/toolbar/toolbar.js +169 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tooltip/tooltip-default-theme.css +11 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tooltip/tooltip.css +72 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/tooltip/tooltip.js +267 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/whiteframe/whiteframe.css +25 -0
- data/vendor/assets/bower_components/angular-material/modules/closure/whiteframe/whiteframe.js +15 -0
- data/vendor/assets/bower_components/angular-material/modules/css/angular-material-layout.css +2375 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/autocomplete-default-theme.css +24 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/autocomplete-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/autocomplete.css +220 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/autocomplete.js +951 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/autocomplete.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/autocomplete.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/autocomplete/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/backdrop.css +59 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/backdrop.js +39 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/backdrop.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/backdrop.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/backdrop/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.css +16 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.css +170 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.js +267 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/bottomSheet/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/button-default-theme.css +94 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/button-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/button.css +158 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/button.js +136 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/button.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/button/button.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/card-default-theme.css +12 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/card-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/card.css +34 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/card.js +85 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/card.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/card/card.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.css +47 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/checkbox.css +124 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/checkbox.js +167 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/checkbox.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/checkbox/checkbox.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/chips-default-theme.css +24 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/chips-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/chips.css +131 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/chips.js +949 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/chips.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/chips/chips.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/content-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/content-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/content.css +20 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/content.js +85 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/content.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/content/content.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/core/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/core/core.css +2594 -0
- data/vendor/assets/bower_components/angular-material/modules/js/core/core.js +3772 -0
- data/vendor/assets/bower_components/angular-material/modules/js/core/core.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/core/core.min.js +10 -0
- data/vendor/assets/bower_components/angular-material/modules/js/core/default-theme.js +4 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/dialog-default-theme.css +12 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/dialog-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/dialog.css +111 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/dialog.js +713 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/dialog.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/dialog/dialog.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/divider-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/divider-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/divider.css +14 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/divider.js +46 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/divider.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/divider/divider.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabActions/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabActions/fabActions.js +58 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabActions/fabActions.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabSpeedDial/bower.json +9 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.css +100 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.js +235 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabSpeedDial/fabSpeedDial.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabToolbar/bower.json +9 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.css +74 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.js +217 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabToolbar/fabToolbar.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabTrigger/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabTrigger/fabTrigger.js +55 -0
- data/vendor/assets/bower_components/angular-material/modules/js/fabTrigger/fabTrigger.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/gridList/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/gridList/gridList.css +68 -0
- data/vendor/assets/bower_components/angular-material/modules/js/gridList/gridList.js +763 -0
- data/vendor/assets/bower_components/angular-material/modules/js/gridList/gridList.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/gridList/gridList.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/icon-default-theme.css +15 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/icon-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/icon.css +20 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/icon.js +784 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/icon.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/icon/icon.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/input-default-theme.css +46 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/input-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/input.css +162 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/input.js +372 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/input.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/input/input.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/list-default-theme.css +23 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/list-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/list.css +147 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/list.js +274 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/list.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/list/list.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/menu-default-theme.css +11 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/menu-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/menu.css +121 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/menu.js +620 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/menu.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/menu/menu.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.css +36 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/progressCircular.css +1409 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/progressCircular.js +110 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.css +27 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/progressLinear.css +287 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/progressLinear.js +127 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.css +47 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/radioButton.css +91 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/radioButton.js +313 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/radioButton.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/radioButton/radioButton.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/select-default-theme.css +42 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/select-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/select.css +170 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/select.js +1055 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/select.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/select/select.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.css +9 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/sidenav.css +99 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/sidenav.js +424 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/sidenav.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sidenav/sidenav.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/slider-default-theme.css +56 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/slider-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/slider.css +220 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/slider.js +404 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/slider.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/slider/slider.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sticky/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sticky/sticky.css +21 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sticky/sticky.js +315 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sticky/sticky.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/sticky/sticky.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/subheader-default-theme.css +16 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/subheader-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/subheader.css +63 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/subheader.js +93 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/subheader.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/subheader/subheader.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/swipe/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/swipe/swipe.js +73 -0
- data/vendor/assets/bower_components/angular-material/modules/js/swipe/swipe.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/switch-default-theme.css +33 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/switch-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/switch.css +110 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/switch.js +169 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/switch.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/switch/switch.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/tabs-default-theme.css +82 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/tabs-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/tabs.css +274 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/tabs.js +1060 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/tabs.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tabs/tabs.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/textField-default-theme.css +30 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/textField-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/textField.css +111 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/textField.js +143 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/textField.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/textField/textField.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/toast-default-theme.css +18 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/toast-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/toast.css +119 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/toast.js +265 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/toast.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toast/toast.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/bower.json +8 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.css +20 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/toolbar.css +83 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/toolbar.js +169 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/toolbar.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/toolbar/toolbar.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/bower.json +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.css +11 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/tooltip.css +72 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/tooltip.js +268 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/tooltip.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/tooltip/tooltip.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/modules/js/whiteframe/bower.json +5 -0
- data/vendor/assets/bower_components/angular-material/modules/js/whiteframe/whiteframe.css +25 -0
- data/vendor/assets/bower_components/angular-material/modules/js/whiteframe/whiteframe.js +16 -0
- data/vendor/assets/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.css +6 -0
- data/vendor/assets/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.js +7 -0
- data/vendor/assets/bower_components/angular-material/package.json +48 -0
- data/vendor/assets/bower_components/angular/README.md +64 -0
- data/vendor/assets/bower_components/angular/angular-csp.css +21 -0
- data/vendor/assets/bower_components/angular/angular.js +28364 -0
- data/vendor/assets/bower_components/angular/angular.min.js +290 -0
- data/vendor/assets/bower_components/angular/angular.min.js.gzip +0 -0
- data/vendor/assets/bower_components/angular/angular.min.js.map +8 -0
- data/vendor/assets/bower_components/angular/bower.json +8 -0
- data/vendor/assets/bower_components/angular/index.js +2 -0
- data/vendor/assets/bower_components/angular/package.json +25 -0
- data/vendor/assets/bower_components/lodash/LICENSE +22 -0
- data/vendor/assets/bower_components/lodash/bower.json +19 -0
- data/vendor/assets/bower_components/lodash/lodash.js +12351 -0
- data/vendor/assets/bower_components/lodash/lodash.min.js +99 -0
- data/vendor/assets/bower_components/restangular/CHANGELOG.md +18 -0
- data/vendor/assets/bower_components/restangular/CONTRIBUTE.md +31 -0
- data/vendor/assets/bower_components/restangular/Gruntfile.js +149 -0
- data/vendor/assets/bower_components/restangular/README.md +1336 -0
- data/vendor/assets/bower_components/restangular/bower.json +19 -0
- data/vendor/assets/bower_components/restangular/dist/restangular.js +1355 -0
- data/vendor/assets/bower_components/restangular/dist/restangular.min.js +6 -0
- data/vendor/assets/bower_components/restangular/dist/restangular.zip +0 -0
- data/vendor/assets/bower_components/restangular/karma.conf.js +74 -0
- data/vendor/assets/bower_components/restangular/karma.underscore.conf.js +74 -0
- data/vendor/assets/bower_components/restangular/license.md +21 -0
- data/vendor/assets/bower_components/restangular/package.json +55 -0
- data/vendor/assets/bower_components/restangular/src/restangular.js +1350 -0
- data/vendor/assets/bower_components/restangular/test/restangularSpec.js +1136 -0
- metadata +424 -1
data/vendor/assets/bower_components/angular-material/modules/closure/select/select-default-theme.css
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
/*!
|
2
|
+
* Angular Material Design
|
3
|
+
* https://github.com/angular/material
|
4
|
+
* @license MIT
|
5
|
+
* v0.10.0
|
6
|
+
*/
|
7
|
+
/* mixin definition ; sets LTR and RTL within the same style call */
|
8
|
+
md-select.md-THEME_NAME-theme.ng-invalid.ng-dirty .md-select-label {
|
9
|
+
color: '{{warn-500}}' !important;
|
10
|
+
border-bottom-color: '{{warn-500}}' !important; }
|
11
|
+
md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-label {
|
12
|
+
border-bottom-color: '{{primary-color}}';
|
13
|
+
color: '{{ foreground-1 }}'; }
|
14
|
+
md-select.md-THEME_NAME-theme:not([disabled]):focus .md-select-label.md-placeholder {
|
15
|
+
color: '{{ foreground-1 }}'; }
|
16
|
+
md-select.md-THEME_NAME-theme:not([disabled]):focus.md-accent .md-select-label {
|
17
|
+
border-bottom-color: '{{accent-color}}'; }
|
18
|
+
md-select.md-THEME_NAME-theme:not([disabled]):focus.md-warn .md-select-label {
|
19
|
+
border-bottom-color: '{{warn-color}}'; }
|
20
|
+
md-select.md-THEME_NAME-theme[disabled] .md-select-label {
|
21
|
+
color: '{{foreground-3}}'; }
|
22
|
+
md-select.md-THEME_NAME-theme[disabled] .md-select-label.md-placeholder {
|
23
|
+
color: '{{foreground-3}}'; }
|
24
|
+
md-select.md-THEME_NAME-theme .md-select-label {
|
25
|
+
border-bottom-color: '{{foreground-4}}'; }
|
26
|
+
md-select.md-THEME_NAME-theme .md-select-label.md-placeholder {
|
27
|
+
color: '{{foreground-2}}'; }
|
28
|
+
|
29
|
+
md-select-menu.md-THEME_NAME-theme md-optgroup {
|
30
|
+
color: '{{foreground-2}}'; }
|
31
|
+
md-select-menu.md-THEME_NAME-theme md-optgroup md-option {
|
32
|
+
color: '{{foreground-1}}'; }
|
33
|
+
md-select-menu.md-THEME_NAME-theme md-option[selected] {
|
34
|
+
color: '{{primary-500}}'; }
|
35
|
+
md-select-menu.md-THEME_NAME-theme md-option[selected]:focus {
|
36
|
+
color: '{{primary-600}}'; }
|
37
|
+
md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent {
|
38
|
+
color: '{{accent-500}}'; }
|
39
|
+
md-select-menu.md-THEME_NAME-theme md-option[selected].md-accent:focus {
|
40
|
+
color: '{{accent-600}}'; }
|
41
|
+
md-select-menu.md-THEME_NAME-theme md-option:focus:not([selected]) {
|
42
|
+
background: '{{background-200}}'; }
|
@@ -0,0 +1,170 @@
|
|
1
|
+
/*!
|
2
|
+
* Angular Material Design
|
3
|
+
* https://github.com/angular/material
|
4
|
+
* @license MIT
|
5
|
+
* v0.10.0
|
6
|
+
*/
|
7
|
+
/* mixin definition ; sets LTR and RTL within the same style call */
|
8
|
+
.md-select-menu-container {
|
9
|
+
position: fixed;
|
10
|
+
left: 0;
|
11
|
+
top: 0;
|
12
|
+
z-index: 99;
|
13
|
+
opacity: 0; }
|
14
|
+
.md-select-menu-container:not(.md-clickable) {
|
15
|
+
pointer-events: none; }
|
16
|
+
.md-select-menu-container md-progress-circular {
|
17
|
+
display: table;
|
18
|
+
margin: 24px auto !important; }
|
19
|
+
.md-select-menu-container.md-active {
|
20
|
+
opacity: 1; }
|
21
|
+
.md-select-menu-container.md-active md-select-menu {
|
22
|
+
transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
|
23
|
+
transition-duration: 200ms; }
|
24
|
+
.md-select-menu-container.md-active md-select-menu > * {
|
25
|
+
opacity: 1;
|
26
|
+
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
|
27
|
+
transition-duration: 200ms;
|
28
|
+
transition-delay: 100ms; }
|
29
|
+
.md-select-menu-container.md-leave {
|
30
|
+
opacity: 0;
|
31
|
+
transition: all 0.3s cubic-bezier(0.55, 0, 0.55, 0.2);
|
32
|
+
transition-duration: 250ms; }
|
33
|
+
|
34
|
+
md-input-container > md-select {
|
35
|
+
margin: 0;
|
36
|
+
margin-top: 3px; }
|
37
|
+
|
38
|
+
md-select {
|
39
|
+
padding: 24px 2px 26px;
|
40
|
+
display: -webkit-flex;
|
41
|
+
display: -ms-flexbox;
|
42
|
+
display: flex; }
|
43
|
+
md-select:focus {
|
44
|
+
outline: none; }
|
45
|
+
md-select[disabled]:hover {
|
46
|
+
cursor: default; }
|
47
|
+
md-select:not([disabled]):hover {
|
48
|
+
cursor: pointer; }
|
49
|
+
md-select:not([disabled]).ng-invalid.ng-dirty .md-select-label {
|
50
|
+
border-bottom-width: 2px;
|
51
|
+
border-bottom-style: solid;
|
52
|
+
padding-bottom: 0; }
|
53
|
+
md-select:not([disabled]):focus .md-select-label {
|
54
|
+
border-bottom-width: 2px;
|
55
|
+
border-bottom-style: solid;
|
56
|
+
padding-bottom: 0; }
|
57
|
+
|
58
|
+
.md-select-label {
|
59
|
+
display: -webkit-flex;
|
60
|
+
display: -ms-flexbox;
|
61
|
+
display: flex;
|
62
|
+
-webkit-align-items: center;
|
63
|
+
-ms-flex-align: center;
|
64
|
+
align-items: center;
|
65
|
+
padding: 2px 2px 1px;
|
66
|
+
border-bottom-width: 1px;
|
67
|
+
border-bottom-style: solid;
|
68
|
+
position: relative;
|
69
|
+
box-sizing: content-box;
|
70
|
+
min-width: 64px;
|
71
|
+
min-height: 26px; }
|
72
|
+
.md-select-label *:first-child {
|
73
|
+
-webkit-flex: 1;
|
74
|
+
-ms-flex: 1;
|
75
|
+
flex: 1;
|
76
|
+
text-overflow: ellipsis;
|
77
|
+
white-space: nowrap;
|
78
|
+
overflow: hidden;
|
79
|
+
max-width: calc(100% - 2*8px);
|
80
|
+
-webkit-transform: translate3d(0, 2px, 0);
|
81
|
+
transform: translate3d(0, 2px, 0); }
|
82
|
+
.md-select-label .md-select-icon {
|
83
|
+
-webkit-align-items: flex-end;
|
84
|
+
-ms-flex-align: end;
|
85
|
+
align-items: flex-end;
|
86
|
+
text-align: end;
|
87
|
+
width: 24px;
|
88
|
+
margin: 0 4px;
|
89
|
+
-webkit-transform: translate3d(0, 1px, 0);
|
90
|
+
transform: translate3d(0, 1px, 0); }
|
91
|
+
.md-select-label .md-select-icon:after {
|
92
|
+
display: block;
|
93
|
+
content: '\25BC';
|
94
|
+
position: relative;
|
95
|
+
top: 2px;
|
96
|
+
speak: none;
|
97
|
+
-webkit-transform: scaleY(0.6) scaleX(1);
|
98
|
+
transform: scaleY(0.6) scaleX(1); }
|
99
|
+
|
100
|
+
md-select-menu {
|
101
|
+
display: -webkit-flex;
|
102
|
+
display: -ms-flexbox;
|
103
|
+
display: flex;
|
104
|
+
-webkit-flex-direction: column;
|
105
|
+
-ms-flex-direction: column;
|
106
|
+
flex-direction: column;
|
107
|
+
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.14), 0px 2px 2px 0px rgba(0, 0, 0, 0.098), 0px 1px 5px 0px rgba(0, 0, 0, 0.084);
|
108
|
+
max-height: 256px;
|
109
|
+
min-height: 48px;
|
110
|
+
overflow-y: hidden;
|
111
|
+
-webkit-transform-origin: left top;
|
112
|
+
transform-origin: left top;
|
113
|
+
-webkit-transform: scale(1);
|
114
|
+
transform: scale(1); }
|
115
|
+
md-select-menu.md-reverse {
|
116
|
+
-webkit-flex-direction: column-reverse;
|
117
|
+
-ms-flex-direction: column-reverse;
|
118
|
+
flex-direction: column-reverse; }
|
119
|
+
md-select-menu:not(.md-overflow) md-content {
|
120
|
+
padding-top: 8px;
|
121
|
+
padding-bottom: 8px; }
|
122
|
+
html[dir=rtl] md-select-menu {
|
123
|
+
-webkit-transform-origin: right top;
|
124
|
+
transform-origin: right top; }
|
125
|
+
md-select-menu md-content {
|
126
|
+
min-width: 136px;
|
127
|
+
min-height: 48px;
|
128
|
+
max-height: 256px;
|
129
|
+
overflow-y: auto; }
|
130
|
+
md-select-menu > * {
|
131
|
+
opacity: 0; }
|
132
|
+
|
133
|
+
md-option {
|
134
|
+
cursor: pointer;
|
135
|
+
position: relative;
|
136
|
+
display: -webkit-flex;
|
137
|
+
display: -ms-flexbox;
|
138
|
+
display: flex;
|
139
|
+
-webkit-align-items: center;
|
140
|
+
-ms-flex-align: center;
|
141
|
+
align-items: center;
|
142
|
+
width: auto;
|
143
|
+
padding: 0 16px 0 16px;
|
144
|
+
height: 48px; }
|
145
|
+
md-option:focus {
|
146
|
+
outline: none; }
|
147
|
+
md-option .md-text {
|
148
|
+
width: auto;
|
149
|
+
white-space: nowrap;
|
150
|
+
overflow: hidden;
|
151
|
+
text-overflow: ellipsis;
|
152
|
+
font-size: 16px; }
|
153
|
+
|
154
|
+
md-optgroup {
|
155
|
+
display: block; }
|
156
|
+
md-optgroup label {
|
157
|
+
display: block;
|
158
|
+
font-size: 14px;
|
159
|
+
text-transform: uppercase;
|
160
|
+
padding: 16px;
|
161
|
+
font-weight: 500; }
|
162
|
+
md-optgroup md-option {
|
163
|
+
padding-left: 32px;
|
164
|
+
padding-right: 32px; }
|
165
|
+
|
166
|
+
@media screen and (-ms-high-contrast: active) {
|
167
|
+
.md-select-backdrop {
|
168
|
+
background-color: transparent; }
|
169
|
+
md-select-menu {
|
170
|
+
border: 1px solid #fff; } }
|
@@ -0,0 +1,1055 @@
|
|
1
|
+
/*!
|
2
|
+
* Angular Material Design
|
3
|
+
* https://github.com/angular/material
|
4
|
+
* @license MIT
|
5
|
+
* v0.10.0
|
6
|
+
*/
|
7
|
+
goog.provide('ng.material.components.select');
|
8
|
+
goog.require('ng.material.components.backdrop');
|
9
|
+
goog.require('ng.material.core');
|
10
|
+
/**
|
11
|
+
* @ngdoc module
|
12
|
+
* @name material.components.select
|
13
|
+
*/
|
14
|
+
|
15
|
+
/***************************************************
|
16
|
+
|
17
|
+
### TODO ###
|
18
|
+
**DOCUMENTATION AND DEMOS**
|
19
|
+
|
20
|
+
- [ ] ng-model with child mdOptions (basic)
|
21
|
+
- [ ] ng-model="foo" ng-model-options="{ trackBy: '$value.id' }" for objects
|
22
|
+
- [ ] mdOption with value
|
23
|
+
- [ ] Usage with input inside
|
24
|
+
|
25
|
+
### TODO - POST RC1 ###
|
26
|
+
- [ ] Abstract placement logic in $mdSelect service to $mdMenu service
|
27
|
+
|
28
|
+
***************************************************/
|
29
|
+
|
30
|
+
var SELECT_EDGE_MARGIN = 8;
|
31
|
+
var selectNextId = 0;
|
32
|
+
|
33
|
+
angular.module('material.components.select', [
|
34
|
+
'material.core',
|
35
|
+
'material.components.backdrop'
|
36
|
+
])
|
37
|
+
.directive('mdSelect', SelectDirective)
|
38
|
+
.directive('mdSelectMenu', SelectMenuDirective)
|
39
|
+
.directive('mdOption', OptionDirective)
|
40
|
+
.directive('mdOptgroup', OptgroupDirective)
|
41
|
+
.provider('$mdSelect', SelectProvider);
|
42
|
+
|
43
|
+
|
44
|
+
/**
|
45
|
+
* @ngdoc directive
|
46
|
+
* @name mdSelect
|
47
|
+
* @restrict E
|
48
|
+
* @module material.components.select
|
49
|
+
*
|
50
|
+
* @description Displays a select box, bound to an ng-model.
|
51
|
+
*
|
52
|
+
* @param {expression} ng-model The model!
|
53
|
+
* @param {expression=} md-on-close expression to be evaluated when the select is closed
|
54
|
+
* @param {boolean=} multiple Whether it's multiple.
|
55
|
+
* @param {string=} placeholder Placeholder hint text.
|
56
|
+
* @param {string=} aria-label Optional label for accessibility. Only necessary if no placeholder or
|
57
|
+
* explicit label is present.
|
58
|
+
*
|
59
|
+
* @usage
|
60
|
+
* With a placeholder (label and aria-label are added dynamically)
|
61
|
+
* <hljs lang="html">
|
62
|
+
* <md-select
|
63
|
+
* ng-model="someModel"
|
64
|
+
* placeholder="Select a state">
|
65
|
+
* <md-option ng-value="opt" ng-repeat="opt in neighborhoods2">{{ opt }}</md-option>
|
66
|
+
* </md-select>
|
67
|
+
* </hljs>
|
68
|
+
*
|
69
|
+
* With an explicit label
|
70
|
+
* <hljs lang="html">
|
71
|
+
* <md-select
|
72
|
+
* ng-model="someModel">
|
73
|
+
* <md-select-label>Select a state</md-select-label>
|
74
|
+
* <md-option ng-value="opt" ng-repeat="opt in neighborhoods2">{{ opt }}</md-option>
|
75
|
+
* </md-select>
|
76
|
+
* </hljs>
|
77
|
+
*/
|
78
|
+
function SelectDirective($mdSelect, $mdUtil, $mdTheming, $mdAria, $interpolate, $compile, $parse) {
|
79
|
+
return {
|
80
|
+
restrict: 'E',
|
81
|
+
require: ['mdSelect', 'ngModel', '?^form'],
|
82
|
+
compile: compile,
|
83
|
+
controller: function() { } // empty placeholder controller to be initialized in link
|
84
|
+
};
|
85
|
+
|
86
|
+
function compile(element, attr) {
|
87
|
+
// The user is allowed to provide a label for the select as md-select-label child
|
88
|
+
var labelEl = element.find('md-select-label').remove();
|
89
|
+
|
90
|
+
// If not provided, we automatically make one
|
91
|
+
if (!labelEl.length) {
|
92
|
+
labelEl = angular.element('<md-select-label><span></span></md-select-label>');
|
93
|
+
} else {
|
94
|
+
if (!labelEl[0].firstElementChild) {
|
95
|
+
var spanWrapper = angular.element('<span>');
|
96
|
+
spanWrapper.append(labelEl.contents());
|
97
|
+
labelEl.append(spanWrapper);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
labelEl.append('<span class="md-select-icon" aria-hidden="true"></span>');
|
101
|
+
labelEl.addClass('md-select-label');
|
102
|
+
if (!labelEl[0].hasAttribute('id')) {
|
103
|
+
labelEl.attr('id', 'select_label_' + $mdUtil.nextUid());
|
104
|
+
}
|
105
|
+
|
106
|
+
// There's got to be an md-content inside. If there's not one, let's add it.
|
107
|
+
if (!element.find('md-content').length) {
|
108
|
+
element.append( angular.element('<md-content>').append(element.contents()) );
|
109
|
+
}
|
110
|
+
|
111
|
+
// Add progress spinner for md-options-loading
|
112
|
+
if (attr.mdOnOpen) {
|
113
|
+
element.find('md-content').prepend(
|
114
|
+
angular.element('<md-progress-circular>')
|
115
|
+
.attr('md-mode', 'indeterminate')
|
116
|
+
.attr('ng-hide', '$$loadingAsyncDone')
|
117
|
+
.wrap('<div>')
|
118
|
+
.parent()
|
119
|
+
);
|
120
|
+
}
|
121
|
+
|
122
|
+
if (attr.name) {
|
123
|
+
var autofillClone = angular.element('<select class="md-visually-hidden">');
|
124
|
+
autofillClone.attr({
|
125
|
+
'name': '.' + attr.name,
|
126
|
+
'ng-model': attr.ngModel,
|
127
|
+
'aria-hidden': 'true',
|
128
|
+
'tabindex': '-1'
|
129
|
+
});
|
130
|
+
var opts = element.find('md-option');
|
131
|
+
angular.forEach(opts, function(el) {
|
132
|
+
var newEl = angular.element('<option>' + el.innerHTML + '</option>');
|
133
|
+
if (el.hasAttribute('ng-value')) newEl.attr('ng-value', el.getAttribute('ng-value'));
|
134
|
+
else if (el.hasAttribute('value')) newEl.attr('value', el.getAttribute('value'));
|
135
|
+
autofillClone.append(newEl);
|
136
|
+
});
|
137
|
+
|
138
|
+
element.parent().append(autofillClone);
|
139
|
+
}
|
140
|
+
|
141
|
+
// Use everything that's left inside element.contents() as the contents of the menu
|
142
|
+
var selectTemplate = '<div class="md-select-menu-container">' +
|
143
|
+
'<md-select-menu ' +
|
144
|
+
(angular.isDefined(attr.multiple) ? 'multiple' : '') + '>' +
|
145
|
+
element.html() +
|
146
|
+
'</md-select-menu></div>';
|
147
|
+
|
148
|
+
element.empty().append(labelEl);
|
149
|
+
|
150
|
+
attr.tabindex = attr.tabindex || '0';
|
151
|
+
|
152
|
+
return function postLink(scope, element, attr, ctrls) {
|
153
|
+
var isOpen;
|
154
|
+
var isDisabled;
|
155
|
+
|
156
|
+
var mdSelectCtrl = ctrls[0];
|
157
|
+
var ngModel = ctrls[1];
|
158
|
+
var formCtrl = ctrls[2];
|
159
|
+
|
160
|
+
var labelEl = element.find('md-select-label');
|
161
|
+
var customLabel = labelEl.text().length !== 0;
|
162
|
+
var selectContainer, selectScope, selectMenuCtrl;
|
163
|
+
createSelect();
|
164
|
+
|
165
|
+
$mdTheming(element);
|
166
|
+
|
167
|
+
if (attr.name && formCtrl) {
|
168
|
+
var selectEl = element.parent()[0].querySelector('select[name=".' + attr.name + '"]');
|
169
|
+
formCtrl.$removeControl(angular.element(selectEl).controller());
|
170
|
+
}
|
171
|
+
|
172
|
+
var originalRender = ngModel.$render;
|
173
|
+
ngModel.$render = function() {
|
174
|
+
originalRender();
|
175
|
+
syncLabelText();
|
176
|
+
};
|
177
|
+
|
178
|
+
mdSelectCtrl.setLabelText = function(text) {
|
179
|
+
if (customLabel) return; // Assume that user is handling it on their own
|
180
|
+
mdSelectCtrl.setIsPlaceholder(!text);
|
181
|
+
text = text || attr.placeholder || '';
|
182
|
+
var target = customLabel ? labelEl : labelEl.children().eq(0);
|
183
|
+
target.text(text);
|
184
|
+
};
|
185
|
+
|
186
|
+
mdSelectCtrl.setIsPlaceholder = function(val) {
|
187
|
+
val ? labelEl.addClass('md-placeholder') : labelEl.removeClass('md-placeholder');
|
188
|
+
};
|
189
|
+
|
190
|
+
mdSelectCtrl.triggerClose = function() {
|
191
|
+
$parse(attr.mdOnClose)(scope);
|
192
|
+
};
|
193
|
+
|
194
|
+
scope.$$postDigest(function() {
|
195
|
+
setAriaLabel();
|
196
|
+
syncLabelText();
|
197
|
+
});
|
198
|
+
|
199
|
+
function setAriaLabel() {
|
200
|
+
var labelText = element.attr('placeholder');
|
201
|
+
if (!labelText) {
|
202
|
+
labelText = element.find('md-select-label').text();
|
203
|
+
}
|
204
|
+
$mdAria.expect(element, 'aria-label', labelText);
|
205
|
+
}
|
206
|
+
|
207
|
+
function syncLabelText() {
|
208
|
+
if (selectContainer) {
|
209
|
+
selectMenuCtrl = selectMenuCtrl || selectContainer.find('md-select-menu').controller('mdSelectMenu');
|
210
|
+
mdSelectCtrl.setLabelText(selectMenuCtrl.selectedLabels());
|
211
|
+
}
|
212
|
+
}
|
213
|
+
|
214
|
+
var deregisterWatcher;
|
215
|
+
attr.$observe('ngMultiple', function(val) {
|
216
|
+
if (deregisterWatcher) deregisterWatcher();
|
217
|
+
var parser = $parse(val);
|
218
|
+
deregisterWatcher = scope.$watch(function() { return parser(scope); }, function(multiple, prevVal) {
|
219
|
+
if (multiple === undefined && prevVal === undefined) return; // assume compiler did a good job
|
220
|
+
if (multiple) {
|
221
|
+
element.attr('multiple', 'multiple');
|
222
|
+
} else {
|
223
|
+
element.removeAttr('multiple');
|
224
|
+
}
|
225
|
+
if (selectContainer) {
|
226
|
+
selectMenuCtrl.setMultiple(multiple);
|
227
|
+
originalRender = ngModel.$render;
|
228
|
+
ngModel.$render = function() {
|
229
|
+
originalRender();
|
230
|
+
syncLabelText();
|
231
|
+
};
|
232
|
+
selectMenuCtrl.refreshViewValue();
|
233
|
+
ngModel.$render();
|
234
|
+
}
|
235
|
+
});
|
236
|
+
});
|
237
|
+
|
238
|
+
attr.$observe('disabled', function(disabled) {
|
239
|
+
if (typeof disabled == "string") {
|
240
|
+
disabled = true;
|
241
|
+
}
|
242
|
+
// Prevent click event being registered twice
|
243
|
+
if (isDisabled !== undefined && isDisabled === disabled) {
|
244
|
+
return;
|
245
|
+
}
|
246
|
+
isDisabled = disabled;
|
247
|
+
if (disabled) {
|
248
|
+
element.attr({'tabindex': -1, 'aria-disabled': 'true'});
|
249
|
+
element.off('click', openSelect);
|
250
|
+
element.off('keydown', handleKeypress);
|
251
|
+
} else {
|
252
|
+
element.attr({'tabindex': attr.tabindex, 'aria-disabled': 'false'});
|
253
|
+
element.on('click', openSelect);
|
254
|
+
element.on('keydown', handleKeypress);
|
255
|
+
}
|
256
|
+
});
|
257
|
+
|
258
|
+
if (!attr.disabled && !attr.ngDisabled) {
|
259
|
+
element.attr({'tabindex': attr.tabindex, 'aria-disabled': 'false'});
|
260
|
+
element.on('click', openSelect);
|
261
|
+
element.on('keydown', handleKeypress);
|
262
|
+
}
|
263
|
+
|
264
|
+
var ariaAttrs = {
|
265
|
+
role: 'combobox',
|
266
|
+
'aria-expanded': 'false'
|
267
|
+
};
|
268
|
+
if (!element[0].hasAttribute('id')) {
|
269
|
+
ariaAttrs.id = 'select_' + $mdUtil.nextUid();
|
270
|
+
}
|
271
|
+
element.attr(ariaAttrs);
|
272
|
+
|
273
|
+
scope.$on('$destroy', function() {
|
274
|
+
if (isOpen) {
|
275
|
+
$mdSelect.cancel().then(function() {
|
276
|
+
selectContainer.remove();
|
277
|
+
});
|
278
|
+
} else {
|
279
|
+
selectContainer.remove();
|
280
|
+
}
|
281
|
+
});
|
282
|
+
|
283
|
+
|
284
|
+
// Create a fake select to find out the label value
|
285
|
+
function createSelect() {
|
286
|
+
selectContainer = angular.element(selectTemplate);
|
287
|
+
var selectEl = selectContainer.find('md-select-menu');
|
288
|
+
selectEl.data('$ngModelController', ngModel);
|
289
|
+
selectEl.data('$mdSelectController', mdSelectCtrl);
|
290
|
+
selectScope = scope.$new();
|
291
|
+
selectContainer = $compile(selectContainer)(selectScope);
|
292
|
+
selectMenuCtrl = selectContainer.find('md-select-menu').controller('mdSelectMenu');
|
293
|
+
}
|
294
|
+
|
295
|
+
function handleKeypress(e) {
|
296
|
+
var allowedCodes = [32, 13, 38, 40];
|
297
|
+
if (allowedCodes.indexOf(e.keyCode) != -1 ) {
|
298
|
+
// prevent page scrolling on interaction
|
299
|
+
e.preventDefault();
|
300
|
+
openSelect(e);
|
301
|
+
} else {
|
302
|
+
if (e.keyCode <= 90 && e.keyCode >= 31) {
|
303
|
+
e.preventDefault();
|
304
|
+
var node = selectMenuCtrl.optNodeForKeyboardSearch(e);
|
305
|
+
if (!node) return;
|
306
|
+
var optionCtrl = angular.element(node).controller('mdOption');
|
307
|
+
if (!selectMenuCtrl.isMultiple) {
|
308
|
+
selectMenuCtrl.deselect( Object.keys(selectMenuCtrl.selected)[0] );
|
309
|
+
}
|
310
|
+
selectMenuCtrl.select(optionCtrl.hashKey, optionCtrl.value);
|
311
|
+
selectMenuCtrl.refreshViewValue();
|
312
|
+
ngModel.$render();
|
313
|
+
}
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
function openSelect() {
|
318
|
+
scope.$evalAsync(function() {
|
319
|
+
isOpen = true;
|
320
|
+
$mdSelect.show({
|
321
|
+
scope: selectScope,
|
322
|
+
preserveScope: true,
|
323
|
+
skipCompile: true,
|
324
|
+
element: selectContainer,
|
325
|
+
target: element[0],
|
326
|
+
hasBackdrop: true,
|
327
|
+
loadingAsync: attr.mdOnOpen ? scope.$eval(attr.mdOnOpen) || true : false,
|
328
|
+
}).then(function(selectedText) {
|
329
|
+
isOpen = false;
|
330
|
+
});
|
331
|
+
});
|
332
|
+
}
|
333
|
+
};
|
334
|
+
}
|
335
|
+
}
|
336
|
+
SelectDirective.$inject = ["$mdSelect", "$mdUtil", "$mdTheming", "$mdAria", "$interpolate", "$compile", "$parse"];
|
337
|
+
|
338
|
+
function SelectMenuDirective($parse, $mdUtil, $mdTheming) {
|
339
|
+
|
340
|
+
SelectMenuController.$inject = ["$scope", "$attrs", "$element"];
|
341
|
+
return {
|
342
|
+
restrict: 'E',
|
343
|
+
require: ['mdSelectMenu', '?ngModel'],
|
344
|
+
controller: SelectMenuController,
|
345
|
+
link: { pre: preLink }
|
346
|
+
};
|
347
|
+
|
348
|
+
// We use preLink instead of postLink to ensure that the select is initialized before
|
349
|
+
// its child options run postLink.
|
350
|
+
function preLink(scope, element, attr, ctrls) {
|
351
|
+
var selectCtrl = ctrls[0];
|
352
|
+
var ngModel = ctrls[1];
|
353
|
+
|
354
|
+
$mdTheming(element);
|
355
|
+
element.on('click', clickListener);
|
356
|
+
element.on('keypress', keyListener);
|
357
|
+
if (ngModel) selectCtrl.init(ngModel);
|
358
|
+
configureAria();
|
359
|
+
|
360
|
+
function configureAria() {
|
361
|
+
element.attr({
|
362
|
+
'id': 'select_menu_' + $mdUtil.nextUid(),
|
363
|
+
'role': 'listbox',
|
364
|
+
'aria-multiselectable': (selectCtrl.isMultiple ? 'true' : 'false')
|
365
|
+
});
|
366
|
+
}
|
367
|
+
|
368
|
+
function keyListener(e) {
|
369
|
+
if (e.keyCode == 13 || e.keyCode == 32) {
|
370
|
+
clickListener(e);
|
371
|
+
}
|
372
|
+
}
|
373
|
+
|
374
|
+
function clickListener(ev) {
|
375
|
+
var option = $mdUtil.getClosest(ev.target, 'md-option');
|
376
|
+
var optionCtrl = option && angular.element(option).data('$mdOptionController');
|
377
|
+
if (!option || !optionCtrl) return;
|
378
|
+
|
379
|
+
var optionHashKey = selectCtrl.hashGetter(optionCtrl.value);
|
380
|
+
var isSelected = angular.isDefined(selectCtrl.selected[optionHashKey]);
|
381
|
+
|
382
|
+
scope.$apply(function() {
|
383
|
+
if (selectCtrl.isMultiple) {
|
384
|
+
if (isSelected) {
|
385
|
+
selectCtrl.deselect(optionHashKey);
|
386
|
+
} else {
|
387
|
+
selectCtrl.select(optionHashKey, optionCtrl.value);
|
388
|
+
}
|
389
|
+
} else {
|
390
|
+
if (!isSelected) {
|
391
|
+
selectCtrl.deselect( Object.keys(selectCtrl.selected)[0] );
|
392
|
+
selectCtrl.select( optionHashKey, optionCtrl.value );
|
393
|
+
}
|
394
|
+
}
|
395
|
+
selectCtrl.refreshViewValue();
|
396
|
+
});
|
397
|
+
}
|
398
|
+
}
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
function SelectMenuController($scope, $attrs, $element) {
|
403
|
+
var self = this;
|
404
|
+
self.isMultiple = angular.isDefined($attrs.multiple);
|
405
|
+
// selected is an object with keys matching all of the selected options' hashed values
|
406
|
+
self.selected = {};
|
407
|
+
// options is an object with keys matching every option's hash value,
|
408
|
+
// and values matching every option's controller.
|
409
|
+
self.options = {};
|
410
|
+
|
411
|
+
$scope.$watch(function() { return self.options; }, function() {
|
412
|
+
self.ngModel.$render();
|
413
|
+
}, true);
|
414
|
+
|
415
|
+
var deregisterCollectionWatch;
|
416
|
+
self.setMultiple = function(isMultiple) {
|
417
|
+
var ngModel = self.ngModel;
|
418
|
+
self.isMultiple = isMultiple;
|
419
|
+
if (deregisterCollectionWatch) deregisterCollectionWatch();
|
420
|
+
|
421
|
+
if (self.isMultiple) {
|
422
|
+
ngModel.$validators['md-multiple'] = validateArray;
|
423
|
+
ngModel.$render = renderMultiple;
|
424
|
+
|
425
|
+
// watchCollection on the model because by default ngModel only watches the model's
|
426
|
+
// reference. This allowed the developer to also push and pop from their array.
|
427
|
+
$scope.$watchCollection($attrs.ngModel, function(value) {
|
428
|
+
if (validateArray(value)) renderMultiple(value);
|
429
|
+
});
|
430
|
+
} else {
|
431
|
+
delete ngModel.$validators['md-multiple'];
|
432
|
+
ngModel.$render = renderSingular;
|
433
|
+
}
|
434
|
+
|
435
|
+
function validateArray(modelValue, viewValue) {
|
436
|
+
// If a value is truthy but not an array, reject it.
|
437
|
+
// If value is undefined/falsy, accept that it's an empty array.
|
438
|
+
return angular.isArray(modelValue || viewValue || []);
|
439
|
+
}
|
440
|
+
};
|
441
|
+
|
442
|
+
var searchStr = '';
|
443
|
+
var clearSearchTimeout, optNodes, optText;
|
444
|
+
var CLEAR_SEARCH_AFTER = 300;
|
445
|
+
self.optNodeForKeyboardSearch = function(e) {
|
446
|
+
clearSearchTimeout && clearTimeout(clearSearchTimeout);
|
447
|
+
clearSearchTimeout = setTimeout(function() {
|
448
|
+
clearSearchTimeout = undefined;
|
449
|
+
searchStr = '';
|
450
|
+
optText = undefined;
|
451
|
+
optNodes = undefined;
|
452
|
+
}, CLEAR_SEARCH_AFTER);
|
453
|
+
searchStr += String.fromCharCode(e.keyCode);
|
454
|
+
var search = new RegExp('^' + searchStr, 'i');
|
455
|
+
if (!optNodes) {
|
456
|
+
optNodes = $element.find('md-option');
|
457
|
+
optText = new Array(optNodes.length);
|
458
|
+
angular.forEach(optNodes, function(el, i) {
|
459
|
+
optText[i] = el.textContent.trim();
|
460
|
+
});
|
461
|
+
}
|
462
|
+
for (var i = 0; i < optText.length; ++i) {
|
463
|
+
if (search.test(optText[i])) {
|
464
|
+
return optNodes[i];
|
465
|
+
}
|
466
|
+
}
|
467
|
+
};
|
468
|
+
|
469
|
+
|
470
|
+
self.init = function(ngModel) {
|
471
|
+
self.ngModel = ngModel;
|
472
|
+
|
473
|
+
// Allow users to provide `ng-model="foo" ng-model-options="{trackBy: 'foo.id'}"` so
|
474
|
+
// that we can properly compare objects set on the model to the available options
|
475
|
+
if (ngModel.$options && ngModel.$options.trackBy) {
|
476
|
+
var trackByLocals = {};
|
477
|
+
var trackByParsed = $parse(ngModel.$options.trackBy);
|
478
|
+
self.hashGetter = function(value, valueScope) {
|
479
|
+
trackByLocals.$value = value;
|
480
|
+
return trackByParsed(valueScope || $scope, trackByLocals);
|
481
|
+
};
|
482
|
+
// If the user doesn't provide a trackBy, we automatically generate an id for every
|
483
|
+
// value passed in
|
484
|
+
} else {
|
485
|
+
self.hashGetter = function getHashValue(value) {
|
486
|
+
if (angular.isObject(value)) {
|
487
|
+
return 'object_' + (value.$$mdSelectId || (value.$$mdSelectId = ++selectNextId));
|
488
|
+
}
|
489
|
+
return value;
|
490
|
+
};
|
491
|
+
}
|
492
|
+
self.setMultiple(self.isMultiple);
|
493
|
+
};
|
494
|
+
|
495
|
+
self.selectedLabels = function() {
|
496
|
+
var selectedOptionEls = $mdUtil.nodesToArray($element[0].querySelectorAll('md-option[selected]'));
|
497
|
+
if (selectedOptionEls.length) {
|
498
|
+
return selectedOptionEls.map(function(el) { return el.textContent; }).join(', ');
|
499
|
+
} else {
|
500
|
+
return '';
|
501
|
+
}
|
502
|
+
};
|
503
|
+
|
504
|
+
self.select = function(hashKey, hashedValue) {
|
505
|
+
var option = self.options[hashKey];
|
506
|
+
option && option.setSelected(true);
|
507
|
+
self.selected[hashKey] = hashedValue;
|
508
|
+
};
|
509
|
+
self.deselect = function(hashKey) {
|
510
|
+
var option = self.options[hashKey];
|
511
|
+
option && option.setSelected(false);
|
512
|
+
delete self.selected[hashKey];
|
513
|
+
};
|
514
|
+
|
515
|
+
self.addOption = function(hashKey, optionCtrl) {
|
516
|
+
if (angular.isDefined(self.options[hashKey])) {
|
517
|
+
throw new Error('Duplicate md-option values are not allowed in a select. ' +
|
518
|
+
'Duplicate value "' + optionCtrl.value + '" found.');
|
519
|
+
}
|
520
|
+
self.options[hashKey] = optionCtrl;
|
521
|
+
|
522
|
+
// If this option's value was already in our ngModel, go ahead and select it.
|
523
|
+
if (angular.isDefined(self.selected[hashKey])) {
|
524
|
+
self.select(hashKey, optionCtrl.value);
|
525
|
+
self.refreshViewValue();
|
526
|
+
}
|
527
|
+
};
|
528
|
+
self.removeOption = function(hashKey) {
|
529
|
+
delete self.options[hashKey];
|
530
|
+
// Don't deselect an option when it's removed - the user's ngModel should be allowed
|
531
|
+
// to have values that do not match a currently available option.
|
532
|
+
};
|
533
|
+
|
534
|
+
self.refreshViewValue = function() {
|
535
|
+
var values = [];
|
536
|
+
var option;
|
537
|
+
for (var hashKey in self.selected) {
|
538
|
+
// If this hashKey has an associated option, push that option's value to the model.
|
539
|
+
if ((option = self.options[hashKey])) {
|
540
|
+
values.push(option.value);
|
541
|
+
} else {
|
542
|
+
// Otherwise, the given hashKey has no associated option, and we got it
|
543
|
+
// from an ngModel value at an earlier time. Push the unhashed value of
|
544
|
+
// this hashKey to the model.
|
545
|
+
// This allows the developer to put a value in the model that doesn't yet have
|
546
|
+
// an associated option.
|
547
|
+
values.push(self.selected[hashKey]);
|
548
|
+
}
|
549
|
+
}
|
550
|
+
self.ngModel.$setViewValue(self.isMultiple ? values : values[0]);
|
551
|
+
};
|
552
|
+
|
553
|
+
function renderMultiple() {
|
554
|
+
var newSelectedValues = self.ngModel.$modelValue || self.ngModel.$viewValue;
|
555
|
+
if (!angular.isArray(newSelectedValues)) return;
|
556
|
+
|
557
|
+
var oldSelected = Object.keys(self.selected);
|
558
|
+
|
559
|
+
var newSelectedHashes = newSelectedValues.map(self.hashGetter);
|
560
|
+
var deselected = oldSelected.filter(function(hash) {
|
561
|
+
return newSelectedHashes.indexOf(hash) === -1;
|
562
|
+
});
|
563
|
+
|
564
|
+
deselected.forEach(self.deselect);
|
565
|
+
newSelectedHashes.forEach(function(hashKey, i) {
|
566
|
+
self.select(hashKey, newSelectedValues[i]);
|
567
|
+
});
|
568
|
+
}
|
569
|
+
function renderSingular() {
|
570
|
+
var value = self.ngModel.$viewValue || self.ngModel.$modelValue;
|
571
|
+
Object.keys(self.selected).forEach(self.deselect);
|
572
|
+
self.select( self.hashGetter(value), value );
|
573
|
+
}
|
574
|
+
}
|
575
|
+
|
576
|
+
}
|
577
|
+
SelectMenuDirective.$inject = ["$parse", "$mdUtil", "$mdTheming"];
|
578
|
+
|
579
|
+
function OptionDirective($mdButtonInkRipple, $mdUtil) {
|
580
|
+
|
581
|
+
OptionController.$inject = ["$element"];
|
582
|
+
return {
|
583
|
+
restrict: 'E',
|
584
|
+
require: ['mdOption', '^^mdSelectMenu'],
|
585
|
+
controller: OptionController,
|
586
|
+
compile: compile
|
587
|
+
};
|
588
|
+
|
589
|
+
function compile(element, attr) {
|
590
|
+
// Manual transclusion to avoid the extra inner <span> that ng-transclude generates
|
591
|
+
element.append( angular.element('<div class="md-text">').append(element.contents()) );
|
592
|
+
|
593
|
+
element.attr('tabindex', attr.tabindex || '0');
|
594
|
+
return postLink;
|
595
|
+
}
|
596
|
+
|
597
|
+
function postLink(scope, element, attr, ctrls) {
|
598
|
+
var optionCtrl = ctrls[0];
|
599
|
+
var selectCtrl = ctrls[1];
|
600
|
+
|
601
|
+
if (angular.isDefined(attr.ngValue)) {
|
602
|
+
scope.$watch(attr.ngValue, setOptionValue);
|
603
|
+
} else if (angular.isDefined(attr.value)) {
|
604
|
+
setOptionValue(attr.value);
|
605
|
+
} else {
|
606
|
+
scope.$watch(function() { return element.text(); }, setOptionValue);
|
607
|
+
}
|
608
|
+
|
609
|
+
scope.$$postDigest(function() {
|
610
|
+
attr.$observe('selected', function(selected) {
|
611
|
+
if (!angular.isDefined(selected)) return;
|
612
|
+
if (selected) {
|
613
|
+
if (!selectCtrl.isMultiple) {
|
614
|
+
selectCtrl.deselect( Object.keys(selectCtrl.selected)[0] );
|
615
|
+
}
|
616
|
+
selectCtrl.select(optionCtrl.hashKey, optionCtrl.value);
|
617
|
+
} else {
|
618
|
+
selectCtrl.deselect(optionCtrl.hashKey);
|
619
|
+
}
|
620
|
+
selectCtrl.refreshViewValue();
|
621
|
+
selectCtrl.ngModel.$render();
|
622
|
+
});
|
623
|
+
});
|
624
|
+
|
625
|
+
$mdButtonInkRipple.attach(scope, element);
|
626
|
+
configureAria();
|
627
|
+
|
628
|
+
function setOptionValue(newValue, oldValue) {
|
629
|
+
var oldHashKey = selectCtrl.hashGetter(oldValue, scope);
|
630
|
+
var newHashKey = selectCtrl.hashGetter(newValue, scope);
|
631
|
+
|
632
|
+
optionCtrl.hashKey = newHashKey;
|
633
|
+
optionCtrl.value = newValue;
|
634
|
+
|
635
|
+
selectCtrl.removeOption(oldHashKey, optionCtrl);
|
636
|
+
selectCtrl.addOption(newHashKey, optionCtrl);
|
637
|
+
}
|
638
|
+
|
639
|
+
scope.$on('$destroy', function() {
|
640
|
+
selectCtrl.removeOption(optionCtrl.hashKey, optionCtrl);
|
641
|
+
});
|
642
|
+
|
643
|
+
function configureAria() {
|
644
|
+
var ariaAttrs = {
|
645
|
+
'role': 'option',
|
646
|
+
'aria-selected': 'false'
|
647
|
+
};
|
648
|
+
|
649
|
+
if (!element[0].hasAttribute('id')) {
|
650
|
+
ariaAttrs.id = 'select_option_' + $mdUtil.nextUid();
|
651
|
+
}
|
652
|
+
element.attr(ariaAttrs);
|
653
|
+
}
|
654
|
+
}
|
655
|
+
|
656
|
+
function OptionController($element) {
|
657
|
+
this.selected = false;
|
658
|
+
this.setSelected = function(isSelected) {
|
659
|
+
if (isSelected && !this.selected) {
|
660
|
+
$element.attr({
|
661
|
+
'selected': 'selected',
|
662
|
+
'aria-selected': 'true'
|
663
|
+
});
|
664
|
+
} else if (!isSelected && this.selected) {
|
665
|
+
$element.removeAttr('selected');
|
666
|
+
$element.attr('aria-selected', 'false');
|
667
|
+
}
|
668
|
+
this.selected = isSelected;
|
669
|
+
};
|
670
|
+
}
|
671
|
+
|
672
|
+
}
|
673
|
+
OptionDirective.$inject = ["$mdButtonInkRipple", "$mdUtil"];
|
674
|
+
|
675
|
+
function OptgroupDirective() {
|
676
|
+
return {
|
677
|
+
restrict: 'E',
|
678
|
+
compile: compile
|
679
|
+
};
|
680
|
+
function compile(el, attrs) {
|
681
|
+
var labelElement = el.find('label');
|
682
|
+
if (!labelElement.length) {
|
683
|
+
labelElement = angular.element('<label>');
|
684
|
+
el.prepend(labelElement);
|
685
|
+
}
|
686
|
+
if (attrs.label) labelElement.text(attrs.label);
|
687
|
+
}
|
688
|
+
}
|
689
|
+
|
690
|
+
function SelectProvider($$interimElementProvider) {
|
691
|
+
selectDefaultOptions.$inject = ["$mdSelect", "$mdConstant", "$$rAF", "$mdUtil", "$mdTheming", "$timeout", "$window"];
|
692
|
+
return $$interimElementProvider('$mdSelect')
|
693
|
+
.setDefaults({
|
694
|
+
methods: ['target'],
|
695
|
+
options: selectDefaultOptions
|
696
|
+
});
|
697
|
+
|
698
|
+
/* ngInject */
|
699
|
+
function selectDefaultOptions($mdSelect, $mdConstant, $$rAF, $mdUtil, $mdTheming, $timeout, $window ) {
|
700
|
+
return {
|
701
|
+
parent: 'body',
|
702
|
+
onShow: onShow,
|
703
|
+
onRemove: onRemove,
|
704
|
+
hasBackdrop: true,
|
705
|
+
disableParentScroll: true,
|
706
|
+
themable: true
|
707
|
+
};
|
708
|
+
|
709
|
+
function onShow(scope, element, opts) {
|
710
|
+
if (!opts.target) {
|
711
|
+
throw new Error('$mdSelect.show() expected a target element in options.target but got ' +
|
712
|
+
'"' + opts.target + '"!');
|
713
|
+
}
|
714
|
+
|
715
|
+
angular.extend(opts, {
|
716
|
+
isRemoved: false,
|
717
|
+
target: angular.element(opts.target), //make sure it's not a naked dom node
|
718
|
+
parent: angular.element(opts.parent),
|
719
|
+
selectEl: element.find('md-select-menu'),
|
720
|
+
contentEl: element.find('md-content'),
|
721
|
+
backdrop: opts.hasBackdrop && angular.element('<md-backdrop class="md-select-backdrop md-click-catcher">')
|
722
|
+
});
|
723
|
+
|
724
|
+
opts.resizeFn = function() {
|
725
|
+
$$rAF(function() {
|
726
|
+
$$rAF(function() {
|
727
|
+
animateSelect(scope, element, opts);
|
728
|
+
});
|
729
|
+
});
|
730
|
+
};
|
731
|
+
|
732
|
+
angular.element($window).on('resize', opts.resizeFn);
|
733
|
+
angular.element($window).on('orientationchange', opts.resizeFn);
|
734
|
+
|
735
|
+
|
736
|
+
configureAria();
|
737
|
+
|
738
|
+
element.removeClass('md-leave');
|
739
|
+
|
740
|
+
var optionNodes = opts.selectEl[0].getElementsByTagName('md-option');
|
741
|
+
|
742
|
+
if (opts.loadingAsync && opts.loadingAsync.then) {
|
743
|
+
opts.loadingAsync.then(function() {
|
744
|
+
scope.$$loadingAsyncDone = true;
|
745
|
+
// Give ourselves two frames for the progress loader to clear out.
|
746
|
+
$$rAF(function() {
|
747
|
+
$$rAF(function() {
|
748
|
+
// Don't go forward if the select has been removed in this time...
|
749
|
+
if (opts.isRemoved) return;
|
750
|
+
animateSelect(scope, element, opts);
|
751
|
+
});
|
752
|
+
});
|
753
|
+
});
|
754
|
+
} else if (opts.loadingAsync) {
|
755
|
+
scope.$$loadingAsyncDone = true;
|
756
|
+
}
|
757
|
+
|
758
|
+
if (opts.disableParentScroll && !$mdUtil.getClosest(opts.target, 'MD-DIALOG')) {
|
759
|
+
opts.restoreScroll = $mdUtil.disableScrollAround(opts.element);
|
760
|
+
} else {
|
761
|
+
opts.disableParentScroll = false;
|
762
|
+
}
|
763
|
+
// Only activate click listeners after a short time to stop accidental double taps/clicks
|
764
|
+
// from clicking the wrong item
|
765
|
+
$timeout(activateInteraction, 75, false);
|
766
|
+
|
767
|
+
if (opts.backdrop) {
|
768
|
+
$mdTheming.inherit(opts.backdrop, opts.parent);
|
769
|
+
opts.parent.append(opts.backdrop);
|
770
|
+
}
|
771
|
+
opts.parent.append(element);
|
772
|
+
|
773
|
+
// Give the select a frame to 'initialize' in the DOM,
|
774
|
+
// so we can read its height/width/position
|
775
|
+
$$rAF(function() {
|
776
|
+
$$rAF(function() {
|
777
|
+
if (opts.isRemoved) return;
|
778
|
+
animateSelect(scope, element, opts);
|
779
|
+
});
|
780
|
+
});
|
781
|
+
|
782
|
+
return $mdUtil.transitionEndPromise(opts.selectEl, {timeout: 350});
|
783
|
+
|
784
|
+
function configureAria() {
|
785
|
+
opts.target.attr('aria-expanded', 'true');
|
786
|
+
}
|
787
|
+
|
788
|
+
function activateInteraction() {
|
789
|
+
if (opts.isRemoved) return;
|
790
|
+
var selectCtrl = opts.selectEl.controller('mdSelectMenu') || {};
|
791
|
+
element.addClass('md-clickable');
|
792
|
+
|
793
|
+
opts.backdrop && opts.backdrop.on('click', function(e) {
|
794
|
+
e.preventDefault();
|
795
|
+
e.stopPropagation();
|
796
|
+
opts.restoreFocus = false;
|
797
|
+
scope.$apply($mdSelect.cancel);
|
798
|
+
});
|
799
|
+
|
800
|
+
// Escape to close
|
801
|
+
opts.selectEl.on('keydown', function(ev) {
|
802
|
+
switch (ev.keyCode) {
|
803
|
+
case $mdConstant.KEY_CODE.SPACE:
|
804
|
+
case $mdConstant.KEY_CODE.ENTER:
|
805
|
+
var option = $mdUtil.getClosest(ev.target, 'md-option');
|
806
|
+
if (option) {
|
807
|
+
opts.selectEl.triggerHandler({
|
808
|
+
type: 'click',
|
809
|
+
target: option
|
810
|
+
});
|
811
|
+
ev.preventDefault();
|
812
|
+
}
|
813
|
+
break;
|
814
|
+
case $mdConstant.KEY_CODE.TAB:
|
815
|
+
case $mdConstant.KEY_CODE.ESCAPE:
|
816
|
+
ev.preventDefault();
|
817
|
+
opts.restoreFocus = true;
|
818
|
+
scope.$apply($mdSelect.cancel);
|
819
|
+
}
|
820
|
+
});
|
821
|
+
|
822
|
+
// Cycling of options, and closing on enter
|
823
|
+
opts.selectEl.on('keydown', function(ev) {
|
824
|
+
switch (ev.keyCode) {
|
825
|
+
case $mdConstant.KEY_CODE.UP_ARROW: return focusPrevOption();
|
826
|
+
case $mdConstant.KEY_CODE.DOWN_ARROW: return focusNextOption();
|
827
|
+
default:
|
828
|
+
if (ev.keyCode >= 31 && ev.keyCode <= 90) {
|
829
|
+
var optNode = opts.selectEl.controller('mdSelectMenu').optNodeForKeyboardSearch(ev);
|
830
|
+
optNode && optNode.focus();
|
831
|
+
}
|
832
|
+
}
|
833
|
+
});
|
834
|
+
|
835
|
+
|
836
|
+
function focusOption(direction) {
|
837
|
+
var optionsArray = $mdUtil.nodesToArray(optionNodes);
|
838
|
+
var index = optionsArray.indexOf(opts.focusedNode);
|
839
|
+
if (index === -1) {
|
840
|
+
// We lost the previously focused element, reset to first option
|
841
|
+
index = 0;
|
842
|
+
} else if (direction === 'next' && index < optionsArray.length - 1) {
|
843
|
+
index++;
|
844
|
+
} else if (direction === 'prev' && index > 0) {
|
845
|
+
index--;
|
846
|
+
}
|
847
|
+
var newOption = opts.focusedNode = optionsArray[index];
|
848
|
+
newOption && newOption.focus();
|
849
|
+
}
|
850
|
+
function focusNextOption() {
|
851
|
+
focusOption('next');
|
852
|
+
}
|
853
|
+
function focusPrevOption() {
|
854
|
+
focusOption('prev');
|
855
|
+
}
|
856
|
+
|
857
|
+
opts.selectEl.on('click', checkCloseMenu);
|
858
|
+
opts.selectEl.on('keydown', function(e) {
|
859
|
+
if (e.keyCode == 32 || e.keyCode == 13) {
|
860
|
+
checkCloseMenu();
|
861
|
+
}
|
862
|
+
});
|
863
|
+
|
864
|
+
function checkCloseMenu() {
|
865
|
+
if (!selectCtrl.isMultiple) {
|
866
|
+
opts.restoreFocus = true;
|
867
|
+
scope.$evalAsync(function() {
|
868
|
+
$mdSelect.hide(selectCtrl.ngModel.$viewValue);
|
869
|
+
});
|
870
|
+
}
|
871
|
+
}
|
872
|
+
}
|
873
|
+
|
874
|
+
}
|
875
|
+
|
876
|
+
function onRemove(scope, element, opts) {
|
877
|
+
opts.isRemoved = true;
|
878
|
+
element.addClass('md-leave')
|
879
|
+
.removeClass('md-clickable');
|
880
|
+
opts.target.attr('aria-expanded', 'false');
|
881
|
+
|
882
|
+
|
883
|
+
angular.element($window).off('resize', opts.resizeFn);
|
884
|
+
angular.element($window).off('orientationchange', opts.resizefn);
|
885
|
+
opts.resizeFn = undefined;
|
886
|
+
|
887
|
+
var mdSelect = opts.selectEl.controller('mdSelect');
|
888
|
+
if (mdSelect) {
|
889
|
+
mdSelect.setLabelText(opts.selectEl.controller('mdSelectMenu').selectedLabels());
|
890
|
+
}
|
891
|
+
|
892
|
+
return $mdUtil.transitionEndPromise(element, { timeout: 350 }).then(function() {
|
893
|
+
element.removeClass('md-active');
|
894
|
+
opts.backdrop && opts.backdrop.remove();
|
895
|
+
if (element[0].parentNode === opts.parent[0]) {
|
896
|
+
opts.parent[0].removeChild(element[0]); // use browser to avoid $destroy event
|
897
|
+
}
|
898
|
+
if (opts.disableParentScroll) {
|
899
|
+
opts.restoreScroll();
|
900
|
+
}
|
901
|
+
if (opts.restoreFocus) opts.target.focus();
|
902
|
+
mdSelect && mdSelect.triggerClose();
|
903
|
+
});
|
904
|
+
}
|
905
|
+
|
906
|
+
function animateSelect(scope, element, opts) {
|
907
|
+
var containerNode = element[0],
|
908
|
+
targetNode = opts.target[0].firstElementChild.firstElementChild, // target the first span, functioning as the label
|
909
|
+
parentNode = opts.parent[0],
|
910
|
+
selectNode = opts.selectEl[0],
|
911
|
+
contentNode = opts.contentEl[0],
|
912
|
+
parentRect = parentNode.getBoundingClientRect(),
|
913
|
+
targetRect = targetNode.getBoundingClientRect(),
|
914
|
+
shouldOpenAroundTarget = false,
|
915
|
+
bounds = {
|
916
|
+
left: parentRect.left + SELECT_EDGE_MARGIN,
|
917
|
+
top: SELECT_EDGE_MARGIN,
|
918
|
+
bottom: parentRect.height - SELECT_EDGE_MARGIN,
|
919
|
+
right: parentRect.width - SELECT_EDGE_MARGIN - ($mdUtil.floatingScrollbars() ? 16 : 0)
|
920
|
+
},
|
921
|
+
spaceAvailable = {
|
922
|
+
top: targetRect.top - bounds.top,
|
923
|
+
left: targetRect.left - bounds.left,
|
924
|
+
right: bounds.right - (targetRect.left + targetRect.width),
|
925
|
+
bottom: bounds.bottom - (targetRect.top + targetRect.height)
|
926
|
+
},
|
927
|
+
maxWidth = parentRect.width - SELECT_EDGE_MARGIN * 2,
|
928
|
+
isScrollable = contentNode.scrollHeight > contentNode.offsetHeight,
|
929
|
+
selectedNode = selectNode.querySelector('md-option[selected]'),
|
930
|
+
optionNodes = selectNode.getElementsByTagName('md-option'),
|
931
|
+
optgroupNodes = selectNode.getElementsByTagName('md-optgroup');
|
932
|
+
|
933
|
+
|
934
|
+
var centeredNode;
|
935
|
+
// If a selected node, center around that
|
936
|
+
if (selectedNode) {
|
937
|
+
centeredNode = selectedNode;
|
938
|
+
// If there are option groups, center around the first option group
|
939
|
+
} else if (optgroupNodes.length) {
|
940
|
+
centeredNode = optgroupNodes[0];
|
941
|
+
// Otherwise, center around the first optionNode
|
942
|
+
} else if (optionNodes.length){
|
943
|
+
centeredNode = optionNodes[0];
|
944
|
+
// In case there are no options, center on whatever's in there... (eg progress indicator)
|
945
|
+
} else {
|
946
|
+
centeredNode = contentNode.firstElementChild || contentNode;
|
947
|
+
}
|
948
|
+
|
949
|
+
if (contentNode.offsetWidth > maxWidth) {
|
950
|
+
contentNode.style['max-width'] = maxWidth + 'px';
|
951
|
+
}
|
952
|
+
if (shouldOpenAroundTarget) {
|
953
|
+
contentNode.style['min-width'] = targetRect.width + 'px';
|
954
|
+
}
|
955
|
+
|
956
|
+
// Remove padding before we compute the position of the menu
|
957
|
+
if (isScrollable) {
|
958
|
+
selectNode.classList.add('md-overflow');
|
959
|
+
}
|
960
|
+
|
961
|
+
// Get the selectMenuRect *after* max-width is possibly set above
|
962
|
+
var selectMenuRect = selectNode.getBoundingClientRect();
|
963
|
+
var centeredRect = getOffsetRect(centeredNode);
|
964
|
+
|
965
|
+
if (centeredNode) {
|
966
|
+
var centeredStyle = $window.getComputedStyle(centeredNode);
|
967
|
+
centeredRect.paddingLeft = parseInt(centeredStyle.paddingLeft, 10) || 0;
|
968
|
+
centeredRect.paddingRight = parseInt(centeredStyle.paddingRight, 10) || 0;
|
969
|
+
}
|
970
|
+
|
971
|
+
var focusedNode = centeredNode;
|
972
|
+
if ((focusedNode.tagName || '').toUpperCase() === 'MD-OPTGROUP') {
|
973
|
+
focusedNode = optionNodes[0] || contentNode.firstElementChild || contentNode;
|
974
|
+
}
|
975
|
+
|
976
|
+
if (isScrollable) {
|
977
|
+
var scrollBuffer = contentNode.offsetHeight / 2;
|
978
|
+
contentNode.scrollTop = centeredRect.top + centeredRect.height / 2 - scrollBuffer;
|
979
|
+
|
980
|
+
if (spaceAvailable.top < scrollBuffer) {
|
981
|
+
contentNode.scrollTop = Math.min(
|
982
|
+
centeredRect.top,
|
983
|
+
contentNode.scrollTop + scrollBuffer - spaceAvailable.top
|
984
|
+
);
|
985
|
+
} else if (spaceAvailable.bottom < scrollBuffer) {
|
986
|
+
contentNode.scrollTop = Math.max(
|
987
|
+
centeredRect.top + centeredRect.height - selectMenuRect.height,
|
988
|
+
contentNode.scrollTop - scrollBuffer + spaceAvailable.bottom
|
989
|
+
);
|
990
|
+
}
|
991
|
+
}
|
992
|
+
|
993
|
+
var left, top, transformOrigin;
|
994
|
+
if (shouldOpenAroundTarget) {
|
995
|
+
left = targetRect.left;
|
996
|
+
top = targetRect.top + targetRect.height;
|
997
|
+
transformOrigin = '50% 0';
|
998
|
+
if (top + selectMenuRect.height > bounds.bottom) {
|
999
|
+
top = targetRect.top - selectMenuRect.height;
|
1000
|
+
transformOrigin = '50% 100%';
|
1001
|
+
}
|
1002
|
+
} else {
|
1003
|
+
left = targetRect.left + centeredRect.left - centeredRect.paddingLeft;
|
1004
|
+
top = Math.floor(targetRect.top + targetRect.height / 2 - centeredRect.height / 2 -
|
1005
|
+
centeredRect.top + contentNode.scrollTop);
|
1006
|
+
|
1007
|
+
|
1008
|
+
transformOrigin = (centeredRect.left + targetRect.width / 2) + 'px ' +
|
1009
|
+
(centeredRect.top + centeredRect.height / 2 - contentNode.scrollTop) + 'px 0px';
|
1010
|
+
|
1011
|
+
containerNode.style.minWidth = targetRect.width + centeredRect.paddingLeft +
|
1012
|
+
centeredRect.paddingRight + 'px';
|
1013
|
+
}
|
1014
|
+
|
1015
|
+
// Keep left and top within the window
|
1016
|
+
var containerRect = containerNode.getBoundingClientRect();
|
1017
|
+
containerNode.style.left = clamp(bounds.left, left, bounds.right - containerRect.width) + 'px';
|
1018
|
+
containerNode.style.top = clamp(bounds.top, top, bounds.bottom - containerRect.height) + 'px';
|
1019
|
+
selectNode.style[$mdConstant.CSS.TRANSFORM_ORIGIN] = transformOrigin;
|
1020
|
+
|
1021
|
+
selectNode.style[$mdConstant.CSS.TRANSFORM] = 'scale(' +
|
1022
|
+
Math.min(targetRect.width / selectMenuRect.width, 1.0) + ',' +
|
1023
|
+
Math.min(targetRect.height / selectMenuRect.height, 1.0) +
|
1024
|
+
')';
|
1025
|
+
|
1026
|
+
|
1027
|
+
$$rAF(function() {
|
1028
|
+
element.addClass('md-active');
|
1029
|
+
selectNode.style[$mdConstant.CSS.TRANSFORM] = '';
|
1030
|
+
if (focusedNode) {
|
1031
|
+
opts.focusedNode = focusedNode;
|
1032
|
+
focusedNode.focus();
|
1033
|
+
}
|
1034
|
+
});
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
function clamp(min, n, max) {
|
1040
|
+
return Math.max(min, Math.min(n, max));
|
1041
|
+
}
|
1042
|
+
|
1043
|
+
function getOffsetRect(node) {
|
1044
|
+
return node ? {
|
1045
|
+
left: node.offsetLeft,
|
1046
|
+
top: node.offsetTop,
|
1047
|
+
width: node.offsetWidth,
|
1048
|
+
height: node.offsetHeight
|
1049
|
+
} : { left: 0, top: 0, width: 0, height: 0 };
|
1050
|
+
}
|
1051
|
+
}
|
1052
|
+
SelectProvider.$inject = ["$$interimElementProvider"];
|
1053
|
+
|
1054
|
+
|
1055
|
+
ng.material.components.select = angular.module("material.components.select");
|