| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --><html><head><link rel="import" href="../polymer/polymer.html"> | 9 --><html><head><link rel="import" href="../polymer/polymer.html"> |
| 10 <link rel="import" href="../paper-ripple/paper-ripple.html"> | 10 <link rel="import" href="../paper-ripple/paper-ripple.html"> |
| 11 <link rel="import" href="../paper-styles/default-theme.html"> | 11 <link rel="import" href="../paper-styles/default-theme.html"> |
| 12 <link rel="import" href="../paper-styles/color.html"> | 12 <link rel="import" href="../paper-styles/color.html"> |
| 13 <link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html"> | 13 <link rel="import" href="../paper-behaviors/paper-checked-element-behavior.html"
> |
| 14 <link rel="import" href="../iron-checked-element-behavior/iron-checked-element-b
ehavior.html"> | 14 |
| 15 <!-- | 15 <!-- |
| 16 Material design: [Checkbox](https://www.google.com/design/spec/components/select
ion-controls.html#selection-controls-checkbox) |
| 16 | 17 |
| 17 `paper-checkbox` is a button that can be either checked or unchecked. User | 18 `paper-checkbox` is a button that can be either checked or unchecked. User |
| 18 can tap the checkbox to check or uncheck it. Usually you use checkboxes | 19 can tap the checkbox to check or uncheck it. Usually you use checkboxes |
| 19 to allow user to select multiple options from a set. If you have a single | 20 to allow user to select multiple options from a set. If you have a single |
| 20 ON/OFF option, avoid using a single checkbox and use `paper-toggle-button` | 21 ON/OFF option, avoid using a single checkbox and use `paper-toggle-button` |
| 21 instead. | 22 instead. |
| 22 | 23 |
| 23 Example: | 24 Example: |
| 24 | 25 |
| 25 <paper-checkbox>label</paper-checkbox> | 26 <paper-checkbox>label</paper-checkbox> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 38 `--paper-checkbox-checked-color` | Checkbox color when the input is checked | `-
-default-primary-color` | 39 `--paper-checkbox-checked-color` | Checkbox color when the input is checked | `-
-default-primary-color` |
| 39 `--paper-checkbox-checked-ink-color` | Selected/focus ripple color when the inpu
t is checked | `--default-primary-color` | 40 `--paper-checkbox-checked-ink-color` | Selected/focus ripple color when the inpu
t is checked | `--default-primary-color` |
| 40 `--paper-checkbox-checkmark-color` | Checkmark color | `white` | 41 `--paper-checkbox-checkmark-color` | Checkmark color | `white` |
| 41 `--paper-checkbox-label-color` | Label color | `--primary-text-color` | 42 `--paper-checkbox-label-color` | Label color | `--primary-text-color` |
| 42 `--paper-checkbox-error-color` | Checkbox color when invalid | `--google-red-500
` | 43 `--paper-checkbox-error-color` | Checkbox color when invalid | `--google-red-500
` |
| 43 | 44 |
| 44 @demo demo/index.html | 45 @demo demo/index.html |
| 45 --> | 46 --> |
| 46 | 47 |
| 47 </head><body><dom-module id="paper-checkbox"> | 48 </head><body><dom-module id="paper-checkbox"> |
| 48 <template> | 49 <template strip-whitespace=""> |
| 49 <style> | 50 <style> |
| 50 :host { | 51 :host { |
| 51 display: inline-block; | 52 display: inline-block; |
| 52 white-space: nowrap; | 53 white-space: nowrap; |
| 53 } | 54 } |
| 54 | 55 |
| 55 :host(:focus) { | 56 :host(:focus) { |
| 56 outline: none; | 57 outline: none; |
| 57 } | 58 } |
| 58 | 59 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 opacity: 0.65; | 191 opacity: 0.65; |
| 191 } | 192 } |
| 192 | 193 |
| 193 /* invalid state */ | 194 /* invalid state */ |
| 194 #checkbox.invalid:not(.checked) { | 195 #checkbox.invalid:not(.checked) { |
| 195 border-color: var(--paper-checkbox-error-color, --google-red-500); | 196 border-color: var(--paper-checkbox-error-color, --google-red-500); |
| 196 } | 197 } |
| 197 </style> | 198 </style> |
| 198 | 199 |
| 199 <div id="checkboxContainer"> | 200 <div id="checkboxContainer"> |
| 200 <paper-ripple id="ink" class="circle" center="" checked$="[[checked]]"></p
aper-ripple> | |
| 201 <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> | 201 <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]"> |
| 202 <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> | 202 <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div> |
| 203 </div> | 203 </div> |
| 204 </div> | 204 </div> |
| 205 | 205 |
| 206 <div id="checkboxLabel"><content></content></div> | 206 <div id="checkboxLabel"><content></content></div> |
| 207 </template> | 207 </template> |
| 208 | 208 |
| 209 </dom-module> | 209 </dom-module> |
| 210 <script src="paper-checkbox-extracted.js"></script></body></html> | 210 <script src="paper-checkbox-extracted.js"></script></body></html> |
| OLD | NEW |