polymer-paper-rails 0.2.0 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/components/core-a11y-keys/core-a11y-keys.html +335 -0
- data/app/assets/components/core-animation/core-animation.html +7 -6
- data/app/assets/components/core-animation/web-animations.html +1 -1
- data/app/assets/components/core-collapse/core-collapse.html +41 -5
- data/app/assets/components/core-component-page/core-component-page.html +1 -1
- data/app/assets/components/core-drawer-panel/core-drawer-panel.css +14 -9
- data/app/assets/components/core-drawer-panel/core-drawer-panel.html +76 -21
- data/app/assets/components/core-drawer-panel/metadata.html +1 -1
- data/app/assets/components/core-dropdown/core-dropdown-base.html +117 -0
- data/app/assets/components/core-dropdown/core-dropdown.html +305 -0
- data/app/assets/components/core-dropdown/metadata.html +62 -0
- data/app/assets/components/core-elements/paper-elements.html +2 -0
- data/app/assets/components/core-focusable/core-focusable.html +4 -0
- data/app/assets/components/core-focusable/core-focusable.js +134 -0
- data/app/assets/components/core-focusable/polymer-mixin.js +35 -0
- data/app/assets/components/core-header-panel/core-header-panel.css +6 -3
- data/app/assets/components/core-header-panel/core-header-panel.html +96 -44
- data/app/assets/components/core-header-panel/metadata.html +1 -1
- data/app/assets/components/core-icon/core-icon.html +19 -5
- data/app/assets/components/core-icons/av-icons.html +57 -31
- data/app/assets/components/core-icons/communication-icons.html +42 -44
- data/app/assets/components/core-icons/core-icons.html +267 -263
- data/app/assets/components/core-icons/device-icons.html +90 -44
- data/app/assets/components/core-icons/editor-icons.html +52 -52
- data/app/assets/components/core-icons/hardware-icons.html +42 -43
- data/app/assets/components/core-icons/image-icons.html +140 -130
- data/app/assets/components/core-icons/maps-icons.html +57 -54
- data/app/assets/components/core-icons/notification-icons.html +34 -35
- data/app/assets/components/core-icons/social-icons.html +38 -37
- data/app/assets/components/core-iconset-svg/core-iconset-svg.html +1 -1
- data/app/assets/components/core-input/core-input.css +3 -7
- data/app/assets/components/core-input/core-input.html +105 -411
- data/app/assets/components/core-input/metadata.html +6 -3
- data/app/assets/components/core-item/core-item.css +7 -6
- data/app/assets/components/core-item/core-item.html +4 -5
- data/app/assets/components/core-item/metadata.html +1 -1
- data/app/assets/components/core-label/core-label.html +124 -0
- data/app/assets/components/core-menu/core-menu.css +3 -3
- data/app/assets/components/core-menu/core-menu.html +8 -2
- data/app/assets/components/core-menu/core-submenu.css +14 -0
- data/app/assets/components/core-menu/core-submenu.html +21 -1
- data/app/assets/components/core-overlay/core-overlay-layer.html +1 -0
- data/app/assets/components/core-overlay/core-overlay.html +163 -90
- data/app/assets/components/core-overlay/gulpfile.js +2 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-basic.html +127 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning-margin.html +153 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-positioning.html +167 -0
- data/app/assets/components/core-overlay/tests/html/core-overlay-scroll.html +130 -0
- data/app/assets/components/core-overlay/tests/js/htmltests.js +6 -0
- data/app/assets/components/core-overlay/tests/runner.html +14 -0
- data/app/assets/components/core-overlay/tests/tests.json +6 -0
- data/app/assets/components/core-scroll-header-panel/core-scroll-header-panel.html +45 -9
- data/app/assets/components/core-scroll-header-panel/metadata.html +1 -1
- data/app/assets/components/core-selector/core-selector.html +116 -28
- data/app/assets/components/core-selector/metadata.html +1 -1
- data/app/assets/components/core-style/core-style.html +4 -4
- data/app/assets/components/core-style/elements.html +1 -1
- data/app/assets/components/core-style/my-theme.html +1 -1
- data/app/assets/components/core-toolbar/core-toolbar.css +14 -7
- data/app/assets/components/core-toolbar/core-toolbar.html +88 -7
- data/app/assets/components/core-toolbar/metadata.html +1 -1
- data/app/assets/components/core-transition/core-transition-css.html +1 -2
- data/app/assets/components/core-transition/core-transition-overlay.css +9 -9
- data/app/assets/components/core-transition/core-transition.html +1 -1
- data/app/assets/components/font-roboto/roboto.html +1 -1
- data/app/assets/components/paper-button/metadata.html +2 -2
- data/app/assets/components/paper-button/paper-button-base.html +120 -0
- data/app/assets/components/paper-button/paper-button.html +114 -145
- data/app/assets/components/paper-checkbox/paper-checkbox.css +1 -1
- data/app/assets/components/paper-dialog/paper-action-dialog.html +104 -0
- data/app/assets/components/paper-dialog/paper-dialog-base.html +81 -0
- data/app/assets/components/paper-dialog/paper-dialog-transition.html +1 -1
- data/app/assets/components/paper-dialog/paper-dialog.html +68 -143
- data/app/assets/components/{paper-dropdown/paper-dropdown.css → paper-dropdown-menu/paper-dropdown-menu.css} +1 -5
- data/app/assets/components/paper-dropdown-menu/paper-dropdown-menu.html +181 -0
- data/app/assets/components/{polymer/polymer.html → paper-dropdown/paper-dropdown-transition.css} +9 -7
- data/app/assets/components/paper-dropdown/paper-dropdown-transition.html +166 -0
- data/app/assets/components/paper-dropdown/paper-dropdown.html +69 -143
- data/app/assets/components/paper-fab/metadata.html +1 -1
- data/app/assets/components/paper-fab/paper-fab.html +140 -16
- data/app/assets/components/paper-icon-button/paper-icon-button.html +99 -32
- data/app/assets/components/paper-input/metadata.html +1 -4
- data/app/assets/components/paper-input/paper-autogrow-textarea.html +157 -0
- data/app/assets/components/paper-input/{paper-input.css → paper-input-decorator.css} +25 -25
- data/app/assets/components/paper-input/paper-input-decorator.html +468 -0
- data/app/assets/components/paper-input/paper-input.html +74 -269
- data/app/assets/components/paper-item/metadata.html +1 -1
- data/app/assets/components/paper-item/paper-item.html +95 -52
- data/app/assets/components/paper-menu-button/metadata.html +1 -1
- data/app/assets/components/paper-menu-button/paper-menu-button.css +38 -19
- data/app/assets/components/paper-menu-button/paper-menu-button.html +57 -138
- data/app/assets/components/paper-progress/paper-progress.css +39 -6
- data/app/assets/components/paper-progress/paper-progress.html +30 -4
- data/app/assets/components/paper-radio-button/paper-radio-button.html +3 -0
- data/app/assets/components/paper-radio-group/paper-radio-group.html +34 -1
- data/app/assets/components/paper-ripple/paper-ripple.html +110 -61
- data/app/assets/components/paper-shadow/metadata.html +2 -2
- data/app/assets/components/paper-shadow/paper-shadow.css +20 -45
- data/app/assets/components/paper-shadow/paper-shadow.html +55 -195
- data/app/assets/components/paper-slider/paper-slider.css +15 -1
- data/app/assets/components/paper-slider/paper-slider.html +98 -57
- data/app/assets/components/paper-spinner/paper-spinner.css +311 -0
- data/app/assets/components/paper-spinner/paper-spinner.html +116 -0
- data/app/assets/components/paper-tabs/paper-tab.css +26 -16
- data/app/assets/components/paper-tabs/paper-tab.html +24 -8
- data/app/assets/components/paper-tabs/paper-tabs.css +31 -13
- data/app/assets/components/paper-tabs/paper-tabs.html +217 -20
- data/app/assets/components/paper-toast/paper-toast.html +44 -6
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +7 -1
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html +12 -2
- data/app/assets/components/sampler-scaffold/sampler-scaffold.css +2 -1
- data/app/assets/components/web-animations-next/Gruntfile.js +279 -0
- data/app/assets/components/web-animations-next/History.md +76 -0
- data/app/assets/components/web-animations-next/package.json +33 -0
- data/app/assets/components/web-animations-next/src/animation-constructor.js +139 -0
- data/app/assets/components/web-animations-next/src/animation-node.js +31 -0
- data/app/assets/components/web-animations-next/src/animation.js +65 -0
- data/app/assets/components/web-animations-next/src/apply-preserving-inline-style.js +192 -0
- data/app/assets/components/web-animations-next/src/apply.js +25 -0
- data/app/assets/components/web-animations-next/src/box-handler.js +57 -0
- data/app/assets/components/web-animations-next/src/color-handler.js +62 -0
- data/app/assets/components/web-animations-next/src/deprecation.js +42 -0
- data/app/assets/components/web-animations-next/src/dev.js +16 -0
- data/app/assets/components/web-animations-next/src/dimension-handler.js +167 -0
- data/app/assets/components/web-animations-next/src/effect-callback.js +86 -0
- data/app/assets/components/web-animations-next/src/effect.js +110 -0
- data/app/assets/components/web-animations-next/src/element-animatable.js +19 -0
- data/app/assets/components/web-animations-next/src/font-weight-handler.js +42 -0
- data/app/assets/components/web-animations-next/src/group-constructors.js +81 -0
- data/app/assets/components/web-animations-next/src/handler-utils.js +177 -0
- data/app/assets/components/web-animations-next/src/interpolation.js +49 -0
- data/app/assets/components/web-animations-next/src/matrix-decomposition.js +452 -0
- data/app/assets/components/web-animations-next/src/matrix-interpolation.js +130 -0
- data/app/assets/components/web-animations-next/src/maxifill-player.js +162 -0
- data/app/assets/components/web-animations-next/src/normalize-keyframes.js +259 -0
- data/app/assets/components/web-animations-next/src/number-handler.js +72 -0
- data/app/assets/components/web-animations-next/src/player.js +193 -0
- data/app/assets/components/web-animations-next/src/position-handler.js +117 -0
- data/app/assets/components/web-animations-next/src/property-interpolation.js +62 -0
- data/app/assets/components/web-animations-next/src/property-names.js +35 -0
- data/app/assets/components/web-animations-next/src/scope.js +20 -0
- data/app/assets/components/web-animations-next/src/shadow-handler.js +108 -0
- data/app/assets/components/web-animations-next/src/shape-handler.js +85 -0
- data/app/assets/components/web-animations-next/src/tick.js +148 -0
- data/app/assets/components/web-animations-next/src/timeline.js +77 -0
- data/app/assets/components/web-animations-next/src/timing-utilities.js +242 -0
- data/app/assets/components/web-animations-next/src/transform-handler.js +262 -0
- data/app/assets/components/web-animations-next/src/visibility-handler.js +29 -0
- data/app/assets/components/web-animations-next/target-config.js +124 -0
- data/app/assets/components/web-animations-next/target-loader.js +13 -0
- data/app/assets/components/web-animations-next/templates/boilerplate +13 -0
- data/app/assets/components/web-animations-next/templates/runner.html +26 -0
- data/app/assets/components/web-animations-next/templates/web-animations.html +18 -0
- data/app/assets/components/web-animations-next/templates/web-animations.js +21 -0
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.html +44 -0
- data/app/assets/components/web-animations-next/web-animations-next-lite.dev.js +21 -0
- data/app/assets/components/web-animations-next/web-animations-next.dev.html +49 -0
- data/app/assets/components/web-animations-next/web-animations-next.dev.js +21 -0
- data/app/assets/components/web-animations-next/web-animations.dev.html +44 -0
- data/app/assets/components/web-animations-next/web-animations.dev.js +21 -0
- data/app/assets/components/web-animations-next/web-animations.html +50 -0
- data/lib/polymer-paper-rails/version.rb +1 -1
- metadata +82 -421
- data/app/assets/components/core-animation/README.md +0 -4
- data/app/assets/components/core-animation/bower.json +0 -8
- data/app/assets/components/core-animation/demo.html +0 -149
- data/app/assets/components/core-animation/index.html +0 -22
- data/app/assets/components/core-collapse/README.md +0 -4
- data/app/assets/components/core-collapse/bower.json +0 -7
- data/app/assets/components/core-collapse/demo.html +0 -93
- data/app/assets/components/core-collapse/index.html +0 -22
- data/app/assets/components/core-component-page/README.md +0 -6
- data/app/assets/components/core-component-page/bower.json +0 -8
- data/app/assets/components/core-component-page/demo.html +0 -23
- data/app/assets/components/core-component-page/index.html +0 -22
- data/app/assets/components/core-drawer-panel/README.md +0 -4
- data/app/assets/components/core-drawer-panel/bower.json +0 -8
- data/app/assets/components/core-drawer-panel/demo.html +0 -73
- data/app/assets/components/core-drawer-panel/index.html +0 -22
- data/app/assets/components/core-elements/README.md +0 -4
- data/app/assets/components/core-elements/bower.json +0 -29
- data/app/assets/components/core-elements/demo.html +0 -105
- data/app/assets/components/core-elements/demos/core-toolbar.html +0 -98
- data/app/assets/components/core-field/README.md +0 -4
- data/app/assets/components/core-field/bower.json +0 -7
- data/app/assets/components/core-field/demo.html +0 -67
- data/app/assets/components/core-field/index.html +0 -22
- data/app/assets/components/core-header-panel/README.md +0 -4
- data/app/assets/components/core-header-panel/bower.json +0 -7
- data/app/assets/components/core-header-panel/demo.html +0 -100
- data/app/assets/components/core-header-panel/index.html +0 -23
- data/app/assets/components/core-icon-button/README.md +0 -4
- data/app/assets/components/core-icon-button/bower.json +0 -7
- data/app/assets/components/core-icon-button/demo.html +0 -35
- data/app/assets/components/core-icon-button/index.html +0 -22
- data/app/assets/components/core-icon/README.md +0 -4
- data/app/assets/components/core-icon/bower.json +0 -8
- data/app/assets/components/core-icon/demo.html +0 -44
- data/app/assets/components/core-icon/index.html +0 -22
- data/app/assets/components/core-icons/README.md +0 -4
- data/app/assets/components/core-icons/bower.json +0 -9
- data/app/assets/components/core-icons/demo.html +0 -96
- data/app/assets/components/core-icons/index.html +0 -22
- data/app/assets/components/core-iconset-svg/README.md +0 -4
- data/app/assets/components/core-iconset-svg/bower.json +0 -8
- data/app/assets/components/core-iconset-svg/demo.html +0 -66
- data/app/assets/components/core-iconset-svg/index.html +0 -22
- data/app/assets/components/core-iconset/README.md +0 -4
- data/app/assets/components/core-iconset/bower.json +0 -9
- data/app/assets/components/core-iconset/demo.html +0 -62
- data/app/assets/components/core-iconset/index.html +0 -22
- data/app/assets/components/core-input/README.md +0 -2
- data/app/assets/components/core-input/bower.json +0 -6
- data/app/assets/components/core-input/demo.html +0 -142
- data/app/assets/components/core-input/index.html +0 -22
- data/app/assets/components/core-item/README.md +0 -4
- data/app/assets/components/core-item/bower.json +0 -8
- data/app/assets/components/core-item/demo.html +0 -92
- data/app/assets/components/core-item/index.html +0 -22
- data/app/assets/components/core-media-query/README.md +0 -4
- data/app/assets/components/core-media-query/bower.json +0 -7
- data/app/assets/components/core-media-query/demo.html +0 -44
- data/app/assets/components/core-media-query/index.html +0 -22
- data/app/assets/components/core-menu/README.md +0 -4
- data/app/assets/components/core-menu/bower.json +0 -9
- data/app/assets/components/core-menu/demo.html +0 -101
- data/app/assets/components/core-menu/index.html +0 -22
- data/app/assets/components/core-meta/README.md +0 -4
- data/app/assets/components/core-meta/bower.json +0 -7
- data/app/assets/components/core-meta/demo.html +0 -58
- data/app/assets/components/core-meta/index.html +0 -22
- data/app/assets/components/core-overlay/README.md +0 -4
- data/app/assets/components/core-overlay/bower.json +0 -8
- data/app/assets/components/core-overlay/demo.html +0 -155
- data/app/assets/components/core-overlay/index.html +0 -22
- data/app/assets/components/core-popup-menu/README.md +0 -6
- data/app/assets/components/core-popup-menu/bower.json +0 -13
- data/app/assets/components/core-popup-menu/demo.html +0 -542
- data/app/assets/components/core-popup-menu/index.html +0 -22
- data/app/assets/components/core-range/README.md +0 -2
- data/app/assets/components/core-range/bower.json +0 -7
- data/app/assets/components/core-range/demo.html +0 -64
- data/app/assets/components/core-range/index.html +0 -22
- data/app/assets/components/core-scroll-header-panel/README.md +0 -4
- data/app/assets/components/core-scroll-header-panel/bower.json +0 -11
- data/app/assets/components/core-scroll-header-panel/demo.html +0 -111
- data/app/assets/components/core-scroll-header-panel/demos/demo1.html +0 -80
- data/app/assets/components/core-scroll-header-panel/demos/demo2.html +0 -82
- data/app/assets/components/core-scroll-header-panel/demos/demo3.html +0 -81
- data/app/assets/components/core-scroll-header-panel/demos/demo4.html +0 -109
- data/app/assets/components/core-scroll-header-panel/demos/demo5.html +0 -109
- data/app/assets/components/core-scroll-header-panel/demos/demo6.html +0 -113
- data/app/assets/components/core-scroll-header-panel/demos/demo7.html +0 -120
- data/app/assets/components/core-scroll-header-panel/demos/demo8.html +0 -122
- data/app/assets/components/core-scroll-header-panel/demos/demo9.html +0 -100
- data/app/assets/components/core-scroll-header-panel/demos/images/bg2.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg3.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg5.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg6.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/images/bg9.jpg +0 -0
- data/app/assets/components/core-scroll-header-panel/demos/lorem-ipsum.html +0 -42
- data/app/assets/components/core-scroll-header-panel/index.html +0 -22
- data/app/assets/components/core-selection/README.md +0 -4
- data/app/assets/components/core-selection/bower.json +0 -7
- data/app/assets/components/core-selection/demo.html +0 -59
- data/app/assets/components/core-selection/index.html +0 -22
- data/app/assets/components/core-selector/README.md +0 -4
- data/app/assets/components/core-selector/bower.json +0 -8
- data/app/assets/components/core-selector/demo.html +0 -106
- data/app/assets/components/core-selector/index.html +0 -22
- data/app/assets/components/core-style/README.md +0 -4
- data/app/assets/components/core-style/bower.json +0 -7
- data/app/assets/components/core-style/demo.html +0 -58
- data/app/assets/components/core-style/index.html +0 -22
- data/app/assets/components/core-toolbar/README.md +0 -4
- data/app/assets/components/core-toolbar/bower.json +0 -7
- data/app/assets/components/core-toolbar/demo.html +0 -107
- data/app/assets/components/core-toolbar/index.html +0 -22
- data/app/assets/components/core-transition/README.md +0 -2
- data/app/assets/components/core-transition/bower.json +0 -8
- data/app/assets/components/core-transition/demo.html +0 -87
- data/app/assets/components/core-transition/index.html +0 -22
- data/app/assets/components/paper-button/README.md +0 -4
- data/app/assets/components/paper-button/bower.json +0 -11
- data/app/assets/components/paper-button/demo.html +0 -99
- data/app/assets/components/paper-button/demo2.html +0 -136
- data/app/assets/components/paper-button/index.html +0 -22
- data/app/assets/components/paper-button/paper-button.css +0 -125
- data/app/assets/components/paper-checkbox/README.md +0 -4
- data/app/assets/components/paper-checkbox/bower.json +0 -8
- data/app/assets/components/paper-checkbox/demo.html +0 -113
- data/app/assets/components/paper-checkbox/index.html +0 -22
- data/app/assets/components/paper-dialog/README.md +0 -4
- data/app/assets/components/paper-dialog/bower.json +0 -10
- data/app/assets/components/paper-dialog/demo.html +0 -85
- data/app/assets/components/paper-dialog/index.html +0 -22
- data/app/assets/components/paper-dialog/paper-dialog.css +0 -52
- data/app/assets/components/paper-dropdown/README.md +0 -9
- data/app/assets/components/paper-dropdown/bower.json +0 -12
- data/app/assets/components/paper-dropdown/demo.html +0 -345
- data/app/assets/components/paper-dropdown/index.html +0 -22
- data/app/assets/components/paper-fab/README.md +0 -4
- data/app/assets/components/paper-fab/bower.json +0 -8
- data/app/assets/components/paper-fab/demo.html +0 -72
- data/app/assets/components/paper-fab/demo2.html +0 -103
- data/app/assets/components/paper-fab/index.html +0 -22
- data/app/assets/components/paper-fab/paper-fab.css +0 -36
- data/app/assets/components/paper-focusable/README.md +0 -4
- data/app/assets/components/paper-focusable/bower.json +0 -7
- data/app/assets/components/paper-focusable/demo.html +0 -155
- data/app/assets/components/paper-icon-button/README.md +0 -4
- data/app/assets/components/paper-icon-button/bower.json +0 -9
- data/app/assets/components/paper-icon-button/demo.html +0 -102
- data/app/assets/components/paper-icon-button/index.html +0 -22
- data/app/assets/components/paper-icon-button/paper-icon-button.css +0 -17
- data/app/assets/components/paper-icon-button/pulse-ink.css +0 -20
- data/app/assets/components/paper-input/README.md +0 -4
- data/app/assets/components/paper-input/bower.json +0 -11
- data/app/assets/components/paper-input/demo.html +0 -124
- data/app/assets/components/paper-input/index.html +0 -22
- data/app/assets/components/paper-item/README.md +0 -4
- data/app/assets/components/paper-item/bower.json +0 -9
- data/app/assets/components/paper-item/demo.html +0 -39
- data/app/assets/components/paper-item/index.html +0 -22
- data/app/assets/components/paper-item/paper-item.css +0 -43
- data/app/assets/components/paper-menu-button/README.md +0 -4
- data/app/assets/components/paper-menu-button/bower.json +0 -16
- data/app/assets/components/paper-menu-button/demo.html +0 -95
- data/app/assets/components/paper-menu-button/index.html +0 -22
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.css +0 -19
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.html +0 -123
- data/app/assets/components/paper-progress/README.md +0 -4
- data/app/assets/components/paper-progress/bower.json +0 -8
- data/app/assets/components/paper-progress/demo.html +0 -107
- data/app/assets/components/paper-progress/index.html +0 -22
- data/app/assets/components/paper-radio-button/README.md +0 -4
- data/app/assets/components/paper-radio-button/bower.json +0 -7
- data/app/assets/components/paper-radio-button/demo.html +0 -75
- data/app/assets/components/paper-radio-button/index.html +0 -22
- data/app/assets/components/paper-radio-group/README.md +0 -4
- data/app/assets/components/paper-radio-group/bower.json +0 -9
- data/app/assets/components/paper-radio-group/demo.html +0 -82
- data/app/assets/components/paper-radio-group/index.html +0 -22
- data/app/assets/components/paper-ripple/README.md +0 -4
- data/app/assets/components/paper-ripple/bower.json +0 -9
- data/app/assets/components/paper-ripple/demo.html +0 -418
- data/app/assets/components/paper-ripple/index.html +0 -22
- data/app/assets/components/paper-ripple/raw.html +0 -799
- data/app/assets/components/paper-shadow/README.md +0 -4
- data/app/assets/components/paper-shadow/bower.json +0 -7
- data/app/assets/components/paper-shadow/demo.html +0 -252
- data/app/assets/components/paper-shadow/index.html +0 -22
- data/app/assets/components/paper-slider/README.md +0 -4
- data/app/assets/components/paper-slider/bower.json +0 -9
- data/app/assets/components/paper-slider/demo.html +0 -151
- data/app/assets/components/paper-slider/index.html +0 -22
- data/app/assets/components/paper-tabs/README.md +0 -4
- data/app/assets/components/paper-tabs/bower.json +0 -12
- data/app/assets/components/paper-tabs/demo.html +0 -166
- data/app/assets/components/paper-tabs/index.html +0 -22
- data/app/assets/components/paper-toast/README.md +0 -4
- data/app/assets/components/paper-toast/bower.json +0 -10
- data/app/assets/components/paper-toast/demo.html +0 -67
- data/app/assets/components/paper-toast/index.html +0 -22
- data/app/assets/components/paper-toggle-button/README.md +0 -4
- data/app/assets/components/paper-toggle-button/bower.json +0 -8
- data/app/assets/components/paper-toggle-button/demo.html +0 -77
- data/app/assets/components/paper-toggle-button/index.html +0 -22
- data/app/assets/components/platform/README.md +0 -6
- data/app/assets/components/platform/bower.json +0 -16
- data/app/assets/components/platform/build.log +0 -35
- data/app/assets/components/platform/platform.js.map +0 -1
- data/app/assets/components/polymer/README.md +0 -17
- data/app/assets/components/polymer/bower.json +0 -8
- data/app/assets/components/polymer/build.log +0 -35
- data/app/assets/components/polymer/layout.html +0 -286
- data/app/assets/components/polymer/polymer.js +0 -14
- data/app/assets/components/polymer/polymer.js.map +0 -1
- data/app/assets/components/sampler-scaffold/README.md +0 -4
- data/app/assets/components/sampler-scaffold/bower.json +0 -12
- data/app/assets/components/sampler-scaffold/demo.html +0 -54
- data/app/assets/components/sampler-scaffold/demos/checkbox.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/color.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/radio.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/range.html +0 -20
- data/app/assets/components/sampler-scaffold/demos/string.html +0 -20
- data/app/assets/components/sampler-scaffold/index.html +0 -22
- data/app/assets/components/web-animations-js/COPYING +0 -202
- data/app/assets/components/web-animations-js/README.md +0 -237
- data/app/assets/components/web-animations-js/run-lint.sh +0 -19
- data/app/assets/components/web-animations-js/run-tests-android.sh +0 -25
- data/app/assets/components/web-animations-js/run-tests.sh +0 -15
- data/app/assets/components/web-animations-js/test/bootstrap.js +0 -1266
- data/app/assets/components/web-animations-js/test/img/error.png +0 -0
- data/app/assets/components/web-animations-js/test/img/success.png +0 -0
- data/app/assets/components/web-animations-js/test/img/unknown.png +0 -0
- data/app/assets/components/web-animations-js/test/perf/balls-add-compositing.html +0 -147
- data/app/assets/components/web-animations-js/test/perf/balls-replace-compositing.html +0 -144
- data/app/assets/components/web-animations-js/test/perf/perf.js +0 -158
- data/app/assets/components/web-animations-js/test/perf/updating-inline-style-during-animation.html +0 -165
- data/app/assets/components/web-animations-js/test/test-generator.html +0 -240
- data/app/assets/components/web-animations-js/test/test-results-post.html +0 -3
- data/app/assets/components/web-animations-js/test/test-runner.html +0 -810
- data/app/assets/components/web-animations-js/test/testcases.js +0 -93
- data/app/assets/components/web-animations-js/test/testcases/auto-test-box-shadow-checks.js +0 -42
- data/app/assets/components/web-animations-js/test/testcases/auto-test-box-shadow.html +0 -40
- data/app/assets/components/web-animations-js/test/testcases/auto-test-calc-checks.js +0 -41
- data/app/assets/components/web-animations-js/test/testcases/auto-test-calc.html +0 -156
- data/app/assets/components/web-animations-js/test/testcases/auto-test-change-playback-rate-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-circular-path-checks.js +0 -65
- data/app/assets/components/web-animations-js/test/testcases/auto-test-circular-path.html +0 -83
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color-checks.js +0 -101
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color-names-checks.js +0 -431
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color-names.html +0 -204
- data/app/assets/components/web-animations-js/test/testcases/auto-test-color.html +0 -117
- data/app/assets/components/web-animations-js/test/testcases/auto-test-composite-transforms-checks.js +0 -45
- data/app/assets/components/web-animations-js/test/testcases/auto-test-composite-transforms.html +0 -97
- data/app/assets/components/web-animations-js/test/testcases/auto-test-compositor-checks.js +0 -26
- data/app/assets/components/web-animations-js/test/testcases/auto-test-compositor.html +0 -68
- data/app/assets/components/web-animations-js/test/testcases/auto-test-delay-checks.js +0 -92
- data/app/assets/components/web-animations-js/test/testcases/auto-test-delay.html +0 -39
- data/app/assets/components/web-animations-js/test/testcases/auto-test-element-animate-checks.js +0 -8
- data/app/assets/components/web-animations-js/test/testcases/auto-test-element-animate.html +0 -30
- data/app/assets/components/web-animations-js/test/testcases/auto-test-fill-values-checks.js +0 -266
- data/app/assets/components/web-animations-js/test/testcases/auto-test-fill-values.html +0 -114
- data/app/assets/components/web-animations-js/test/testcases/auto-test-font-weight-checks.js +0 -26
- data/app/assets/components/web-animations-js/test/testcases/auto-test-font-weight.html +0 -43
- data/app/assets/components/web-animations-js/test/testcases/auto-test-initial-checks.js +0 -74
- data/app/assets/components/web-animations-js/test/testcases/auto-test-initial.html +0 -242
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-checks.js +0 -17
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-fallback-checks.js +0 -17
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-fallback.html +0 -78
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-methods-checks.js +0 -17
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style-methods.html +0 -70
- data/app/assets/components/web-animations-js/test/testcases/auto-test-inline-style.html +0 -69
- data/app/assets/components/web-animations-js/test/testcases/auto-test-integer-checks.js +0 -38
- data/app/assets/components/web-animations-js/test/testcases/auto-test-integer.html +0 -52
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iteration-start-checks.js +0 -506
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iteration-start.html +0 -160
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate-checks.js +0 -44
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate-holes-checks.js +0 -41
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate-holes.html +0 -48
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-alternate.html +0 -50
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-basic-checks.js +0 -162
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-basic.html +0 -116
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-fill-checks.js +0 -602
- data/app/assets/components/web-animations-js/test/testcases/auto-test-iterations-fill.html +0 -167
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-creation-checks.js +0 -67
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-creation.html +0 -109
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-easing-checks.js +0 -65
- data/app/assets/components/web-animations-js/test/testcases/auto-test-keyframe-easing.html +0 -64
- data/app/assets/components/web-animations-js/test/testcases/auto-test-length-units-checks.js +0 -342
- data/app/assets/components/web-animations-js/test/testcases/auto-test-length-units.html +0 -103
- data/app/assets/components/web-animations-js/test/testcases/auto-test-matrix-transforms-checks.js +0 -56
- data/app/assets/components/web-animations-js/test/testcases/auto-test-matrix-transforms.html +0 -90
- data/app/assets/components/web-animations-js/test/testcases/auto-test-motion-path-checks.js +0 -110
- data/app/assets/components/web-animations-js/test/testcases/auto-test-motion-path.html +0 -133
- data/app/assets/components/web-animations-js/test/testcases/auto-test-non-numeric-checks.js +0 -26
- data/app/assets/components/web-animations-js/test/testcases/auto-test-non-numeric.html +0 -42
- data/app/assets/components/web-animations-js/test/testcases/auto-test-parent-checks.js +0 -38
- data/app/assets/components/web-animations-js/test/testcases/auto-test-parent.html +0 -52
- data/app/assets/components/web-animations-js/test/testcases/auto-test-partial-keyframes-checks.js +0 -27
- data/app/assets/components/web-animations-js/test/testcases/auto-test-partial-keyframes.html +0 -43
- data/app/assets/components/web-animations-js/test/testcases/auto-test-path-checks.js +0 -20
- data/app/assets/components/web-animations-js/test/testcases/auto-test-path.html +0 -41
- data/app/assets/components/web-animations-js/test/testcases/auto-test-pause-checks.js +0 -79
- data/app/assets/components/web-animations-js/test/testcases/auto-test-pause.html +0 -82
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective-checks.js +0 -37
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective-origin-checks.js +0 -61
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective-origin.html +0 -94
- data/app/assets/components/web-animations-js/test/testcases/auto-test-perspective.html +0 -79
- data/app/assets/components/web-animations-js/test/testcases/auto-test-playback-rate-checks.js +0 -146
- data/app/assets/components/web-animations-js/test/testcases/auto-test-playback-rate.html +0 -128
- data/app/assets/components/web-animations-js/test/testcases/auto-test-position-list-type-checks.js +0 -73
- data/app/assets/components/web-animations-js/test/testcases/auto-test-rectangle-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-rectangle.html +0 -57
- data/app/assets/components/web-animations-js/test/testcases/auto-test-reparent-checks.js +0 -95
- data/app/assets/components/web-animations-js/test/testcases/auto-test-reparent.html +0 -60
- data/app/assets/components/web-animations-js/test/testcases/auto-test-seq-speed-checks.js +0 -69
- data/app/assets/components/web-animations-js/test/testcases/auto-test-seq-speed.html +0 -86
- data/app/assets/components/web-animations-js/test/testcases/auto-test-shorthand-checks.js +0 -197
- data/app/assets/components/web-animations-js/test/testcases/auto-test-shorthand.html +0 -115
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time-checks.js +0 -58
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time-iterations-checks.js +0 -92
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time-iterations.html +0 -107
- data/app/assets/components/web-animations-js/test/testcases/auto-test-start-time.html +0 -90
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-anim-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-anim.html +0 -39
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-circle-checks.js +0 -23
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-circle.html +0 -38
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-color-checks.js +0 -20
- data/app/assets/components/web-animations-js/test/testcases/auto-test-svg-color.html +0 -36
- data/app/assets/components/web-animations-js/test/testcases/auto-test-text-shadow-checks.js +0 -20
- data/app/assets/components/web-animations-js/test/testcases/auto-test-text-shadow.html +0 -37
- data/app/assets/components/web-animations-js/test/testcases/auto-test-timing-functions-checks.js +0 -89
- data/app/assets/components/web-animations-js/test/testcases/auto-test-timing-functions.html +0 -77
- data/app/assets/components/web-animations-js/test/testcases/auto-test-to-animation-checks.js +0 -58
- data/app/assets/components/web-animations-js/test/testcases/auto-test-to-animation.html +0 -83
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-3d-checks.js +0 -134
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-3d.html +0 -123
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-functions-checks.js +0 -160
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-functions.html +0 -158
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-origin-checks.js +0 -37
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-origin.html +0 -80
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-primitives-checks.js +0 -292
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-primitives.html +0 -97
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-units-checks.js +0 -202
- data/app/assets/components/web-animations-js/test/testcases/auto-test-transform-units.html +0 -98
- data/app/assets/components/web-animations-js/test/testcases/auto-test-visibility-checks.js +0 -54
- data/app/assets/components/web-animations-js/test/testcases/auto-test-visibility.html +0 -80
- data/app/assets/components/web-animations-js/test/testcases/auto-test-wrapping-bug-checks.js +0 -58
- data/app/assets/components/web-animations-js/test/testcases/auto-test-wrapping-bug.html +0 -60
- data/app/assets/components/web-animations-js/test/testcases/background.png +0 -0
- data/app/assets/components/web-animations-js/test/testcases/disabled-auto-test-change-playback-rate.html +0 -65
- data/app/assets/components/web-animations-js/test/testcases/disabled-auto-test-position-list-type.html +0 -103
- data/app/assets/components/web-animations-js/test/testcases/disabled-media.html +0 -439
- data/app/assets/components/web-animations-js/test/testcases/disabled-test-compositing-order.html +0 -112
- data/app/assets/components/web-animations-js/test/testcases/impl-test-deprecation.html +0 -85
- data/app/assets/components/web-animations-js/test/testcases/impl-test-from-css-value.html +0 -219
- data/app/assets/components/web-animations-js/test/testcases/impl-test-paced-timing-function.html +0 -83
- data/app/assets/components/web-animations-js/test/testcases/impl-test-totimelinetime.html +0 -37
- data/app/assets/components/web-animations-js/test/testcases/impl-unit-test-position-type.html +0 -256
- data/app/assets/components/web-animations-js/test/testcases/manual-test-add-player-onend.html +0 -57
- data/app/assets/components/web-animations-js/test/testcases/manual-test-preset-timings.html +0 -71
- data/app/assets/components/web-animations-js/test/testcases/manual-test-step.html +0 -88
- data/app/assets/components/web-animations-js/test/testcases/small.mp4 +0 -0
- data/app/assets/components/web-animations-js/test/testcases/small.webm +0 -0
- data/app/assets/components/web-animations-js/test/testcases/test-bounds.html +0 -69
- data/app/assets/components/web-animations-js/test/testcases/test-document-timeline.html +0 -53
- data/app/assets/components/web-animations-js/test/testcases/test-dynamic-load.html +0 -65
- data/app/assets/components/web-animations-js/test/testcases/test-fill-auto.html +0 -78
- data/app/assets/components/web-animations-js/test/testcases/test-getcurrent.html +0 -324
- data/app/assets/components/web-animations-js/test/testcases/test-keyframe-animation-effect.html +0 -248
- data/app/assets/components/web-animations-js/test/testcases/test-keyframe-composite-operation.html +0 -182
- data/app/assets/components/web-animations-js/test/testcases/test-null-target.html +0 -66
- data/app/assets/components/web-animations-js/test/testcases/test-pause-for-testing.html +0 -52
- data/app/assets/components/web-animations-js/test/testcases/test-player-addeventlistener.html +0 -161
- data/app/assets/components/web-animations-js/test/testcases/test-player-cleanup.html +0 -79
- data/app/assets/components/web-animations-js/test/testcases/test-player-finish-event.html +0 -101
- data/app/assets/components/web-animations-js/test/testcases/test-player-sort.html +0 -48
- data/app/assets/components/web-animations-js/test/testcases/test-player.html +0 -786
- data/app/assets/components/web-animations-js/test/testcases/test-pseudo-element-reference.html +0 -38
- data/app/assets/components/web-animations-js/test/testcases/test-repeated-pause.html +0 -54
- data/app/assets/components/web-animations-js/test/testcases/test-restart.html +0 -115
- data/app/assets/components/web-animations-js/test/testcases/test-reversed-player-active-phase.html +0 -28
- data/app/assets/components/web-animations-js/test/testcases/test-rotation-not-reversed.html +0 -55
- data/app/assets/components/web-animations-js/test/testcases/test-update-state.html +0 -113
- data/app/assets/components/web-animations-js/test/testcases/unit-test-clone.html +0 -80
- data/app/assets/components/web-animations-js/test/testcases/unit-test-delay.html +0 -66
- data/app/assets/components/web-animations-js/test/testcases/unit-test-dom-operations.html +0 -164
- data/app/assets/components/web-animations-js/test/testcases/unit-test-duration.html +0 -66
- data/app/assets/components/web-animations-js/test/testcases/unit-test-get-siblings.html +0 -112
- data/app/assets/components/web-animations-js/test/testcases/unit-test-modify-timing-params.html +0 -105
- data/app/assets/components/web-animations-js/test/testcases/unit-test-null-effect.html +0 -43
- data/app/assets/components/web-animations-js/test/testcases/unit-test-set-parent.html +0 -111
- data/app/assets/components/web-animations-js/test/testcases/unit-test-testharness-failure.html +0 -54
- data/app/assets/components/web-animations-js/test/testcases/unit-test-testharness.html +0 -248
- data/app/assets/components/web-animations-js/test/testcases/unit-test-unpause.html +0 -68
- data/app/assets/components/web-animations-js/test/testharness_timing.css +0 -75
- data/app/assets/components/web-animations-js/test/update-testcases.py +0 -63
- data/app/assets/components/web-animations-js/tools/android/config.sh +0 -8
- data/app/assets/components/web-animations-js/tools/android/setup.sh +0 -152
- data/app/assets/components/web-animations-js/tools/android/stop.sh +0 -20
- data/app/assets/components/web-animations-js/tools/python/requirements.txt +0 -12
- data/app/assets/components/web-animations-js/tools/python/run-tests.py +0 -813
- data/app/assets/components/web-animations-js/tools/python/setup.sh +0 -60
- data/app/assets/components/web-animations-js/tutorial/basic-animations/basic-animation-exercise-1.html +0 -62
- data/app/assets/components/web-animations-js/tutorial/basic-animations/basic-animation.html +0 -120
- data/app/assets/components/web-animations-js/tutorial/iframe-contents.html +0 -29
- data/app/assets/components/web-animations-js/tutorial/jquery.js +0 -9555
- data/app/assets/components/web-animations-js/tutorial/page-load.js +0 -114
- data/app/assets/components/web-animations-js/tutorial/parallel/parallel-exercise-1.html +0 -58
- data/app/assets/components/web-animations-js/tutorial/parallel/parallel.html +0 -101
- data/app/assets/components/web-animations-js/tutorial/sample-tutorial.html +0 -44
- data/app/assets/components/web-animations-js/tutorial/try-it-yourself.js +0 -216
- data/app/assets/components/web-animations-js/tutorial/tutorial-style.css +0 -344
- data/app/assets/components/web-animations-js/tutorial/tutorial-testing.js +0 -84
@@ -9,79 +9,146 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
9
9
|
|
10
10
|
<!--
|
11
11
|
@group Paper Elements
|
12
|
-
`paper-icon-button` is a button with an image placed at the center.
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
<paper-icon-button iconSrc="star.png"></paper-icon-button>
|
13
|
+
Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Buttons</a>
|
17
14
|
|
18
|
-
`paper-icon-button`
|
19
|
-
|
15
|
+
`paper-icon-button` is a button with an image placed at the center. When the user touches
|
16
|
+
the button, a ripple effect emanates from the center of the button.
|
20
17
|
|
21
|
-
|
18
|
+
`paper-icon-button` includes a default icon set. Use `icon` to specify which icon
|
19
|
+
from the icon set to use.
|
22
20
|
|
23
21
|
<paper-icon-button icon="menu"></paper-icon-button>
|
24
22
|
|
25
|
-
|
23
|
+
See [`core-iconset`](#core-iconset) for more information about
|
24
|
+
how to use a custom icon set.
|
26
25
|
|
27
26
|
Example:
|
28
27
|
|
29
|
-
<
|
28
|
+
<link href="path/to/core-icons/core-icons.html" rel="import">
|
29
|
+
|
30
|
+
<paper-icon-button icon="favorite"></paper-icon-button>
|
31
|
+
<paper-icon-button src="star.png"></paper-icon-button>
|
32
|
+
|
33
|
+
Styling
|
34
|
+
-------
|
35
|
+
|
36
|
+
Style the button with CSS as you would a normal DOM element. If you are using the icons
|
37
|
+
provided by `core-icons`, they will inherit the foreground color of the button.
|
38
|
+
|
39
|
+
/* make a red "favorite" button */
|
40
|
+
<paper-icon-button icon="favorite" style="color: red;"></paper-icon-button>
|
30
41
|
|
31
|
-
|
42
|
+
By default, the ripple is the same color as the foreground at 25% opacity. You may
|
43
|
+
customize the color using this selector:
|
44
|
+
|
45
|
+
/* make #my-button use a blue ripple instead of foreground color */
|
46
|
+
#my-button::shadow #ripple {
|
47
|
+
color: blue;
|
48
|
+
}
|
49
|
+
|
50
|
+
The opacity of the ripple is not customizable via CSS.
|
51
|
+
|
52
|
+
Accessibility
|
53
|
+
-------------
|
54
|
+
|
55
|
+
The button is accessible by default if you use the `icon` property. By default, the
|
56
|
+
`aria-label` attribute will be set to the `icon` property. If you use a custom icon,
|
57
|
+
you should ensure that the `aria-label` attribute is set.
|
58
|
+
|
59
|
+
<paper-icon-button src="star.png" aria-label="star"></paper-icon-button>
|
32
60
|
|
33
61
|
@element paper-icon-button
|
34
|
-
@extends paper-button
|
62
|
+
@extends paper-button-base
|
35
63
|
@homepage github.io
|
36
64
|
-->
|
37
65
|
|
66
|
+
<link href="../polymer/polymer.html" rel="import">
|
38
67
|
<link href="../core-icon/core-icon.html" rel="import">
|
39
|
-
<link href="../
|
68
|
+
<link href="../core-icons/core-icons.html" rel="import">
|
69
|
+
<link href="../paper-button/paper-button-base.html" rel="import">
|
70
|
+
<link href="../paper-ripple/paper-ripple.html" rel="import">
|
40
71
|
|
41
|
-
<polymer-element name="paper-icon-button" extends="paper-button" attributes="
|
72
|
+
<polymer-element name="paper-icon-button" extends="paper-button-base" attributes="src icon" role="button">
|
42
73
|
|
43
74
|
<template>
|
44
75
|
|
45
|
-
<
|
76
|
+
<style>
|
77
|
+
:host {
|
78
|
+
display: inline-block;
|
79
|
+
position: relative;
|
80
|
+
padding: 8px;
|
81
|
+
outline: none;
|
82
|
+
-webkit-user-select: none;
|
83
|
+
-moz-user-select: none;
|
84
|
+
-ms-user-select: none;
|
85
|
+
user-select: none;
|
86
|
+
cursor: pointer;
|
87
|
+
z-index: 0;
|
88
|
+
}
|
89
|
+
|
90
|
+
:host([disabled]) {
|
91
|
+
color: #c9c9c9;
|
92
|
+
pointer-events: none;
|
93
|
+
cursor: auto;
|
94
|
+
}
|
46
95
|
|
47
|
-
|
96
|
+
#ripple {
|
97
|
+
pointer-events: none;
|
98
|
+
z-index: -1;
|
99
|
+
}
|
100
|
+
|
101
|
+
#icon {
|
102
|
+
display: block;
|
103
|
+
pointer-events: none;
|
104
|
+
}
|
105
|
+
</style>
|
106
|
+
|
107
|
+
<!-- to position to ripple behind the icon -->
|
108
|
+
<core-icon relative id="icon" src="{{src}}" icon="{{icon}}"></core-icon>
|
48
109
|
|
49
110
|
</template>
|
50
111
|
|
51
112
|
<script>
|
52
|
-
|
53
|
-
Polymer('paper-icon-button', {
|
113
|
+
Polymer({
|
54
114
|
|
55
115
|
publish: {
|
56
116
|
|
57
117
|
/**
|
58
|
-
*
|
118
|
+
* The URL of an image for the icon. If the src property is specified,
|
119
|
+
* the icon property should not be.
|
59
120
|
*
|
60
|
-
* @attribute
|
61
|
-
* @type
|
62
|
-
* @default
|
121
|
+
* @attribute src
|
122
|
+
* @type string
|
123
|
+
* @default ''
|
63
124
|
*/
|
64
|
-
|
125
|
+
src: '',
|
65
126
|
|
66
|
-
|
127
|
+
/**
|
128
|
+
* Specifies the icon name or index in the set of icons available in
|
129
|
+
* the icon's icon set. If the icon property is specified,
|
130
|
+
* the src property should not be.
|
131
|
+
*
|
132
|
+
* @attribute icon
|
133
|
+
* @type string
|
134
|
+
* @default ''
|
135
|
+
*/
|
136
|
+
icon: '',
|
67
137
|
|
68
|
-
|
69
|
-
|
70
|
-
this.fillChanged();
|
71
|
-
},
|
138
|
+
recenteringTouch: true,
|
139
|
+
fill: false
|
72
140
|
|
73
|
-
fillChanged: function() {
|
74
|
-
this.$.ripple.classList.toggle('circle', !this.fill);
|
75
141
|
},
|
76
142
|
|
77
143
|
iconChanged: function(oldIcon) {
|
78
|
-
|
144
|
+
var label = this.getAttribute('aria-label');
|
145
|
+
if (!label || label === oldIcon) {
|
79
146
|
this.setAttribute('aria-label', this.icon);
|
80
147
|
}
|
81
148
|
}
|
82
149
|
|
83
150
|
});
|
84
|
-
|
151
|
+
|
85
152
|
</script>
|
86
|
-
|
153
|
+
|
87
154
|
</polymer-element>
|
@@ -12,12 +12,9 @@
|
|
12
12
|
<template>
|
13
13
|
<paper-input label="Type something..."></paper-input>
|
14
14
|
</template>
|
15
|
-
|
15
|
+
|
16
16
|
<template id="imports">
|
17
17
|
<link rel="import" href="paper-input.html">
|
18
18
|
</template>
|
19
19
|
|
20
|
-
<property name="validate" kind="string"></property>
|
21
|
-
<property name="error" kind="string"></property>
|
22
|
-
|
23
20
|
</x-meta>
|
@@ -0,0 +1,157 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
8
|
+
-->
|
9
|
+
|
10
|
+
<!--
|
11
|
+
`paper-autogrow-textarea` is an element containing a textarea that grows in height as more
|
12
|
+
lines of input are entered. Unless an explicit height or the `maxRows` property is set, it will
|
13
|
+
never scroll.
|
14
|
+
|
15
|
+
Example:
|
16
|
+
|
17
|
+
<paper-autogrow-textarea id="a1">
|
18
|
+
<textarea id="t1"></textarea>
|
19
|
+
<paper-autogrow-textarea>
|
20
|
+
|
21
|
+
Because the `textarea`'s `value` property is not observable, if you set the `value` imperatively
|
22
|
+
you must call `update` to notify this element the value has changed.
|
23
|
+
|
24
|
+
Example:
|
25
|
+
|
26
|
+
/* using example HTML above */
|
27
|
+
t1.value = 'some\ntext';
|
28
|
+
a1.update();
|
29
|
+
|
30
|
+
@group Paper Elements
|
31
|
+
@element paper-autogrow-textarea
|
32
|
+
@status unstable
|
33
|
+
-->
|
34
|
+
|
35
|
+
<link href="../polymer/polymer.html" rel="import">
|
36
|
+
|
37
|
+
<polymer-element name="paper-autogrow-textarea" on-input="{{inputAction}}">
|
38
|
+
<template>
|
39
|
+
|
40
|
+
<style>
|
41
|
+
:host {
|
42
|
+
display: inline-block;
|
43
|
+
position: relative;
|
44
|
+
width: 400px;
|
45
|
+
}
|
46
|
+
|
47
|
+
::content textarea {
|
48
|
+
padding: 0;
|
49
|
+
margin: 0;
|
50
|
+
border: none;
|
51
|
+
outline: none;
|
52
|
+
resize: none;
|
53
|
+
/* see comments in template */
|
54
|
+
width: 100%;
|
55
|
+
height: 100%;
|
56
|
+
}
|
57
|
+
|
58
|
+
::content textarea:invalid {
|
59
|
+
box-shadow: none;
|
60
|
+
}
|
61
|
+
</style>
|
62
|
+
|
63
|
+
<!-- the mirror sizes the input/textarea so it grows with typing -->
|
64
|
+
<div id="mirror" class="mirror-text" invisible aria-hidden="true"> </div>
|
65
|
+
|
66
|
+
<!-- size the input/textarea with a div, because the textarea has intrinsic size in ff -->
|
67
|
+
<div class="textarea-container" fit>
|
68
|
+
<content></content>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
</template>
|
72
|
+
<script>
|
73
|
+
|
74
|
+
Polymer({
|
75
|
+
|
76
|
+
publish: {
|
77
|
+
|
78
|
+
/**
|
79
|
+
* The textarea that should auto grow.
|
80
|
+
*
|
81
|
+
* @attribute target
|
82
|
+
* @type HTMLTextAreaElement
|
83
|
+
* @default null
|
84
|
+
*/
|
85
|
+
target: null,
|
86
|
+
|
87
|
+
/**
|
88
|
+
* The initial number of rows.
|
89
|
+
*
|
90
|
+
* @attribute rows
|
91
|
+
* @type number
|
92
|
+
* @default 1
|
93
|
+
*/
|
94
|
+
rows: 1,
|
95
|
+
|
96
|
+
/**
|
97
|
+
* The maximum number of rows this element can grow to until it
|
98
|
+
* scrolls. 0 means no maximum.
|
99
|
+
*
|
100
|
+
* @attribute maxRows
|
101
|
+
* @type number
|
102
|
+
* @default 0
|
103
|
+
*/
|
104
|
+
maxRows: 0
|
105
|
+
},
|
106
|
+
|
107
|
+
tokens: null,
|
108
|
+
|
109
|
+
observe: {
|
110
|
+
rows: 'updateCached',
|
111
|
+
maxRows: 'updateCached'
|
112
|
+
},
|
113
|
+
|
114
|
+
constrain: function(tokens) {
|
115
|
+
var _tokens;
|
116
|
+
tokens = tokens || [''];
|
117
|
+
// Enforce the min and max heights for a multiline input to avoid measurement
|
118
|
+
if (this.maxRows > 0 && tokens.length > this.maxRows) {
|
119
|
+
_tokens = tokens.slice(0, this.maxRows);
|
120
|
+
} else {
|
121
|
+
_tokens = tokens.slice(0);
|
122
|
+
}
|
123
|
+
while (this.rows > 0 && _tokens.length < this.rows) {
|
124
|
+
_tokens.push('');
|
125
|
+
}
|
126
|
+
return _tokens.join('<br>') + ' ';
|
127
|
+
},
|
128
|
+
|
129
|
+
valueForMirror: function(input) {
|
130
|
+
this.tokens = (input && input.value) ? input.value.replace(/&/gm, '&').replace(/"/gm, '"').replace(/'/gm, ''').replace(/</gm, '<').replace(/>/gm, '>').split('\n') : [''];
|
131
|
+
return this.constrain(this.tokens);
|
132
|
+
},
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Sizes this element to fit the input value. This function is automatically called
|
136
|
+
* when the user types in new input, but you must call this function if the value
|
137
|
+
* is updated imperatively.
|
138
|
+
*
|
139
|
+
* @method update
|
140
|
+
* @param Element The input
|
141
|
+
*/
|
142
|
+
update: function(input) {
|
143
|
+
this.$.mirror.innerHTML = this.valueForMirror(input);
|
144
|
+
},
|
145
|
+
|
146
|
+
updateCached: function() {
|
147
|
+
this.$.mirror.innerHTML = this.constrain(this.tokens);
|
148
|
+
},
|
149
|
+
|
150
|
+
inputAction: function(e) {
|
151
|
+
this.update(e.target);
|
152
|
+
}
|
153
|
+
|
154
|
+
});
|
155
|
+
|
156
|
+
</script>
|
157
|
+
</polymer-element>
|
@@ -12,43 +12,45 @@
|
|
12
12
|
display: inline-block;
|
13
13
|
outline: none;
|
14
14
|
text-align: inherit;
|
15
|
-
color: #757575;
|
16
15
|
padding: 0.75em 0;
|
17
16
|
}
|
18
17
|
|
19
|
-
|
20
|
-
:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
position: absolute;
|
25
|
-
top: 0;
|
26
|
-
left: 0;
|
27
|
-
bottom: 0;
|
28
|
-
right: 0;
|
18
|
+
polyfill-next-selector {
|
19
|
+
content: '.input-body > :not(.label):not(.cursor)';
|
20
|
+
}
|
21
|
+
::content > *,
|
22
|
+
::content > input[is="core-input"] {
|
29
23
|
padding: 0;
|
30
|
-
/* Important to use margin here so the margin remains visible
|
31
|
-
* when textarea scrolls internally. */
|
32
24
|
margin: 0.5em 0 0.25em;
|
25
|
+
width: 100%;
|
26
|
+
}
|
27
|
+
|
28
|
+
polyfill-next-selector {
|
29
|
+
content: 'input, textarea';
|
30
|
+
}
|
31
|
+
::content input,
|
32
|
+
::content input[is=core-input],
|
33
|
+
::content textarea {
|
34
|
+
font: inherit;
|
35
|
+
color: inherit;
|
33
36
|
background-color: transparent;
|
34
37
|
border: none;
|
35
38
|
outline: none;
|
36
|
-
width: 100%;
|
37
39
|
}
|
38
40
|
|
39
|
-
|
40
|
-
:
|
41
|
-
cursor: text;
|
41
|
+
polyfill-next-selector {
|
42
|
+
content: ':invalid';
|
42
43
|
}
|
43
|
-
|
44
|
-
|
45
|
-
textarea:invalid {
|
44
|
+
::content input:invalid,
|
45
|
+
::content textarea:invalid {
|
46
46
|
box-shadow: none;
|
47
47
|
}
|
48
48
|
|
49
|
-
|
49
|
+
polyfill-next-selector {
|
50
|
+
content: 'textarea';
|
51
|
+
}
|
52
|
+
::content textarea {
|
50
53
|
resize: none;
|
51
|
-
overflow: hidden;
|
52
54
|
}
|
53
55
|
|
54
56
|
[invisible] {
|
@@ -121,13 +123,11 @@ textarea {
|
|
121
123
|
}
|
122
124
|
|
123
125
|
:host([disabled]) .underline {
|
124
|
-
border-bottom: 1px dashed;
|
126
|
+
border-bottom: 1px dashed #757575;
|
125
127
|
}
|
126
128
|
|
127
129
|
.unfocused-underline {
|
128
130
|
height: 1px;
|
129
|
-
background: #757575;
|
130
|
-
border-bottom-color: #757575;
|
131
131
|
}
|
132
132
|
|
133
133
|
.focused-underline {
|
@@ -0,0 +1,468 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
8
|
+
-->
|
9
|
+
|
10
|
+
<!--
|
11
|
+
|
12
|
+
Material Design: <a href="http://www.google.com/design/spec/components/text-fields.html">Text fields</a>
|
13
|
+
|
14
|
+
`paper-input-decorator` adds Material Design input field styling and animations to an element.
|
15
|
+
|
16
|
+
Example:
|
17
|
+
|
18
|
+
<paper-input-decorator label="Your Name">
|
19
|
+
<input is="core-input">
|
20
|
+
</paper-input-decorator>
|
21
|
+
|
22
|
+
<paper-input-decorator floatingLabel label="Your address">
|
23
|
+
<textarea></textarea>
|
24
|
+
</paper-input-decorator>
|
25
|
+
|
26
|
+
Theming
|
27
|
+
-------
|
28
|
+
|
29
|
+
`paper-input-decorator` uses `core-style` for global theming. The following options are available:
|
30
|
+
|
31
|
+
- `CoreStyle.g.paperInput.labelColor` - The inline label, floating label, error message and error icon color when the input does not have focus.
|
32
|
+
- `CoreStyle.g.paperInput.focusedColor` - The floating label and the underline color when the input has focus.
|
33
|
+
- `CoreStyle.g.paperInput.cursorColor` - The cursor color during the focus animation. Typically this is the same as `focusedColor`.
|
34
|
+
- `CoreStyle.g.paperInput.invalidColor` - The error message, the error icon, the cursor, the floating label and the underline's color when the input is invalid and has focus.
|
35
|
+
|
36
|
+
To add custom styling to only some elements, use these selectors:
|
37
|
+
|
38
|
+
paper-input-decorator /deep/ .label-text,
|
39
|
+
paper-input-decorator /deep/ .error {
|
40
|
+
/* inline label, floating label, error message and error icon color when the input is unfocused */
|
41
|
+
color: green;
|
42
|
+
}
|
43
|
+
|
44
|
+
paper-input-decorator /deep/ ::-webkit-input-placeholder {
|
45
|
+
/* platform specific rules for placeholder text */
|
46
|
+
color: green;
|
47
|
+
}
|
48
|
+
paper-input-decorator /deep/ ::-moz-placeholder {
|
49
|
+
color: green;
|
50
|
+
}
|
51
|
+
paper-input-decorator /deep/ :-ms-input-placeholder {
|
52
|
+
color: green;
|
53
|
+
}
|
54
|
+
|
55
|
+
paper-input-decorator /deep/ .unfocused-underline {
|
56
|
+
/* line color when the input is unfocused */
|
57
|
+
background-color: green;
|
58
|
+
}
|
59
|
+
|
60
|
+
paper-input-decorator[focused] /deep/ .floating-label .label-text {
|
61
|
+
/* floating label color when the input is focused */
|
62
|
+
color: orange;
|
63
|
+
}
|
64
|
+
|
65
|
+
paper-input-decorator /deep/ .focused-underline {
|
66
|
+
/* line color when the input is focused */
|
67
|
+
background-color: orange;
|
68
|
+
}
|
69
|
+
|
70
|
+
paper-input-decorator /deep/ .cursor {
|
71
|
+
/* cursor color during the focus transition */
|
72
|
+
background-color: orange;
|
73
|
+
}
|
74
|
+
|
75
|
+
paper-input-decorator.invalid[focused] /deep/ .floated-label .label-text,
|
76
|
+
paper-input-decorator[focused] /deep/ .error {
|
77
|
+
/* floating label, error message nad error icon color when the input is invalid and focused */
|
78
|
+
color: salmon;
|
79
|
+
}
|
80
|
+
|
81
|
+
paper-input-decorator.invalid /deep/ .focused-underline,
|
82
|
+
paper-input-decorator.invalid /deep/ .cursor {
|
83
|
+
/* line and cursor color when the input is invalid and focused */
|
84
|
+
background-color: salmon;
|
85
|
+
}
|
86
|
+
|
87
|
+
Form submission
|
88
|
+
---------------
|
89
|
+
|
90
|
+
You can use inputs decorated with this element in a `form` as usual.
|
91
|
+
|
92
|
+
Accessibility
|
93
|
+
-------------
|
94
|
+
|
95
|
+
`paper-input-decorator` will automatically set the `aria-label` attribute on the nested input
|
96
|
+
to the value of `label`. Do not set the `placeholder` attribute on the nested input, as it will
|
97
|
+
conflict with this element.
|
98
|
+
|
99
|
+
@group Paper Elements
|
100
|
+
@element paper-input-decorator
|
101
|
+
@homepage github.io
|
102
|
+
-->
|
103
|
+
<link href="../polymer/polymer.html" rel="import">
|
104
|
+
<link href="../core-icon/core-icon.html" rel="import">
|
105
|
+
<link href="../core-icons/core-icons.html" rel="import">
|
106
|
+
<link href="../core-input/core-input.html" rel="import">
|
107
|
+
<link href="../core-style/core-style.html" rel="import">
|
108
|
+
|
109
|
+
<core-style id="paper-input-decorator">
|
110
|
+
|
111
|
+
.label-text,
|
112
|
+
.error {
|
113
|
+
color: {{g.paperInput.labelColor}};
|
114
|
+
}
|
115
|
+
|
116
|
+
::-webkit-input-placeholder {
|
117
|
+
color: {{g.paperInput.labelColor}};
|
118
|
+
}
|
119
|
+
|
120
|
+
::-moz-placeholder {
|
121
|
+
color: {{g.paperInput.labelColor}};
|
122
|
+
}
|
123
|
+
|
124
|
+
:-ms-input-placeholder {
|
125
|
+
color: {{g.paperInput.labelColor}};
|
126
|
+
}
|
127
|
+
|
128
|
+
.unfocused-underline {
|
129
|
+
background-color: {{g.paperInput.labelColor}};
|
130
|
+
}
|
131
|
+
|
132
|
+
:host([focused]) .floated-label .label-text {
|
133
|
+
color: {{g.paperInput.focusedColor}};
|
134
|
+
}
|
135
|
+
|
136
|
+
.focused-underline {
|
137
|
+
background-color: {{g.paperInput.focusedColor}};
|
138
|
+
}
|
139
|
+
|
140
|
+
.cursor {
|
141
|
+
background-color: {{g.paperInput.cursorColor}};
|
142
|
+
}
|
143
|
+
|
144
|
+
:host(.invalid) .floated-label .label-text,
|
145
|
+
.error {
|
146
|
+
color: {{g.paperInput.invalidColor}};
|
147
|
+
}
|
148
|
+
|
149
|
+
:host(.invalid) .unfocused-underline,
|
150
|
+
:host(.invalid) .focused-underline,
|
151
|
+
:host(.invalid) .cursor {
|
152
|
+
background-color: {{g.paperInput.invalidColor}};
|
153
|
+
}
|
154
|
+
|
155
|
+
</core-style>
|
156
|
+
|
157
|
+
<polymer-element name="paper-input-decorator" layout vertical
|
158
|
+
on-transitionEnd="{{transitionEndAction}}" on-webkitTransitionEnd="{{transitionEndAction}}"
|
159
|
+
on-input="{{inputAction}}"
|
160
|
+
on-down="{{downAction}}">
|
161
|
+
|
162
|
+
<template>
|
163
|
+
|
164
|
+
<link href="paper-input-decorator.css" rel="stylesheet">
|
165
|
+
<core-style ref="paper-input-decorator"></core-style>
|
166
|
+
|
167
|
+
<div class="floated-label" aria-hidden="true" hidden?="{{!floatingLabel}}" invisible?="{{!floatingLabelVisible || labelAnimated}}">
|
168
|
+
<!-- needed for floating label animation measurement -->
|
169
|
+
<span id="floatedLabelText" class="label-text">{{label}}</span>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
<div class="input-body" flex auto relative>
|
173
|
+
|
174
|
+
<div class="label" fit invisible aria-hidden="true">
|
175
|
+
<!-- needed for floating label animation measurement -->
|
176
|
+
<span id="labelText" class="label-text" invisible?="{{!_labelVisible}}" animated?="{{labelAnimated}}">{{label}}</span>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div class="cursor" invisible?="{{!cursorAnimated}}" animated?="{{cursorAnimated}}"></div>
|
180
|
+
|
181
|
+
<content></content>
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<div id="underline" class="underline" relative>
|
186
|
+
<div class="unfocused-underline" fit invisible?="{{disabled}}"></div>
|
187
|
+
<div id="focusedUnderline" class="focused-underline" fit invisible?="{{!focused}}" animated?="{{underlineAnimated}}"></div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
<div class="error" layout horizontal center hidden?="{{!isInvalid}}">
|
191
|
+
<div class="error-text" flex auto role="alert" aria-hidden="{{!isInvalid}}">{{error}}</div>
|
192
|
+
<core-icon class="error-icon" icon="warning"></core-icon>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
</template>
|
196
|
+
|
197
|
+
<script>
|
198
|
+
|
199
|
+
(function() {
|
200
|
+
|
201
|
+
var paperInput = CoreStyle.g.paperInput = CoreStyle.g.paperInput || {};
|
202
|
+
|
203
|
+
paperInput.labelColor = '#757575';
|
204
|
+
paperInput.cursorColor = '#4059a9';
|
205
|
+
paperInput.focusedColor = '#4059a9';
|
206
|
+
paperInput.invalidColor = '#d34336';
|
207
|
+
|
208
|
+
Polymer({
|
209
|
+
|
210
|
+
publish: {
|
211
|
+
|
212
|
+
/**
|
213
|
+
* The label for this input. It normally appears as grey text inside
|
214
|
+
* the text input and disappears once the user enters text.
|
215
|
+
*
|
216
|
+
* @attribute label
|
217
|
+
* @type string
|
218
|
+
* @default ''
|
219
|
+
*/
|
220
|
+
label: '',
|
221
|
+
|
222
|
+
/**
|
223
|
+
* If true, the label will "float" above the text input once the
|
224
|
+
* user enters text instead of disappearing.
|
225
|
+
*
|
226
|
+
* @attribute floatingLabel
|
227
|
+
* @type boolean
|
228
|
+
* @default false
|
229
|
+
*/
|
230
|
+
floatingLabel: false,
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Set to true to style the element as disabled.
|
234
|
+
*
|
235
|
+
* @attribute disabled
|
236
|
+
* @type boolean
|
237
|
+
* @default false
|
238
|
+
*/
|
239
|
+
disabled: {value: false, reflect: true},
|
240
|
+
|
241
|
+
/**
|
242
|
+
* Use this property to override the automatic label visibility.
|
243
|
+
* If this property is set to `true` or `false`, the label visibility
|
244
|
+
* will respect this value instead of be based on whether there is
|
245
|
+
* a non-null value in the input.
|
246
|
+
*
|
247
|
+
* @attribute labelVisible
|
248
|
+
* @type boolean
|
249
|
+
* @default false
|
250
|
+
*/
|
251
|
+
labelVisible: null,
|
252
|
+
|
253
|
+
/**
|
254
|
+
* Set this property to true to show the error message.
|
255
|
+
*
|
256
|
+
* @attribute isInvalid
|
257
|
+
* @type boolean
|
258
|
+
* @default false
|
259
|
+
*/
|
260
|
+
isInvalid: false,
|
261
|
+
|
262
|
+
/**
|
263
|
+
* The message to display if the input value fails validation. If this
|
264
|
+
* is unset or the empty string, a default message is displayed depending
|
265
|
+
* on the type of validation error.
|
266
|
+
*
|
267
|
+
* @attribute error
|
268
|
+
* @type string
|
269
|
+
*/
|
270
|
+
error: '',
|
271
|
+
|
272
|
+
focused: {value: false, reflect: true}
|
273
|
+
|
274
|
+
},
|
275
|
+
|
276
|
+
computed: {
|
277
|
+
floatingLabelVisible: 'floatingLabel && !_labelVisible',
|
278
|
+
_labelVisible: '(labelVisible === true || labelVisible === false) ? labelVisible : _autoLabelVisible'
|
279
|
+
},
|
280
|
+
|
281
|
+
ready: function() {
|
282
|
+
// Delegate focus/blur events
|
283
|
+
Polymer.addEventListener(this, 'focus', this.focusAction.bind(this), true);
|
284
|
+
Polymer.addEventListener(this, 'blur', this.blurAction.bind(this), true);
|
285
|
+
},
|
286
|
+
|
287
|
+
attached: function() {
|
288
|
+
this.input = this.querySelector('input,textarea');
|
289
|
+
|
290
|
+
this.mo = new MutationObserver(function() {
|
291
|
+
this.input = this.querySelector('input,textarea');
|
292
|
+
}.bind(this));
|
293
|
+
this.mo.observe(this, {childList: true});
|
294
|
+
},
|
295
|
+
|
296
|
+
detached: function() {
|
297
|
+
this.mo.disconnect();
|
298
|
+
this.mo = null;
|
299
|
+
},
|
300
|
+
|
301
|
+
prepareLabelTransform: function() {
|
302
|
+
var toRect = this.$.floatedLabelText.getBoundingClientRect();
|
303
|
+
var fromRect = this.$.labelText.getBoundingClientRect();
|
304
|
+
if (toRect.width !== 0) {
|
305
|
+
var sy = toRect.height / fromRect.height;
|
306
|
+
this.$.labelText.cachedTransform =
|
307
|
+
'scale3d(' + (toRect.width / fromRect.width) + ',' + sy + ',1) ' +
|
308
|
+
'translate3d(0,' + (toRect.top - fromRect.top) / sy + 'px,0)';
|
309
|
+
}
|
310
|
+
},
|
311
|
+
|
312
|
+
animateFloatingLabel: function() {
|
313
|
+
if (!this.floatingLabel || this.labelAnimated) {
|
314
|
+
return;
|
315
|
+
}
|
316
|
+
|
317
|
+
if (!this.$.labelText.cachedTransform) {
|
318
|
+
this.prepareLabelTransform();
|
319
|
+
}
|
320
|
+
|
321
|
+
// If there's still no cached transform, the input is invisible so don't
|
322
|
+
// do the animation.
|
323
|
+
if (!this.$.labelText.cachedTransform) {
|
324
|
+
return;
|
325
|
+
}
|
326
|
+
|
327
|
+
this.labelAnimated = true;
|
328
|
+
// Handle interrupted animation
|
329
|
+
this.async(function() {
|
330
|
+
this.transitionEndAction();
|
331
|
+
}, null, 250);
|
332
|
+
|
333
|
+
if (this._labelVisible) {
|
334
|
+
// Handle if the label started out floating
|
335
|
+
if (!this.$.labelText.style.webkitTransform && !this.$.labelText.style.transform) {
|
336
|
+
this.$.labelText.style.webkitTransform = this.$.labelText.cachedTransform;
|
337
|
+
this.$.labelText.style.transform = this.$.labelText.cachedTransform;
|
338
|
+
this.$.labelText.offsetTop;
|
339
|
+
}
|
340
|
+
this.$.labelText.style.webkitTransform = '';
|
341
|
+
this.$.labelText.style.transform = '';
|
342
|
+
} else {
|
343
|
+
this.$.labelText.style.webkitTransform = this.$.labelText.cachedTransform;
|
344
|
+
this.$.labelText.style.transform = this.$.labelText.cachedTransform;
|
345
|
+
this.input.placeholder = '';
|
346
|
+
}
|
347
|
+
|
348
|
+
},
|
349
|
+
|
350
|
+
_labelVisibleChanged: function(old) {
|
351
|
+
// do not do the animation on first render
|
352
|
+
if (old !== undefined) {
|
353
|
+
this.animateFloatingLabel();
|
354
|
+
}
|
355
|
+
},
|
356
|
+
|
357
|
+
labelChanged: function() {
|
358
|
+
if (this.input) {
|
359
|
+
this.updateInputLabel(this.input, this.label);
|
360
|
+
}
|
361
|
+
},
|
362
|
+
|
363
|
+
isInvalidChanged: function() {
|
364
|
+
this.classList.toggle('invalid', this.isInvalid);
|
365
|
+
},
|
366
|
+
|
367
|
+
focusedChanged: function() {
|
368
|
+
this.updateLabelVisibility(this.input && this.input.value);
|
369
|
+
},
|
370
|
+
|
371
|
+
inputChanged: function(old) {
|
372
|
+
if (this.input) {
|
373
|
+
this.updateLabelVisibility(this.input.value);
|
374
|
+
this.updateInputLabel(this.input, this.label);
|
375
|
+
}
|
376
|
+
if (old) {
|
377
|
+
this.updateInputLabel(old, '');
|
378
|
+
}
|
379
|
+
},
|
380
|
+
|
381
|
+
focusAction: function() {
|
382
|
+
this.focused = true;
|
383
|
+
},
|
384
|
+
|
385
|
+
blurAction: function(e) {
|
386
|
+
this.focused = false;
|
387
|
+
},
|
388
|
+
|
389
|
+
/**
|
390
|
+
* Updates the label visibility based on a value. This is handled automatically
|
391
|
+
* if the user is typing, but if you imperatively set the input value you need
|
392
|
+
* to call this function.
|
393
|
+
*
|
394
|
+
* @method updateLabelVisibility
|
395
|
+
* @param {string} value
|
396
|
+
*/
|
397
|
+
updateLabelVisibility: function(value) {
|
398
|
+
var v = (value !== null && value !== undefined) ? String(value) : value;
|
399
|
+
this._autoLabelVisible = (!this.focused && !v) || (!this.floatingLabel && !v);
|
400
|
+
},
|
401
|
+
|
402
|
+
updateInputLabel: function(input, label) {
|
403
|
+
if (this._labelVisible) {
|
404
|
+
this.input.placeholder = this.label;
|
405
|
+
} else {
|
406
|
+
this.input.placeholder = '';
|
407
|
+
}
|
408
|
+
if (label) {
|
409
|
+
input.setAttribute('aria-label', label);
|
410
|
+
} else {
|
411
|
+
input.removeAttribute('aria-label');
|
412
|
+
}
|
413
|
+
},
|
414
|
+
|
415
|
+
inputAction: function(e) {
|
416
|
+
this.updateLabelVisibility(e.target.value);
|
417
|
+
},
|
418
|
+
|
419
|
+
downAction: function(e) {
|
420
|
+
if (this.disabled) {
|
421
|
+
return;
|
422
|
+
}
|
423
|
+
|
424
|
+
if (this.focused) {
|
425
|
+
return;
|
426
|
+
}
|
427
|
+
|
428
|
+
if (this.input) {
|
429
|
+
this.input.focus();
|
430
|
+
e.preventDefault();
|
431
|
+
}
|
432
|
+
|
433
|
+
// The underline spills from the tap location
|
434
|
+
var rect = this.$.underline.getBoundingClientRect();
|
435
|
+
var right = e.x - rect.left;
|
436
|
+
this.$.focusedUnderline.style.mozTransformOrigin = right + 'px';
|
437
|
+
this.$.focusedUnderline.style.webkitTransformOrigin = right + 'px ';
|
438
|
+
this.$.focusedUnderline.style.transformOriginX = right + 'px';
|
439
|
+
|
440
|
+
// Animations only run when the user interacts with the input
|
441
|
+
this.underlineAnimated = true;
|
442
|
+
|
443
|
+
// Cursor animation only runs if the input is empty
|
444
|
+
if (this._labelVisible) {
|
445
|
+
this.cursorAnimated = true;
|
446
|
+
}
|
447
|
+
// Handle interrupted animation
|
448
|
+
this.async(function() {
|
449
|
+
this.transitionEndAction();
|
450
|
+
}, null, 250);
|
451
|
+
},
|
452
|
+
|
453
|
+
transitionEndAction: function() {
|
454
|
+
this.underlineAnimated = false;
|
455
|
+
this.cursorAnimated = false;
|
456
|
+
this.labelAnimated = false;
|
457
|
+
if (this._labelVisible) {
|
458
|
+
this.input.placeholder = this.label;
|
459
|
+
}
|
460
|
+
}
|
461
|
+
|
462
|
+
});
|
463
|
+
|
464
|
+
}());
|
465
|
+
|
466
|
+
</script>
|
467
|
+
|
468
|
+
</polymer-element>
|