Mixins provides small reusable helper modules for file-type inspection and number formatting across Enso UI packages.
Install the package:
yarn add @enso-ui/mixinsThe helpers can be consumed from any Vue application or Enso UI package.
- exports
EnsoFile,numberFormat, andshortNumberfrom the package root - maps file extensions to Font Awesome icons and viewability helpers
- formats decimal values with the current Enso locale preferences
- compacts large numbers into SI-style suffixes such as
k,M, andG
import { EnsoFile, numberFormat, shortNumber } from '@enso-ui/mixins';
const file = new EnsoFile({ extension: 'pdf' });
file.icon();
numberFormat(1234.567, 2);
shortNumber(128000);Import: @enso-ui/mixins
Helper class for file extension inspection.
Constructor:
new EnsoFile({ extension })
Methods:
extension()isImage()isPdf()isViewable()icon()
Formats a decimal number with Intl.NumberFormat using the current Enso UI locale preferences.
Compacts large numbers into SI-style suffixes and returns values such as 1.2k, 4.5M, or 9G.
are welcome. Pull requests are great, but issues are good too.
Thank you to all the people who already contributed to Enso!