polymer-paper-rails 0.1.0
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 +69 -0
- data/Rakefile +1 -0
- data/app/assets/components/core/animation/web-animations.html.erb +1 -0
- data/app/assets/components/core/animation/web-animations.js +5666 -0
- data/app/assets/components/core/icon/core-icon.css +25 -0
- data/app/assets/components/core/icon/core-icon.html.erb +126 -0
- data/app/assets/components/core/iconset/core-iconset.html.erb +236 -0
- data/app/assets/components/core/input/core-input.css +35 -0
- data/app/assets/components/core/input/core-input.html.erb +385 -0
- data/app/assets/components/core/list/core-list.css +20 -0
- data/app/assets/components/core/list/core-list.html.erb +403 -0
- data/app/assets/components/core/media-query/core-media-query.html +86 -0
- data/app/assets/components/core/menu/core-menu.css +18 -0
- data/app/assets/components/core/menu/core-menu.html.erb +62 -0
- data/app/assets/components/core/menu/core-submenu.css +29 -0
- data/app/assets/components/core/menu/core-submenu.html.erb +106 -0
- data/app/assets/components/core/meta/core-meta.html +143 -0
- data/app/assets/components/core/overlay/core-key-helper.html +17 -0
- data/app/assets/components/core/overlay/core-overlay-layer.html +112 -0
- data/app/assets/components/core/overlay/core-overlay.html.erb +661 -0
- data/app/assets/components/core/range/core-range.html +106 -0
- data/app/assets/components/core/selection/core-selection.html +148 -0
- data/app/assets/components/core/selector/core-selector.html.erb +423 -0
- data/app/assets/components/core/style/core-style.html +386 -0
- data/app/assets/components/core/transition/core-transition-css.html.erb +76 -0
- data/app/assets/components/core/transition/core-transition-overlay.css +46 -0
- data/app/assets/components/core/transition/core-transition.html.erb +44 -0
- data/app/assets/components/paper-button/paper-button.css +115 -0
- data/app/assets/components/paper-button/paper-button.html.erb +210 -0
- data/app/assets/components/paper-checkbox/paper-checkbox.css +262 -0
- data/app/assets/components/paper-checkbox/paper-checkbox.html.erb +104 -0
- data/app/assets/components/paper-dialog/paper-dialog-transition.css +59 -0
- data/app/assets/components/paper-dialog/paper-dialog-transition.html.erb +27 -0
- data/app/assets/components/paper-dialog/paper-dialog.css +0 -0
- data/app/assets/components/paper-dialog/paper-dialog.html.erb +176 -0
- data/app/assets/components/paper-fab/paper-fab.css +27 -0
- data/app/assets/components/paper-fab/paper-fab.html.erb +55 -0
- data/app/assets/components/paper-focusable/paper-focusable.html +144 -0
- data/app/assets/components/paper-icon-button/paper-icon-button.css +17 -0
- data/app/assets/components/paper-icon-button/paper-icon-button.html.erb +87 -0
- data/app/assets/components/paper-input/error-100.png +0 -0
- data/app/assets/components/paper-input/error-200.png +0 -0
- data/app/assets/components/paper-input/paper-input.html.erb +398 -0
- data/app/assets/components/paper-input/paper-input.scss +203 -0
- data/app/assets/components/paper-item/paper-item.css +30 -0
- data/app/assets/components/paper-item/paper-item.html.erb +103 -0
- data/app/assets/components/paper-menu-button/paper-menu-button-overlay.html.erb +86 -0
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.css +19 -0
- data/app/assets/components/paper-menu-button/paper-menu-button-transition.html.erb +118 -0
- data/app/assets/components/paper-menu-button/paper-menu-button.css +86 -0
- data/app/assets/components/paper-menu-button/paper-menu-button.html.erb +128 -0
- data/app/assets/components/paper-progress/paper-progress.css +35 -0
- data/app/assets/components/paper-progress/paper-progress.html.erb +98 -0
- data/app/assets/components/paper-radio-button/paper-radio-button.css +98 -0
- data/app/assets/components/paper-radio-button/paper-radio-button.html.erb +148 -0
- data/app/assets/components/paper-radio-group/paper-radio-group.html.erb +68 -0
- data/app/assets/components/paper-ripple/paper-ripple.html +426 -0
- data/app/assets/components/paper-shadow/paper-shadow.css +81 -0
- data/app/assets/components/paper-shadow/paper-shadow.html.erb +212 -0
- data/app/assets/components/paper-slider/paper-slider.css +193 -0
- data/app/assets/components/paper-slider/paper-slider.html.erb +310 -0
- data/app/assets/components/paper-tabs/paper-tab.css +49 -0
- data/app/assets/components/paper-tabs/paper-tab.html.erb +66 -0
- data/app/assets/components/paper-tabs/paper-tabs.css +57 -0
- data/app/assets/components/paper-tabs/paper-tabs.html.erb +127 -0
- data/app/assets/components/paper-toast/paper-toast.css +0 -0
- data/app/assets/components/paper-toast/paper-toast.html.erb +258 -0
- data/app/assets/components/paper-toggle-button/paper-toggle-button.css +61 -0
- data/app/assets/components/paper-toggle-button/paper-toggle-button.html.erb +125 -0
- data/lib/polymer-paper-rails/engine.rb +4 -0
- data/lib/polymer-paper-rails/version.rb +3 -0
- data/lib/polymer-paper-rails.rb +2 -0
- metadata +158 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
|
2
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
3
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
4
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
5
|
+
Code distributed by Google as part of the polymer project is also
|
|
6
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */
|
|
7
|
+
|
|
8
|
+
:host(.core-transition) {
|
|
9
|
+
outline: none;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
opacity: 0;
|
|
12
|
+
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in;
|
|
13
|
+
-webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
:host(.core-transition.core-opened) {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
transform: none;
|
|
20
|
+
-webkit-transform: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host(.core-transition-center) {
|
|
24
|
+
transform: scale(0.5);
|
|
25
|
+
-webkit-transform: scale(0.5);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host(.core-transition-top) {
|
|
29
|
+
transform: translateY(-200%);
|
|
30
|
+
-webkit-transform: translateY(-200%);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host(.core-transition-bottom) {
|
|
34
|
+
transform: translateY(200%);
|
|
35
|
+
-webkit-transform: translateY(200%);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host(.core-transition-left) {
|
|
39
|
+
transform: translateX(-200%);
|
|
40
|
+
-webkit-transform: translateX(-200%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host(.core-transition-right) {
|
|
44
|
+
transform: translateX(200%);
|
|
45
|
+
-webkit-transform: translateX(200%);
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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.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
|
+
<%= html_import_tag "core/meta/core-meta" %>
|
|
11
|
+
|
|
12
|
+
<polymer-element name="core-transition" extends="core-meta">
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
Polymer('core-transition', {
|
|
16
|
+
|
|
17
|
+
type: 'transition',
|
|
18
|
+
|
|
19
|
+
go: function(node, state) {
|
|
20
|
+
this.complete(node);
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
setup: function(node) {
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
teardown: function(node) {
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
complete: function(node) {
|
|
30
|
+
this.fire('core-transitionend', null, node);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
listenOnce: function(node, event, fn, args) {
|
|
34
|
+
var self = this;
|
|
35
|
+
var listener = function() {
|
|
36
|
+
fn.apply(self, args);
|
|
37
|
+
node.removeEventListener(event, listener, false);
|
|
38
|
+
}
|
|
39
|
+
node.addEventListener(event, listener, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
44
|
+
</polymer-element>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
position: relative;
|
|
4
|
+
border: 0;
|
|
5
|
+
background: transparent;
|
|
6
|
+
text-align: center;
|
|
7
|
+
font: inherit;
|
|
8
|
+
text-transform: uppercase;
|
|
9
|
+
outline: none;
|
|
10
|
+
border-radius: 3px;
|
|
11
|
+
-webkit-user-select: none;
|
|
12
|
+
user-select: none;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host(.hover:hover) {
|
|
17
|
+
background: #e4e4e4;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([raisedButton]) {
|
|
21
|
+
background: #dfdfdf;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([raisedButton].hover:hover) {
|
|
25
|
+
background: #d6d6d6;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([disabled]) {
|
|
29
|
+
background: #eaeaea !important;
|
|
30
|
+
color: #a8a8a8 !important;
|
|
31
|
+
cursor: auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#shadow-container {
|
|
35
|
+
border-radius: inherit;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#clip {
|
|
39
|
+
position: relative;
|
|
40
|
+
border-radius: inherit;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
#focusBg {
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
opacity: 0;
|
|
52
|
+
border-radius: inherit;
|
|
53
|
+
background: #c3c3c3;
|
|
54
|
+
-webkit-transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
55
|
+
transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([focused]) #focusBg {
|
|
59
|
+
-webkit-transition: none;
|
|
60
|
+
transition: none;
|
|
61
|
+
-webkit-animation: focus-fade 0.7s infinite alternate;
|
|
62
|
+
animation: focus-fade 0.7s infinite alternate;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@-webkit-keyframes focus-fade {
|
|
66
|
+
0% {
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
100% {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes focus-fade {
|
|
75
|
+
0% {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
100% {
|
|
79
|
+
opacity: 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
#ripple {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
bottom: 0;
|
|
89
|
+
right: 0;
|
|
90
|
+
color: #d1d1d1;
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([raisedButton]) #ripple {
|
|
95
|
+
color: #cecece;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#ripple::shadow canvas {
|
|
99
|
+
top: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#content {
|
|
104
|
+
/* needed to position the ink behind the content */
|
|
105
|
+
position: relative;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
#icon {
|
|
109
|
+
margin: 8px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#content > span {
|
|
113
|
+
display: inline-block;
|
|
114
|
+
margin: 0.5em;
|
|
115
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
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.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
|
+
<!--
|
|
11
|
+
@group Paper Elements
|
|
12
|
+
|
|
13
|
+
`paper-button` is a button containing text or an image. When the user touches
|
|
14
|
+
the button, a ripple effect emanates from the point of contact.
|
|
15
|
+
|
|
16
|
+
A `paper-button` may be flat or raised. A raised button behaves like a piece
|
|
17
|
+
of paper resting on another sheet, and lifts up upon press. Flat buttons do
|
|
18
|
+
not raise up. Add the `raisedButton` attribute to make a raised button.
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
|
|
22
|
+
<paper-button label="flat button"></paper-button>
|
|
23
|
+
<paper-button label="raised button" raisedButton></paper-button>
|
|
24
|
+
|
|
25
|
+
A button should be styled with a background color, text color, ripple color
|
|
26
|
+
and hover color.
|
|
27
|
+
|
|
28
|
+
To style the background, text and hover color, apply the `background` and
|
|
29
|
+
`color` CSS properties to the button. To style the ripple color, apply the
|
|
30
|
+
`color` CSS property to the `#ripple` element in the button's shadow root:
|
|
31
|
+
|
|
32
|
+
/* Style #my-button blue with white text and darker blue ink. */
|
|
33
|
+
#my-button {
|
|
34
|
+
background: #4285f4;
|
|
35
|
+
color: #fff;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#my-button:hover {
|
|
39
|
+
background: #2a56c6;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#my-button::shadow #ripple {
|
|
43
|
+
color: #2a56c6;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@element paper-button
|
|
47
|
+
@extends paper-focusable
|
|
48
|
+
-->
|
|
49
|
+
|
|
50
|
+
<%= html_import_tag 'core/icon/core-icon' %>
|
|
51
|
+
<%= html_import_tag 'paper-focusable/paper-focusable' %>
|
|
52
|
+
<%= html_import_tag 'paper-ripple/paper-ripple' %>
|
|
53
|
+
<%= html_import_tag 'paper-shadow/paper-shadow' %>
|
|
54
|
+
|
|
55
|
+
<polymer-element name="paper-button" extends="paper-focusable" attributes="label raisedButton iconSrc icon"
|
|
56
|
+
role="button">
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
|
|
60
|
+
<%= stylesheet_link_tag 'paper-button/paper-button'%>
|
|
61
|
+
|
|
62
|
+
<template if="{{raisedButton}}">
|
|
63
|
+
<div fit id="shadow-container">
|
|
64
|
+
<paper-shadow id="shadow" z="{{z}}" animated></paper-shadow>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<div id="clip">
|
|
69
|
+
<!-- <div id="focusBg"></div> -->
|
|
70
|
+
<paper-ripple id="ripple"></paper-ripple>
|
|
71
|
+
<div id="content">
|
|
72
|
+
<template if="{{iconSrc || icon}}">
|
|
73
|
+
<core-icon id="icon" src="{{iconSrc}}" icon="{{icon}}"></core-icon>
|
|
74
|
+
</template>
|
|
75
|
+
<template if="{{label}}">
|
|
76
|
+
<span>{{label}}</span>
|
|
77
|
+
</template>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
Polymer('paper-button', {
|
|
85
|
+
|
|
86
|
+
publish: {
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The label of the button.
|
|
90
|
+
*
|
|
91
|
+
* @attribute label
|
|
92
|
+
* @type string
|
|
93
|
+
* @default ''
|
|
94
|
+
*/
|
|
95
|
+
label: '',
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* If true, the button will be styled as a "raised" button.
|
|
99
|
+
*
|
|
100
|
+
* @attribute raisedButton
|
|
101
|
+
* @type boolean
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
raisedButton: {value: false, reflect: true},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* (optional) The URL of an image for an icon to use in the button.
|
|
108
|
+
* Should not use `icon` property if you are using this property.
|
|
109
|
+
*
|
|
110
|
+
* @attribute iconSrc
|
|
111
|
+
* @type string
|
|
112
|
+
* @default ''
|
|
113
|
+
*/
|
|
114
|
+
iconSrc: {value: ''},
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* (optional) Specifies the icon name or index in the set of icons
|
|
118
|
+
* available in the icon set. If using this property, load the icon
|
|
119
|
+
* set separately where the icon is used. Should not use `src`
|
|
120
|
+
* if you are using this property.
|
|
121
|
+
*
|
|
122
|
+
* @attribute icon
|
|
123
|
+
* @type string
|
|
124
|
+
* @default ''
|
|
125
|
+
*/
|
|
126
|
+
icon: {value: ''}
|
|
127
|
+
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
z: 1,
|
|
131
|
+
|
|
132
|
+
attached: function() {
|
|
133
|
+
if (this.textContent && !this.textContent.match(/\s+/)) {
|
|
134
|
+
console.warn('Using textContent to label the button is deprecated. Use the "label" property instead');
|
|
135
|
+
this.label = this.textContent;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
activeChanged: function() {
|
|
140
|
+
this.super();
|
|
141
|
+
|
|
142
|
+
if (this.active) {
|
|
143
|
+
// FIXME: remove when paper-ripple can have a default 'down' state.
|
|
144
|
+
if (!this.lastEvent) {
|
|
145
|
+
var rect = this.getBoundingClientRect();
|
|
146
|
+
this.lastEvent = {
|
|
147
|
+
x: rect.left + rect.width / 2,
|
|
148
|
+
y: rect.top + rect.height / 2
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.$.ripple.downAction(this.lastEvent);
|
|
152
|
+
} else {
|
|
153
|
+
this.$.ripple.upAction();
|
|
154
|
+
}
|
|
155
|
+
this.adjustZ();
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
focusedChanged: function() {
|
|
159
|
+
this.super();
|
|
160
|
+
this.adjustZ();
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
disabledChanged: function() {
|
|
164
|
+
this.super();
|
|
165
|
+
this.adjustZ();
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
// waitForSpillCompleted: function(callback) {
|
|
169
|
+
// this.async(callback, null, (this.$.ink.spillCompleted ? 0 : this.duration));
|
|
170
|
+
// },
|
|
171
|
+
|
|
172
|
+
// resetInk: function() {
|
|
173
|
+
// this.active = false;
|
|
174
|
+
// this.$.ink.reset();
|
|
175
|
+
// },
|
|
176
|
+
|
|
177
|
+
insideButton: function(x, y) {
|
|
178
|
+
var rect = this.getBoundingClientRect();
|
|
179
|
+
return (rect.left <= x) && (x <= rect.right) && (rect.top <= y) && (y <= rect.bottom);
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
adjustZ: function() {
|
|
183
|
+
if (this.focused) {
|
|
184
|
+
this.classList.add('paper-shadow-animate-z-1-z-2');
|
|
185
|
+
} else {
|
|
186
|
+
this.classList.remove('paper-shadow-animate-z-1-z-2');
|
|
187
|
+
|
|
188
|
+
if (this.active) {
|
|
189
|
+
this.z = 2;
|
|
190
|
+
} else if (this.disabled) {
|
|
191
|
+
this.z = 0;
|
|
192
|
+
} else {
|
|
193
|
+
this.z = 1;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
downAction: function(e) {
|
|
200
|
+
this.super(e);
|
|
201
|
+
this.lastEvent = e;
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
labelChanged: function() {
|
|
205
|
+
this.setAttribute('aria-label', this.label);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
});
|
|
209
|
+
</script>
|
|
210
|
+
</polymer-element>
|
|
@@ -0,0 +1,262 @@
|
|
|
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.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
|
+
:host {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host(:focus) {
|
|
16
|
+
outline: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
#checkboxContainer {
|
|
20
|
+
position: relative;
|
|
21
|
+
width: 18px;
|
|
22
|
+
height: 18px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
-webkit-transform: translateZ(0);
|
|
25
|
+
transform: translateZ(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#checkboxContainer.labeled {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
vertical-align: middle;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#ink {
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: -29px;
|
|
36
|
+
left: -29px;
|
|
37
|
+
width: 76px;
|
|
38
|
+
height: 76px;
|
|
39
|
+
color: #5a5f5a;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#ink[checked] {
|
|
43
|
+
color: #0f9d58;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#checkbox {
|
|
47
|
+
position: absolute;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
top: 0px;
|
|
50
|
+
left: 0px;
|
|
51
|
+
width: 18px;
|
|
52
|
+
height: 18px;
|
|
53
|
+
border: solid 2px;
|
|
54
|
+
border-color: #5a5a5a;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* checkbox checked animations */
|
|
59
|
+
#checkbox.checked.box {
|
|
60
|
+
border: solid 2px;
|
|
61
|
+
-webkit-animation: box-shrink 140ms ease-out forwards;
|
|
62
|
+
animation: box-shrink 140ms ease-out forwards;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@-webkit-keyframes box-shrink {
|
|
66
|
+
0% {
|
|
67
|
+
-webkit-transform: rotate(0deg);
|
|
68
|
+
top: 0px;
|
|
69
|
+
left: 0px;
|
|
70
|
+
width: 18px;
|
|
71
|
+
height: 18px;
|
|
72
|
+
}
|
|
73
|
+
100% {
|
|
74
|
+
-webkit-transform: rotate(45deg);
|
|
75
|
+
top: 13px;
|
|
76
|
+
left: 5px;
|
|
77
|
+
width: 4px;
|
|
78
|
+
height: 4px;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes box-shrink {
|
|
83
|
+
0% {
|
|
84
|
+
transform: rotate(0deg);
|
|
85
|
+
top: 0px;
|
|
86
|
+
left: 0px;
|
|
87
|
+
width: 18px;
|
|
88
|
+
height: 18px;
|
|
89
|
+
}
|
|
90
|
+
100% {
|
|
91
|
+
transform: rotate(45deg);
|
|
92
|
+
top: 13px;
|
|
93
|
+
left: 5px;
|
|
94
|
+
width: 4px;
|
|
95
|
+
height: 4px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
#checkbox.checked.checkmark {
|
|
100
|
+
border-left: none;
|
|
101
|
+
border-top: none;
|
|
102
|
+
-webkit-animation: checkmark-expand 140ms ease-out forwards;
|
|
103
|
+
animation: checkmark-expand 140ms ease-out forwards;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@-webkit-keyframes checkmark-expand {
|
|
107
|
+
0% {
|
|
108
|
+
-webkit-transform: rotate(45deg);
|
|
109
|
+
top: 13px;
|
|
110
|
+
left: 5px;
|
|
111
|
+
width: 4px;
|
|
112
|
+
height: 4px;
|
|
113
|
+
}
|
|
114
|
+
100% {
|
|
115
|
+
-webkit-transform: rotate(45deg);
|
|
116
|
+
top: -4px;
|
|
117
|
+
left: 6px;
|
|
118
|
+
width: 10px;
|
|
119
|
+
height: 21px;
|
|
120
|
+
border-right-width: 2px;
|
|
121
|
+
border-bottom-width: 2px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@keyframes checkmark-expand {
|
|
126
|
+
0% {
|
|
127
|
+
transform: rotate(45deg);
|
|
128
|
+
top: 13px;
|
|
129
|
+
left: 5px;
|
|
130
|
+
width: 4px;
|
|
131
|
+
height: 4px;
|
|
132
|
+
}
|
|
133
|
+
100% {
|
|
134
|
+
transform: rotate(45deg);
|
|
135
|
+
top: -4px;
|
|
136
|
+
left: 6px;
|
|
137
|
+
width: 10px;
|
|
138
|
+
height: 21px;
|
|
139
|
+
border-right-width: 2px;
|
|
140
|
+
border-bottom-width: 2px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
#checkbox.checked {
|
|
145
|
+
-webkit-transform: rotate(45deg);
|
|
146
|
+
transform: rotate(45deg);
|
|
147
|
+
top: -4px;
|
|
148
|
+
left: 6px;
|
|
149
|
+
width: 10px;
|
|
150
|
+
height: 21px;
|
|
151
|
+
border-top: none;
|
|
152
|
+
border-left: none;
|
|
153
|
+
border-right-width: 2px;
|
|
154
|
+
border-bottom-width: 2px;
|
|
155
|
+
border-color: #0f9d58;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* checkbox unchecked animations */
|
|
159
|
+
#checkbox.unchecked.checkmark {
|
|
160
|
+
-webkit-transform: rotate(45deg);
|
|
161
|
+
transform: rotate(45deg);
|
|
162
|
+
border-left: none;
|
|
163
|
+
border-top: none;
|
|
164
|
+
-webkit-animation: checkmark-shrink 140ms ease-out forwards;
|
|
165
|
+
animation: checkmark-shrink 140ms ease-out forwards;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@-webkit-keyframes checkmark-shrink {
|
|
169
|
+
0% {
|
|
170
|
+
top: -4px;
|
|
171
|
+
left: 6px;
|
|
172
|
+
width: 10px;
|
|
173
|
+
height: 21px;
|
|
174
|
+
border-right-width: 2px;
|
|
175
|
+
border-bottom-width: 2px;
|
|
176
|
+
}
|
|
177
|
+
100% {
|
|
178
|
+
top: 13px;
|
|
179
|
+
left: 5px;
|
|
180
|
+
width: 4px;
|
|
181
|
+
height: 4px;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@keyframes checkmark-shrink {
|
|
186
|
+
0% {
|
|
187
|
+
top: -4px;
|
|
188
|
+
left: 6px;
|
|
189
|
+
width: 10px;
|
|
190
|
+
height: 21px;
|
|
191
|
+
border-right-width: 2px;
|
|
192
|
+
border-bottom-width: 2px;
|
|
193
|
+
}
|
|
194
|
+
100% {
|
|
195
|
+
top: 13px;
|
|
196
|
+
left: 5px;
|
|
197
|
+
width: 4px;
|
|
198
|
+
height: 4px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
#checkbox.unchecked.box {
|
|
203
|
+
-webkit-animation: box-expand 140ms ease-out forwards;
|
|
204
|
+
animation: box-expand 140ms ease-out forwards;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@-webkit-keyframes box-expand {
|
|
208
|
+
0% {
|
|
209
|
+
-webkit-transform: rotate(45deg);
|
|
210
|
+
top: 13px;
|
|
211
|
+
left: 5px;
|
|
212
|
+
width: 4px;
|
|
213
|
+
height: 4px;
|
|
214
|
+
}
|
|
215
|
+
100% {
|
|
216
|
+
-webkit-transform: rotate(0deg);
|
|
217
|
+
top: 0px;
|
|
218
|
+
left: 0px;
|
|
219
|
+
width: 18px;
|
|
220
|
+
height: 18px;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
@keyframes box-expand {
|
|
225
|
+
0% {
|
|
226
|
+
transform: rotate(45deg);
|
|
227
|
+
top: 13px;
|
|
228
|
+
left: 5px;
|
|
229
|
+
width: 4px;
|
|
230
|
+
height: 4px;
|
|
231
|
+
}
|
|
232
|
+
100% {
|
|
233
|
+
transform: rotate(0deg);
|
|
234
|
+
top: 0px;
|
|
235
|
+
left: 0px;
|
|
236
|
+
width: 18px;
|
|
237
|
+
height: 18px;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* label */
|
|
242
|
+
#checkboxLabel {
|
|
243
|
+
position: relative;
|
|
244
|
+
display: inline-block;
|
|
245
|
+
vertical-align: middle;
|
|
246
|
+
padding-left: 8px;
|
|
247
|
+
white-space: normal;
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
#checkboxLabel[hidden] {
|
|
252
|
+
display: none;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/* disabled state */
|
|
256
|
+
:host([disabled]) {
|
|
257
|
+
pointer-events: none;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
:host([disabled]) #checkbox {
|
|
261
|
+
border-color: #eaeaea !important;
|
|
262
|
+
}
|