Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
basic-arrow-selection
Advanced tools
Mixin used to add prominent left and right arrow buttons to a wrapped child. Clicking the left/right buttons selects the previous/next item.
ElementBase
Component which adds prominent left and right arrow buttons to a wrapped child such as a carousel.
You can see a live demo of this component applied to a carousel.
Clicking the left/right buttons selects the previous/next item.
Typical usage:
<basic-arrow-selection>
<basic-carousel>
... images, etc. ...
</basic-carousel>
</basic-arrow-selection>
By default, the arrow buttons are shown on devices with a mouse or mouse-like point device. They are not shown on a touch-capable device unless mouse movement is detected. To cause the buttons to always appear, apply the 'showArrows' CSS class.
Kind: global class
Extends: ElementBase
Mixes: ContentFirstChildTarget
, DirectionSelection
, DistributedChildrenAsContent
, ItemsSelection
, Keyboard
, KeyboardDirection
, TargetInCollective
, TargetInCollective
, TargetSelection
ElementBase
boolean
boolean
Array.<HTMLElement>
Array.<HTMLElement>
boolean
string
number
number
HTMLElement
object
boolean
HTMLElement
HTMLElement
HTMLElement
HTMLElement
Apply the indicate selection state to the item.
The default implementation of this method does nothing. User-visible effects will typically be handled by other mixins.
Kind: instance method of ArrowSelection
. Defined by ItemsSelection
mixin.
Param | Type | Description |
---|---|---|
item | HTMLElement | the item being selected/deselected |
selected | boolean | true if the item is selected, false if not |
boolean
True if the selection can be moved to the next item, false if not (the selected item is the last item in the list).
Kind: instance property of ArrowSelection
. Defined by ItemsSelection
mixin.
boolean
True if the selection can be moved to the previous item, false if not (the selected item is the first one in the list).
Kind: instance property of ArrowSelection
. Defined by ItemsSelection
mixin.
Array.<HTMLElement>
The content of this component, defined to be the flattened array of children distributed to the component.
Kind: instance property of ArrowSelection
. Defined by DistributedChildrenAsContent
mixin.
Invoked when the user wants to go/navigate down. The default implementation of this method does nothing.
Kind: instance method of ArrowSelection
. Defined by KeyboardDirection
mixin.
Invoked when the user wants to go/navigate to the end (e.g., of a list). The default implementation of this method does nothing.
Kind: instance method of ArrowSelection
. Defined by KeyboardDirection
mixin.
Invoked when the user wants to go/navigate left. The default implementation of this method does nothing.
Kind: instance method of ArrowSelection
. Defined by KeyboardDirection
mixin.
Invoked when the user wants to go/navigate right. The default implementation of this method does nothing.
Kind: instance method of ArrowSelection
. Defined by KeyboardDirection
mixin.
Invoked when the user wants to go/navigate to the start (e.g., of a list). The default implementation of this method does nothing.
Kind: instance method of ArrowSelection
. Defined by KeyboardDirection
mixin.
Invoked when the user wants to go/navigate up. The default implementation of this method does nothing.
Kind: instance method of ArrowSelection
. Defined by KeyboardDirection
mixin.
Handle a new item being added to the list.
The default implementation of this method simply sets the item's selection state to false.
Kind: instance method of ArrowSelection
. Defined by ItemsSelection
mixin.
Param | Type | Description |
---|---|---|
item | HTMLElement | the item being added |
Array.<HTMLElement>
The current set of items in the list.
Kind: instance property of ArrowSelection
. Defined by TargetSelection
mixin.
This method is invoked when the underlying contents change. It is also invoked on component initialization – since the items have "changed" from being nothing.
Kind: instance method of ArrowSelection
. Defined by TargetSelection
mixin.
boolean
Handle the indicated keyboard event.
The default implementation of this method does nothing. This will typically be handled by other mixins.
Kind: instance method of ArrowSelection
. Defined by Keyboard
mixin.
Returns: boolean
- true if the event was handled
Param | Type | Description |
---|---|---|
event | KeyboardEvent | the keyboard event |
string
Indicates the direction of permitted navigation with the keyboard.
Accepted values are "horizontal", "vertical", or "both" (the default). If this property is "horizontal", the Up Arrow and Down Arrow keys will be ignored. Conversely, if this is "vertical", the Left Arrow and Right Arrow keys will be ignored.
Kind: instance property of ArrowSelection
. Defined by KeyboardDirection
mixin.
Fires when the selectedIndex property changes.
Kind: event emitted by ArrowSelection
. Defined by ItemsSelection
mixin.
Param | Type | Description |
---|---|---|
detail.selectedIndex | number | The new selected index. |
Fires when the selectedItem property changes.
Kind: event emitted by ArrowSelection
. Defined by ItemsSelection
mixin.
Param | Type | Description |
---|---|---|
detail.selectedItem | HTMLElement | The new selected item. |
detail.previousItem | HTMLElement | The previously selected item. |
number
The index of the item which is currently selected, or -1 if there is no selection.
Kind: instance property of ArrowSelection
. Defined by TargetSelection
mixin.
number
The index of the item which is currently selected, or -1 if there is no selection.
Setting the index to -1 deselects any current-selected item.
Kind: instance property of ArrowSelection
. Defined by ItemsSelection
mixin.
HTMLElement
The currently selected item, or null if there is no selection.
Kind: instance property of ArrowSelection
. Defined by TargetSelection
mixin.
object
The currently selected item, or null if there is no selection.
Setting this property to null deselects any currently-selected item.
Kind: instance property of ArrowSelection
. Defined by ItemsSelection
mixin.
Select the first item in the list.
Kind: instance method of ArrowSelection
. Defined by ItemsSelection
mixin.
boolean
True if the list should always have a selection (if it has items).
Kind: instance property of ArrowSelection
. Defined by ItemsSelection
mixin.
Select the last item in the list.
Kind: instance method of ArrowSelection
. Defined by ItemsSelection
mixin.
Select the next item in the list.
Kind: instance method of ArrowSelection
. Defined by ItemsSelection
mixin.
Select the previous item in the list.
Kind: instance method of ArrowSelection
. Defined by ItemsSelection
mixin.
HTMLElement
Gets/sets the current target of the component.
Set this to point to another element. That target element will be implicitly added to the component's collective. That is, the component and its target will share responsibility for handling keyboard events.
You can set this property yourself, or you can use the ContentFirstChildTarget mixin to automatically set the target to the component's first child.
Kind: instance property of ArrowSelection
. Defined by TargetInCollective
mixin.
HTMLElement
Gets/sets the current target of the component.
Kind: instance property of ArrowSelection
. Defined by ContentFirstChildTarget
mixin.
HTMLElement
Gets/sets the target element to which this component will delegate selection actions.
Kind: instance property of ArrowSelection
. Defined by TargetSelection
mixin.
HTMLElement
Gets/sets the current target of the component.
Set this to point to another element. That target element will be implicitly added to the component's collective. That is, the component and its target will share responsibility for handling keyboard events.
You can set this property yourself, or you can use the ContentFirstChildTarget mixin to automatically set the target to the component's first child.
Kind: instance property of ArrowSelection
. Defined by TargetInCollective
mixin.
FAQs
Mixin used to add prominent left and right arrow buttons to a wrapped child. Clicking the left/right buttons selects the previous/next item.
The npm package basic-arrow-selection receives a total of 20 weekly downloads. As such, basic-arrow-selection popularity was classified as not popular.
We found that basic-arrow-selection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.