github magicasaservice/vue-equipment v1.1.0
Release 1.1.0

3 hours ago

🍿 Features

  • MagicTray and MagicDrawer support snap point ranges. Pass { min, max } in place of a snap point, and the side or drawer can rest anywhere between the two. A release outside the range snaps to the closest point, with min and max counting as points. A flick inside a range still carries on to the next point, unless the range sets momentum: false.
  • Values inside a range are rounded, to four decimals if both ends are decimals and to whole pixels otherwise. activeSnapPoint and the snap events report the rounded value, and willSnapTo fires once when the target enters a range.
  • In MagicDrawer, a range that reaches 0 closes the drawer when it’s let go within threshold.distance of 0. A mouse can’t follow the drawer past the edge of the window, so it would otherwise never reach the closed end.
  • useMagicDrawer now returns activeSnapPoint.

❗️ Bug Fixes

  • MagicTray’s threshold.momentum works again. The distance check overwrote it on every move, so flicks never registered. With the default of 1, a fast drag now snaps to the next point.
  • snapTo and initial snap points in MagicTray and MagicDrawer ignore a value that is neither a snap point nor inside a range, and log a warning. Before, the tray or drawer jumped to whichever point was closest and reported the value it was given. A snap point written in another unit still works, and activeSnapPoint reports it as configured.
  • In MagicDrawer, dragging back within threshold.distance now returns the drawer to where it started, as in MagicTray. Before, a drag that had passed the threshold once kept its target.
  • MagicDrawer resolves snap points from its current size, so snapping right after a window resize no longer uses an outdated lookup.

📖 Docs

  • MagicTray and MagicDrawer have range demos, and the MagicDrawer page documents useMagicDrawer.
  • The MagicTray demos fit narrow screens.

Full Changelog: v1.0.1...v1.1.0

Don't miss a new vue-equipment release

NewReleases is sending notifications on new releases.