Commit efb6902c authored by michaelpg's avatar michaelpg Committed by Commit bot

Pull latest Polymer elements

BUG=none

Review URL: https://codereview.chromium.org/1124053009

Cr-Commit-Position: refs/heads/master@{#330424}
parent 089be897
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
"web-component-tester": "Polymer/web-component-tester#^2.2.3", "web-component-tester": "Polymer/web-component-tester#^2.2.3",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0"
}, },
"homepage": "https://github.com/PolymerElements/iron-selector", "homepage": "https://github.com/polymerelements/iron-selector",
"_release": "0.8.5", "_release": "0.8.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.8.5", "tag": "v0.8.5",
"commit": "6b56de55e3e7f8ed108c9c227c85bc2a2f360d0d" "commit": "6b56de55e3e7f8ed108c9c227c85bc2a2f360d0d"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^0.8.0", "_target": "^0.8.0",
"_originalSource": "PolymerElements/iron-selector" "_originalSource": "polymerelements/iron-selector"
} }
\ No newline at end of file
{
"name": "iron-behaviors",
"private": true,
"authors": [
"The Polymer Authors"
],
"license": "MIT",
"dependencies": {
"polymer": "Polymer/polymer#v0.8.0-rc.7"
},
"devDependencies": {
"iron-test-helpers": "polymerelements/iron-test-helpers#^0.8.0",
"test-fixture": "polymerelements/test-fixture#^0.8.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0",
"web-component-tester": "*"
},
"homepage": "https://github.com/PolymerElements/iron-state-behaviors",
"version": "0.8.0",
"_release": "0.8.0",
"_resolution": {
"type": "version",
"tag": "v0.8.0",
"commit": "bde97715665a35c467efd869174eaadf6acea2ff"
},
"_source": "git://github.com/PolymerElements/iron-state-behaviors.git",
"_target": "^0.8.0",
"_originalSource": "PolymerElements/iron-state-behaviors"
}
\ No newline at end of file
iron-behaviors
==============
This repository collects shared behaviors that are mixed in to other elements.
{
"name": "iron-behaviors",
"private": true,
"authors": [
"The Polymer Authors"
],
"license": "MIT",
"dependencies": {
"polymer": "Polymer/polymer#v0.8.0-rc.7"
},
"devDependencies": {
"iron-test-helpers": "polymerelements/iron-test-helpers#^0.8.0",
"test-fixture": "polymerelements/test-fixture#^0.8.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0",
"web-component-tester": "*"
}
}
<!doctype html>
<!--
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></iron-component-page>
</body>
</html>
Polymer.IronButtonState = {
properties: {
/**
* If true, the user is currently holding down the button.
*
* @attribute pressed
* @type boolean
* @default false
*/
pressed: {
type: Boolean,
readOnly: true,
reflectToAttribute: true,
observer: '_pressedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*
* @attribute toggles
* @type boolean
* @default false
*/
toggles: {
type: Boolean,
reflectToAttribute: true
},
/**
* If true, the button is a toggle and is currently in the active state.
*
* @attribute active
* @type boolean
* @default false
*/
active: {
type: Boolean,
notify: true,
reflectToAttribute: true,
observer: '_activeChanged'
}
},
listeners: {
mousedown: '_downHandler',
mouseup: '_upHandler',
keydown: '_keyDownHandler',
keyup: '_keyUpHandler',
tap: '_tapHandler'
},
_tapHandler: function() {
if (this.toggles) {
// a tap is needed to toggle the active state
this._userActivate(!this.active);
} else {
this.active = false;
}
},
// to emulate native checkbox, (de-)activations from a user interaction fire
// 'change' events
_userActivate: function(active) {
this.active = active;
this.fire('change');
},
_downHandler: function() {
this._setPressed(true);
},
_upHandler: function(e) {
this._setPressed(false);
},
_keyDownHandler: function(e) {
switch(e.keyCode) {
case this.keyCodes.ENTER_KEY:
this._asyncClick();
break;
case this.keyCodes.SPACE:
this._setPressed(true);
break;
}
},
_keyUpHandler: function(e) {
if (e.keyCode == this.keyCodes.SPACE) {
if (this.pressed) {
this._asyncClick();
}
this._setPressed(false);
}
},
// trigger click asynchronously, the asynchrony is useful to allow one
// event handler to unwind before triggering another event
_asyncClick: function() {
this.async(function() {
this.click();
}, 1);
},
// any of these changes are considered a change to button state
_pressedChanged: function(pressed) {
this._changedButtonState();
},
_activeChanged: function(active) {
this.setAttribute('aria-pressed', active ? 'true' : 'false');
this._changedButtonState();
},
_controlStateChanged: function() {
if (this.disabled) {
this._setPressed(false);
this.active = false;
} else {
this._changedButtonState();
}
},
// provide hook for follow-on behaviors to react to button-state
_changedButtonState: function() {
if (this._buttonStateChanged) {
this._buttonStateChanged(); // abstract
}
}
};
<!--
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><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="iron-control-state.html">
</head><body><script src="iron-button-state-extracted.js"></script></body></html>
\ No newline at end of file
Polymer.IronControlState = {
properties: {
/**
* If true, the element currently has focus.
*
* @attribute focused
* @type boolean
* @default false
*/
focused: {
type: Boolean,
value: false,
notify: true,
readOnly: true,
reflectToAttribute: true
},
/**
* If true, the user cannot interact with this element.
*
* @attribute disabled
* @type boolean
* @default false
*/
disabled: {
type: Boolean,
value: false,
notify: true,
observer: '_disabledChanged',
reflectToAttribute: true
},
_oldTabIndex: {
type: String
}
},
observers: [
'_changedControlState(focused, disabled)'
],
listeners: {
focus: '_focusHandler',
blur: '_blurHandler'
},
ready: function() {
// TODO(sjmiles): ensure read-only property is valued so the compound
// observer will fire
if (this.focused === undefined) {
this._setFocused(false);
}
},
_focusHandler: function() {
this._setFocused(true);
},
_blurHandler: function() {
this._setFocused(false);
},
_disabledChanged: function(disabled, old) {
this.setAttribute('aria-disabled', disabled ? 'true' : 'false');
this.style.pointerEvents = disabled ? 'none' : '';
if (disabled) {
this._oldTabIndex = this.tabIndex;
this.focused = false;
this.tabIndex = -1;
} else if (this._oldTabIndex !== undefined) {
this.tabIndex = this._oldTabIndex;
}
},
_changedControlState: function() {
// _controlStateChanged is abstract, follow-on behaviors may implement it
if (this._controlStateChanged) {
this._controlStateChanged();
}
}
};
<!--
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><link rel="import" href="../polymer/polymer.html">
</head><body><script src="iron-control-state-extracted.js"></script></body></html>
\ No newline at end of file
{ {
"name": "paper-toggle-button", "name": "paper-toggle-button",
"version": "0.8.0", "version": "0.8.1",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
], ],
...@@ -22,21 +22,21 @@ ...@@ -22,21 +22,21 @@
"polymer": "polymer/polymer#v0.8.0-rc.7", "polymer": "polymer/polymer#v0.8.0-rc.7",
"paper-ripple": "PolymerElements/paper-ripple#^0.8.0", "paper-ripple": "PolymerElements/paper-ripple#^0.8.0",
"paper-styles": "PolymerElements/paper-styles#^0.8.0", "paper-styles": "PolymerElements/paper-styles#^0.8.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0", "paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0"
"iron-state-behaviors": "PolymerElements/iron-state-behaviors#^0.8.0"
}, },
"devDependencies": { "devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1",
"web-component-tester": "Polymer/web-component-tester#^2.2.3", "web-component-tester": "Polymer/web-component-tester#^2.2.3",
"test-fixture": "PolymerElements/test-fixture#^0.8.0", "test-fixture": "PolymerElements/test-fixture#^0.8.0",
"iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0", "iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^0.8.0"
}, },
"_release": "0.8.0", "_release": "0.8.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.8.0", "tag": "v0.8.1",
"commit": "6d9e93cc963e9f6974c3c34c63e3790586ae5d6c" "commit": "db5ce1ea8c4435650b172d3f287821d9797974c8"
}, },
"_source": "git://github.com/PolymerElements/paper-toggle-button.git", "_source": "git://github.com/PolymerElements/paper-toggle-button.git",
"_target": "^0.8.0", "_target": "^0.8.0",
......
{ {
"name": "paper-toggle-button", "name": "paper-toggle-button",
"version": "0.8.0", "version": "0.8.1",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
], ],
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
"polymer": "polymer/polymer#v0.8.0-rc.7", "polymer": "polymer/polymer#v0.8.0-rc.7",
"paper-ripple": "PolymerElements/paper-ripple#^0.8.0", "paper-ripple": "PolymerElements/paper-ripple#^0.8.0",
"paper-styles": "PolymerElements/paper-styles#^0.8.0", "paper-styles": "PolymerElements/paper-styles#^0.8.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0", "paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0"
"iron-state-behaviors": "PolymerElements/iron-state-behaviors#^0.8.0"
}, },
"devDependencies": { "devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1",
"web-component-tester": "Polymer/web-component-tester#^2.2.3", "web-component-tester": "Polymer/web-component-tester#^2.2.3",
"test-fixture": "PolymerElements/test-fixture#^0.8.0", "test-fixture": "PolymerElements/test-fixture#^0.8.0",
"iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0", "iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^0.8.0"
} }
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
is: 'paper-toggle-button', is: 'paper-toggle-button',
behaviors: [ behaviors: [
Polymer.PaperButtonBehavior Polymer.PaperRadioButtonBehavior
], ],
// The custom properties shim is currently an opt-in feature. // The custom properties shim is currently an opt-in feature.
...@@ -37,7 +37,22 @@ ...@@ -37,7 +37,22 @@
type: Boolean, type: Boolean,
value: false, value: false,
reflectToAttribute: true, reflectToAttribute: true,
notify: true,
observer: '_checkedChanged' observer: '_checkedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*
* @attribute toggles
* @type boolean
* @default true
*/
toggles: {
type: Boolean,
value: true,
reflectToAttribute: true
} }
}, },
...@@ -47,10 +62,6 @@ ...@@ -47,10 +62,6 @@
//xtrack: '_ontrack' //xtrack: '_ontrack'
}, },
ready: function() {
this.toggles = true;
},
// button-behavior hook // button-behavior hook
_buttonStateChanged: function() { _buttonStateChanged: function() {
this.checked = this.active; this.checked = this.active;
......
...@@ -8,7 +8,7 @@ Code distributed by Google as part of the polymer project is also ...@@ -8,7 +8,7 @@ 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 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><link rel="import" href="../polymer/polymer.html"> --><html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-ripple/paper-ripple.html"> <link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-behaviors/paper-button-behavior.html"> <link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
<!-- <!--
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state `paper-toggle-button` provides a ON/OFF switch that user can toggle the state
......
{ {
"name": "polymer-externs", "name": "polymer-externs",
"homepage": "https://github.com/PolymerLabs/polymer-externs", "homepage": "https://github.com/PolymerLabs/polymer-externs",
"version": "0.8.0", "version": "0.8.1",
"_release": "0.8.0", "_release": "0.8.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.8.0", "tag": "v0.8.1",
"commit": "a135fbf1cfbd0675f92fc936a26ffe73d448f092" "commit": "bfd541f00f7d38ba73eeeeb5e582d85db37ddf28"
}, },
"_source": "git://github.com/PolymerLabs/polymer-externs.git", "_source": "git://github.com/PolymerLabs/polymer-externs.git",
"_target": "^0.8.0", "_target": "^0.8.0",
......
...@@ -20,10 +20,13 @@ var Polymer = function(descriptor) {}; ...@@ -20,10 +20,13 @@ var Polymer = function(descriptor) {};
/** @constructor @extends {HTMLElement} */ /** @constructor @extends {HTMLElement} */
var PolymerElement = function() { var PolymerElement = function() {};
/** @type {!Object<string,!HTMLElement>} */
this.$; /**
}; * A mapping from ID to element in this Polymer Element's local DOM.
* @type {!Object}
*/
PolymerElement.prototype.$;
/** @type {string} The Custom element tag name. */ /** @type {string} The Custom element tag name. */
PolymerElement.prototype.is; PolymerElement.prototype.is;
......
...@@ -18,14 +18,14 @@ ...@@ -18,14 +18,14 @@
"web-component-tester": "Polymer/web-component-tester#^2.2.3", "web-component-tester": "Polymer/web-component-tester#^2.2.3",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0"
}, },
"homepage": "https://github.com/PolymerElements/iron-selector", "homepage": "https://github.com/polymerelements/iron-selector",
"_release": "0.8.5", "_release": "0.8.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.8.5", "tag": "v0.8.5",
"commit": "6b56de55e3e7f8ed108c9c227c85bc2a2f360d0d" "commit": "6b56de55e3e7f8ed108c9c227c85bc2a2f360d0d"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^0.8.0", "_target": "^0.8.0",
"_originalSource": "PolymerElements/iron-selector" "_originalSource": "polymerelements/iron-selector"
} }
\ No newline at end of file
{
"name": "iron-behaviors",
"private": true,
"authors": [
"The Polymer Authors"
],
"license": "MIT",
"dependencies": {
"polymer": "Polymer/polymer#v0.8.0-rc.7"
},
"devDependencies": {
"iron-test-helpers": "polymerelements/iron-test-helpers#^0.8.0",
"test-fixture": "polymerelements/test-fixture#^0.8.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0",
"web-component-tester": "*"
},
"homepage": "https://github.com/PolymerElements/iron-state-behaviors",
"version": "0.8.0",
"_release": "0.8.0",
"_resolution": {
"type": "version",
"tag": "v0.8.0",
"commit": "bde97715665a35c467efd869174eaadf6acea2ff"
},
"_source": "git://github.com/PolymerElements/iron-state-behaviors.git",
"_target": "^0.8.0",
"_originalSource": "PolymerElements/iron-state-behaviors"
}
\ No newline at end of file
iron-behaviors
==============
This repository collects shared behaviors that are mixed in to other elements.
{
"name": "iron-behaviors",
"private": true,
"authors": [
"The Polymer Authors"
],
"license": "MIT",
"dependencies": {
"polymer": "Polymer/polymer#v0.8.0-rc.7"
},
"devDependencies": {
"iron-test-helpers": "polymerelements/iron-test-helpers#^0.8.0",
"test-fixture": "polymerelements/test-fixture#^0.8.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.0",
"web-component-tester": "*"
}
}
<!doctype html>
<!--
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></iron-component-page>
</body>
</html>
<!--
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-control-state.html">
<script>
Polymer.IronButtonState = {
properties: {
/**
* If true, the user is currently holding down the button.
*
* @attribute pressed
* @type boolean
* @default false
*/
pressed: {
type: Boolean,
readOnly: true,
reflectToAttribute: true,
observer: '_pressedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*
* @attribute toggles
* @type boolean
* @default false
*/
toggles: {
type: Boolean,
reflectToAttribute: true
},
/**
* If true, the button is a toggle and is currently in the active state.
*
* @attribute active
* @type boolean
* @default false
*/
active: {
type: Boolean,
notify: true,
reflectToAttribute: true,
observer: '_activeChanged'
}
},
listeners: {
mousedown: '_downHandler',
mouseup: '_upHandler',
keydown: '_keyDownHandler',
keyup: '_keyUpHandler',
tap: '_tapHandler'
},
_tapHandler: function() {
if (this.toggles) {
// a tap is needed to toggle the active state
this._userActivate(!this.active);
} else {
this.active = false;
}
},
// to emulate native checkbox, (de-)activations from a user interaction fire
// 'change' events
_userActivate: function(active) {
this.active = active;
this.fire('change');
},
_downHandler: function() {
this._setPressed(true);
},
_upHandler: function(e) {
this._setPressed(false);
},
_keyDownHandler: function(e) {
switch(e.keyCode) {
case this.keyCodes.ENTER_KEY:
this._asyncClick();
break;
case this.keyCodes.SPACE:
this._setPressed(true);
break;
}
},
_keyUpHandler: function(e) {
if (e.keyCode == this.keyCodes.SPACE) {
if (this.pressed) {
this._asyncClick();
}
this._setPressed(false);
}
},
// trigger click asynchronously, the asynchrony is useful to allow one
// event handler to unwind before triggering another event
_asyncClick: function() {
this.async(function() {
this.click();
}, 1);
},
// any of these changes are considered a change to button state
_pressedChanged: function(pressed) {
this._changedButtonState();
},
_activeChanged: function(active) {
this.setAttribute('aria-pressed', active ? 'true' : 'false');
this._changedButtonState();
},
_controlStateChanged: function() {
if (this.disabled) {
this._setPressed(false);
this.active = false;
} else {
this._changedButtonState();
}
},
// provide hook for follow-on behaviors to react to button-state
_changedButtonState: function() {
if (this._buttonStateChanged) {
this._buttonStateChanged(); // abstract
}
}
};
</script>
<!--
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>
Polymer.IronControlState = {
properties: {
/**
* If true, the element currently has focus.
*
* @attribute focused
* @type boolean
* @default false
*/
focused: {
type: Boolean,
value: false,
notify: true,
readOnly: true,
reflectToAttribute: true
},
/**
* If true, the user cannot interact with this element.
*
* @attribute disabled
* @type boolean
* @default false
*/
disabled: {
type: Boolean,
value: false,
notify: true,
observer: '_disabledChanged',
reflectToAttribute: true
},
_oldTabIndex: {
type: String
}
},
observers: [
'_changedControlState(focused, disabled)'
],
listeners: {
focus: '_focusHandler',
blur: '_blurHandler'
},
ready: function() {
// TODO(sjmiles): ensure read-only property is valued so the compound
// observer will fire
if (this.focused === undefined) {
this._setFocused(false);
}
},
_focusHandler: function() {
this._setFocused(true);
},
_blurHandler: function() {
this._setFocused(false);
},
_disabledChanged: function(disabled, old) {
this.setAttribute('aria-disabled', disabled ? 'true' : 'false');
this.style.pointerEvents = disabled ? 'none' : '';
if (disabled) {
this._oldTabIndex = this.tabIndex;
this.focused = false;
this.tabIndex = -1;
} else if (this._oldTabIndex !== undefined) {
this.tabIndex = this._oldTabIndex;
}
},
_changedControlState: function() {
// _controlStateChanged is abstract, follow-on behaviors may implement it
if (this._controlStateChanged) {
this._controlStateChanged();
}
}
};
</script>
{ {
"name": "paper-toggle-button", "name": "paper-toggle-button",
"version": "0.8.0", "version": "0.8.1",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
], ],
...@@ -22,21 +22,21 @@ ...@@ -22,21 +22,21 @@
"polymer": "polymer/polymer#v0.8.0-rc.7", "polymer": "polymer/polymer#v0.8.0-rc.7",
"paper-ripple": "PolymerElements/paper-ripple#^0.8.0", "paper-ripple": "PolymerElements/paper-ripple#^0.8.0",
"paper-styles": "PolymerElements/paper-styles#^0.8.0", "paper-styles": "PolymerElements/paper-styles#^0.8.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0", "paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0"
"iron-state-behaviors": "PolymerElements/iron-state-behaviors#^0.8.0"
}, },
"devDependencies": { "devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1",
"web-component-tester": "Polymer/web-component-tester#^2.2.3", "web-component-tester": "Polymer/web-component-tester#^2.2.3",
"test-fixture": "PolymerElements/test-fixture#^0.8.0", "test-fixture": "PolymerElements/test-fixture#^0.8.0",
"iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0", "iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^0.8.0"
}, },
"_release": "0.8.0", "_release": "0.8.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.8.0", "tag": "v0.8.1",
"commit": "6d9e93cc963e9f6974c3c34c63e3790586ae5d6c" "commit": "db5ce1ea8c4435650b172d3f287821d9797974c8"
}, },
"_source": "git://github.com/PolymerElements/paper-toggle-button.git", "_source": "git://github.com/PolymerElements/paper-toggle-button.git",
"_target": "^0.8.0", "_target": "^0.8.0",
......
{ {
"name": "paper-toggle-button", "name": "paper-toggle-button",
"version": "0.8.0", "version": "0.8.1",
"authors": [ "authors": [
"The Polymer Authors" "The Polymer Authors"
], ],
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
"polymer": "polymer/polymer#v0.8.0-rc.7", "polymer": "polymer/polymer#v0.8.0-rc.7",
"paper-ripple": "PolymerElements/paper-ripple#^0.8.0", "paper-ripple": "PolymerElements/paper-ripple#^0.8.0",
"paper-styles": "PolymerElements/paper-styles#^0.8.0", "paper-styles": "PolymerElements/paper-styles#^0.8.0",
"paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0", "paper-behaviors": "PolymerElements/paper-behaviors#^0.8.0"
"iron-state-behaviors": "PolymerElements/iron-state-behaviors#^0.8.0"
}, },
"devDependencies": { "devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.6.1",
"web-component-tester": "Polymer/web-component-tester#^2.2.3", "web-component-tester": "Polymer/web-component-tester#^2.2.3",
"test-fixture": "PolymerElements/test-fixture#^0.8.0", "test-fixture": "PolymerElements/test-fixture#^0.8.0",
"iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0", "iron-doc-viewer": "PolymerElements/iron-doc-viewer#^0.8.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^0.8.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^0.8.0"
} }
} }
...@@ -10,7 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN ...@@ -10,7 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-ripple/paper-ripple.html"> <link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-behaviors/paper-button-behavior.html"> <link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
<!-- <!--
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state `paper-toggle-button` provides a ON/OFF switch that user can toggle the state
...@@ -67,7 +67,7 @@ Styling toggle-button: ...@@ -67,7 +67,7 @@ Styling toggle-button:
is: 'paper-toggle-button', is: 'paper-toggle-button',
behaviors: [ behaviors: [
Polymer.PaperButtonBehavior Polymer.PaperRadioButtonBehavior
], ],
// The custom properties shim is currently an opt-in feature. // The custom properties shim is currently an opt-in feature.
...@@ -101,7 +101,22 @@ Styling toggle-button: ...@@ -101,7 +101,22 @@ Styling toggle-button:
type: Boolean, type: Boolean,
value: false, value: false,
reflectToAttribute: true, reflectToAttribute: true,
notify: true,
observer: '_checkedChanged' observer: '_checkedChanged'
},
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
*
* @attribute toggles
* @type boolean
* @default true
*/
toggles: {
type: Boolean,
value: true,
reflectToAttribute: true
} }
}, },
...@@ -111,10 +126,6 @@ Styling toggle-button: ...@@ -111,10 +126,6 @@ Styling toggle-button:
//xtrack: '_ontrack' //xtrack: '_ontrack'
}, },
ready: function() {
this.toggles = true;
},
// button-behavior hook // button-behavior hook
_buttonStateChanged: function() { _buttonStateChanged: function() {
this.checked = this.active; this.checked = this.active;
......
{ {
"name": "polymer-externs", "name": "polymer-externs",
"homepage": "https://github.com/PolymerLabs/polymer-externs", "homepage": "https://github.com/PolymerLabs/polymer-externs",
"version": "0.8.0", "version": "0.8.1",
"_release": "0.8.0", "_release": "0.8.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v0.8.0", "tag": "v0.8.1",
"commit": "a135fbf1cfbd0675f92fc936a26ffe73d448f092" "commit": "bfd541f00f7d38ba73eeeeb5e582d85db37ddf28"
}, },
"_source": "git://github.com/PolymerLabs/polymer-externs.git", "_source": "git://github.com/PolymerLabs/polymer-externs.git",
"_target": "^0.8.0", "_target": "^0.8.0",
......
...@@ -20,10 +20,13 @@ var Polymer = function(descriptor) {}; ...@@ -20,10 +20,13 @@ var Polymer = function(descriptor) {};
/** @constructor @extends {HTMLElement} */ /** @constructor @extends {HTMLElement} */
var PolymerElement = function() { var PolymerElement = function() {};
/** @type {!Object<string,!HTMLElement>} */
this.$; /**
}; * A mapping from ID to element in this Polymer Element's local DOM.
* @type {!Object}
*/
PolymerElement.prototype.$;
/** @type {string} The Custom element tag name. */ /** @type {string} The Custom element tag name. */
PolymerElement.prototype.is; PolymerElement.prototype.is;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment