Build the dismiss lifecycle for a menu-bearing trigger directive.
Lazily instantiates the handler on first attach() so the trigger's
popover input is bound before the factory reads it. The returned
lastSource signal is owned by this binding - the factory writes it
via its onDismiss callback, which runs from DOM event handlers
(never inside an Angular effect()).