I_changed_another_theme

This commit is contained in:
2016-08-16 20:03:40 -04:00
parent 23434adfb0
commit 3d1bca5d8b
345 changed files with 47813 additions and 2571 deletions
+48
View File
@@ -0,0 +1,48 @@
{
"name": "paper-behaviors",
"version": "1.0.2",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
],
"main": [
"paper-button-behavior.html",
"paper-radio-button-behavior.html"
],
"keywords": [
"web-components",
"web-component",
"polymer",
"paper",
"behavior"
],
"private": true,
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/paper-behaviors"
},
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-behaviors",
"dependencies": {
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-material": "PolymerElements/paper-material#^1.0.0",
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.2",
"_resolution": {
"type": "version",
"tag": "v1.0.2",
"commit": "4dd226a2cc5b780a73d0058cd9998b6e0af1cb2c"
},
"_source": "git://github.com/polymerelements/paper-behaviors.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/paper-behaviors"
}
@@ -0,0 +1 @@
bower_components
+4
View File
@@ -0,0 +1,4 @@
paper-behaviors
===============
These are common behaviors used across `paper-*` elements.
+39
View File
@@ -0,0 +1,39 @@
{
"name": "paper-behaviors",
"version": "1.0.2",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
],
"main": [
"paper-button-behavior.html",
"paper-radio-button-behavior.html"
],
"keywords": [
"web-components",
"web-component",
"polymer",
"paper",
"behavior"
],
"private": true,
"repository": {
"type": "git",
"url": "git://github.com/PolymerElements/paper-behaviors"
},
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-behaviors",
"dependencies": {
"iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"paper-material": "PolymerElements/paper-material#^1.0.0",
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
}
+57
View File
@@ -0,0 +1,57 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<title>paper-behaviors demo</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<link href="paper-button.html" rel="import">
<link href="paper-radio-button.html" rel="import">
<style>
body {
font-family: sans-serif;
padding: 24px;
margin: 0;
}
</style>
</head>
<body>
<h3>Normal</h3>
<paper-button tabindex="0">Hello World</paper-button>
<h3>Toggles</h3>
<paper-button toggles tabindex="0">Hello World</paper-button>
<h3>Disabled</h3>
<paper-button disabled tabindex="0">Hello World</paper-button>
<h3>Radio button with focus state</h3>
<paper-radio-button tabindex="0" title="Radio button with focus state"></paper-radio-button>
</body>
</html>
+71
View File
@@ -0,0 +1,71 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../paper-material/paper-material.html">
<link rel="import" href="../paper-button-behavior.html">
<dom-module id="paper-button">
<style>
:host {
display: inline-block;
background-color: #4285F4;
color: #fff;
border-radius: 3px;
text-transform: uppercase;
outline: none;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: pointer;
}
paper-material {
border-radius: inherit;
padding: 16px;
}
:host([disabled]) {
background-color: #888;
pointer-events: none;
}
:host([active]),
:host([pressed]) {
background-color: #3367D6;
box-shadow: inset 0 3px 5px rgba(0,0,0,.2);
}
</style>
<template>
<paper-material class="content" elevation="[[_elevation]]" animated>
<content></content>
</paper-material>
</template>
<script>
Polymer({
is: 'paper-button',
behaviors: [
Polymer.PaperButtonBehavior
]
});
</script>
</dom-module>
@@ -0,0 +1,116 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-inky-focus-behavior.html">
<dom-module id="paper-radio-button">
<style>
:host {
display: inline-block;
white-space: nowrap;
}
:host(:focus) {
outline: none
}
#radioContainer {
display: inline-block;
position: relative;
width: 16px;
height: 16px;
cursor: pointer;
vertical-align: middle;
}
#offRadio {
position: absolute;
top: 0px;
left: 0px;
width: 12px;
height: 12px;
border-radius: 50%;
border: solid 2px;
border-color: black;
transition: border-color 0.28s;
}
#onRadio {
position: absolute;
top: 4px;
left: 4px;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: red;
-webkit-transform: scale(0);
transform: scale(0);
transition: -webkit-transform ease 0.28s;
transition: transform ease 0.28s;
}
:host([disabled]) {
opacity: 0.3;
pointer-events: none;
}
:host([pressed]) #offRadio,
:host([active]) #offRadio {
border-color: red;
}
:host([pressed]) #onRadio,
:host([active]) #onRadio {
-webkit-transform: scale(1);
transform: scale(1);
}
#ink {
position: absolute;
top: -16px;
left: -16px;
width: 48px;
height: 48px;
}
</style>
<template>
<div id="radioContainer">
<div id="offRadio"></div>
<div id="onRadio"></div>
<paper-ripple id="ink" class="circle" center></paper-ripple>
</div>
</template>
<script>
Polymer({
behaviors: [
Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
role: 'radio'
},
ready: function() {
this.toggles = true;
}
});
</script>
</dom-module>
+26
View File
@@ -0,0 +1,26 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
The complete set of authors may be found at http://polymer.github.io/AUTHORS
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="../iron-component-page/iron-component-page.html">
</head>
<body>
<iron-component-page src="paper-button-behavior.html"></iron-component-page>
</body>
</html>
@@ -0,0 +1,56 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html">
<script>
/** @polymerBehavior */
Polymer.PaperButtonBehaviorImpl = {
properties: {
_elevation: {
type: Number
}
},
observers: [
'_calculateElevation(focused, disabled, active, pressed, receivedFocusFromKeyboard)'
],
hostAttributes: {
role: 'button',
tabindex: '0'
},
_calculateElevation: function() {
var e = 1;
if (this.disabled) {
e = 0;
} else if (this.active || this.pressed) {
e = 4;
} else if (this.receivedFocusFromKeyboard) {
e = 3;
}
this._elevation = e;
}
};
/** @polymerBehavior */
Polymer.PaperButtonBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
Polymer.PaperButtonBehaviorImpl
];
</script>
@@ -0,0 +1,44 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html">
<script>
/**
* `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus.
*
* @polymerBehavior Polymer.PaperInkyFocusBehavior
*/
Polymer.PaperInkyFocusBehaviorImpl = {
observers: [
'_focusedChanged(receivedFocusFromKeyboard)'
],
_focusedChanged: function(receivedFocusFromKeyboard) {
if (!this.$.ink) {
return;
}
this.$.ink.holdDown = receivedFocusFromKeyboard;
}
};
/** @polymerBehavior Polymer.PaperInkyFocusBehavior */
Polymer.PaperInkyFocusBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
Polymer.PaperInkyFocusBehaviorImpl
];
</script>
+26
View File
@@ -0,0 +1,26 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<meta charset="utf-8">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
WCT.loadSuites([
'paper-button-behavior.html',
'paper-radio-button-behavior.html'
]);
</script>
</body>
</html>
@@ -0,0 +1,82 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>paper-button-behavior</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<script src="../../iron-test-helpers/mock-interactions.js"></script>
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="test-button.html">
</head>
<body>
<test-fixture id="basic">
<template>
<test-button></test-button>
</template>
</test-fixture>
<script>
suite('basic', function() {
var button;
setup(function() {
button = fixture('basic');
});
test('normal (no states)', function() {
assert.equal(button._elevation, 1);
});
test('set disabled property', function() {
button.disabled = true;
assert.equal(button._elevation, 0);
});
test('pressed and released', function() {
MockInteractions.down(button);
assert.equal(button._elevation, 4);
MockInteractions.up(button);
assert.equal(button._elevation, 1);
});
suite('a button with toggles', function() {
setup(function() {
button.toggles = true;
});
test('activated by tap', function(done) {
MockInteractions.downAndUp(button, function() {
try {
assert.equal(button._elevation, 4);
done();
} catch (e) {
done(e);
}
});
});
});
test('receives focused', function() {
MockInteractions.focus(button);
assert.equal(button._elevation, 3);
});
});
</script>
</body>
</html>
@@ -0,0 +1,62 @@
<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>paper-radio-button-behavior</title>
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<script src="../../iron-test-helpers/mock-interactions.js"></script>
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="test-radio-button.html">
</head>
<body>
<test-fixture id="basic">
<template>
<test-radio-button></test-radio-button>
</template>
</test-fixture>
<script>
suite('basic', function() {
var button;
var ink;
setup(function() {
button = fixture('basic');
ink = button.querySelector('paper-ripple');
MockInteractions.blur(button);
});
test('normal (no states)', function() {
assert.isFalse(button.focused);
assert.isFalse(ink._animating);
assert.equal(ink.ripples.length, 0);
});
test('receives focus', function() {
MockInteractions.focus(button);
assert.isTrue(button.focused);
assert.isTrue(ink._animating);
assert.equal(ink.ripples.length, 1);
});
});
</script>
</body>
</html>
+34
View File
@@ -0,0 +1,34 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../paper-button-behavior.html">
<dom-module id="test-button">
<template>
<content></content>
</template>
<script>
Polymer({
is: 'test-button',
behaviors: [
Polymer.PaperButtonBehavior
]
});
</script>
</dom-module>
@@ -0,0 +1,41 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../paper-inky-focus-behavior.html">
<link rel="import" href="../../paper-ripple/paper-ripple.html">
<dom-module id="test-radio-button">
<style>
:host #ink {
position: absolute;
top: -16px;
left: -16px;
width: 48px;
height: 48px;
}
</style>
<template>
<div id="container">
<paper-ripple id="ink" class="circle" center></paper-ripple>
</div>
</template>
</dom-module>
<script>
Polymer({
is: 'test-radio-button',
behaviors: [
Polymer.PaperInkyFocusBehavior
]
});
</script>