
Improves support for touch devices and pointer events.
Features
- Lasso plugin now updates the Toolkit's selection, rather than the Surface's drag selection, allowing the Surface to decide whether or not selected elements should be added to the drag selection.
- The Surface widget no longer adds an element in the Toolkit's current selection to the underlying drag selection, instead maintaining a separate drag group for selected elements. What this means is that if you have a few elements selected and you drag one that is not selected, the selected elements will not also be dragged.
- Upgraded to Typescript 4.x.
- The Surface widget now supports an instantiated Decorator in its
decorators
constructor parameter. This can be useful in situations where your code needs to work closely with the decorator's behavior. - The args in the
decorate
method in a Decorator are now typed asDecorateParams
. - On a device that support touch events, the container element for a Surface is now assigned a
jtk-surface-touch-device
css class. The purpose of this is to allow you to style differently for touch devices, for instance by making visible elements that are only visible on hover on a device supporting pointer events. - On a device that supports pointer events, the container element for a Surface is now assigned a
jtk-surface-pointer-device
css class. - The
constrainFunction
that can be passed in thedragOptions
to a Surface can now return null, indicating that for the given tick of the drag lifecycle there is no suitable place for the element and the element should not be moved from its previous position.