add new slider
This commit is contained in:
parent
e33e5875cf
commit
09d4af3357
133 changed files with 9418 additions and 256 deletions
40
dashboard-ui/bower_components/iron-range-behavior/.bower.json
vendored
Normal file
40
dashboard-ui/bower_components/iron-range-behavior/.bower.json
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"behavior"
|
||||
],
|
||||
"main": [
|
||||
"iron-range-behavior.html"
|
||||
],
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-range-behavior.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-input": "PolymerElements/iron-input#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-range-behavior",
|
||||
"_release": "1.0.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "a743ac0b204a8e76466c2dba349ab2180c9f15f5"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-range-behavior.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "PolymerElements/iron-range-behavior"
|
||||
}
|
1
dashboard-ui/bower_components/iron-range-behavior/.gitignore
vendored
Normal file
1
dashboard-ui/bower_components/iron-range-behavior/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bower_components
|
30
dashboard-ui/bower_components/iron-range-behavior/bower.json
vendored
Normal file
30
dashboard-ui/bower_components/iron-range-behavior/bower.json
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "iron-range-behavior",
|
||||
"version": "1.0.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Provides a behavior for something with a minimum and maximum value",
|
||||
"authors": "The Polymer Authors",
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"behavior"
|
||||
],
|
||||
"main": [
|
||||
"iron-range-behavior.html"
|
||||
],
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-range-behavior.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-input": "PolymerElements/iron-input#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
}
|
79
dashboard-ui/bower_components/iron-range-behavior/demo/index.html
vendored
Normal file
79
dashboard-ui/bower_components/iron-range-behavior/demo/index.html
vendored
Normal file
|
@ -0,0 +1,79 @@
|
|||
<!--
|
||||
@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
|
||||
-->
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>iron-range-behavior demo</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../iron-range-behavior.html">
|
||||
<link rel="import" href="../../iron-input/iron-input.html">
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body unresolved>
|
||||
|
||||
<dom-module id="x-progressbar">
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
height: 40px;
|
||||
background-color: #555;
|
||||
border-radius: 4px;
|
||||
padding: 8px;
|
||||
box-shadow: inset 0px 2px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.progress {
|
||||
background-color: #999;
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.progress-value {
|
||||
padding: 0 8px;
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="progress" horizontal center layout style$="{{_computeStyle(ratio)}}">
|
||||
<div class="progress-value"><span>{{ratio}}</span>%</div>
|
||||
</div>
|
||||
</template>
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
HTMLImports.whenReady(function() {
|
||||
Polymer({
|
||||
is: 'x-progressbar',
|
||||
|
||||
behaviors: [Polymer.IronRangeBehavior],
|
||||
|
||||
_computeStyle: function(ratio) {
|
||||
return 'width: ' + ratio + '%;';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<x-progressbar min="0" max="200" value="120"></x-progressbar>
|
||||
|
||||
</body>
|
||||
</html>
|
24
dashboard-ui/bower_components/iron-range-behavior/index.html
vendored
Normal file
24
dashboard-ui/bower_components/iron-range-behavior/index.html
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<!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, 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></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
109
dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html
vendored
Normal file
109
dashboard-ui/bower_components/iron-range-behavior/iron-range-behavior.html
vendored
Normal file
|
@ -0,0 +1,109 @@
|
|||
<!--
|
||||
@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">
|
||||
|
||||
<script>
|
||||
|
||||
/**
|
||||
* `iron-range-behavior` provides the behavior for something with a minimum to maximum range.
|
||||
*
|
||||
* @demo demo/index.html
|
||||
* @polymerBehavior
|
||||
*/
|
||||
Polymer.IronRangeBehavior = {
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* The number that represents the current value.
|
||||
*/
|
||||
value: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
notify: true,
|
||||
reflectToAttribute: true
|
||||
},
|
||||
|
||||
/**
|
||||
* The number that indicates the minimum value of the range.
|
||||
*/
|
||||
min: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
notify: true
|
||||
},
|
||||
|
||||
/**
|
||||
* The number that indicates the maximum value of the range.
|
||||
*/
|
||||
max: {
|
||||
type: Number,
|
||||
value: 100,
|
||||
notify: true
|
||||
},
|
||||
|
||||
/**
|
||||
* Specifies the value granularity of the range's value.
|
||||
*/
|
||||
step: {
|
||||
type: Number,
|
||||
value: 1,
|
||||
notify: true
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the ratio of the value.
|
||||
*/
|
||||
ratio: {
|
||||
type: Number,
|
||||
value: 0,
|
||||
readOnly: true,
|
||||
notify: true
|
||||
},
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_update(value, min, max, step)'
|
||||
],
|
||||
|
||||
_calcRatio: function(value) {
|
||||
return (this._clampValue(value) - this.min) / (this.max - this.min);
|
||||
},
|
||||
|
||||
_clampValue: function(value) {
|
||||
return Math.min(this.max, Math.max(this.min, this._calcStep(value)));
|
||||
},
|
||||
|
||||
_calcStep: function(value) {
|
||||
/**
|
||||
* if we calculate the step using
|
||||
* `Math.round(value / step) * step` we may hit a precision point issue
|
||||
* eg. 0.1 * 0.2 = 0.020000000000000004
|
||||
* http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
|
||||
*
|
||||
* as a work around we can divide by the reciprocal of `step`
|
||||
*/
|
||||
return this.step ? (Math.round(value / this.step) / (1 / this.step)) : value;
|
||||
},
|
||||
|
||||
_validateValue: function() {
|
||||
var v = this._clampValue(this.value);
|
||||
this.value = this.oldValue = isNaN(v) ? this.oldValue : v;
|
||||
return this.value !== v;
|
||||
},
|
||||
|
||||
_update: function() {
|
||||
this._validateValue();
|
||||
this._setRatio(this._calcRatio(this.value) * 100);
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
111
dashboard-ui/bower_components/iron-range-behavior/test/basic.html
vendored
Normal file
111
dashboard-ui/bower_components/iron-range-behavior/test/basic.html
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
<!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>iron-range-behavior</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="x-progressbar.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="trivialRange">
|
||||
<template>
|
||||
<x-progressbar></x-progressbar>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('<x-progressbar>', function() {
|
||||
var range;
|
||||
|
||||
setup(function() {
|
||||
range = fixture('trivialRange');
|
||||
});
|
||||
|
||||
test('check default', function() {
|
||||
assert.equal(range.min, 0);
|
||||
assert.equal(range.max, 100);
|
||||
assert.equal(range.value, 0);
|
||||
});
|
||||
|
||||
test('set value', function(done) {
|
||||
range.value = 50;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.value, 50);
|
||||
// test clamp value
|
||||
range.value = 60.1;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.value, 60);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('set max', function(done) {
|
||||
range.max = 10;
|
||||
range.value = 11;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.value, range.max);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('test ratio', function(done) {
|
||||
range.max = 10;
|
||||
range.value = 5;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.ratio, 50);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test('set min', function(done) {
|
||||
range.min = 10
|
||||
range.max = 50;
|
||||
range.value = 30;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.ratio, 50);
|
||||
range.value = 0;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.value, range.min);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
test('set step', function(done) {
|
||||
range.min = 0;
|
||||
range.max = 10;
|
||||
range.value = 5.1;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.value, 5);
|
||||
range.step = 0.1;
|
||||
range.value = 5.1;
|
||||
asyncPlatformFlush(function() {
|
||||
assert.equal(range.value, 5.1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
25
dashboard-ui/bower_components/iron-range-behavior/test/index.html
vendored
Normal file
25
dashboard-ui/bower_components/iron-range-behavior/test/index.html
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!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>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'basic.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
dashboard-ui/bower_components/iron-range-behavior/test/x-progressbar.html
vendored
Normal file
18
dashboard-ui/bower_components/iron-range-behavior/test/x-progressbar.html
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!--
|
||||
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="../iron-range-behavior.html">
|
||||
|
||||
<script>
|
||||
Polymer({
|
||||
is: 'x-progressbar',
|
||||
|
||||
behaviors: [Polymer.IronRangeBehavior]
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue