I'm trying to make a key-value selection tool inside a Tom Select dropdown menu. More precisely I'm trying to simulate a dropdown from AWS E2 search tool, images below:
1. Upon clicking "Filter instances" search box you get prompted by a dropdown tag selection

2. After clicking on a tag (e.g. Architecture) a second dropdown appears:

3. After clicking on one of the values in the dropdown, I get key-value representation of my selection:

I have tried to make it work by preventing default event behavior but I couldn't get it to work and documentation isn't really helping.
Could you please guide me in the right direction or propose a new Select UI control plugin?