Return a new tree containing only nodes whose value matches predicateor have at least one matching descendant. Ancestors of any match are
preserved so the path is never broken; branches with zero matches are
dropped entirely.
Fresh implementation — not ported from @cngx/data-display/treetable.