Skip to content

Releases: shijistar/enum-plus

v3.1.8

28 Jan 08:02

Choose a tag to compare

Features

  • ✨ Enhance EnumLocaleExtends type definition to support global extension of EnumItemLabel.

v3.1.7

26 Jan 03:29

Choose a tag to compare

Features

  • ✨ Update has method type signature for better type inference.

[email protected]

23 Dec 11:23

Choose a tag to compare

✨ Features

  • React integration for enum-plus with automatic UI re-render on language change.
  • Enum labels & enum name localize to React elements (not plain strings).
  • Global localization configuration fields:
    • localize.mode: localization mode (text or component).
      • text: returns plain text, does not auto-update on language change.
      • component: returns a React component that auto-updates on language change.
    • isMatch.defaultSearchField (for search helpers)
  • Search helper APIs for non-string labels:
    • WeekEnum.isMatch(search, item) (case-insensitive fuzzy match)
    • WeekEnum.isMatchCaseSensitive(search, item)
  • Works seamlessly with enum-generated option arrays (e.g. for <Select />).

v3.1.6

26 Nov 09:24

Choose a tag to compare

Features

  • ✨ Expand the AnyEnum type to be compatible with all enumeration types.

v3.1.5

21 Nov 07:04

Choose a tag to compare

Features

  • ✨ Enhance enum creation to support function labels and enum name.

Bug Fixes

  • 🐞 Fix the issue where enum.meta is always empty in meta-only mode.

v3.1.4

19 Nov 06:39

Choose a tag to compare

Features

  • ✨ Add AnyEnum type as a generic enum type that can be used to represent any enum collection.
  • 🛠 Improve the type of enum.meta.

v3.1.3

17 Nov 03:55

Choose a tag to compare

Features

  • ✨ Enhance Enum.extends method to support getter and setter properties in the extension object.

v3.1.2

07 Nov 08:39

Choose a tag to compare

Features

  • 🛠 Export the ./extension subpath in package.json to fix the Cannot find module 'enum-plus/extension'" error.
  • 🛠 Exclude label field from the type of autoLabel option.

v3.1.1

22 Oct 02:59

Choose a tag to compare

Features

  • ✨ Introduce meta-only mode in Enum creation, allowing the creation of Enums without value and label fields. This is useful for scenarios where only metadata is needed for enum items.
  • ✨ Implementation instanceof operator of Enum method, and add type guard to provide type narrowing functionality. This allows you to use instanceof to check if an object is an enum object created by Enum.
  • ✨ Add type guard to Enum.has method.
  • 🛠️ Allow the type extending for Enum.name, just like enum labels.
  • 📝 Add documentation for TypeScript 5.0 upgrade instructions

v3.1.0

20 Oct 15:26

Choose a tag to compare

Features

  • Introduce Enum.config to manage global configuration for all Enums.
    • Enum.config.autoLabel to enable/disable automatic label generation for enum items by specifying the label prefix.
  • Add options.labelPrefix to specify the label prefix for enum items during Enum creation.
  • Add options.autoLabel to enable/disable automatic label generation on Enum creation. It overrides the global configuration.
  • ✨ Allow extending EnumItemLabel type to support IntelliSense.