basic-list-box
Advanced tools
Comparing version 0.7.6 to 0.8.0
{ | ||
"name": "basic-list-box", | ||
"version": "0.7.6", | ||
"version": "0.8.0", | ||
"description": "A single-selection list box that supports selection highlighting (using the system highlight color) and keyboard navigation.", | ||
@@ -15,4 +15,4 @@ "homepage": "https://component.kitchen", | ||
"dependencies": { | ||
"basic-element-base": "^0.7.6", | ||
"basic-component-mixins": "^0.7.6" | ||
"basic-element-base": "^0.8.0", | ||
"basic-component-mixins": "^0.8.0" | ||
}, | ||
@@ -19,0 +19,0 @@ "browserify": { |
# API Documentation | ||
<a name="ListBox"></a> | ||
## ListBox ⇐ <code>ElementBase</code> | ||
@@ -104,3 +103,2 @@ A single-selection list box that supports selection highlighting (using the | ||
<a name="ContentAsItems+applySelection"></a> | ||
### listBox.applySelection(item, selected) | ||
@@ -121,3 +119,2 @@ Apply the selection state to a single item. | ||
<a name="ItemsSelection+applySelection"></a> | ||
### listBox.applySelection(item, selected) | ||
@@ -137,3 +134,2 @@ Apply the indicate selection state to the item. | ||
<a name="ItemsSelection+canSelectNext"></a> | ||
### listBox.canSelectNext : <code>boolean</code> | ||
@@ -145,3 +141,2 @@ True if the selection can be moved to the next item, false if not (the | ||
<a name="ItemsSelection+canSelectPrevious"></a> | ||
### listBox.canSelectPrevious : <code>boolean</code> | ||
@@ -153,3 +148,2 @@ True if the selection can be moved to the previous item, false if not | ||
<a name="DistributedChildrenAsContent+content"></a> | ||
### listBox.content : <code>Array.<HTMLElement></code> | ||
@@ -161,3 +155,2 @@ The content of this component, defined to be the flattened array of | ||
<a name="ObserveContentChanges.event_content-changed"></a> | ||
### "content-changed" | ||
@@ -169,3 +162,2 @@ This event is raised when the component's contents (including distributed | ||
<a name="ObserveContentChanges+contentChanged"></a> | ||
### listBox.contentChanged() | ||
@@ -181,3 +173,2 @@ Invoked when the contents of the component (including distributed | ||
<a name="Generic+generic"></a> | ||
### listBox.generic : <code>Boolean</code> | ||
@@ -193,3 +184,2 @@ True if the component would like to receive generic styling. | ||
<a name="KeyboardDirection+goDown"></a> | ||
### listBox.goDown() | ||
@@ -201,3 +191,2 @@ Invoked when the user wants to go/navigate down. | ||
<a name="KeyboardDirection+goEnd"></a> | ||
### listBox.goEnd() | ||
@@ -209,3 +198,2 @@ Invoked when the user wants to go/navigate to the end (e.g., of a list). | ||
<a name="KeyboardDirection+goLeft"></a> | ||
### listBox.goLeft() | ||
@@ -217,3 +205,2 @@ Invoked when the user wants to go/navigate left. | ||
<a name="KeyboardDirection+goRight"></a> | ||
### listBox.goRight() | ||
@@ -225,3 +212,2 @@ Invoked when the user wants to go/navigate right. | ||
<a name="KeyboardDirection+goStart"></a> | ||
### listBox.goStart() | ||
@@ -233,3 +219,2 @@ Invoked when the user wants to go/navigate to the start (e.g., of a | ||
<a name="KeyboardDirection+goUp"></a> | ||
### listBox.goUp() | ||
@@ -241,3 +226,2 @@ Invoked when the user wants to go/navigate up. | ||
<a name="ItemsSelection+itemAdded"></a> | ||
### listBox.itemAdded(item) | ||
@@ -256,3 +240,2 @@ Handle a new item being added to the list. | ||
<a name="ContentAsItems+itemAdded"></a> | ||
### listBox.itemAdded(item) | ||
@@ -271,3 +254,2 @@ This method is invoked whenever a new item is added to the list. | ||
<a name="ContentAsItems+items"></a> | ||
### listBox.items : <code>Array.<HTMLElement></code> | ||
@@ -279,3 +261,2 @@ The current set of items in the list. See the top-level documentation for | ||
<a name="ContentAsItems.event_items-changed"></a> | ||
### "items-changed" | ||
@@ -286,3 +267,2 @@ Fires when the items in the list change. | ||
<a name="ContentAsItems+itemsChanged"></a> | ||
### listBox.itemsChanged() | ||
@@ -295,3 +275,2 @@ This method is invoked when the underlying contents change. It is also | ||
<a name="Keyboard+keydown"></a> | ||
### listBox.keydown(event) ⇒ <code>boolean</code> | ||
@@ -311,3 +290,2 @@ Handle the indicated keyboard event. | ||
<a name="KeyboardDirection+navigationAxis"></a> | ||
### listBox.navigationAxis : <code>string</code> | ||
@@ -323,3 +301,2 @@ Indicates the direction of permitted navigation with the keyboard. | ||
<a name="KeyboardPagedSelection+pageDown"></a> | ||
### listBox.pageDown() | ||
@@ -330,3 +307,2 @@ Scroll down one page. | ||
<a name="KeyboardPagedSelection+pageUp"></a> | ||
### listBox.pageUp() | ||
@@ -337,3 +313,2 @@ Scroll up one page. | ||
<a name="SelectionInView+scrollItemIntoView"></a> | ||
### listBox.scrollItemIntoView(item) | ||
@@ -354,3 +329,2 @@ Scroll the given element completely into view, minimizing the degree of | ||
<a name="SelectionInView+scrollTarget"></a> | ||
### listBox.scrollTarget : <code>HTMLElement</code> | ||
@@ -363,3 +337,2 @@ The element that should be scrolled to bring an item into view. | ||
<a name="KeyboardPagedSelection+scrollTarget"></a> | ||
### listBox.scrollTarget : <code>HTMLElement</code> | ||
@@ -371,3 +344,2 @@ The element that should be scrolled with the Page Up/Down keys. | ||
<a name="ItemsSelection.event_selected-index-changed"></a> | ||
### "selected-index-changed" | ||
@@ -383,3 +355,2 @@ Fires when the selectedIndex property changes. | ||
<a name="ItemsSelection.event_selected-item-changed"></a> | ||
### "selected-item-changed" | ||
@@ -396,3 +367,2 @@ Fires when the selectedItem property changes. | ||
<a name="ItemsSelection+selectedIndex"></a> | ||
### listBox.selectedIndex : <code>number</code> | ||
@@ -407,3 +377,2 @@ The index of the item which is currently selected. | ||
<a name="ItemsSelection+selectedItem"></a> | ||
### listBox.selectedItem : <code>object</code> | ||
@@ -416,3 +385,2 @@ The currently selected item, or null if there is no selection. | ||
<a name="ItemsSelection+selectFirst"></a> | ||
### listBox.selectFirst() | ||
@@ -423,3 +391,2 @@ Select the first item in the list. | ||
<a name="ItemsSelection+selectionRequired"></a> | ||
### listBox.selectionRequired : <code>boolean</code> | ||
@@ -429,4 +396,4 @@ True if the list should always have a selection (if it has items). | ||
**Kind**: instance property of <code>[ListBox](#ListBox)</code>. Defined by <code>[ItemsSelection](../basic-component-mixins/docs/ItemsSelection.md)</code> mixin. | ||
**Default**: <code>false</code> | ||
<a name="ItemsSelection+selectionWraps"></a> | ||
### listBox.selectionWraps : <code>boolean</code> | ||
@@ -436,5 +403,4 @@ True if selection navigations wrap from last to first, and vice versa. | ||
**Kind**: instance property of <code>[ListBox](#ListBox)</code>. Defined by <code>[ItemsSelection](../basic-component-mixins/docs/ItemsSelection.md)</code> mixin. | ||
**Default**: <code>{false}</code> | ||
**Default**: <code>false</code> | ||
<a name="KeyboardPrefixSelection+selectItemWithTextPrefix"></a> | ||
### listBox.selectItemWithTextPrefix(prefix) | ||
@@ -450,3 +416,2 @@ Select the first item whose text content begins with the given prefix. | ||
<a name="ItemsSelection+selectLast"></a> | ||
### listBox.selectLast() | ||
@@ -457,3 +422,2 @@ Select the last item in the list. | ||
<a name="ItemsSelection+selectNext"></a> | ||
### listBox.selectNext() | ||
@@ -464,3 +428,2 @@ Select the next item in the list. | ||
<a name="ItemsSelection+selectPrevious"></a> | ||
### listBox.selectPrevious() | ||
@@ -471,3 +434,2 @@ Select the previous item in the list. | ||
<a name="TargetInCollective+target"></a> | ||
### listBox.target : <code>HTMLElement</code> | ||
@@ -486,3 +448,2 @@ Gets/sets the current target of the component. | ||
<a name="ListBox+value"></a> | ||
### listBox.value : <code>string</code> | ||
@@ -497,3 +458,2 @@ The text content of the selected item. | ||
<a name="ListBox.event_value-changed"></a> | ||
### "value-changed" | ||
@@ -500,0 +460,0 @@ Fires when the list's value property changes. |
@@ -92,5 +92,6 @@ import ElementBase from '../../basic-element-base/src/ElementBase'; | ||
createdCallback() { | ||
if (super.createdCallback) { super.createdCallback(); } | ||
this.navigationAxis = 'vertical'; | ||
get defaults() { | ||
let defaults = super.defaults || {}; | ||
defaults.navigationAxis = 'vertical'; | ||
return defaults; | ||
} | ||
@@ -97,0 +98,0 @@ |
import { assert } from 'chai'; | ||
import ListBox from '../src/ListBox'; // jshint ignore:line | ||
import microtask from '../../basic-component-mixins/src/microtask'; | ||
@@ -7,9 +8,12 @@ | ||
it("defines a value property equivalent to text of selectedItem", () => { | ||
it("defines a value property equivalent to text of selectedItem", done => { | ||
let listBox = createSampleListBox(); | ||
assert.equal(listBox.value, ''); | ||
listBox.selectedIndex = 2; | ||
assert.equal(listBox.value, 'Two'); | ||
listBox.value = 'One'; | ||
assert.equal(listBox.selectedIndex, 1); | ||
microtask(() => { | ||
assert.equal(listBox.value, ''); | ||
listBox.selectedIndex = 2; | ||
assert.equal(listBox.value, 'Two'); | ||
listBox.value = 'One'; | ||
assert.equal(listBox.selectedIndex, 1); | ||
done(); | ||
}); | ||
}); | ||
@@ -16,0 +20,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
393622
4247
423
+ Addedbasic-component-mixins@0.8.0(transitive)
+ Addedbasic-element-base@0.8.0(transitive)
- Removedbasic-component-mixins@0.7.6(transitive)
- Removedbasic-element-base@0.7.6(transitive)
Updatedbasic-element-base@^0.8.0