Versatile platform of nonlocal metasurfaces for both spectral and spatial control of light waves