@enso-ui/directives
Directives
Description
Vue directives used across Enso UI packages.
Installation
yarn add @enso-ui/directives
Features
- exports reusable DOM and interaction directives consumed across Enso UI packages
- supports focus, click-outside, select-on-focus, resize, long-click, and scroll-into-view flows
- stays dependency-light and does not pull syntax highlighters or other large optional libraries
Usage
Register the directives you need locally:
import { clickOutside, scrollIntoView } from '@enso-ui/directives';
export default {
directives: { clickOutside, scrollIntoView },
};
Or register them globally:
import * as directives from '@enso-ui/directives';
Object.entries(directives).forEach(([name, directive]) => {
app.directive(name, directive);
});
API
v-click-outside
Calls a handler when the click target is outside the bound element.
v-fits-below
Computes whether an element fully fits in the current viewport and passes the result to a callback.
v-focus
Focuses the element after the current tick.
Accepts an optional boolean value. Omitting the value behaves like true; passing false skips focusing.
v-long-click
Runs a handler only after the pointer stays pressed for the configured duration in milliseconds.
v-resize
Auto-resizes an input to its content width. An optional numeric argument sets the minimum width in pixels.
v-scroll-into-view
Calls Element.scrollIntoView() when scroll transitions to true.
v-select-on-focus
Selects the current value when the element receives focus.
Depends On
- Vue 3
Contributions
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!
License
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 3.2.0 | ^3.5.0 | MIT | |
| 3.1.4 | ^3.5.0 | MIT | |
| 3.1.3 | ^3.5.0 | MIT | |
| 3.1.2 | ^3.5.0 | MIT | |
| 3.1.1 | ^3.5.0 | MIT | |
| 3.1.0 | ^3.0 | MIT | |
| 3.0.0 | ^3.0 | MIT | |
| 2.0.13 | ^3.0 | ISC | |
| 2.0.12 | ^3.0 | ISC | |
| 2.0.11 | ^3.0 | ISC | |
| 2.0.10 | ^3.0 | ISC | |
| 2.0.9 | ^3.0 | ISC | |
| 2.0.8 | ^3.0 | ISC | |
| 2.0.7 | ^3.0 | ISC | |
| 2.0.6 | ^3.0 | ISC | |
| 2.0.5 | ^3.0 | ISC | |
| 2.0.4 | ^3.0 | ISC | |
| 2.0.3 | ^3.0 | ISC | |
| 2.0.2 | ^3.0 | ISC | |
| 2.0.1 | ^3.0 | ISC | |
| 2.0.0 | ^3.0 | ISC | |
| 1.0.16 | ^2.5.16 | ISC | |
| 1.0.15 | ^2.5.16 | ISC | |
| 1.0.14 | ^2.5.16 | ISC | |
| 1.0.13 | ^2.5.16 | ISC | |
| 1.0.12 | ^2.5.16 | ISC | |
| 1.0.11 | ^2.5.16 | ISC | |
| 1.0.10 | ^2.5.16 | ISC | |
| 1.0.9 | ^2.5.16 | ISC | |
| 1.0.8 | ^2.5.16 | ISC |
Showing the latest 30 of 37. See every release on npm