Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html

Issue 1401633002: Update Polymer from 1.1.4 -> 1.1.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dzhioev@ review Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
index ff78809ac37ff3b55e2a4a4952970e9f5a04b471..20dab1b750b787ec00d2ee49cb496139d21e4238 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
@@ -7,7 +7,8 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
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="../paper-styles/paper-styles.html">
+<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
+<link rel="import" href="../paper-styles/color.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
@@ -17,6 +18,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
<!--
+Material design: [Sliders](https://www.google.com/design/spec/components/sliders.html)
+
`paper-slider` allows user to select a value from a range of values by
moving the slider thumb. The interactive nature of the slider makes it a
great choice for settings that reflect intensity levels, such as volume,
@@ -59,10 +62,248 @@ Custom property | Description | Default
-->
</head><body><dom-module id="paper-slider">
+ <template strip-whitespace="">
+ <style>
+ :host {
+ display: inline-block;
+ width: 200px;
+ cursor: default;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ --paper-progress-active-color: var(--paper-slider-active-color, --google-blue-700);
+ --paper-progress-secondary-color: var(--paper-slider-secondary-color, --google-blue-300);
+ --paper-progress-disabled-active-color: var(--paper-slider-disabled-active-color, --google-grey-500);
+ --paper-progress-disabled-secondary-color: var(--paper-slider-disabled-secondary-color, --google-grey-300);
+ }
+
+ /* focus shows the ripple */
+ :host(:focus) {
+ outline: none;
+ }
+
+ #sliderContainer {
+ position: relative;
+ width: calc(100% - 32px);
+ height: 32px;
+ }
+
+ #sliderContainer:focus {
+ outline: 0;
+ }
+
+ #sliderContainer.editable {
+ float: left;
+ width: calc(100% - 72px);
+ margin: 12px 0;
+ }
+
+ .bar-container {
+ position: absolute;
+ top: 0;
+ left: 16px;
+ height: 100%;
+ width: 100%;
+ overflow: hidden;
+ }
+
+ .ring > .bar-container {
+ left: 20px;
+ width: calc(100% - 4px);
+ transition: left 0.18s ease, width 0.18s ease;
+ }
+
+ .ring.expand:not(.pin) > .bar-container {
+ left: 30px;
+ width: calc(100% - 14px);
+ }
+
+ .ring.expand.dragging > .bar-container {
+ transition: none;
+ }
+
+ #sliderBar {
+ position: absolute;
+ top: 15px;
+ left: 0;
+ width: 100%;
+ padding: 8px 0;
+ margin: -8px 0;
+ background-color: var(--paper-slider-bar-color, transparent);
+ --paper-progress-height: var(--paper-slider-height, 2px);
+ }
+
+ .ring #sliderBar {
+ left: -4px;
+ width: calc(100% + 4px);
+ }
+
+ .ring.expand:not(.pin) #sliderBar {
+ left: -14px;
+ width: calc(100% + 14px);
+ }
+
+ .slider-markers {
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ height: 2px;
+ width: calc(100% + 2px);
+ box-sizing: border-box;
+ pointer-events: none;
+ }
+
+ .slider-markers::after,
+ .slider-marker::after {
+ content: "";
+ display: block;
+ width: 2px;
+ height: 2px;
+ border-radius: 50%;
+ background-color: black;
+ }
+
+ #sliderKnob {
+ @apply(--layout-center-justified);
+ @apply(--layout-center);
+ @apply(--layout-horizontal);
+
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 32px;
+ height: 32px;
+ }
+
+ .transiting > #sliderKnob {
+ transition: left 0.08s ease;
+ }
+
+ #sliderKnob:focus {
+ outline: none;
+ }
+
+ #sliderKnob.dragging {
+ transition: none;
+ }
+
+ .snaps > #sliderKnob.dragging {
+ transition: -webkit-transform 0.08s ease;
+ transition: transform 0.08s ease;
+ }
+
+ #sliderKnobInner {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background-color: var(--paper-slider-knob-color, --google-blue-700);
- <link rel="import" type="css" href="paper-slider.css">
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
- <template>
+ transition-property: height, width, background-color, border;
+ transition-duration: 0.1s;
+ transition-timing-function: ease;
+ }
+
+ .expand:not(.pin) > #sliderKnob > #sliderKnobInner {
+ width: 100%;
+ height: 100%;
+
+ -webkit-transform: translateZ(0);
+ transform: translateZ(0);
+ }
+
+ .ring > #sliderKnob > #sliderKnobInner {
+ background-color: var(--paper-slider-knob-start-color, transparent);
+ border: 2px solid var(--paper-slider-knob-start-border-color, #c8c8c8);
+ }
+
+ #sliderKnobInner::before {
+ background-color: var(--paper-slider-pin-color, --google-blue-700);
+ }
+
+ .pin > #sliderKnob > #sliderKnobInner::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 26px;
+ height: 26px;
+ margin-left: 3px;
+ border-radius: 50% 50% 50% 0;
+
+ -webkit-transform: rotate(-45deg) scale(0) translate(0);
+ transform: rotate(-45deg) scale(0) translate(0);
+ }
+
+ #sliderKnobInner::before,
+ #sliderKnobInner::after {
+ transition: -webkit-transform .2s ease, background-color .18s ease;
+ transition: transform .2s ease, background-color .18s ease;
+ }
+
+ .pin.ring > #sliderKnob > #sliderKnobInner::before {
+ background-color: var(--paper-slider-pin-start-color, #c8c8c8);
+ }
+
+ .pin.expand > #sliderKnob > #sliderKnobInner::before {
+ -webkit-transform: rotate(-45deg) scale(1) translate(17px, -17px);
+ transform: rotate(-45deg) scale(1) translate(17px, -17px);
+ }
+
+ .pin > #sliderKnob > #sliderKnobInner::after {
+ content: attr(value);
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 32px;
+ height: 26px;
+ text-align: center;
+ color: var(--paper-slider-font-color, #fff);
+ font-size: 10px;
+
+ -webkit-transform: scale(0) translate(0);
+ transform: scale(0) translate(0);
+ }
+
+ .pin.expand > #sliderKnob > #sliderKnobInner::after {
+ -webkit-transform: scale(1) translate(0, -17px);
+ transform: scale(1) translate(0, -17px);
+ }
+
+ /* paper-input */
+ .slider-input {
+ width: 50px;
+ float: right;
+ overflow: hidden;
+ --paper-input-container-input: {
+ text-align: center;
+ };
+ }
+
+ /* disabled state */
+ #sliderContainer.disabled {
+ pointer-events: none;
+ }
+
+ .disabled > #sliderKnob > #sliderKnobInner {
+ width: 8px;
+ height: 8px;
+ background-color: var(--paper-slider-disabled-knob-color, --google-grey-500);
+ }
+
+ .disabled.ring > #sliderKnob > #sliderKnobInner {
+ background-color: transparent;
+ }
+
+ paper-ripple {
+ color: var(--paper-slider-knob-color, --google-blue-700);
+ }
+
+ </style>
<div id="sliderContainer" class$="[[_getClassNames(disabled, pin, snaps, immediateValue, min, expand, dragging, transiting, editable)]]">
<div class="bar-container">
@@ -79,18 +320,14 @@ Custom property | Description | Default
</template>
<div id="sliderKnob" class="center-justified center horizontal layout" on-down="_knobdown" on-up="_resetKnob" on-track="_onTrack" on-transitionend="_knobTransitionEnd">
- <paper-ripple center="" id="ink" class="circle" hidden$="[[!receivedFocusFromKeyboard]]">
- </paper-ripple>
<div id="sliderKnobInner" value$="[[immediateValue]]"></div>
</div>
</div>
-
<template is="dom-if" if="[[editable]]">
- <paper-input id="input" class="slider-input" disabled$="[[disabled]]" on-change="_inputChange" value="[[_fixForInput(immediateValue)]]">
+ <paper-input id="input" type="number" step="[[step]]" min="[[min]]" max="[[max]]" class="slider-input" disabled$="[[disabled]]" value="[[immediateValue]]" on-change="_changeValue" on-keydown="_inputKeyDown" no-label-float="">
</paper-input>
</template>
</template>
-
</dom-module>
<script src="paper-slider-extracted.js"></script></body></html>

Powered by Google App Engine
This is Rietveld 408576698