Sparse domination results for compactness on weighted spaces