DragSelector : Module to Drag Select multiple components

DragSelector is a module that allows you to click & drag selection of multiple items in a container and automatically alter the color of the item on hover and selection.

dragselect

Highlights:

  • DragSelector(container,event_name="",selected_color=primary_color,default_color="") will raise the event name on the container every time an item is selected and alter between the two colors given. (primary color is theme’s primary container color)
  • add_items(key,value) takes in a component and value to return when calling get_items
  • get_items will return all the values of the selected items
  • The mousedown event , in the container given, triggers the drag selection to occur

FUTURE Capability:

I am working on the mobile side of this.

Clone:

The clone also has the example use (the gif above).

Shout Out

Thank you @stucork for updating the augment class to be able to identify native events of objects. (It was definitely out of my wheelhouse after seeing your commit.)

9 Likes

Awesome, thank you for sharing this!

2 Likes