mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update tabs
This commit is contained in:
parent
382dea3748
commit
9ea282ff39
129 changed files with 371 additions and 418 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-toggle-button",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "A material design toggle button control",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -20,24 +20,25 @@
|
|||
"homepage": "https://github.com/PolymerElements/paper-toggle-button",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.1.0",
|
||||
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
|
||||
},
|
||||
"_release": "1.0.6",
|
||||
"_release": "1.0.7",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.6",
|
||||
"commit": "e0bc6b17079da9487c62aaadeb46e3a199a7a112"
|
||||
"tag": "v1.0.7",
|
||||
"commit": "9abc8568d25c83c77394d141b82ff1630649ee7c"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
|
||||
"_target": "~1.0.5",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper-toggle-button",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "A material design toggle button control",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
|
@ -20,17 +20,18 @@
|
|||
"homepage": "https://github.com/PolymerElements/paper-toggle-button",
|
||||
"ignore": [],
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.1.0",
|
||||
"paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "Polymer/web-component-tester#^3.3.0",
|
||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,113 +0,0 @@
|
|||
/*
|
||||
@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
|
||||
*/
|
||||
|
||||
:host {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
:host([disabled]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline:none;
|
||||
}
|
||||
|
||||
:host .toggle-bar {
|
||||
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
|
||||
@apply(--paper-toggle-button-unchecked-bar);
|
||||
}
|
||||
|
||||
:host .toggle-button {
|
||||
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
|
||||
@apply(--paper-toggle-button-unchecked-button);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-bar {
|
||||
background-color: var(--paper-toggle-button-checked-bar-color, --google-green-500);
|
||||
@apply(--paper-toggle-button-checked-bar);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-button {
|
||||
background-color: var(--paper-toggle-button-checked-button-color, --google-green-500);
|
||||
@apply(--paper-toggle-button-checked-button);
|
||||
}
|
||||
|
||||
:host .toggle-ink {
|
||||
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-ink {
|
||||
color: var(--paper-toggle-button-checked-ink-color, --google-green-500);
|
||||
}
|
||||
|
||||
/* ID selectors should not be overriden by users. */
|
||||
|
||||
#toggleContainer {
|
||||
position: relative;
|
||||
width: 36px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
#toggleBar {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
pointer-events: none;
|
||||
opacity: 0.4;
|
||||
transition: background-color linear .08s;
|
||||
}
|
||||
|
||||
:host([checked]) #toggleBar {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host([disabled]) #toggleBar {
|
||||
background-color: #000;
|
||||
opacity: 0.12;
|
||||
}
|
||||
|
||||
#toggleButton {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6);
|
||||
transition: -webkit-transform linear .08s, background-color linear .08s;
|
||||
transition: transform linear .08s, background-color linear .08s;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
#toggleButton.dragging {
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
:host([checked]) #toggleButton {
|
||||
-webkit-transform: translate(16px, 0);
|
||||
transform: translate(16px, 0);
|
||||
}
|
||||
|
||||
:host([disabled]) #toggleButton {
|
||||
background-color: #bdbdbd;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#ink {
|
||||
position: absolute;
|
||||
top: -14px;
|
||||
left: -14px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
|
@ -13,6 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
<link rel="import" href="../paper-styles/default-theme.html">
|
||||
<link rel="import" href="../paper-ripple/paper-ripple.html">
|
||||
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
|
||||
<link rel="import" href="../iron-checked-element-behavior/iron-checked-element-behavior.html">
|
||||
|
||||
<!--
|
||||
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state
|
||||
|
@ -31,9 +32,9 @@ Custom property | Description | Default
|
|||
`--paper-toggle-button-unchecked-bar-color` | Slider color when the input is not checked | `#000000`
|
||||
`--paper-toggle-button-unchecked-button-color` | Button color when the input is not checked | `--paper-grey-50`
|
||||
`--paper-toggle-button-unchecked-ink-color` | Selected/focus ripple color when the input is not checked | `--dark-primary-color`
|
||||
`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--google-green-500`
|
||||
`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--google-green-500`
|
||||
`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--google-green-500`
|
||||
`--paper-toggle-button-checked-bar-color` | Slider button color when the input is checked | `--default-primary-color`
|
||||
`--paper-toggle-button-checked-button-color` | Button color when the input is checked | `--default-primary-color`
|
||||
`--paper-toggle-button-checked-ink-color` | Selected/focus ripple color when the input is checked | `--default-primary-color`
|
||||
`--paper-toggle-button-unchecked-bar` | Mixin applied to the slider when the input is not checked | `{}`
|
||||
`--paper-toggle-button-unchecked-button` | Mixin applied to the slider button when the input is not checked | `{}`
|
||||
`--paper-toggle-button-checked-bar` | Mixin applied to the slider when the input is checked | `{}`
|
||||
|
@ -46,11 +47,114 @@ Custom property | Description | Default
|
|||
-->
|
||||
|
||||
<dom-module id="paper-toggle-button">
|
||||
|
||||
<link rel="import" type="css" href="paper-toggle-button.css">
|
||||
|
||||
<template>
|
||||
|
||||
<style>
|
||||
:host {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
:host([disabled]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline:none;
|
||||
}
|
||||
|
||||
:host .toggle-bar {
|
||||
background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
|
||||
@apply(--paper-toggle-button-unchecked-bar);
|
||||
}
|
||||
|
||||
:host .toggle-button {
|
||||
background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
|
||||
@apply(--paper-toggle-button-unchecked-button);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-bar {
|
||||
background-color: var(--paper-toggle-button-checked-bar-color, --default-primary-color);
|
||||
@apply(--paper-toggle-button-checked-bar);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-button {
|
||||
background-color: var(--paper-toggle-button-checked-button-color, --default-primary-color);
|
||||
@apply(--paper-toggle-button-checked-button);
|
||||
}
|
||||
|
||||
:host .toggle-ink {
|
||||
color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
|
||||
}
|
||||
|
||||
:host([checked]) .toggle-ink {
|
||||
color: var(--paper-toggle-button-checked-ink-color, --default-primary-color);
|
||||
}
|
||||
|
||||
/* ID selectors should not be overriden by users. */
|
||||
|
||||
#toggleContainer {
|
||||
position: relative;
|
||||
width: 36px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
#toggleBar {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 8px;
|
||||
pointer-events: none;
|
||||
opacity: 0.4;
|
||||
transition: background-color linear .08s;
|
||||
}
|
||||
|
||||
:host([checked]) #toggleBar {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
:host([disabled]) #toggleBar {
|
||||
background-color: #000;
|
||||
opacity: 0.12;
|
||||
}
|
||||
|
||||
#toggleButton {
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.6);
|
||||
transition: -webkit-transform linear .08s, background-color linear .08s;
|
||||
transition: transform linear .08s, background-color linear .08s;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
#toggleButton.dragging {
|
||||
-webkit-transition: none;
|
||||
transition: none;
|
||||
}
|
||||
|
||||
:host([checked]) #toggleButton {
|
||||
-webkit-transform: translate(16px, 0);
|
||||
transform: translate(16px, 0);
|
||||
}
|
||||
|
||||
:host([disabled]) #toggleButton {
|
||||
background-color: #bdbdbd;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#ink {
|
||||
position: absolute;
|
||||
top: -14px;
|
||||
left: -14px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="toggleContainer">
|
||||
<div id="toggleBar" class="toggle-bar"></div>
|
||||
<div id="toggleButton" class="toggle-button">
|
||||
|
@ -65,7 +169,8 @@ Custom property | Description | Default
|
|||
is: 'paper-toggle-button',
|
||||
|
||||
behaviors: [
|
||||
Polymer.PaperInkyFocusBehavior
|
||||
Polymer.PaperInkyFocusBehavior,
|
||||
Polymer.IronCheckedElementBehavior
|
||||
],
|
||||
|
||||
hostAttributes: {
|
||||
|
@ -85,34 +190,6 @@ Custom property | Description | Default
|
|||
*
|
||||
* @event iron-change
|
||||
*/
|
||||
/**
|
||||
* Gets or sets the state, `true` is checked and `false` is unchecked.
|
||||
*
|
||||
* @attribute checked
|
||||
* @type boolean
|
||||
* @default false
|
||||
*/
|
||||
checked: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
reflectToAttribute: true,
|
||||
notify: true,
|
||||
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
|
||||
}
|
||||
},
|
||||
|
||||
listeners: {
|
||||
|
@ -133,11 +210,6 @@ Custom property | Description | Default
|
|||
}
|
||||
},
|
||||
|
||||
_checkedChanged: function(checked) {
|
||||
this.active = this.checked;
|
||||
this.fire('iron-change');
|
||||
},
|
||||
|
||||
_ontrack: function(event) {
|
||||
var track = event.detail;
|
||||
if (track.state === 'start') {
|
||||
|
@ -174,5 +246,4 @@ Custom property | Description | Default
|
|||
|
||||
});
|
||||
</script>
|
||||
|
||||
</dom-module>
|
||||
|
|
|
@ -39,33 +39,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
b1 = fixture('Basic');
|
||||
});
|
||||
|
||||
test('check button via click', function() {
|
||||
test('check button via click', function(done) {
|
||||
b1.addEventListener('click', function() {
|
||||
assert.isTrue(b1.getAttribute('aria-checked'));
|
||||
assert.isTrue(b1.getAttribute('aria-pressed') == 'true');
|
||||
assert.isTrue(b1.checked);
|
||||
done();
|
||||
});
|
||||
MockInteractions.down(b1);
|
||||
MockInteractions.tap(b1);
|
||||
});
|
||||
|
||||
test('toggle button via click', function() {
|
||||
test('toggle button via click', function(done) {
|
||||
b1.checked = true;
|
||||
b1.addEventListener('click', function() {
|
||||
assert.isFalse(b1.getAttribute('aria-checked'));
|
||||
assert.isFalse(b1.getAttribute('aria-pressed') == 'true');
|
||||
assert.isFalse(b1.checked);
|
||||
done();
|
||||
});
|
||||
MockInteractions.down(b1);
|
||||
MockInteractions.tap(b1);
|
||||
});
|
||||
|
||||
test('disabled button cannot be clicked', function() {
|
||||
test('disabled button cannot be clicked', function(done) {
|
||||
b1.disabled = true;
|
||||
b1.addEventListener('click', function() {
|
||||
assert.isTrue(b1.getAttribute('aria-checked'));
|
||||
b1.checked = true;
|
||||
MockInteractions.tap(b1);
|
||||
|
||||
setTimeout(function() {
|
||||
assert.isTrue(b1.getAttribute('aria-pressed') == 'true');
|
||||
assert.isTrue(b1.checked);
|
||||
done();
|
||||
});
|
||||
MockInteractions.down(b1);
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -80,6 +82,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
console.log(b1.getAttribute('role'));
|
||||
assert.isTrue(b1.getAttribute('role') == 'button');
|
||||
});
|
||||
|
||||
a11ySuite('Basic');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue