update polymer components

This commit is contained in:
Luke Pulverenti 2015-10-29 19:23:43 -04:00
parent 39b96c14d1
commit 15b68f5f4b
17 changed files with 1592 additions and 1227 deletions

View file

@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
"version": "1.0.3",
"version": "1.0.4",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
@ -19,22 +19,25 @@
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-drawer-panel",
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0",
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0"
"polymer": "Polymer/polymer#^1.1.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.3",
"main": "paper-drawer-panel.html",
"_release": "1.0.4",
"_resolution": {
"type": "version",
"tag": "v1.0.3",
"commit": "92713b61eb8eec378db63af61b73341453b8180d"
"tag": "v1.0.4",
"commit": "9d4a4c737d8e2e5d23baee39128625e476f2b051"
},
"_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
"_target": "~1.0.2",

View file

@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
"version": "1.0.3",
"version": "1.0.4",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
@ -19,15 +19,18 @@
"license": "http://polymer.github.io/LICENSE.txt",
"homepage": "https://github.com/PolymerElements/paper-drawer-panel",
"dependencies": {
"polymer": "Polymer/polymer#^1.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0",
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0"
"polymer": "Polymer/polymer#^1.1.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
},
"main": "paper-drawer-panel.html"
}

View file

@ -1,152 +0,0 @@
/**
@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
*/
:host {
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
iron-selector > #drawer {
position: absolute;
top: 0;
left: 0;
height: 100%;
background-color: white;
-moz-box-sizing: border-box;
box-sizing: border-box;
@apply(--paper-drawer-panel-drawer-container);
}
.transition > #drawer {
transition: -webkit-transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;
transition: transform ease-in-out 0.3s, width ease-in-out 0.3s, visibility 0.3s;
}
.left-drawer > #drawer {
@apply(--paper-drawer-panel-left-drawer-container);
}
.right-drawer > #drawer {
left: auto;
right: 0;
@apply(--paper-drawer-panel-right-drawer-container);
}
iron-selector > #main {
position: absolute;
top: 0;
right: 0;
bottom: 0;
@apply(--paper-drawer-panel-main-container);
}
.transition > #main {
transition: left ease-in-out 0.3s, padding ease-in-out 0.3s;
}
.right-drawer > #main {
left: 0;
}
.right-drawer.transition > #main {
transition: right ease-in-out 0.3s, padding ease-in-out 0.3s;
}
#main > ::content > [main] {
height: 100%;
}
#drawer > ::content > [drawer] {
height: 100%;
}
#scrim {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
visibility: hidden;
opacity: 0;
transition: opacity ease-in-out 0.38s, visibility ease-in-out 0.38s;
background-color: rgba(0, 0, 0, 0.3);
}
.narrow-layout > #drawer {
will-change: transform;
}
.narrow-layout > #drawer.iron-selected {
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}
.right-drawer.narrow-layout > #drawer.iron-selected {
box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.15);
}
.narrow-layout > #drawer > ::content > [drawer] {
border: 0;
}
.left-drawer.narrow-layout > #drawer:not(.iron-selected) {
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
}
.right-drawer.narrow-layout > #drawer:not(.iron-selected) {
left: auto;
visibility: hidden;
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
.right-drawer.narrow-layout.dragging > #drawer:not(.iron-selected),
.right-drawer.narrow-layout.peeking > #drawer:not(.iron-selected) {
visibility: visible;
}
.narrow-layout > #main {
padding: 0;
}
.right-drawer.narrow-layout > #main {
left: 0;
right: 0;
}
.narrow-layout > #main:not(.iron-selected) > #scrim,
.dragging > #main > #scrim {
visibility: visible;
opacity: var(--paper-drawer-panel-scrim-opacity, 1);
}
.narrow-layout > #main > * {
margin: 0;
min-height: 100%;
left: 0;
right: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
display: none;
}

File diff suppressed because it is too large Load diff

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">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>paper-drawer-panel tests</title>
<script src="../../web-component-tester/browser.js"></script>
</head>
<body>
<script>
WCT.loadSuites([
'positioning.html',
'small-devices.html'
]);
</script>
</body>
</html>

View file

