I upgraded my TS140 with new motherboard (B250), CPU (i7-7700K), power supply, and cooler. Here are some notes:
1. Standard MicroATX MB can be installed perfectly.
2. To conveniently connect SATA cables, it’s better to choose a MB with upward (instead of sideward) SATA connectors.
3. To connect the power front panel on TS140, refer to:
(1) the pins for TS140: https://forums.lenovo.com/t5/ThinkCentre-A-E-M-S-Series/ThinkCentre-front-panel-connector-power-audio-and-USB-pinouts/td-p/190651
(2) the system panel connector (F_PANEL) on your new MB.
4. If using tower cooler, be careful of the total height. I use one with 125mm height.