polymer-paper-elements-rails 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +51 -0
  3. data/Rakefile +1 -0
  4. data/app/assets/components/iron-a11y-announcer/iron-a11y-announcer.html +125 -0
  5. data/app/assets/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html +418 -0
  6. data/app/assets/components/iron-autogrow-textarea/hero.svg +33 -0
  7. data/app/assets/components/iron-autogrow-textarea/iron-autogrow-textarea.html +263 -0
  8. data/app/assets/components/iron-behaviors/iron-button-state.html +195 -0
  9. data/app/assets/components/iron-behaviors/iron-control-state.html +102 -0
  10. data/app/assets/components/iron-fit-behavior/iron-fit-behavior.html +230 -0
  11. data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
  12. data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
  13. data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
  14. data/app/assets/components/iron-form-element-behavior/iron-form-element-behavior.html +50 -0
  15. data/app/assets/components/iron-icon/hero.svg +19 -0
  16. data/app/assets/components/iron-icon/iron-icon.html +187 -0
  17. data/app/assets/components/iron-icons/av-icons.html +73 -0
  18. data/app/assets/components/iron-icons/communication-icons.html +59 -0
  19. data/app/assets/components/iron-icons/device-icons.html +94 -0
  20. data/app/assets/components/iron-icons/editor-icons.html +70 -0
  21. data/app/assets/components/iron-icons/hardware-icons.html +61 -0
  22. data/app/assets/components/iron-icons/hero.svg +35 -0
  23. data/app/assets/components/iron-icons/image-icons.html +164 -0
  24. data/app/assets/components/iron-icons/iron-icons.html +303 -0
  25. data/app/assets/components/iron-icons/maps-icons.html +71 -0
  26. data/app/assets/components/iron-icons/notification-icons.html +62 -0
  27. data/app/assets/components/iron-icons/social-icons.html +40 -0
  28. data/app/assets/components/iron-iconset-svg/iron-iconset-svg.html +191 -0
  29. data/app/assets/components/iron-input/hero.svg +19 -0
  30. data/app/assets/components/iron-input/iron-input.html +235 -0
  31. data/app/assets/components/iron-media-query/hero.svg +29 -0
  32. data/app/assets/components/iron-media-query/iron-media-query.html +84 -0
  33. data/app/assets/components/iron-menu-behavior/iron-menu-behavior.html +214 -0
  34. data/app/assets/components/iron-menu-behavior/iron-menubar-behavior.html +65 -0
  35. data/app/assets/components/iron-meta/hero.svg +33 -0
  36. data/app/assets/components/iron-meta/iron-meta.html +352 -0
  37. data/app/assets/components/iron-overlay-behavior/iron-overlay-backdrop.html +132 -0
  38. data/app/assets/components/iron-overlay-behavior/iron-overlay-behavior.html +432 -0
  39. data/app/assets/components/iron-overlay-behavior/iron-overlay-manager.html +107 -0
  40. data/app/assets/components/iron-range-behavior/iron-range-behavior.html +101 -0
  41. data/app/assets/components/iron-resizable-behavior/iron-resizable-behavior.html +139 -0
  42. data/app/assets/components/iron-selector/iron-multi-selectable.html +120 -0
  43. data/app/assets/components/iron-selector/iron-selectable.html +307 -0
  44. data/app/assets/components/iron-selector/iron-selection.html +115 -0
  45. data/app/assets/components/iron-selector/iron-selector.html +71 -0
  46. data/app/assets/components/iron-validatable-behavior/iron-validatable-behavior.html +100 -0
  47. data/app/assets/components/neon-animation/animations/cascaded-animation.html +84 -0
  48. data/app/assets/components/neon-animation/animations/fade-in-animation.html +49 -0
  49. data/app/assets/components/neon-animation/animations/fade-out-animation.html +49 -0
  50. data/app/assets/components/neon-animation/animations/hero-animation.html +83 -0
  51. data/app/assets/components/neon-animation/animations/opaque-animation.html +46 -0
  52. data/app/assets/components/neon-animation/animations/ripple-animation.html +92 -0
  53. data/app/assets/components/neon-animation/animations/scale-down-animation.html +65 -0
  54. data/app/assets/components/neon-animation/animations/scale-up-animation.html +58 -0
  55. data/app/assets/components/neon-animation/animations/slide-down-animation.html +59 -0
  56. data/app/assets/components/neon-animation/animations/slide-from-left-animation.html +60 -0
  57. data/app/assets/components/neon-animation/animations/slide-from-right-animation.html +60 -0
  58. data/app/assets/components/neon-animation/animations/slide-left-animation.html +59 -0
  59. data/app/assets/components/neon-animation/animations/slide-right-animation.html +59 -0
  60. data/app/assets/components/neon-animation/animations/slide-up-animation.html +59 -0
  61. data/app/assets/components/neon-animation/animations/transform-animation.html +61 -0
  62. data/app/assets/components/neon-animation/guides/neon-animation.md +313 -0
  63. data/app/assets/components/neon-animation/neon-animatable-behavior.html +156 -0
  64. data/app/assets/components/neon-animation/neon-animatable.html +54 -0
  65. data/app/assets/components/neon-animation/neon-animated-pages.html +208 -0
  66. data/app/assets/components/neon-animation/neon-animation-behavior.html +88 -0
  67. data/app/assets/components/neon-animation/neon-animation-runner-behavior.html +110 -0
  68. data/app/assets/components/neon-animation/neon-animation.html +17 -0
  69. data/app/assets/components/neon-animation/neon-animations.html +25 -0
  70. data/app/assets/components/neon-animation/neon-shared-element-animatable-behavior.html +37 -0
  71. data/app/assets/components/neon-animation/neon-shared-element-animation-behavior.html +66 -0
  72. data/app/assets/components/neon-animation/web-animations.html +11 -0
  73. data/app/assets/components/paper-behaviors/paper-button-behavior.html +55 -0
  74. data/app/assets/components/paper-behaviors/paper-inky-focus-behavior.html +44 -0
  75. data/app/assets/components/paper-button/paper-button.html +177 -0
  76. data/app/assets/components/paper-checkbox/metadata.html +17 -0
  77. data/app/assets/components/paper-checkbox/paper-checkbox.css +149 -0
  78. data/app/assets/components/paper-checkbox/paper-checkbox.html +163 -0
  79. data/app/assets/components/paper-dialog-behavior/hero.svg +51 -0
  80. data/app/assets/components/paper-dialog-behavior/paper-dialog-behavior.html +236 -0
  81. data/app/assets/components/paper-dialog-behavior/paper-dialog-common.css +58 -0
  82. data/app/assets/components/paper-dialog-scrollable/hero.svg +69 -0
  83. data/app/assets/components/paper-dialog-scrollable/paper-dialog-scrollable.html +150 -0
  84. data/app/assets/components/paper-dialog/hero.svg +58 -0
  85. data/app/assets/components/paper-dialog/paper-dialog.html +122 -0
  86. data/app/assets/components/paper-drawer-panel/hero.svg +21 -0
  87. data/app/assets/components/paper-drawer-panel/paper-drawer-panel.css +142 -0
  88. data/app/assets/components/paper-drawer-panel/paper-drawer-panel.html +585 -0
  89. data/app/assets/components/paper-fab/paper-fab.html +159 -0
  90. data/app/assets/components/paper-header-panel/hero.svg +38 -0
  91. data/app/assets/components/paper-header-panel/paper-header-panel.html +496 -0
  92. data/app/assets/components/paper-icon-button/paper-icon-button.html +141 -0
  93. data/app/assets/components/paper-input/all-imports.html +12 -0
  94. data/app/assets/components/paper-input/hero.svg +19 -0
  95. data/app/assets/components/paper-input/paper-input-addon-behavior.html +43 -0
  96. data/app/assets/components/paper-input/paper-input-behavior.html +293 -0
  97. data/app/assets/components/paper-input/paper-input-char-counter.html +95 -0
  98. data/app/assets/components/paper-input/paper-input-container.html +495 -0
  99. data/app/assets/components/paper-input/paper-input-error.html +99 -0
  100. data/app/assets/components/paper-input/paper-input.html +126 -0
  101. data/app/assets/components/paper-input/paper-textarea.html +100 -0
  102. data/app/assets/components/paper-item/all-imports.html +13 -0
  103. data/app/assets/components/paper-item/paper-icon-item.html +86 -0
  104. data/app/assets/components/paper-item/paper-item-body.html +93 -0
  105. data/app/assets/components/paper-item/paper-item-shared.css +19 -0
  106. data/app/assets/components/paper-item/paper-item.html +95 -0
  107. data/app/assets/components/paper-material/paper-material.html +98 -0
  108. data/app/assets/components/paper-menu/hero.svg +35 -0
  109. data/app/assets/components/paper-menu/paper-menu.html +133 -0
  110. data/app/assets/components/paper-progress/hero.svg +21 -0
  111. data/app/assets/components/paper-progress/paper-progress.html +199 -0
  112. data/app/assets/components/paper-radio-button/hero.svg +22 -0
  113. data/app/assets/components/paper-radio-button/paper-radio-button.css +109 -0
  114. data/app/assets/components/paper-radio-button/paper-radio-button.html +148 -0
  115. data/app/assets/components/paper-radio-group/hero.svg +25 -0
  116. data/app/assets/components/paper-radio-group/paper-radio-group.html +186 -0
  117. data/app/assets/components/paper-ripple/hero.svg +30 -0
  118. data/app/assets/components/paper-ripple/paper-ripple.html +714 -0
  119. data/app/assets/components/paper-scroll-header-panel/hero.svg +41 -0
  120. data/app/assets/components/paper-scroll-header-panel/paper-scroll-header-panel.html +455 -0
  121. data/app/assets/components/paper-slider/hero.svg +20 -0
  122. data/app/assets/components/paper-slider/paper-slider.css +252 -0
  123. data/app/assets/components/paper-slider/paper-slider.html +449 -0
  124. data/app/assets/components/paper-spinner/hero.svg +27 -0
  125. data/app/assets/components/paper-spinner/paper-spinner.css +325 -0
  126. data/app/assets/components/paper-spinner/paper-spinner.html +222 -0
  127. data/app/assets/components/paper-styles/classes/global.html +96 -0
  128. data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
  129. data/app/assets/components/paper-styles/classes/shadow.html +39 -0
  130. data/app/assets/components/paper-styles/classes/typography.html +171 -0
  131. data/app/assets/components/paper-styles/color.html +333 -0
  132. data/app/assets/components/paper-styles/default-theme.html +39 -0
  133. data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
  134. data/app/assets/components/paper-styles/paper-styles.html +17 -0
  135. data/app/assets/components/paper-styles/shadow.html +61 -0
  136. data/app/assets/components/paper-styles/typography.html +240 -0
  137. data/app/assets/components/paper-tabs/hero.svg +23 -0
  138. data/app/assets/components/paper-tabs/paper-tab.html +158 -0
  139. data/app/assets/components/paper-tabs/paper-tabs-icons.html +18 -0
  140. data/app/assets/components/paper-tabs/paper-tabs.html +483 -0
  141. data/app/assets/components/paper-toast/hero.svg +20 -0
  142. data/app/assets/components/paper-toast/paper-toast.html +164 -0
  143. data/app/assets/components/paper-toggle-button/hero.svg +22 -0
  144. data/app/assets/components/paper-toggle-button/paper-toggle-button.css +108 -0
  145. data/app/assets/components/paper-toggle-button/paper-toggle-button.html +183 -0
  146. data/app/assets/components/paper-toolbar/paper-toolbar.html +375 -0
  147. data/app/assets/components/polymer-gestures/Gruntfile.js +60 -0
  148. data/app/assets/components/polymer-gestures/banner.txt +9 -0
  149. data/app/assets/components/polymer-gestures/build.json +17 -0
  150. data/app/assets/components/polymer-gestures/conf/karma.conf.js +39 -0
  151. data/app/assets/components/polymer-gestures/package.json +20 -0
  152. data/app/assets/components/polymer-gestures/polymer-gestures.html +21 -0
  153. data/app/assets/components/polymer-gestures/polymer-gestures.js +46 -0
  154. data/app/assets/components/polymer-gestures/src/dispatcher.js +474 -0
  155. data/app/assets/components/polymer-gestures/src/eventFactory.js +127 -0
  156. data/app/assets/components/polymer-gestures/src/hold.js +129 -0
  157. data/app/assets/components/polymer-gestures/src/mouse.js +135 -0
  158. data/app/assets/components/polymer-gestures/src/ms.js +80 -0
  159. data/app/assets/components/polymer-gestures/src/pinch.js +186 -0
  160. data/app/assets/components/polymer-gestures/src/platform-events.js +39 -0
  161. data/app/assets/components/polymer-gestures/src/pointer.js +68 -0
  162. data/app/assets/components/polymer-gestures/src/pointermap.js +67 -0
  163. data/app/assets/components/polymer-gestures/src/scope.js +10 -0
  164. data/app/assets/components/polymer-gestures/src/tap.js +103 -0
  165. data/app/assets/components/polymer-gestures/src/targetfind.js +244 -0
  166. data/app/assets/components/polymer-gestures/src/touch-action.js +60 -0
  167. data/app/assets/components/polymer-gestures/src/touch.js +341 -0
  168. data/app/assets/components/polymer-gestures/src/track.js +230 -0
  169. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
  170. data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
  171. data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
  172. data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
  173. data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
  174. data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
  175. data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
  176. data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
  177. data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
  178. data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
  179. data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
  180. data/app/assets/components/webcomponentsjs/package.json +31 -0
  181. data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
  182. data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
  183. data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
  184. data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
  185. data/lib/polymer-paper-elements-rails.rb +2 -0
  186. data/lib/polymer-paper-elements-rails/engine.rb +4 -0
  187. data/lib/polymer-paper-elements-rails/version.rb +3 -0
  188. metadata +272 -0
