2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 @group Polymer Core Elements
11 The `<core-selection>` element is used to manage selection state. It has no
12 visual appearance and is typically used in conjunction with another element.
13 For example, [core-selector](#core-selector)
14 uses a `<core-selection>` to manage selection.
16 To mark an item as selected, call the `select(item)` method on
17 `<core-selection>`. The item itself is an argument to this method.
19 The `<core-selection>`element manages selection state for any given set of
20 items. When an item is selected, the `core-select` event is fired.
22 The attribute `multi` indicates if multiple items can be selected at once.
26 <polymer-element name="selection-example">
29 polyfill-next-selector { content: ':host > .selected'; }
30 ::content > .selected {
35 <ul on-tap="{{itemTapAction}}">
38 <core-selection id="selection" multi
39 on-core-select="{{selectAction}}"></core-selection>
42 Polymer('selection-example', {
43 itemTapAction: function(e, detail, sender) {
44 this.$.selection.select(e.target);
46 selectAction: function(e, detail, sender) {
47 detail.item.classList.toggle('selected', detail.isSelected);
59 @element core-selection
61 Fired when an item's selection state is changed. This event is fired both
62 when an item is selected or deselected. The `isSelected` detail property
63 contains the selection state.
66 @param {Object} detail
67 @param {boolean} detail.isSelected true for selection and false for de-selection
68 @param {Object} detail.item the item element
69 --><html><head><link rel="import" href="../polymer/polymer.html">
71 </head><body><polymer-element name="core-selection" attributes="multi" hidden="" assetpath="">
74 <script charset="utf-8" src="core-selection-extracted.js"></script></body></html>