ReadonlyactionClasses to remove on the actions target if any actions are checked
ReadonlyactionTarget(s) that will have the actionInactive classes removed if any actions are checked
ReadonlyallAll select-all checkbox targets
ReadonlycontextReadonlyitemAll item checkbox targets
OptionallastInternal tracking of last clicked for shift+click behavior
OptionalshiftInternal tracking of whether the shift key is active for multiple selection
StaticblessingsStaticclassesStaticoutletsStatictargetsStaticvaluesStaticshouldOn creation, ensure that the select all checkboxes are in sync. Set up the event listeners for shift+click behavior.
Returns all valid targets (i.e. not disabled).
When an item is toggled, ensure the select all targets are kept in sync. Update the classes on the action targets to reflect the current state. If the shift key is pressed, toggle all the items between the last clicked item and the current item.
Optionalevent: CustomEvent<ToggleOptions> & { params?: ToggleOptions }Toggles all item checkboxes, can be used to force check or uncheck all. If the event used to trigger this method does not have a suitable target, the first allTarget will be used to determine the current checked value.
Staticafter
Adds the ability to collectively toggle a set of (non-disabled) checkboxes.
Example: - Basic usage
@example - Using groups to allow toggles to be controlled separately or together