@@ -0,0 +1,159 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+
11
+ <link rel="import" href="../polymer/polymer.html">
12
+ <link rel="import" href="../iron-icon/iron-icon.html">
13
+ <link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
14
+ <link rel="import" href="../paper-styles/default-theme.html">
15
+ <link rel="import" href="../paper-styles/color.html">
16
+ <link rel="import" href="../paper-material/paper-material.html">
17
+ <link rel="import" href="../paper-ripple/paper-ripple.html">
18
+ <link rel="import" href="../paper-behaviors/paper-button-behavior.html">
19
+
20
+ <!--
21
+ Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Button</a>
22
+
23
+ `paper-fab` is a floating action button. It contains an image placed in the center and
24
+ comes in two sizes: regular size and a smaller size by applying the attribute `mini`. When
25
+ the user touches the button, a ripple effect emanates from the center of the button.
26
+
27
+ You may import `iron-icons` to use with this element, or provide a URL to a custom icon.
28
+ See `iron-iconset` for more information about how to use a custom icon set.
29
+
30
+ Example:
31
+
32
+ <link href="path/to/iron-icons/iron-icons.html" rel="import">
33
+
34
+ <paper-fab icon="add"></paper-fab>
35
+ <paper-fab mini icon="favorite"></paper-fab>
36
+ <paper-fab src="star.png"></paper-fab>
37
+
38
+
39
+ ### Styling
40
+
41
+ The following custom properties and mixins are available for styling:
42
+
43
+ Custom property | Description | Default
44
+ ----------------|-------------|----------
45
+ `--paper-fab-background` | The background color of the button | `--paper-indigo-500`
46
+ `--paper-fab-disabled-background` | The background color of the button when it's disabled | `--paper-grey-300`
47
+ `--paper-fab-disabled-text` | The text color of the button when it's disabled | `--paper-grey-500`
48
+ `--paper-fab` | Mixin applied to the button | `{}`
49
+ `--paper-fab-mini` | Mixin applied to a mini button | `{}`
50
+ `--paper-fab-disabled` | Mixin applied to a disabled button | `{}`
51
+
52
+ @group Paper Elements
53
+ @demo demo/index.html
54
+
55
+ -->
56
+
57
+ <dom-module id="paper-fab">
58
+ <style>
59
+
60
+ :host {
61
+ display: inline-block;
62
+ position: relative;
63
+ outline: none;
64
+ -moz-user-select: none;
65
+ -ms-user-select: none;
66
+ -webkit-user-select: none;
67
+ user-select: none;
68
+ cursor: pointer;
69
+
70
+ box-sizing: border-box;
71
+ min-width: 0;
72
+ width: 56px;
73
+ height: 56px;
74
+ background: var(--paper-fab-background, --paper-indigo-500);
75
+ color: var(--text-primary-color);
76
+ border-radius: 50%;
77
+ padding: 16px;
78
+
79
+ z-index: 0;
80
+
81
+ @apply(--paper-fab);
82
+ }
83
+
84
+ :host([mini]) {
85
+ width: 40px;
86
+ height: 40px;
87
+ padding: 8px;
88
+
89
+ @apply(--paper-fab-mini);
90
+ }
91
+
92
+ :host([disabled]) {
93
+ color: var(--paper-fab-disabled-text, --paper-grey-500);
94
+ background: var(--paper-fab-disabled-background, --paper-grey-300);
95
+ @apply(--paper-fab-disabled);
96
+ }
97
+
98
+ paper-material {
99
+ border-radius: inherit;
100
+ }
101
+ </style>
102
+ <template>
103
+ <paper-ripple></paper-ripple>
104
+ <paper-material class="content fit flex layout vertical center-center" elevation="[[elevation]]" animated>
105
+ <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
106
+ </paper-material>
107
+ </template>
108
+ </dom-module>
109
+ <script>
110
+ Polymer({
111
+ is: 'paper-fab',
112
+
113
+ behaviors: [
114
+ Polymer.PaperButtonBehavior
115
+ ],
116
+
117
+ properties: {
118
+ /**
119
+ * The URL of an image for the icon. If the src property is specified,
120
+ * the icon property should not be.
121
+ *
122
+ * @attribute src
123
+ * @type string
124
+ * @default ''
125
+ */
126
+ src: {
127
+ type: String,
128
+ value: ''
129
+ },
130
+
131
+ /**
132
+ * Specifies the icon name or index in the set of icons available in
133
+ * the icon's icon set. If the icon property is specified,
134
+ * the src property should not be.
135
+ *
136
+ * @attribute icon
137
+ * @type string
138
+ * @default ''
139
+ */
140
+ icon: {
141
+ type: String,
142
+ value: ''
143
+ },
144
+
145
+ /**
146
+ * Set this to true to style this is a "mini" FAB.
147
+ *
148
+ * @attribute mini
149
+ * @type boolean
150
+ * @default false
151
+ */
152
+ mini: {
153
+ type: Boolean,
154
+ value: false
155
+ }
156
+ }
157
+
158
+ });
159
+ </script>
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
6
+ <g id="background" display="none">
7
+ <rect display="inline" fill="#B0BEC5" width="225" height="126"/>
8
+ </g>
9
+ <g id="label">
10
+ </g>
11
+ <g id="art">
12
+ <path d="M163,102H73V24h90V102z M75,100h86V26H75V100z"/>
13
+ <g>
14
+ <polygon points="74,59.6 74,62.5 74.5,63 77.4,63 "/>
15
+ <polygon points="74,51.9 74,54.7 82.3,63 85.1,63 "/>
16
+ <polygon points="74,44.1 74,46.9 90.1,63 92.9,63 "/>
17
+ <polygon points="74,36.3 74,39.2 97.8,63 100.7,63 "/>
18
+ <polygon points="74,28.6 74,31.4 105.6,63 108.4,63 "/>
19
+ <polygon points="78.2,25 75.4,25 113.4,63 116.2,63 "/>
20
+ <polygon points="86,25 83.1,25 121.1,63 124,63 "/>
21
+ <polygon points="93.7,25 90.9,25 128.9,63 131.7,63 "/>
22
+ <polygon points="101.5,25 98.7,25 136.7,63 139.5,63 "/>
23
+ <polygon points="109.2,25 106.4,25 144.4,63 147.2,63 "/>
24
+ <polygon points="117,25 114.2,25 152.2,63 155,63 "/>
25
+ <polygon points="124.8,25 122,25 160,63 162,63 162,62.2 "/>
26
+ <polygon points="132.5,25 129.7,25 162,57.3 162,54.5 "/>
27
+ <polygon points="140.3,25 137.5,25 162,49.5 162,46.7 "/>
28
+ <polygon points="148.1,25 145.2,25 162,41.8 162,38.9 "/>
29
+ <polygon points="155.8,25 153,25 162,34 162,31.2 "/>
30
+ <polygon points="162,26.2 162,25 160.8,25 "/>
31
+ </g>
32
+ <rect x="74" y="62" width="88" height="2"/>
33
+ <g id="ic_x5F_add_x0D_">
34
+ </g>
35
+ </g>
36
+ <g id="Guides">
37
+ </g>
38
+ </svg>
@@ -0,0 +1,496 @@
1
+ <!--
2
+ Copyright (c) 2015 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.txt
4
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
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.txt
8
+ -->
9
+
10
+ <link rel="import" href="../polymer/polymer.html">
11
+ <link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
12
+
13
+ <!--
14
+ `paper-header-panel` contains a header section and a content panel section.
15
+
16
+ __Important:__ The `paper-header-panel` will not display if its parent does not have a height.
17
+
18
+ Using layout classes, you can make the `paper-header-panel` fill the screen
19
+
20
+ <body class="fullbleed layout vertical">
21
+ <paper-header-panel class="flex">
22
+ <paper-toolbar>
23
+ <div>Hello World!</div>
24
+ </paper-toolbar>
25
+ </paper-header-panel>
26
+ </body>
27
+
28
+ Special support is provided for scrolling modes when one uses a paper-toolbar or equivalent for the
29
+ header section.
30
+
31
+ Example:
32
+
33
+ <paper-header-panel>
34
+ <paper-toolbar>Header</paper-toolbar>
35
+ <div>Content goes here...</div>
36
+ </paper-header-panel>
37
+
38
+ If you want to use other than `paper-toolbar` for the header, add `paper-header` class to that
39
+ element.
40
+
41
+ Example:
42
+
43
+ <paper-header-panel>
44
+ <div class="paper-header">Header</div>
45
+ <div>Content goes here...</div>
46
+ </paper-header-panel>
47
+
48
+ To have the content fit to the main area, use the `fit` class.
49
+
50
+ <paper-header-panel>
51
+ <div class="paper-header">standard</div>
52
+ <div class="fit">content fits 100% below the header</div>
53
+ </paper-header-panel>
54
+
55
+ Modes
56
+
57
+ Controls header and scrolling behavior. Options are `standard`, `seamed`, `waterfall`, `waterfall-tall`, `scroll` and
58
+ `cover`. Default is `standard`.
59
+
60
+ Mode | Description
61
+ ----------------|-------------
62
+ `standard` | The header is a step above the panel. The header will consume the panel at the point of entry, preventing it from passing through to the opposite side.
63
+ `seamed` | The header is presented as seamed with the panel.
64
+ `waterfall` | Similar to standard mode, but header is initially presented as seamed with panel, but then separates to form the step.
65
+ `waterfall-tall` | The header is initially taller (`tall` class is added to the header). As the user scrolls, the header separates (forming an edge) while condensing (`tall` class is removed from the header).
66
+ `scroll` | The header keeps its seam with the panel, and is pushed off screen.
67
+ `cover` | The panel covers the whole `paper-header-panel` including the header. This allows user to style the panel in such a way that the panel is partially covering the header.
68
+
69
+ Example:
70
+
71
+ <paper-header-panel mode="waterfall">
72
+ <div class="paper-header">standard</div>
73
+ <div class="content fit">content fits 100% below the header</div>
74
+ </paper-header-panel>
75
+
76
+
77
+ Styling header panel:
78
+
79
+ To change the shadow that shows up underneath the header:
80
+
81
+ paper-header-panel {
82
+ --paper-header-panel-shadow: {
83
+ height: 6px;
84
+ bottom: -6px;
85
+ box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
86
+ };
87
+ }
88
+
89
+ To change the panel container in different modes:
90
+
91
+ paper-slider {
92
+ --paper-header-panel-standard-container: {
93
+ border: 1px solid gray;
94
+ };
95
+
96
+ --paper-header-panel-cover-container: {
97
+ border: 1px solid gray;
98
+ };
99
+
100
+ --paper-header-panel-waterfall-container: {
101
+ border: 1px solid gray;
102
+ };
103
+
104
+ --paper-header-panel-waterfall-tall-container: {
105
+ border: 1px solid gray;
106
+ };
107
+ }
108
+
109
+ @group Paper Elements
110
+ @element paper-header-panel
111
+ @demo demo/index.html
112
+ @hero hero.svg
113
+ -->
114
+
115
+ <dom-module id="paper-header-panel">
116
+
117
+ <style>
118
+ :host {
119
+ @apply(--layout);
120
+ @apply(--layout-vertical);
121
+
122
+ display: block;
123
+ position: relative;
124
+ height: 100%;
125
+
126
+ /* Create a stack context, we will need it for the shadow*/
127
+ z-index: 0;
128
+ }
129
+
130
+ #mainContainer {
131
+ @apply(--layout-flex);
132
+
133
+ position: relative;
134
+ overflow-y: auto;
135
+ overflow-x: hidden;
136
+ -webkit-overflow-scrolling: touch;
137
+ flex-basis: 0.0001px;
138
+ }
139
+
140
+ /*
141
+ * mode: scroll
142
+ */
143
+ :host([mode=scroll]) #mainContainer {
144
+ @apply(--paper-header-panel-scroll-container);
145
+ overflow: visible;
146
+ }
147
+
148
+ :host([mode=scroll]) {
149
+ overflow-y: auto;
150
+ overflow-x: hidden;
151
+ -webkit-overflow-scrolling: touch;
152
+ }
153
+
154
+ /*
155
+ * mode: cover
156
+ */
157
+ :host([mode=cover]) #mainContainer {
158
+ @apply(--paper-header-panel-cover-container);
159
+ position: absolute;
160
+ top: 0;
161
+ right: 0;
162
+ bottom: 0;
163
+ left: 0;
164
+ }
165
+
166
+ /*
167
+ * mode: standard
168
+ */
169
+ :host([mode=standard]) #mainContainer {
170
+ @apply(--paper-header-panel-standard-container);
171
+ }
172
+
173
+ /*
174
+ * mode: waterfall
175
+ */
176
+ :host([mode=waterfall]) #mainContainer {
177
+ @apply(--paper-header-panel-waterfall-container);
178
+ }
179
+
180
+ /*
181
+ * mode: waterfall-tall
182
+ */
183
+ :host([mode=waterfall-tall]) #mainContainer {
184
+ @apply(--paper-header-panel-waterfall-tall-container);
185
+ }
186
+
187
+ :host ::content paper-toolbar,
188
+ :host ::content .paper-header {
189
+ position: relative;
190
+ overflow: visible !important;
191
+ }
192
+
193
+ :host ::content paper-toolbar:after,
194
+ :host ::content .paper-header:after {
195
+ @apply(--paper-header-panel-shadow);
196
+
197
+ -webkit-transition: opacity 0.5s, -webkit-transform 0.5s;
198
+ transition: opacity 0.5s, transform 0.5s;
199
+
200
+ opacity: 0;
201
+ content: "";
202
+
203
+ width: 100%;
204
+ position: absolute;
205
+ left: 0px;
206
+ right: 0px;
207
+ z-index: 1;
208
+
209
+ -webkit-transform: scale3d(1, 0, 1);
210
+ -webkit-transform-origin: 0% 0%;
211
+
212
+ transform: scale3d(1, 0, 1);
213
+ transform-origin: 0% 0%;
214
+ }
215
+
216
+ :host ::content paper-toolbar.has-shadow:after,
217
+ :host ::content .paper-header.has-shadow:after {
218
+ opacity: 1;
219
+ -webkit-transform: scale3d(1, 1, 1);
220
+ transform: scale3d(1, 1, 1);
221
+ }
222
+ </style>
223
+
224
+ <template>
225
+ <content id="headerContent" select="paper-toolbar, .paper-header"></content>
226
+ <div id="mainContainer" class$="[[_computeMainContainerClass(mode)]]">
227
+ <content id="mainContent" select="*"></content>
228
+ </div>
229
+ </template>
230
+
231
+ </dom-module>
232
+
233
+ <style is="custom-style">
234
+ :root {
235
+ /**
236
+ * Default paper header panel shadow
237
+ */
238
+ --paper-header-panel-shadow: {
239
+ height: 6px;
240
+ bottom: -6px;
241
+ box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
242
+ };
243
+ }
244
+ </style>
245
+
246
+ <script>
247
+
248
+ (function() {
249
+
250
+ 'use strict';
251
+
252
+ var SHADOW_WHEN_SCROLLING = 1;
253
+ var SHADOW_ALWAYS = 2;
254
+
255
+
256
+ var MODE_CONFIGS = {
257
+
258
+ outerScroll: {
259
+ scroll: true
260
+ },
261
+
262
+ shadowMode: {
263
+ standard: SHADOW_ALWAYS,
264
+ waterfall: SHADOW_WHEN_SCROLLING,
265
+ 'waterfall-tall': SHADOW_WHEN_SCROLLING
266
+ },
267
+
268
+ tallMode: {
269
+ 'waterfall-tall': true
270
+ }
271
+ };
272
+
273
+ Polymer({
274
+
275
+ is: 'paper-header-panel',
276
+
277
+ /**
278
+ * Fired when the content has been scrolled. `event.detail.target` returns
279
+ * the scrollable element which you can use to access scroll info such as
280
+ * `scrollTop`.
281
+ *
282
+ * <paper-header-panel on-content-scroll="{{scrollHandler}}">
283
+ * ...
284
+ * </paper-header-panel>
285
+ *
286
+ *
287
+ * scrollHandler: function(event) {
288
+ * var scroller = event.detail.target;
289
+ * console.log(scroller.scrollTop);
290
+ * }
291
+ *
292
+ * @event content-scroll
293
+ */
294
+
295
+ properties: {
296
+
297
+ /**
298
+ * Controls header and scrolling behavior. Options are
299
+ * `standard`, `seamed`, `waterfall`, `waterfall-tall`, `scroll` and
300
+ * `cover`. Default is `standard`.
301
+ *
302
+ * `standard`: The header is a step above the panel. The header will consume the
303
+ * panel at the point of entry, preventing it from passing through to the
304
+ * opposite side.
305
+ *
306
+ * `seamed`: The header is presented as seamed with the panel.
307
+ *
308
+ * `waterfall`: Similar to standard mode, but header is initially presented as
309
+ * seamed with panel, but then separates to form the step.
310
+ *
311
+ * `waterfall-tall`: The header is initially taller (`tall` class is added to
312
+ * the header). As the user scrolls, the header separates (forming an edge)
313
+ * while condensing (`tall` class is removed from the header).
314
+ *
315
+ * `scroll`: The header keeps its seam with the panel, and is pushed off screen.
316
+ *
317
+ * `cover`: The panel covers the whole `paper-header-panel` including the
318
+ * header. This allows user to style the panel in such a way that the panel is
319
+ * partially covering the header.
320
+ *
321
+ * <paper-header-panel mode="cover">
322
+ * <paper-toolbar class="tall">
323
+ * <core-icon-button icon="menu"></core-icon-button>
324
+ * </paper-toolbar>
325
+ * <div class="content"></div>
326
+ * </paper-header-panel>
327
+ */
328
+ mode: {
329
+ type: String,
330
+ value: 'standard',
331
+ observer: '_modeChanged',
332
+ reflectToAttribute: true
333
+ },
334
+
335
+ /**
336
+ * If true, the drop-shadow is always shown no matter what mode is set to.
337
+ */
338
+ shadow: {
339
+ type: Boolean,
340
+ value: false
341
+ },
342
+
343
+ /**
344
+ * The class used in waterfall-tall mode. Change this if the header
345
+ * accepts a different class for toggling height, e.g. "medium-tall"
346
+ */
347
+ tallClass: {
348
+ type: String,
349
+ value: 'tall'
350
+ },
351
+
352
+ /**
353
+ * If true, the scroller is at the top
354
+ */
355
+ atTop: {
356
+ type: Boolean,
357
+ value: true,
358
+ readOnly: true
359
+ }
360
+ },
361
+
362
+ observers: [
363
+ '_computeDropShadowHidden(atTop, mode, shadow)'
364
+ ],
365
+
366
+ ready: function() {
367
+ this.scrollHandler = this._scroll.bind(this);
368
+ this._addListener();
369
+
370
+ // Run `scroll` logic once to initialze class names, etc.
371
+ this._keepScrollingState();
372
+ },
373
+
374
+ detached: function() {
375
+ this._removeListener();
376
+ },
377
+
378
+ /**
379
+ * Returns the header element
380
+ *
381
+ * @property header
382
+ * @type Object
383
+ */
384
+ get header() {
385
+ return Polymer.dom(this.$.headerContent).getDistributedNodes()[0];
386
+ },
387
+
388
+ /**
389
+ * Returns the scrollable element.
390
+ *
391
+ * @property scroller
392
+ * @type Object
393
+ */
394
+ get scroller() {
395
+ return this._getScrollerForMode(this.mode);
396
+ },
397
+
398
+ /**
399
+ * Returns true if the scroller has a visible shadow.
400
+ *
401
+ * @property visibleShadow
402
+ * @type Boolean
403
+ */
404
+ get visibleShadow() {
405
+ return this.header.classList.contains('has-shadow');
406
+ },
407
+
408
+ _computeDropShadowHidden: function(atTop, mode, shadow) {
409
+
410
+ var shadowMode = MODE_CONFIGS.shadowMode[mode];
411
+
412
+ if (this.shadow) {
413
+ this.toggleClass('has-shadow', true, this.header);
414
+
415
+ } else if (shadowMode === SHADOW_ALWAYS) {
416
+ this.toggleClass('has-shadow', true, this.header);
417
+
418
+ } else if (shadowMode === SHADOW_WHEN_SCROLLING && !atTop) {
419
+ this.toggleClass('has-shadow', true, this.header);
420
+
421
+ } else {
422
+ this.toggleClass('has-shadow', false, this.header);
423
+
424
+ }
425
+ },
426
+
427
+ _computeMainContainerClass: function(mode) {
428
+ // TODO: It will be useful to have a utility for classes
429
+ // e.g. Polymer.Utils.classes({ foo: true });
430
+
431
+ var classes = {};
432
+
433
+ classes['flex'] = mode !== 'cover';
434
+
435
+ return Object.keys(classes).filter(
436
+ function(className) {
437
+ return classes[className];
438
+ }).join(' ');
439
+ },
440
+
441
+ _addListener: function() {
442
+ this.scroller.addEventListener('scroll', this.scrollHandler, false);
443
+ },
444
+
445
+ _removeListener: function() {
446
+ this.scroller.removeEventListener('scroll', this.scrollHandler);
447
+ },
448
+
449
+ _modeChanged: function(newMode, oldMode) {
450
+ var configs = MODE_CONFIGS;
451
+ var header = this.header;
452
+ var animateDuration = 200;
453
+
454
+ if (header) {
455
+ // in tallMode it may add tallClass to the header; so do the cleanup
456
+ // when mode is changed from tallMode to not tallMode
457
+ if (configs.tallMode[oldMode] && !configs.tallMode[newMode]) {
458
+ header.classList.remove(this.tallClass);
459
+ this.async(function() {
460
+ header.classList.remove('animate');
461
+ }, null, animateDuration);
462
+ } else {
463
+ header.classList.toggle('animate', configs.tallMode[newMode]);
464
+ }
465
+ }
466
+ this._keepScrollingState();
467
+ },
468
+
469
+ _keepScrollingState: function () {
470
+ var main = this.scroller;
471
+ var header = this.header;
472
+
473
+ this._setAtTop(main.scrollTop === 0);
474
+
475
+ if (header && MODE_CONFIGS.tallMode[this.mode]) {
476
+ this.toggleClass(this.tallClass, this.atTop ||
477
+ header.classList.contains(this.tallClass) &&
478
+ main.scrollHeight < this.offsetHeight, header);
479
+ }
480
+ },
481
+
482
+ _scroll: function(e) {
483
+ this._keepScrollingState();
484
+ this.fire('content-scroll', {target: this.scroller}, this, false);
485
+ },
486
+
487
+ _getScrollerForMode: function(mode) {
488
+ return MODE_CONFIGS.outerScroll[mode] ?
489
+ this : this.$.mainContainer;
490
+ }
491
+
492
+ });
493
+
494
+ })();
495
+
496
+ </script>