mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update polymer
This commit is contained in:
parent
571dd964e6
commit
c526176a6a
23 changed files with 707 additions and 243 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
@ -19,21 +19,23 @@
|
|||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-selector.git"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-selector",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^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-selector",
|
||||
"_release": "1.0.2",
|
||||
"_release": "1.0.3",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "ea22d91d11ba6f72c01faa952d5e600f9d1773cf"
|
||||
"tag": "v1.0.3",
|
||||
"commit": "d93b02871f790b6bcb1fff52f24757e9c2eb04a5"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/iron-selector.git",
|
||||
"_target": "^1.0.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-selector",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "Manages a set of elements that can be selected",
|
||||
"private": true,
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
|
@ -19,10 +19,13 @@
|
|||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-selector.git"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/iron-selector",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
|
|
|
@ -17,50 +17,70 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
||||
<link rel="import" href="../iron-selector.html">
|
||||
|
||||
<style>
|
||||
<style is="custom-style">
|
||||
|
||||
iron-selector > * {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.horizontal-section {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.iron-selected {
|
||||
background-color: #ddd;
|
||||
background-color: var(--google-blue-500);
|
||||
color: white;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<body unresolved>
|
||||
|
||||
<h3>Basic</h3>
|
||||
<div class="horizontal center-justified layout">
|
||||
<div>
|
||||
<h3>Basic</h3>
|
||||
<div class="horizontal-section">
|
||||
<iron-selector selected="0">
|
||||
<div>Item 0</div>
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
<div>Item 3</div>
|
||||
<div>Item 4</div>
|
||||
</iron-selector>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<iron-selector selected="0">
|
||||
<div>Item 0</div>
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
<div>Item 3</div>
|
||||
<div>Item 4</div>
|
||||
</iron-selector>
|
||||
<div>
|
||||
<h3>Multi-select</h3>
|
||||
<div class="horizontal-section">
|
||||
<iron-selector multi selected-values='[0,2]'>
|
||||
<div>Item 0</div>
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
<div>Item 3</div>
|
||||
<div>Item 4</div>
|
||||
</iron-selector>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3>Multi-select</h3>
|
||||
|
||||
<iron-selector multi selected-values='[0,2]'>
|
||||
<div>Item 0</div>
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
<div>Item 3</div>
|
||||
<div>Item 4</div>
|
||||
</iron-selector>
|
||||
|
||||
<h3>Example</h3>
|
||||
|
||||
<iron-selector selected="foo" attr-for-selected="name">
|
||||
<div name="foo">Foo</div>
|
||||
<div name="bar">Bar</div>
|
||||
<div name="zot">Zot</div>
|
||||
</iron-selector>
|
||||
<div>
|
||||
<h3>Example</h3>
|
||||
<div class="horizontal-section">
|
||||
<iron-selector selected="foo" attr-for-selected="name">
|
||||
<div name="foo">Foo</div>
|
||||
<div name="bar">Bar</div>
|
||||
<div name="baz">Baz</div>
|
||||
<div name="qux">Qux</div>
|
||||
<div name="quux">Quux</div>
|
||||
</iron-selector>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -15,6 +15,27 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
/** @polymerBehavior */
|
||||
Polymer.IronSelectableBehavior = {
|
||||
|
||||
/**
|
||||
* Fired when iron-selector is activated (selected or deselected).
|
||||
* It is fired before the selected items are changed.
|
||||
* Cancel the event to abort selection.
|
||||
*
|
||||
* @event iron-activate
|
||||
*
|
||||
**/
|
||||
/**
|
||||
* Fired when an item is selected
|
||||
*
|
||||
* @event iron-select
|
||||
*
|
||||
**/
|
||||
/**
|
||||
* Fired when an item is deselected
|
||||
*
|
||||
* @event iron-deselect
|
||||
*
|
||||
**/
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
|
@ -68,7 +89,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
/**
|
||||
* This is a CSS selector sting. If this is set, only items that matches the CSS selector
|
||||
* This is a CSS selector string. If this is set, only items that match the CSS selector
|
||||
* are selectable.
|
||||
*
|
||||
* @attribute selectable
|
||||
|
@ -96,18 +117,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
selectedAttribute: {
|
||||
type: String,
|
||||
value: null
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The set of excluded elements where the key is the `localName`
|
||||
* of the element that will be ignored from the item list.
|
||||
*
|
||||
* @type {object}
|
||||
* @default {template: 1}
|
||||
*/
|
||||
|
||||
excludedLocalNames: {
|
||||
type: Object,
|
||||
value: function() {
|
||||
return {
|
||||
'template': 1
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_updateSelected(attrForSelected, selected)'
|
||||
],
|
||||
|
||||
excludedLocalNames: {
|
||||
'template': 1
|
||||
},
|
||||
|
||||
created: function() {
|
||||
this._bindFilterItem = this._filterItem.bind(this);
|
||||
this._selection = new Polymer.IronSelection(this._applySelection.bind(this));
|
||||
|
@ -186,9 +219,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
_removeListener: function(eventName) {
|
||||
// There is no unlisten yet...
|
||||
// https://github.com/Polymer/polymer/issues/1639
|
||||
//this.removeEventListener(eventName, this._bindActivateHandler);
|
||||
this.unlisten(this, eventName, '_activateHandler');
|
||||
},
|
||||
|
||||
_activateEventChanged: function(eventName, old) {
|
||||
|
@ -277,11 +308,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
},
|
||||
|
||||
_activateHandler: function(e) {
|
||||
// TODO: remove this when https://github.com/Polymer/polymer/issues/1639 is fixed so we
|
||||
// can just remove the old event listener.
|
||||
if (e.type !== this.activateEvent) {
|
||||
return;
|
||||
}
|
||||
var t = e.target;
|
||||
var items = this.items;
|
||||
while (t && t != this) {
|
||||
|
|
90
dashboard-ui/bower_components/iron-selector/test/excluded-local-names.html
vendored
Normal file
90
dashboard-ui/bower_components/iron-selector/test/excluded-local-names.html
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
<!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.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>
|
||||
|
||||
<title>iron-selector-selected-attribute</title>
|
||||
<meta charset="utf-8">
|
||||
<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="../iron-selector.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="test1">
|
||||
<template>
|
||||
<iron-selector>
|
||||
<div>Item 0</div>
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
<span>Item 3</span>
|
||||
</iron-selector>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="test2">
|
||||
<template>
|
||||
<iron-selector>
|
||||
<div>Item 0</div>
|
||||
<div>Item 1</div>
|
||||
<div>Item 2</div>
|
||||
<p>Item 3</p>
|
||||
</iron-selector>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('excluded local names', function() {
|
||||
|
||||
var test1, test2;
|
||||
|
||||
setup(function () {
|
||||
test1 = fixture('test1');
|
||||
test2 = fixture('test2');
|
||||
});
|
||||
|
||||
test('default `excludedLocalNames`', function() {
|
||||
assert.isTrue('template' in test1.excludedLocalNames);
|
||||
assert.isTrue('template' in test2.excludedLocalNames);
|
||||
});
|
||||
|
||||
test('custom `excludedLocalNames`', function() {
|
||||
test1.excludedLocalNames.foo = 1;
|
||||
|
||||
assert.isTrue('foo' in test1.excludedLocalNames);
|
||||
assert.isFalse('foo' in test2.excludedLocalNames);
|
||||
});
|
||||
|
||||
|
||||
test('items', function() {
|
||||
test1.excludedLocalNames.span = 1;
|
||||
test2.excludedLocalNames.div = 1;
|
||||
|
||||
var NOT_FOUND = -1;
|
||||
var items1 = test1.items.map(function(el) { return el.localName; });
|
||||
var items2 = test2.items.map(function(el) { return el.localName; });
|
||||
|
||||
assert.equal(items1.indexOf('span'), NOT_FOUND);
|
||||
assert.equal(items2.indexOf('div'), NOT_FOUND);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -27,7 +27,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
'next-previous.html',
|
||||
'selected-attribute.html',
|
||||
'template-repeat.html',
|
||||
'content.html'
|
||||
'content.html',
|
||||
'excluded-local-names.html'
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue