Releases: shijistar/enum-plus
Releases · shijistar/enum-plus
v3.1.8
v3.1.7
[email protected]
✨ Features
- React integration for
enum-pluswith 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 (textorcomponent).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
v3.1.5
v3.1.4
v3.1.3
v3.1.2
v3.1.1
Features
- ✨ Introduce
meta-onlymode inEnumcreation, allowing the creation of Enums withoutvalueandlabelfields. This is useful for scenarios where only metadata is needed for enum items. - ✨ Implementation
instanceofoperator ofEnummethod, and add type guard to provide type narrowing functionality. This allows you to useinstanceofto check if an object is an enum object created byEnum. - ✨ Add type guard to
Enum.hasmethod. - 🛠️ Allow the type extending for
Enum.name, just like enum labels. - 📝 Add documentation for TypeScript 5.0 upgrade instructions
v3.1.0
Features
- Introduce
Enum.configto manage global configuration for all Enums.Enum.config.autoLabelto enable/disable automatic label generation for enum items by specifying the label prefix.
- Add
options.labelPrefixto specify the label prefix for enum items during Enum creation. - Add
options.autoLabelto enable/disable automatic label generation on Enum creation. It overrides the global configuration. - ✨ Allow extending
EnumItemLabeltype to support IntelliSense.