Laravel EnsoLaravel Enso
Guide
Back End
Front End
GitHub
Guide
Back End
Front End
GitHub
  • Front End

    • Accessories
    • Addresses
    • Algolia
    • Audits
    • Auth
    • Bookmarks
    • Calendar
    • Card
    • Cargo Partner
    • Categories
    • Charts
    • Checkbox
    • Clipboard
    • Comments
    • Commercial
    • Companies
    • Confirmation
    • Currencies
    • Data Import
    • Date
    • Datepicker
    • Directives
    • Discounts
    • Divider
    • Documents
    • Dropdown
    • Dropdown Indicator
    • Eav
    • Emag
    • Emails
    • Enums
    • ERD
    • Facebook
    • Files
    • Filters
    • Financials
    • Forms
    • Frisbo
    • Google
    • Holidays
    • How to
    • Interactions
    • Inventory
    • IO
    • Laravel Validation
    • Loader
    • Localisation
    • Logs
    • Measurement Units
    • Meili Search
    • Menus
    • Mixins
    • Modal
    • Money
    • Monitored Emails
    • Notifications
    • Orderable Trees
    • Packaging Units
    • Pagination
    • People
    • Permissions
    • Product Lots
    • Products
    • Progress Bar
    • Progress Circle
    • Progress Indicator
    • Questionnaires
    • Quick View
    • Range Slider
    • Rating
    • Roles
    • Route Mapper
    • Sale Channels
    • Scroll to Top
    • Search Mode
    • Select
    • Sentry
    • Services
    • Smart Bill
    • SMS Advert
    • Strings
    • Switch
    • Tables
    • Tabs
    • Tasks
    • Teams
    • Textarea
    • Themes
    • Ticketing
    • Toastr
    • Transitions
    • Tree View
    • Tutorials
    • Typeahead
    • Typesense
    • UI
    • Uploader
    • UPS
    • User Groups
    • Users
    • Virtual Call Center
    • Vouchers
    • Webshop
    • WYSIWYG

Enums

LicenseStableDownloadsVueJavaScriptnpmIssuesMerge Requests

Description

Enums provides the shared enum wrappers and Pinia bootstrap used across Enso UI packages.

It turns raw enum dictionaries into helper objects with translated labels, option builders, randomizers, and a central store-registration flow.

Installation

Install the package:

yarn add @enso-ui/enums

This package is also available through the full enso-ui workspace bundle.

Features

  • exports the Enum class wrapper as the default export
  • exports initEnums for building wrapped enum collections
  • exports the enums Pinia store accessor
  • exports register to bootstrap the store module

Usage

import Enum, { initEnums, enums, register } from '@enso-ui/enums';

register();

const wrapped = initEnums({ statuses: { 1: 'Draft', 2: 'Sent' } }, key => key);
const statusEnum = new Enum({ 1: 'Draft', 2: 'Sent' }, key => key);

API

Enum

Default export for the enum wrapper class.

Import: @enso-ui/enums

Methods:

  • _get(key)
  • _has(key)
  • _select()
  • _filter()
  • _keys()
  • _values()
  • _all()
  • _data()
  • _randomKey()
  • _randomValue()

initEnums

Builds an object of wrapped Enum instances from a raw enum dictionary payload.

Import: @enso-ui/enums

enums

Pinia store accessor for the shared enums store.

Import: @enso-ui/enums

register

Bootstraps the Pinia enum store.

Import: @enso-ui/enums

Companion Backend Package

  • laravel-enso/enums ↗

The backend companion provides the enum dictionaries that are hydrated into the frontend store during bootstrap.

Depends On

  • pinia

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

License

MIT

Edit this page on GitHub
Last Updated: 4/21/2026, 11:54:34 AM
Prev
Emails
Next
ERD