-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add an
isFocusable()
method to FlyoutItem.
- Loading branch information
Showing
12 changed files
with
195 additions
and
86 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type {IBoundedElement} from './interfaces/i_bounded_element.js'; | ||
|
||
/** | ||
* Representation of an item displayed in a flyout. | ||
*/ | ||
export class FlyoutItem { | ||
/** | ||
* Creates a new FlyoutItem. | ||
* | ||
* @param element The element that will be displayed in the flyout. | ||
* @param type The type of element. Should correspond to the type of the | ||
* flyout inflater that created this object. | ||
* @param focusable True if the element should be allowed to be focused by | ||
* e.g. keyboard navigation in the flyout. | ||
*/ | ||
constructor( | ||
private element: IBoundedElement, | ||
private type: string, | ||
private focusable: boolean, | ||
) {} | ||
|
||
/** | ||
* Returns the element displayed in the flyout. | ||
*/ | ||
getElement() { | ||
return this.element; | ||
} | ||
|
||
/** | ||
* Returns the type of flyout element this item represents. | ||
*/ | ||
getType() { | ||
return this.type; | ||
} | ||
|
||
/** | ||
* Returns whether or not the flyout element can receive focus. | ||
*/ | ||
isFocusable() { | ||
return this.focusable; | ||
} | ||
} |
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.