@polymer/iron-range-behavior
Advanced tools
Comparing version 3.0.0-pre.21 to 3.0.0-pre.22
/** | ||
@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 | ||
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 | ||
*/ | ||
@@ -10,0 +11,0 @@ import '@polymer/polymer/polymer-legacy.js'; |
@@ -15,42 +15,16 @@ { | ||
"devDependencies": { | ||
"@polymer/gen-typescript-declarations": "^1.2.2", | ||
"bower": "^1.8.0", | ||
"webmat": "^0.2.0", | ||
"@polymer/iron-component-page": "^3.0.0-pre.21", | ||
"wct-browser-legacy": "^1.0.1", | ||
"@webcomponents/webcomponentsjs": "^2.0.0" | ||
"@webcomponents/webcomponentsjs": "^2.0.0", | ||
"@polymer/gen-typescript-declarations": "^1.5.0" | ||
}, | ||
"scripts": { | ||
"update-types": "bower install && gen-typescript-declarations --deleteExisting --outDir .", | ||
"format": "webmat && npm run update-types" | ||
"format": "webmat", | ||
"generate-types": "gen-typescript-declarations --deleteExisting --outDir .", | ||
"prepack": "npm run generate-types" | ||
}, | ||
"version": "3.0.0-pre.21", | ||
"resolutions": { | ||
"inherits": "2.0.3", | ||
"samsam": "1.1.3", | ||
"supports-color": "3.1.2", | ||
"type-detect": "1.0.0", | ||
"@webcomponents/webcomponentsjs": "2.0.0-beta.2" | ||
}, | ||
"version": "3.0.0-pre.22", | ||
"main": "iron-range-behavior.js", | ||
"contributors": [ | ||
"T", | ||
"h", | ||
"e", | ||
" ", | ||
"P", | ||
"o", | ||
"l", | ||
"y", | ||
"m", | ||
"e", | ||
"r", | ||
" ", | ||
"A", | ||
"u", | ||
"t", | ||
"h", | ||
"o", | ||
"r", | ||
"s" | ||
"The Polymer Authors" | ||
], | ||
@@ -57,0 +31,0 @@ "dependencies": { |
@@ -0,8 +1,100 @@ | ||
[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-range-behavior.svg)](https://www.npmjs.com/package/@polymer/iron-range-behavior) | ||
[![Build status](https://travis-ci.org/PolymerElements/iron-range-behavior.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-range-behavior) | ||
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-range-behavior) | ||
_[Demo and API docs](https://elements.polymer-project.org/elements/iron-range-behavior)_ | ||
## `IronRangeBehavior` | ||
`IronRangeBehavior` provides the behavior for something with a minimum to | ||
maximum range. | ||
## Polymer.IronRangeBehavior | ||
See: [Documentation](https://www.webcomponents.org/element/@polymer/iron-range-behavior), | ||
[Demo](https://www.webcomponents.org/element/@polymer/iron-range-behavior/demo/demo/index.html). | ||
`iron-range-behavior` provides the behavior for something with a minimum to maximum range. | ||
## Usage | ||
### Installation | ||
``` | ||
npm install --save @polymer/iron-range-behavior | ||
``` | ||
### In a Polymer 3 element | ||
```js | ||
import {PolymerElement} from '@polymer/polymer/polymer-element.js'; | ||
import {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js'; | ||
import {html} from '@polymer/polymer/lib/utils/html-tag.js'; | ||
import {IronRangeBehavior} from '@polymer/iron-range-behavior/iron-range-behavior.js'; | ||
class SimpleRange extends mixinBehaviors(IronRangeBehavior, PolymerElement) { | ||
static get template() { | ||
return html` | ||
<style> | ||
:host { | ||
display: inline-flex; | ||
align-items: center; | ||
} | ||
:host > * { | ||
margin: 0.125em; | ||
} | ||
#barContainer { | ||
display: inline-block; | ||
position: relative; | ||
border: 0.125em solid gray; | ||
height: 1em; | ||
width: 12em; | ||
} | ||
#bar { | ||
position: absolute; | ||
top: 0.125em; | ||
bottom: 0.125em; | ||
left: 0.125em; | ||
background-color: blue; | ||
} | ||
</style> | ||
<span>[[ratio]]%</span> | ||
<div id="barContainer"><div id="bar" style="width: {{ratio}}%;"></div></div> | ||
`; | ||
} | ||
} | ||
customElements.define('simple-range', SimpleRange); | ||
``` | ||
Then, in your HTML: | ||
```html | ||
<simple-range min="0" max="200" value="120"></simple-range> | ||
``` | ||
## Contributing | ||
If you want to send a PR to this element, here are the instructions for running | ||
the tests and demo locally: | ||
### Installation | ||
```sh | ||
git clone https://github.com/PolymerElements/iron-range-behavior | ||
cd iron-range-behavior | ||
npm install | ||
npm install -g polymer-cli | ||
``` | ||
### Running the demo locally | ||
```sh | ||
polymer serve --npm | ||
open http://127.0.0.1:<port>/demo/ | ||
``` | ||
### Running the tests | ||
```sh | ||
polymer test --npm | ||
``` |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4
151
101
13510
7
1