OfficeDev / microsoft-teams-ui-component-library

Component library enhanced experiences styled for use in Microsoft Teams custom applications.
MIT License
127 stars 30 forks source link

Interaction handlers #35

Closed thure closed 3 years ago

thure commented 3 years ago

Open in Storybook ↗️

This PR adds the onInteraction optional handler to interactive HVCs, which allows developers to handle user interactions in the HVCs in a way that is forward-compatible with a JSON API. This replaces the earlier __internal_callbacks__ handler from before which was not exposed to developers.

All HVCs will call onInteraction for interactions designed for developer response with a monolithic object payload like { event, target, subject, action } for Toolbar and List, { event, target, formState } for Forms, and { event, target, items } or { event, target, lanes } for Boards.

We may like to iterate on this schema.

Please note that lanes updates from Board are misrepresented in Storybook; object key order is guaranteed in this library's target dialects, but Storybook sorts object keys alphabetically when displaying them.

Screen Shot 2021-01-13 at 14 09 08 Screen Shot 2021-01-13 at 14 08 10