forked from microsoft/fast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add multiselect functionality to listbox (microsoft#5530)
* add multiselect functionality to listbox * Change files * add comment * rename ariaMultselectable to ariaMultiSelectable * remove empty default case * reduce repetition for notifier * update documentation and specs
- Loading branch information
Showing
16 changed files
with
903 additions
and
58 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@microsoft-fast-components-298c2320-eea5-42e0-9ef4-278fb8b7c952.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "add multiselect functionality to listbox", | ||
"packageName": "@microsoft/fast-components", | ||
"email": "john.kreitlow@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@microsoft-fast-foundation-deec4a21-5dbd-4e3d-870c-b1bbc63cfce1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "add multiselect functionality to listbox", | ||
"packageName": "@microsoft/fast-foundation", | ||
"email": "john.kreitlow@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# fast-listbox | ||
An implementation of a [listbox](https://w3c.github.io/aria/#listbox). | ||
|
||
An implementation of a [listbox](https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox). |
2 changes: 1 addition & 1 deletion
2
packages/web-components/fast-components/src/listbox/fixtures/base.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<h1>Listbox</h1> | ||
<h1>Listbox in single-selection mode</h1> | ||
|
||
<h2>Default</h2> | ||
<fast-listbox id="listbox"> | ||
|
117 changes: 117 additions & 0 deletions
117
packages/web-components/fast-components/src/listbox/fixtures/multiselect.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<h1>Listbox in multiple-selection mode</h1> | ||
|
||
<h2>Default</h2> | ||
<fast-listbox id="listbox-multiple" multiple> | ||
<fast-option>William Hartnell</fast-option> | ||
<fast-option>Patrick Troughton</fast-option> | ||
<fast-option>Jon Pertwee</fast-option> | ||
<fast-option>Tom Baker</fast-option> | ||
<fast-option>Peter Davidson</fast-option> | ||
<fast-option>Colin Baker</fast-option> | ||
<fast-option>Sylvester McCoy</fast-option> | ||
<fast-option>Paul McGann</fast-option> | ||
<fast-option>Christopher Eccleston</fast-option> | ||
<fast-option>David Tenant</fast-option> | ||
<fast-option>Matt Smith</fast-option> | ||
<fast-option>Peter Capaldi</fast-option> | ||
<fast-option>Jodie Whittaker</fast-option> | ||
</fast-listbox> | ||
|
||
<h2>Listboxes with size attribute</h2> | ||
<fast-listbox id="listbox-with-size-1" size="1" multiple> | ||
<fast-option>option 1</fast-option> | ||
<fast-option>option 2</fast-option> | ||
<fast-option>option 3</fast-option> | ||
<fast-option>option 4</fast-option> | ||
<fast-option>option 5</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-size-2" size="2" multiple> | ||
<fast-option>option 1</fast-option> | ||
<fast-option>option 2</fast-option> | ||
<fast-option>option 3</fast-option> | ||
<fast-option>option 4</fast-option> | ||
<fast-option>option 5</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-size-3" size="3" multiple> | ||
<fast-option>option 1</fast-option> | ||
<fast-option>option 2</fast-option> | ||
<fast-option>option 3</fast-option> | ||
<fast-option>option 4</fast-option> | ||
<fast-option>option 5</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-size-4" size="4" multiple> | ||
<fast-option>option 1</fast-option> | ||
<fast-option>option 2</fast-option> | ||
<fast-option>option 3</fast-option> | ||
<fast-option>option 4</fast-option> | ||
<fast-option>option 5</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-size-5" size="5" multiple> | ||
<fast-option>option 1</fast-option> | ||
<fast-option>option 2</fast-option> | ||
<fast-option>option 3</fast-option> | ||
<fast-option>option 4</fast-option> | ||
<fast-option>option 5</fast-option> | ||
</fast-listbox> | ||
|
||
<h2>Listbox with a default selected item</h2> | ||
<fast-listbox id="listbox-with-default" multiple> | ||
<fast-option>John</fast-option> | ||
<fast-option>Paul</fast-option> | ||
<fast-option selected>George</fast-option> | ||
<fast-option>Ringo</fast-option> | ||
</fast-listbox> | ||
|
||
<fast-listbox id="listbox-with-two-default-selected" multiple> | ||
<fast-option>John</fast-option> | ||
<fast-option selected>Paul</fast-option> | ||
<fast-option selected>George</fast-option> | ||
<fast-option>Ringo</fast-option> | ||
</fast-listbox> | ||
|
||
<h2>Listbox with disabled items</h2> | ||
<fast-listbox id="listbox-with-every-other-disabled" multiple> | ||
<fast-option>Extra Small</fast-option> | ||
<fast-option disabled>Small</fast-option> | ||
<fast-option>Medium</fast-option> | ||
<fast-option disabled>Large</fast-option> | ||
<fast-option>Extra Large</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-adjacent-disabled-start" multiple> | ||
<fast-option disabled>Extra Small</fast-option> | ||
<fast-option disabled>Small</fast-option> | ||
<fast-option>Medium</fast-option> | ||
<fast-option>Large</fast-option> | ||
<fast-option>Extra Large</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-adjacent-disabled-middle" multiple> | ||
<fast-option>Extra Small</fast-option> | ||
<fast-option disabled>Small</fast-option> | ||
<fast-option disabled>Medium</fast-option> | ||
<fast-option>Large</fast-option> | ||
<fast-option>Extra Large</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-adjacent-disabled-end" multiple> | ||
<fast-option>Extra Small</fast-option> | ||
<fast-option>Small</fast-option> | ||
<fast-option>Medium</fast-option> | ||
<fast-option disabled>Large</fast-option> | ||
<fast-option disabled>Extra Large</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-all-but-one-disabled" multiple> | ||
<fast-option disabled>Extra Small</fast-option> | ||
<fast-option disabled>Small</fast-option> | ||
<fast-option disabled>Medium</fast-option> | ||
<fast-option disabled>Large</fast-option> | ||
<fast-option>Extra Large</fast-option> | ||
</fast-listbox> | ||
<fast-listbox id="listbox-with-all-disabled" multiple> | ||
<fast-option disabled>Extra Small</fast-option> | ||
<fast-option disabled>Small</fast-option> | ||
<fast-option disabled>Medium</fast-option> | ||
<fast-option disabled>Large</fast-option> | ||
<fast-option disabled>Extra Large</fast-option> | ||
</fast-listbox> | ||
|
||
<h2>Empty Listbox</h2> | ||
<fast-listbox id="listbox-empty" multiple></fast-listbox> |
2 changes: 2 additions & 0 deletions
2
packages/web-components/fast-components/src/listbox/listbox.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import Base from "./fixtures/base.html"; | ||
import Multiselect from "./fixtures/multiselect.html"; | ||
|
||
export default { | ||
title: "Listbox", | ||
}; | ||
|
||
export const Listbox = () => Base; | ||
export const ListboxMultiselect = () => Multiselect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.