Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Forms): add function support for the prefix or suffix props in Field.Number #3880

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

tujoworker
Copy link
Member

@tujoworker tujoworker commented Aug 28, 2024

Quick example:

<Field.Number
  value={1}
  label="With suffix (function)"
  suffix={(value) => (value === 1 ? ' year' : ' years')}
/>

Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 6:05pm

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

@langz langz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏁

@marinahaugen
Copy link

marinahaugen commented Aug 29, 2024

Wow @tujoworker 🥇 Thanks for being so fast in meeting my needs 🤩 This is great 💛

@langz langz merged commit 652448c into main Sep 2, 2024
15 checks passed
@langz langz deleted the feat/number-suffix-function branch September 2, 2024 09:11
tujoworker pushed a commit that referenced this pull request Sep 2, 2024
## [10.46.0](v10.45.0...v10.46.0) (2024-09-02)

### 📝 Documentation

* **Selection:** value should be string when variant is radio or button ([#3869](#3869)) ([aab8f5b](aab8f5b))

### ✨ Features

* **Blocks.ChildrenWithAge:** removes step controls in age field ([#3867](#3867)) ([3b02e45](3b02e45))
* **CopyOnClick:** add new component ([#3834](#3834)) ([07ba09d](07ba09d))
* **Field.ArraySelection:** add dataPath prop ([#3872](#3872)) ([35427d7](35427d7))
* **Forms:** add `Value.SelectCountry` component ([#3875](#3875)) ([416df35](416df35))
* **Forms:** add function support for the `prefix` or `suffix` props in `Field.Number` ([#3880](#3880)) ([652448c](652448c))
* **Forms:** add validation for dnr and fnr in `Field.NationalIdentityNumber` ([#3771](#3771)) ([8a2da43](8a2da43))
* **Forms:** deprecate filterSubmitData in Form.Handler and return `filterData` in onSubmit and onChange instead ([#3873](#3873)) ([f05bdd2](f05bdd2))

### 🐛 Bug Fixes

* **Forms:** add support for `gap={false}` to Value.Composition (ValueBlock) ([#3884](#3884)) ([413c568](413c568))
* **Forms:** enhance `Field.Email` validation pattern ([#3874](#3874)) ([aee005f](aee005f))
* **Forms:** fallback to use default locale for translations when providing a non-existent locale ([#3817](#3817)) ([f768613](f768613))
* **InfinityScroller:** forward load button props ([#3737](#3737)) ([645a7b3](645a7b3))
@tujoworker
Copy link
Member Author

🎉 This PR is included in version 10.46.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants