Methods
keyPress(event) → {string}
- Description:
Retrieves the pressed key from an event.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The keyboard event. |
Returns:
- The name of the key or an empty string.
- Type
- string
preventEvent(event)
- Description:
Stops an event from taking action.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The event. |
isValidInstance(contructor, elements) → {boolean}
- Description:
Check to see if the provided elements have a specific contructor.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
This is essentially just a wrapper function around checking instanceof with more descriptive error message to help debugging.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
contructor |
object | The constructor to check for. |
elements |
object | The element(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isValidType(type, values) → {boolean}
- Description:
Check to see if the provided values are of a specific type.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
This is essentially just a wrapper function around checking typeof with more descriptive error message to help debugging.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The type to check for. |
values |
object | The value(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isCSSSelector(values) → {boolean}
- Description:
Checks to see if the provided values are valid CSS selectors.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
values |
Object.<string> | The value(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isValidClassList(values) → {boolean}
- Description:
Checks to see if the provided value is either a string or an array of strings.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
values |
Object.<string, Array.<string>> | The value(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isValidState(values) → {boolean}
- Description:
Check to see if the provided values are valid focus states for a menu.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
values |
Object.<string> | The value(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isValidEvent(values) → {boolean}
- Description:
Check to see if the provided values are valid event types for a menu.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
values |
Object.<string> | The value(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isValidHoverType(values) → {boolean}
- Description:
Check to see if the provided values are valid hover types for a menu.
The values must be provided inside of an object so the variable name can be retrieved in case of errors.
Will return true is the check is successful.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
values |
Object.<string> | The value(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isTag(tagName, elements) → {boolean}
- Description:
Checks to see if the provided elements are using a specific tag.
The elements must be provided inside of an object so the variable name can be retrieved in case of errors.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tagName |
string | The name of the tag. |
elements |
Object.<HTMLElement> | The element(s) to check. |
Returns:
- The result of the check.
- Type
- boolean
isEventSupported(event, element) → {boolean}
- Description:
Checks to see if an event is supported by a node.
- Source:
- Deprecated:
- Will be removed in v4 unless there is a new found need for it.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event type. |
element |
HTMLElement | The element to check. |
Returns:
- The result.
- Type
- boolean
Events
accessibleMenuExpand
- Description:
Expand event.
- Source:
Properties:
Name | Type | Description |
---|---|---|
details |
Object.<BaseMenuToggle> | The details object containing the BaseMenuToggle itself. |
Type:
- CustomEvent
accessibleMenuCollapse
- Description:
Collapse event.
- Source:
Properties:
Name | Type | Description |
---|---|---|
details |
Object.<BaseMenuToggle> | The details object containing the BaseMenuToggle itself. |
Type:
- CustomEvent