1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update polymer

This commit is contained in:
Luke Pulverenti 2015-10-07 21:49:40 -04:00
parent 8119b930e4
commit cbb6337b41
74 changed files with 2195 additions and 1393 deletions

View file

@ -1,6 +1,6 @@
{
"name": "paper-radio-group",
"version": "1.0.4",
"version": "1.0.5",
"description": "A group of material design radio buttons",
"authors": [
"The Polymer Authors"
@ -33,14 +33,13 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"_release": "1.0.4",
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "v1.0.4",
"commit": "18b94b1ef062d8583cf37c9ccfbb21f70e49ad78"
"tag": "v1.0.5",
"commit": "cab4056c58d273f0953c70cc070001c97c9950b3"
},
"_source": "git://github.com/PolymerElements/paper-radio-group.git",
"_target": "~1.0.4",
"_originalSource": "PolymerElements/paper-radio-group",
"_direct": true
"_originalSource": "PolymerElements/paper-radio-group"
}

View file

@ -1,6 +1,6 @@
{
"name": "paper-radio-group",
"version": "1.0.4",
"version": "1.0.5",
"description": "A group of material design radio buttons",
"authors": [
"The Polymer Authors"

View file

@ -14,11 +14,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
<!--
`paper-radio-group` allows user to select only one radio button from a set.
Material design: [Radio button](https://www.google.com/design/spec/components/selection-controls.html#selection-controls-radio-button)
`paper-radio-group` allows user to select at most one radio button from a set.
Checking one radio button that belongs to a radio group unchecks any
previously checked radio button within the same group. Use
`selected` to get or set the selected radio button.
The <paper-radio-buttons> inside the group must have the `name` attribute
set.
Example:
<paper-radio-group selected="small">
@ -27,7 +32,15 @@ Example:
<paper-radio-button name="large">Large</paper-radio-button>
</paper-radio-group>
See <a href="paper-radio-button.html">paper-radio-button</a> for more
Radio-button-groups can be made optional, and allow zero buttons to be selected:
<paper-radio-group selected="small" allow-empty-selection>
<paper-radio-button name="small">Small</paper-radio-button>
<paper-radio-button name="medium">Medium</paper-radio-button>
<paper-radio-button name="large">Large</paper-radio-button>
</paper-radio-group>
See <a href="paper-radio-button">paper-radio-button</a> for more
information about `paper-radio-button`.
@group Paper Elements
@ -36,7 +49,7 @@ information about `paper-radio-button`.
@demo demo/index.html
-->
<dom-module name="paper-radio-group">
<dom-module id="paper-radio-group">
<style>
:host {
display: inline-block;
@ -68,6 +81,12 @@ information about `paper-radio-button`.
},
properties: {
/**
* Fired when the radio group selection changes.
*
* @event paper-radio-group-changed
*/
/**
* Overriden from Polymer.IronSelectableBehavior
*/
@ -90,6 +109,14 @@ information about `paper-radio-button`.
selectable: {
type: String,
value: 'paper-radio-button'
},
/**
* If true, radio-buttons can be deselected
*/
allowEmptySelection: {
type: Boolean,
value: false
}
},
@ -105,10 +132,16 @@ information about `paper-radio-button`.
if (this.selected) {
var oldItem = this._valueToItem(this.selected);
// Do not allow unchecking the selected item.
if (this.selected == value) {
oldItem.checked = true;
return;
// If deselecting is allowed we'll have to apply an empty selection.
// Otherwise, we should force the selection to stay and make this
// action a no-op.
if (this.allowEmptySelection) {
value = '';
} else {
oldItem.checked = true;
return;
}
}
if (oldItem)

View file

@ -154,15 +154,29 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// The selection should not change, but wait for a little bit just
// in case it would and an event would be fired.
setTimeout(function() {
try {
expect(items[0].checked).to.be.equal(true);
expect(items[1].checked).to.be.equal(false);
expect(items[2].checked).to.be.equal(false);
done();
} catch (e) {
done(e)
}
}, 200);
expect(items[0].checked).to.be.equal(true);
expect(items[1].checked).to.be.equal(false);
expect(items[2].checked).to.be.equal(false);
done();
}, 1);
});
test('clicking the selected item should deselect if allow-empty-selection is set', function (done) {
var g = fixture('WithSelection');
g.allowEmptySelection = true;
var items = g.items;
expect(items[0].checked).to.be.equal(true);
MockInteractions.tap(items[0]);
// The selection should not change, but wait for a little bit just
// in case it would and an event would be fired.
setTimeout(function() {
expect(items[0].checked).to.be.equal(false);
expect(items[1].checked).to.be.equal(false);
expect(items[2].checked).to.be.equal(false);
done();
}, 1);
});
});