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.
- checksums.yaml +7 -0
- data/README.md +51 -0
- data/Rakefile +1 -0
- data/app/assets/components/iron-a11y-announcer/iron-a11y-announcer.html +125 -0
- data/app/assets/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html +418 -0
- data/app/assets/components/iron-autogrow-textarea/hero.svg +33 -0
- data/app/assets/components/iron-autogrow-textarea/iron-autogrow-textarea.html +263 -0
- data/app/assets/components/iron-behaviors/iron-button-state.html +195 -0
- data/app/assets/components/iron-behaviors/iron-control-state.html +102 -0
- data/app/assets/components/iron-fit-behavior/iron-fit-behavior.html +230 -0
- data/app/assets/components/iron-flex-layout/classes/iron-flex-layout.html +307 -0
- data/app/assets/components/iron-flex-layout/classes/iron-shadow-flex-layout.html +302 -0
- data/app/assets/components/iron-flex-layout/iron-flex-layout.html +313 -0
- data/app/assets/components/iron-form-element-behavior/iron-form-element-behavior.html +50 -0
- data/app/assets/components/iron-icon/hero.svg +19 -0
- data/app/assets/components/iron-icon/iron-icon.html +187 -0
- data/app/assets/components/iron-icons/av-icons.html +73 -0
- data/app/assets/components/iron-icons/communication-icons.html +59 -0
- data/app/assets/components/iron-icons/device-icons.html +94 -0
- data/app/assets/components/iron-icons/editor-icons.html +70 -0
- data/app/assets/components/iron-icons/hardware-icons.html +61 -0
- data/app/assets/components/iron-icons/hero.svg +35 -0
- data/app/assets/components/iron-icons/image-icons.html +164 -0
- data/app/assets/components/iron-icons/iron-icons.html +303 -0
- data/app/assets/components/iron-icons/maps-icons.html +71 -0
- data/app/assets/components/iron-icons/notification-icons.html +62 -0
- data/app/assets/components/iron-icons/social-icons.html +40 -0
- data/app/assets/components/iron-iconset-svg/iron-iconset-svg.html +191 -0
- data/app/assets/components/iron-input/hero.svg +19 -0
- data/app/assets/components/iron-input/iron-input.html +235 -0
- data/app/assets/components/iron-media-query/hero.svg +29 -0
- data/app/assets/components/iron-media-query/iron-media-query.html +84 -0
- data/app/assets/components/iron-menu-behavior/iron-menu-behavior.html +214 -0
- data/app/assets/components/iron-menu-behavior/iron-menubar-behavior.html +65 -0
- data/app/assets/components/iron-meta/hero.svg +33 -0
- data/app/assets/components/iron-meta/iron-meta.html +352 -0
- data/app/assets/components/iron-overlay-behavior/iron-overlay-backdrop.html +132 -0
- data/app/assets/components/iron-overlay-behavior/iron-overlay-behavior.html +432 -0
- data/app/assets/components/iron-overlay-behavior/iron-overlay-manager.html +107 -0
- data/app/assets/components/iron-range-behavior/iron-range-behavior.html +101 -0
- data/app/assets/components/iron-resizable-behavior/iron-resizable-behavior.html +139 -0
- data/app/assets/components/iron-selector/iron-multi-selectable.html +120 -0
- data/app/assets/components/iron-selector/iron-selectable.html +307 -0
- data/app/assets/components/iron-selector/iron-selection.html +115 -0
- data/app/assets/components/iron-selector/iron-selector.html +71 -0
- data/app/assets/components/iron-validatable-behavior/iron-validatable-behavior.html +100 -0
- data/app/assets/components/neon-animation/animations/cascaded-animation.html +84 -0
- data/app/assets/components/neon-animation/animations/fade-in-animation.html +49 -0
- data/app/assets/components/neon-animation/animations/fade-out-animation.html +49 -0
- data/app/assets/components/neon-animation/animations/hero-animation.html +83 -0
- data/app/assets/components/neon-animation/animations/opaque-animation.html +46 -0
- data/app/assets/components/neon-animation/animations/ripple-animation.html +92 -0
- data/app/assets/components/neon-animation/animations/scale-down-animation.html +65 -0
- data/app/assets/components/neon-animation/animations/scale-up-animation.html +58 -0
- data/app/assets/components/neon-animation/animations/slide-down-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/slide-from-left-animation.html +60 -0
- data/app/assets/components/neon-animation/animations/slide-from-right-animation.html +60 -0
- data/app/assets/components/neon-animation/animations/slide-left-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/slide-right-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/slide-up-animation.html +59 -0
- data/app/assets/components/neon-animation/animations/transform-animation.html +61 -0
- data/app/assets/components/neon-animation/guides/neon-animation.md +313 -0
- data/app/assets/components/neon-animation/neon-animatable-behavior.html +156 -0
- data/app/assets/components/neon-animation/neon-animatable.html +54 -0
- data/app/assets/components/neon-animation/neon-animated-pages.html +208 -0
- data/app/assets/components/neon-animation/neon-animation-behavior.html +88 -0
- data/app/assets/components/neon-animation/neon-animation-runner-behavior.html +110 -0
- data/app/assets/components/neon-animation/neon-animation.html +17 -0
- data/app/assets/components/neon-animation/neon-animations.html +25 -0
- data/app/assets/components/neon-animation/neon-shared-element-animatable-behavior.html +37 -0
- data/app/assets/components/neon-animation/neon-shared-element-animation-behavior.html +66 -0
- data/app/assets/components/neon-animation/web-animations.html +11 -0
- data/app/assets/components/paper-behaviors/paper-button-behavior.html +55 -0
- data/app/assets/components/paper-behaviors/paper-inky-focus-behavior.html +44 -0
- data/app/assets/components/paper-button/paper-button.html +177 -0
- data/app/assets/components/paper-checkbox/metadata.html +17 -0
- data/app/assets/components/paper-checkbox/paper-checkbox.css +149 -0
- data/app/assets/components/paper-checkbox/paper-checkbox.html +163 -0
- data/app/assets/components/paper-dialog-behavior/hero.svg +51 -0
- data/app/assets/components/paper-dialog-behavior/paper-dialog-behavior.html +236 -0
- data/app/assets/components/paper-dialog-behavior/paper-dialog-common.css +58 -0
- data/app/assets/components/paper-dialog-scrollable/hero.svg +69 -0
- data/app/assets/components/paper-dialog-scrollable/paper-dialog-scrollable.html +150 -0
- data/app/assets/components/paper-dialog/hero.svg +58 -0
- data/app/assets/components/paper-dialog/paper-dialog.html +122 -0
- data/app/assets/components/paper-drawer-panel/hero.svg +21 -0
- data/app/assets/components/paper-drawer-panel/paper-drawer-panel.css +142 -0
- data/app/assets/components/paper-drawer-panel/paper-drawer-panel.html +585 -0
- data/app/assets/components/paper-fab/paper-fab.html +159 -0
- data/app/assets/components/paper-header-panel/hero.svg +38 -0
- data/app/assets/components/paper-header-panel/paper-header-panel.html +496 -0
- data/app/assets/components/paper-icon-button/paper-icon-button.html +141 -0
- data/app/assets/components/paper-input/all-imports.html +12 -0
- data/app/assets/components/paper-input/hero.svg +19 -0
- data/app/assets/components/paper-input/paper-input-addon-behavior.html +43 -0
- data/app/assets/components/paper-input/paper-input-behavior.html +293 -0
- data/app/assets/components/paper-input/paper-input-char-counter.html +95 -0
- data/app/assets/components/paper-input/paper-input-container.html +495 -0
- data/app/assets/components/paper-input/paper-input-error.html +99 -0
- data/app/assets/components/paper-input/paper-input.html +126 -0
- data/app/assets/components/paper-input/paper-textarea.html +100 -0
- data/app/assets/components/paper-item/all-imports.html +13 -0
- data/app/assets/components/paper-item/paper-icon-item.html +86 -0
- data/app/assets/components/paper-item/paper-item-body.html +93 -0
- data/app/assets/components/paper-item/paper-item-shared.css +19 -0
- data/app/assets/components/paper-item/paper-item.html +95 -0
- data/app/assets/components/paper-material/paper-material.html +98 -0
- data/app/assets/components/paper-menu/hero.svg +35 -0
- data/app/assets/components/paper-menu/paper-menu.html +133 -0
- data/app/assets/components/paper-progress/hero.svg +21 -0
- data/app/assets/components/paper-progress/paper-progress.html +199 -0
- data/app/assets/components/paper-radio-button/hero.svg +22 -0
- data/app/assets/components/paper-radio-button/paper-radio-button.css +109 -0
- data/app/assets/components/paper-radio-button/paper-radio-button.html +148 -0
- data/app/assets/components/paper-radio-group/hero.svg +25 -0
- data/app/assets/components/paper-radio-group/paper-radio-group.html +186 -0
- data/app/assets/components/paper-ripple/hero.svg +30 -0
- data/app/assets/components/paper-ripple/paper-ripple.html +714 -0
- data/app/assets/components/paper-scroll-header-panel/hero.svg +41 -0
- data/app/assets/components/paper-scroll-header-panel/paper-scroll-header-panel.html +455 -0
- data/app/assets/components/paper-slider/hero.svg +20 -0
- data/app/assets/components/paper-slider/paper-slider.css +252 -0
- data/app/assets/components/paper-slider/paper-slider.html +449 -0
- data/app/assets/components/paper-spinner/hero.svg +27 -0
- data/app/assets/components/paper-spinner/paper-spinner.css +325 -0
- data/app/assets/components/paper-spinner/paper-spinner.html +222 -0
- data/app/assets/components/paper-styles/classes/global.html +96 -0
- data/app/assets/components/paper-styles/classes/shadow-layout.html +302 -0
- data/app/assets/components/paper-styles/classes/shadow.html +39 -0
- data/app/assets/components/paper-styles/classes/typography.html +171 -0
- data/app/assets/components/paper-styles/color.html +333 -0
- data/app/assets/components/paper-styles/default-theme.html +39 -0
- data/app/assets/components/paper-styles/paper-styles-classes.html +14 -0
- data/app/assets/components/paper-styles/paper-styles.html +17 -0
- data/app/assets/components/paper-styles/shadow.html +61 -0
- data/app/assets/components/paper-styles/typography.html +240 -0
- data/app/assets/components/paper-tabs/hero.svg +23 -0
- data/app/assets/components/paper-tabs/paper-tab.html +158 -0
- data/app/assets/components/paper-tabs/paper-tabs-icons.html +18 -0
- data/app/assets/components/paper-tabs/paper-tabs.html +483 -0
- data/app/assets/components/paper-toast/hero.svg +20 -0
- data/app/assets/components/paper-toast/paper-toast.html +164 -0
- data/app/assets/components/paper-toggle-button/hero.svg +22 -0
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +108 -0
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html +183 -0
- data/app/assets/components/paper-toolbar/paper-toolbar.html +375 -0
- data/app/assets/components/polymer-gestures/Gruntfile.js +60 -0
- data/app/assets/components/polymer-gestures/banner.txt +9 -0
- data/app/assets/components/polymer-gestures/build.json +17 -0
- data/app/assets/components/polymer-gestures/conf/karma.conf.js +39 -0
- data/app/assets/components/polymer-gestures/package.json +20 -0
- data/app/assets/components/polymer-gestures/polymer-gestures.html +21 -0
- data/app/assets/components/polymer-gestures/polymer-gestures.js +46 -0
- data/app/assets/components/polymer-gestures/src/dispatcher.js +474 -0
- data/app/assets/components/polymer-gestures/src/eventFactory.js +127 -0
- data/app/assets/components/polymer-gestures/src/hold.js +129 -0
- data/app/assets/components/polymer-gestures/src/mouse.js +135 -0
- data/app/assets/components/polymer-gestures/src/ms.js +80 -0
- data/app/assets/components/polymer-gestures/src/pinch.js +186 -0
- data/app/assets/components/polymer-gestures/src/platform-events.js +39 -0
- data/app/assets/components/polymer-gestures/src/pointer.js +68 -0
- data/app/assets/components/polymer-gestures/src/pointermap.js +67 -0
- data/app/assets/components/polymer-gestures/src/scope.js +10 -0
- data/app/assets/components/polymer-gestures/src/tap.js +103 -0
- data/app/assets/components/polymer-gestures/src/targetfind.js +244 -0
- data/app/assets/components/polymer-gestures/src/touch-action.js +60 -0
- data/app/assets/components/polymer-gestures/src/touch.js +341 -0
- data/app/assets/components/polymer-gestures/src/track.js +230 -0
- data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
- data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
- data/app/assets/components/webcomponentsjs/CustomElements.js +956 -0
- data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.js +1078 -0
- data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
- data/app/assets/components/webcomponentsjs/MutationObserver.js +344 -0
- data/app/assets/components/webcomponentsjs/MutationObserver.min.js +11 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.js +4414 -0
- data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +15 -0
- data/app/assets/components/webcomponentsjs/package.json +31 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.js +2300 -0
- data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +13 -0
- data/app/assets/components/webcomponentsjs/webcomponents.js +7112 -0
- data/app/assets/components/webcomponentsjs/webcomponents.min.js +15 -0
- data/lib/polymer-paper-elements-rails.rb +2 -0
- data/lib/polymer-paper-elements-rails/engine.rb +4 -0
- data/lib/polymer-paper-elements-rails/version.rb +3 -0
- metadata +272 -0
|
@@ -0,0 +1,375 @@
|
|
|
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="../paper-styles/paper-styles.html">
|
|
12
|
+
|
|
13
|
+
<!--
|
|
14
|
+
`paper-toolbar` is a horizontal bar containing items that can be used for
|
|
15
|
+
label, navigation, search and actions. The items place inside the
|
|
16
|
+
`paper-toolbar` are projected into a `class="horizontal center layout"` container inside of
|
|
17
|
+
`paper-toolbar`'s Shadow DOM. You can use flex attributes to control the items'
|
|
18
|
+
sizing.
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
|
|
22
|
+
<paper-toolbar>
|
|
23
|
+
<paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
|
|
24
|
+
<div class="title">Title</div>
|
|
25
|
+
<paper-icon-button icon="more-vert" on-tap="moreAction"></paper-icon-button>
|
|
26
|
+
</paper-toolbar>
|
|
27
|
+
|
|
28
|
+
`paper-toolbar` has a standard height, but can made be taller by setting `tall`
|
|
29
|
+
class on the `paper-toolbar`. This will make the toolbar 3x the normal height.
|
|
30
|
+
|
|
31
|
+
<paper-toolbar class="tall">
|
|
32
|
+
<paper-icon-button icon="menu"></paper-icon-button>
|
|
33
|
+
</paper-toolbar>
|
|
34
|
+
|
|
35
|
+
Apply `medium-tall` class to make the toolbar medium tall. This will make the
|
|
36
|
+
toolbar 2x the normal height.
|
|
37
|
+
|
|
38
|
+
<paper-toolbar class="medium-tall">
|
|
39
|
+
<paper-icon-button icon="menu"></paper-icon-button>
|
|
40
|
+
</paper-toolbar>
|
|
41
|
+
|
|
42
|
+
When `tall`, items can pin to either the top (default), middle or bottom. Use
|
|
43
|
+
`middle` class for middle content and `bottom` class for bottom content.
|
|
44
|
+
|
|
45
|
+
<paper-toolbar class="tall">
|
|
46
|
+
<paper-icon-button icon="menu"></paper-icon-button>
|
|
47
|
+
<div class="middle title">Middle Title</div>
|
|
48
|
+
<div class="bottom title">Bottom Title</div>
|
|
49
|
+
</paper-toolbar>
|
|
50
|
+
|
|
51
|
+
For `medium-tall` toolbar, the middle and bottom contents overlap and are
|
|
52
|
+
pinned to the bottom. But `middleJustify` and `bottomJustify` attributes are
|
|
53
|
+
still honored separately.
|
|
54
|
+
|
|
55
|
+
### Styling
|
|
56
|
+
|
|
57
|
+
The following custom properties and mixins are available for styling:
|
|
58
|
+
|
|
59
|
+
Custom property | Description | Default
|
|
60
|
+
----------------|-------------|----------
|
|
61
|
+
`--paper-toolbar-background` | Toolbar background color | `--default-primary-color`
|
|
62
|
+
`--paper-toolbar-color` | Toolbar foreground color | `--text-primary-color`
|
|
63
|
+
`--paper-toolbar` | Mixin applied to the toolbar | `{}`
|
|
64
|
+
|
|
65
|
+
### Accessibility
|
|
66
|
+
|
|
67
|
+
`<paper-toolbar>` has `role="toolbar"` by default. Any elements with the class `title` will
|
|
68
|
+
be used as the label of the toolbar via `aria-labelledby`.
|
|
69
|
+
|
|
70
|
+
@demo demo/index.html
|
|
71
|
+
-->
|
|
72
|
+
|
|
73
|
+
<dom-module id="paper-toolbar">
|
|
74
|
+
|
|
75
|
+
<style>
|
|
76
|
+
:host {
|
|
77
|
+
/* technical */
|
|
78
|
+
display: block;
|
|
79
|
+
position: relative;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
-moz-box-sizing: border-box;
|
|
82
|
+
|
|
83
|
+
/* size */
|
|
84
|
+
height: 64px;
|
|
85
|
+
|
|
86
|
+
background: var(--paper-toolbar-background, --default-primary-color);
|
|
87
|
+
color: var(--paper-toolbar-color, --text-primary-color);
|
|
88
|
+
|
|
89
|
+
@apply(--paper-toolbar);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host(.animate) {
|
|
93
|
+
/* transition */
|
|
94
|
+
transition: height 0.18s ease-in;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host(.medium-tall) {
|
|
98
|
+
height: 128px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host(.tall) {
|
|
102
|
+
height: 192px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.toolbar-tools {
|
|
106
|
+
position: relative;
|
|
107
|
+
height: 64px;
|
|
108
|
+
padding: 0 16px;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
* TODO: Where should media query breakpoints live so they can be shared between elements?
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
@media (max-width: 639px) {
|
|
117
|
+
:host {
|
|
118
|
+
height: 56px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
:host(.medium-tall) {
|
|
122
|
+
height: 112px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host(.tall) {
|
|
126
|
+
height: 168px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.toolbar-tools {
|
|
130
|
+
height: 56px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
#topBar {
|
|
135
|
+
position: relative;
|
|
136
|
+
z-index: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* middle bar */
|
|
140
|
+
#middleBar {
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: 0;
|
|
143
|
+
right: 0;
|
|
144
|
+
left: 0;
|
|
145
|
+
z-index: 2;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host(.tall) #middleBar,
|
|
149
|
+
:host(.medium-tall) #middleBar {
|
|
150
|
+
-webkit-transform: translateY(100%);
|
|
151
|
+
transform: translateY(100%);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* bottom bar */
|
|
155
|
+
#bottomBar {
|
|
156
|
+
position: absolute;
|
|
157
|
+
right: 0;
|
|
158
|
+
bottom: 0;
|
|
159
|
+
left: 0;
|
|
160
|
+
z-index: 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/*
|
|
164
|
+
* make elements (e.g. buttons) respond to mouse/touch events
|
|
165
|
+
*
|
|
166
|
+
* `.toolbar-tools` disables touch events so multiple toolbars can stack and not
|
|
167
|
+
* absorb events. All children must have pointer events re-enabled to work as
|
|
168
|
+
* expected.
|
|
169
|
+
*/
|
|
170
|
+
.toolbar-tools > ::content > *:not([disabled]) {
|
|
171
|
+
pointer-events: auto;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.toolbar-tools > ::content .title {
|
|
175
|
+
@apply(--paper-font-title);
|
|
176
|
+
@apply(--layout-flex);
|
|
177
|
+
|
|
178
|
+
text-overflow: ellipsis;
|
|
179
|
+
white-space: nowrap;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
|
|
182
|
+
/*
|
|
183
|
+
* Polymer/polymer/issues/1525
|
|
184
|
+
* --paper-font-title defines a `font-weight`
|
|
185
|
+
* let's override its value, but we need `important!`
|
|
186
|
+
* because all mixins are resolved in rule's selector that has higher precedence
|
|
187
|
+
* than the current selector.
|
|
188
|
+
*/
|
|
189
|
+
font-weight: 400 !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* TODO: Refactor these selectors
|
|
194
|
+
* Work in progress.
|
|
195
|
+
*/
|
|
196
|
+
.toolbar-tools > ::content paper-icon-button[icon=menu] {
|
|
197
|
+
margin-left: -8px;
|
|
198
|
+
margin-right: 24px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.toolbar-tools > ::content paper-icon-button + paper-icon-button {
|
|
202
|
+
margin-right: -8px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.toolbar-tools > ::content > .title,
|
|
206
|
+
.toolbar-tools > ::content[select=".middle"] > .title,
|
|
207
|
+
.toolbar-tools > ::content[select=".bottom"] > .title {
|
|
208
|
+
margin-left: 56px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.toolbar-tools > ::content > paper-icon-button + .title,
|
|
212
|
+
.toolbar-tools > ::content[select=".middle"] paper-icon-button + .title,
|
|
213
|
+
.toolbar-tools > ::content[select=".bottom"] paper-icon-button + .title {
|
|
214
|
+
margin-left: 0;
|
|
215
|
+
}
|
|
216
|
+
</style>
|
|
217
|
+
|
|
218
|
+
<template>
|
|
219
|
+
|
|
220
|
+
<div id="topBar" class$="[[_computeBarClassName(justify)]]">
|
|
221
|
+
<content select=":not(.middle):not(.bottom)"></content>
|
|
222
|
+
</div>
|
|
223
|
+
|
|
224
|
+
<div id="middleBar" class$="[[_computeBarClassName(middleJustify)]]">
|
|
225
|
+
<content select=".middle"></content>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<div id="bottomBar" class$="[[_computeBarClassName(bottomJustify)]]">
|
|
229
|
+
<content select=".bottom"></content>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
</template>
|
|
233
|
+
|
|
234
|
+
</dom-module>
|
|
235
|
+
|
|
236
|
+
<script>
|
|
237
|
+
|
|
238
|
+
(function() {
|
|
239
|
+
|
|
240
|
+
'use strict';
|
|
241
|
+
|
|
242
|
+
function classNames(obj) {
|
|
243
|
+
var classNames = [];
|
|
244
|
+
for (var key in obj) {
|
|
245
|
+
if (obj.hasOwnProperty(key) && obj[key]) {
|
|
246
|
+
classNames.push(key);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return classNames.join(' ');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
Polymer({
|
|
254
|
+
|
|
255
|
+
is: 'paper-toolbar',
|
|
256
|
+
|
|
257
|
+
hostAttributes: {
|
|
258
|
+
'role': 'toolbar'
|
|
259
|
+
},
|
|
260
|
+
|
|
261
|
+
properties: {
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Controls how the items are aligned horizontally when they are placed
|
|
265
|
+
* at the bottom.
|
|
266
|
+
* Options are `start`, `center`, `end`, `justified` and `around`.
|
|
267
|
+
*
|
|
268
|
+
* @attribute bottomJustify
|
|
269
|
+
* @type string
|
|
270
|
+
* @default ''
|
|
271
|
+
*/
|
|
272
|
+
bottomJustify: {
|
|
273
|
+
type: String,
|
|
274
|
+
value: ''
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Controls how the items are aligned horizontally.
|
|
279
|
+
* Options are `start`, `center`, `end`, `justified` and `around`.
|
|
280
|
+
*
|
|
281
|
+
* @attribute justify
|
|
282
|
+
* @type string
|
|
283
|
+
* @default ''
|
|
284
|
+
*/
|
|
285
|
+
justify: {
|
|
286
|
+
type: String,
|
|
287
|
+
value: ''
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Controls how the items are aligned horizontally when they are placed
|
|
292
|
+
* in the middle.
|
|
293
|
+
* Options are `start`, `center`, `end`, `justified` and `around`.
|
|
294
|
+
*
|
|
295
|
+
* @attribute middleJustify
|
|
296
|
+
* @type string
|
|
297
|
+
* @default ''
|
|
298
|
+
*/
|
|
299
|
+
middleJustify: {
|
|
300
|
+
type: String,
|
|
301
|
+
value: ''
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
},
|
|
305
|
+
|
|
306
|
+
attached: function() {
|
|
307
|
+
this._observer = this._observe(this);
|
|
308
|
+
this._updateAriaLabelledBy();
|
|
309
|
+
},
|
|
310
|
+
|
|
311
|
+
detached: function() {
|
|
312
|
+
if (this._observer) {
|
|
313
|
+
this._observer.disconnect();
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
|
|
317
|
+
_observe: function(node) {
|
|
318
|
+
var observer = new MutationObserver(function() {
|
|
319
|
+
this._updateAriaLabelledBy();
|
|
320
|
+
}.bind(this));
|
|
321
|
+
observer.observe(node, {
|
|
322
|
+
childList: true,
|
|
323
|
+
subtree: true
|
|
324
|
+
});
|
|
325
|
+
return observer;
|
|
326
|
+
},
|
|
327
|
+
|
|
328
|
+
_updateAriaLabelledBy: function() {
|
|
329
|
+
var labelledBy = [];
|
|
330
|
+
var contents = Polymer.dom(this.root).querySelectorAll('content');
|
|
331
|
+
for (var content, index = 0; content = contents[index]; index++) {
|
|
332
|
+
var nodes = Polymer.dom(content).getDistributedNodes();
|
|
333
|
+
for (var node, jndex = 0; node = nodes[jndex]; jndex++) {
|
|
334
|
+
if (node.classList && node.classList.contains('title')) {
|
|
335
|
+
if (node.id) {
|
|
336
|
+
labelledBy.push(node.id);
|
|
337
|
+
} else {
|
|
338
|
+
var id = 'paper-toolbar-label-' + Math.floor(Math.random() * 10000);
|
|
339
|
+
node.id = id;
|
|
340
|
+
labelledBy.push(id);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (labelledBy.length > 0) {
|
|
346
|
+
this.setAttribute('aria-labelledby', labelledBy.join(' '));
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
|
|
350
|
+
_computeBarClassName: function(barJustify) {
|
|
351
|
+
var classObj = {
|
|
352
|
+
center: true,
|
|
353
|
+
horizontal: true,
|
|
354
|
+
layout: true,
|
|
355
|
+
'toolbar-tools': true
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
// If a blank string or any falsy value is given, no other class name is
|
|
359
|
+
// added.
|
|
360
|
+
if (barJustify) {
|
|
361
|
+
var justifyClassName = (barJustify === 'justified') ?
|
|
362
|
+
barJustify :
|
|
363
|
+
barJustify + '-justified';
|
|
364
|
+
|
|
365
|
+
classObj[justifyClassName] = true;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return classNames(classObj);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
}());
|
|
374
|
+
|
|
375
|
+
</script>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2014 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
|
+
module.exports = function(grunt) {
|
|
12
|
+
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
13
|
+
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
14
|
+
grunt.loadNpmTasks('grunt-karma');
|
|
15
|
+
|
|
16
|
+
var sourceFiles = grunt.file.readJSON('build.json');
|
|
17
|
+
var banner = grunt.file.read('banner.txt');
|
|
18
|
+
var toolsPath = '../tools/';
|
|
19
|
+
|
|
20
|
+
grunt.initConfig({
|
|
21
|
+
concat: {
|
|
22
|
+
polymergestures: {
|
|
23
|
+
options: {
|
|
24
|
+
stripBanners: true,
|
|
25
|
+
banner: banner
|
|
26
|
+
},
|
|
27
|
+
nonull: true,
|
|
28
|
+
src: sourceFiles,
|
|
29
|
+
dest: 'polymergestures.dev.js'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
uglify: {
|
|
33
|
+
polymergestures: {
|
|
34
|
+
options: {
|
|
35
|
+
banner: banner
|
|
36
|
+
},
|
|
37
|
+
nonull: true,
|
|
38
|
+
dest: 'polymergestures.min.js',
|
|
39
|
+
src: sourceFiles
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
karma: {
|
|
43
|
+
options: {
|
|
44
|
+
configFile: 'conf/karma.conf.js',
|
|
45
|
+
keepalive: true
|
|
46
|
+
},
|
|
47
|
+
polymergestures: {
|
|
48
|
+
},
|
|
49
|
+
buildbot: {
|
|
50
|
+
reporters: 'crbot',
|
|
51
|
+
logLevel: 'OFF'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
grunt.loadTasks(toolsPath + 'tasks');
|
|
57
|
+
grunt.registerTask('default', ['concat', 'uglify']);
|
|
58
|
+
grunt.registerTask('test', ['override-chrome-launcher', 'karma:polymergestures']);
|
|
59
|
+
grunt.registerTask('test-buildbot', ['override-chrome-launcher', 'karma:buildbot']);
|
|
60
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2014 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
|
+
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[
|
|
2
|
+
"src/scope.js",
|
|
3
|
+
"src/targetfind.js",
|
|
4
|
+
"src/touch-action.js",
|
|
5
|
+
"src/eventFactory.js",
|
|
6
|
+
"src/pointermap.js",
|
|
7
|
+
"src/dispatcher.js",
|
|
8
|
+
"src/mouse.js",
|
|
9
|
+
"src/touch.js",
|
|
10
|
+
"src/ms.js",
|
|
11
|
+
"src/pointer.js",
|
|
12
|
+
"src/platform-events.js",
|
|
13
|
+
"src/track.js",
|
|
14
|
+
"src/hold.js",
|
|
15
|
+
"src/tap.js",
|
|
16
|
+
"src/pinch.js"
|
|
17
|
+
]
|