@ -0,0 +1,96 @@
<!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">
<title>paper-drawer-panel tests</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../paper-drawer-panel.html">
</head>
<style>
body {
margin: 0;
padding: 0;
}
</style>
<body>
<test-fixture id="left-drawer">
<template>
<paper-drawer-panel>
<div drawer></div>
<div main></div>
</paper-drawer-panel>
</template>
</test-fixture>
<test-fixture id="right-drawer">
<template>
<paper-drawer-panel right-drawer>
<div drawer></div>
<div main></div>
</paper-drawer-panel>
</template>
</test-fixture>
<script>
suite('positioning', function() {
test('drawer is positioned correctly', function(done) {
var f, drawer, main;
f = fixture('left-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
Polymer.Base.async(function() {
var drawerStyle = window.getComputedStyle(drawer);
expect(drawerStyle.left).to.be.equal('0px');
try {
expect(drawerStyle.right).to.be.equal('auto');
} catch(e) {
// Firefox
expect(drawerStyle.right).to.be.equal(f.offsetWidth - drawer.offsetWidth + 'px');
}
done();
});
});
test('right-drawer is positioned correctly', function(done) {
var f, drawer, main;
f = fixture('right-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
Polymer.Base.async(function() {
var drawerStyle = window.getComputedStyle(drawer);
expect(drawerStyle.right).to.be.equal('0px');
try {
expect(drawerStyle.left).to.be.equal('auto');
} catch(e) {
// Firefox
expect(drawerStyle.left).to.be.equal(f.offsetWidth - drawer.offsetWidth + 'px');
}
done();
});
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,141 @@
<!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">
<title>paper-drawer-panel tests</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../paper-drawer-panel.html">
</head>
<style>
body {
margin: 0;
padding: 0;
}
.notransition,
.notransition * {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}
</style>
<body>
<test-fixture id="left-drawer">
<template>
<paper-drawer-panel class="notransition">
<div drawer></div>
<div main></div>
</paper-drawer-panel>
</template>
</test-fixture>
<test-fixture id="right-drawer">
<template>
<paper-drawer-panel right-drawer class="notransition">
<div drawer></div>
<div main></div>
</paper-drawer-panel>
</template>
</test-fixture>
<script>
suite('on small devices', function() {
test('drawer is hidden by default', function(done) {
var f, panel, drawer, main;
f = fixture('left-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
f.set('forceNarrow', true);
f._forceNarrowChanged();
Polymer.Base.async(function() {
var drawerBoundingRect = drawer.getBoundingClientRect();
var mainStyle = window.getComputedStyle(main);
expect(f._isMainSelected()).to.be.equal(true);
expect(drawerBoundingRect.left).to.be.equal(-256);
expect(drawerBoundingRect.width).to.be.equal(256);
done();
});
});
test('right-drawer is hidden by default', function(done) {
var f, panel, drawer, main;
f = fixture('right-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
f.set('forceNarrow', true);
f._forceNarrowChanged();
Polymer.Base.async(function() {
var drawerBoundingRect = drawer.getBoundingClientRect();
var mainStyle = window.getComputedStyle(main);
expect(drawerBoundingRect.right).to.be.equal(f.offsetWidth + 256);
expect(drawerBoundingRect.width).to.be.equal(256);
done();
});
});
test('drawer is can be opened', function(done) {
var f, panel, drawer, main;
f = fixture('left-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
f.set('forceNarrow', true);
f._forceNarrowChanged();
f.openDrawer();
Polymer.Base.async(function() {
var drawerBoundingRect = drawer.getBoundingClientRect();
var mainStyle = window.getComputedStyle(main);
expect(f.selected).to.be.equal('drawer');
expect(f._isMainSelected()).to.be.equal(false);
expect(drawerBoundingRect.left).to.be.equal(0);
expect(drawerBoundingRect.width).to.be.equal(256);
done();
});
});
test('right-drawer can be closed', function(done) {
var f, panel, drawer, main;
f = fixture('right-drawer');
drawer = f.querySelector('#drawer');
main = f.querySelector('#main');
f.set('forceNarrow', true);
f._forceNarrowChanged();
f.openDrawer();
Polymer.Base.async(function() {
var drawerBoundingRect = drawer.getBoundingClientRect();
var mainStyle = window.getComputedStyle(main);
expect(drawerBoundingRect.right).to.be.equal(f.offsetWidth);
expect(drawerBoundingRect.width).to.be.equal(256);
done();
});
});
});
</script>
</body>
</html>