[v0.3.3] — 2026-11-18
Added
Money.Input.Currencyhas a:groupingfield, read from the locale's currency pattern without a symbol, which<.money_input>renders asdata-grouping("3,2") for theMoneyInputhook.
Changed
- Requires
localize ~> 1.7andex_money ~> 6.3 and >= 6.3.1. localize 1.7 formats a currency the locale does not list, which blanked the field in 72 locales, and ex_money 6.3.1 rounds and validates such a currency in any process locale.
Fixed
A currency the locale does not list, such as BHD in
az-Cyrl, shows its symbol and sendsdata-iso-digitsto the hook, where 14,020 locale and currency pairs in 508 locales showed neither. The symbol is read from the locale's parents and then the default locale, asMoney.to_string/2writes it.An amount stored with more digits than its currency allows is shown with all of them, where the server and the
MoneyInputhook rounded it (1.2345USD showed1.23,1234.5JPY1,235) and an unchanged save stored the rounded amount.Money.Input.Validatornow reports the extra digits instead.With AutoNumeric loaded,
hi,bn-IN,gu,teand the other Indian-grouping locales show12,34,567as the server writes it, andtokgroups in twos, so its amounts of 1,000 or more no longer fail to submit.en-INgroups in threes in the field as on the server, where the hook showed123,45,67,890.12.A stored amount outside
:min/:max(±10 trillion when neither is set) is no longer blanked and erased on save, and one the server sends later no longer reverts to the previous amount. TheMoneyInputhook falls back to the plain input with the server's text when AutoNumeric refuses an amount.A paste into the plain amount input reaches
phx-change, and a padded(1,234.56)shows as-1,234.56. TheMoneyInputhook cancels the browser's paste to clean the text, which also cancelled itsinputevent.
[v0.3.2] — 2026-11-09
Changed
Requires
ex_money ~> 6.3, and solocalize ~> 1.5.In locales with digits of their own (
fa,ar-SA,bn,mrand others) theMoneyInputhook leaves the field a plain input, since AutoNumeric only writes Latin digits and the server could not read them back with Arabic separators.
Fixed
The
MoneyInputhook no longer blanks the amount inar,he,urand other locales whose minus sign carries a direction mark, and falls back to a plain input if AutoNumeric rejects a locale's separators.A form reset restores the amount in
arandheinstead of blanking it.<.money_input>andMoney.Input.Castno longer raiseBadMapErroron a string amount in locales such asfa,ar-SAandbn; the fix is in ex_money 6.3.
[v0.3.1] — 2026-11-08
Added
The amount input carries a
data-amountattribute with the plain decimal amount ("1234.56"), which theMoneyInputhook uses to start and resync AutoNumeric.A
package.json, so the hooks import as"ex_money_input"whereverdepsis on esbuild'sNODE_PATH, as in Phoenix's generated config.
Changed
<.money_input>and<.currency_picker>validate:localeonce into aLocalize.LanguageTagand accept a string, atom or tag. An invalid locale renders without adata-localeattribute instead of echoing it.
Fixed
The
MoneyInputhook resyncs AutoNumeric after every LiveView update, so the amount no longer disappears or reverts to an old value when the pointer leaves the field. Fixes #2.<.money_input>without a:localeattribute formats the amount in the current locale instead of English, matching the separators it gives the hook.With AutoNumeric loaded, grouped amounts in zero-decimal currencies such as JPY in
deno longer start misread.<.money_input>with an invalid:localeand an amount to format no longer raisesLocalize.InvalidLocaleError.The documented
"money_input"import anddeps/money_inputpaths did not resolve. The README, guides and moduledoc now import"ex_money_input"and load the stylesheet fromdeps/ex_money_input/priv/static/.
[v0.3.0] — 2026-07-31
Changed
- Requires
localize ~> 1.0andex_money ~> 6.2. The previous requirements excluded Localize 1.0.
[v0.2.3] — 2026-05-17
Bug Fixes
Money.Input.Validator.validate_money/2no longer raisesFunctionClauseErrorwhen called with a non-%Money{}value (binary, atom, map, etc.).check_money_range/3now has a final catch-all that skips the range check on type mismatch.<.money_input>no longer raises when:min/:maxis a value Phoenix can't render as iodata —value_attr/1rescuesProtocol.UndefinedErrorand drops the attribute.<.money_input>with an unknown:localeno longer 500s on downstream@locale_data.Xreads. The placeholder when both the requested locale AND its fallback fail to resolve is now a shaped%Money.Input.Currency{}struct (all fieldsnil) rather than a bare%{}— so attribute reads degrade toniland Phoenix omits the attribute.<.currency_picker>no longer raises on:preferrednon-list values (nil, atom, integer).assign_picker/1coerces to[]and writes the safe value back to assigns so the template'sEnum.map_join(@preferred, ...)reads the coerced value.Adversarial-input test suite added (
test/adversarial_render_test.exs) that exercises every public component with a matrix of bad attr values, and an atom-safety guard (test/atom_safety_test.exs) that fails the suite if any newString.to_atom/1is added tolib/.
[v0.2.2] — 2026-05-17
Bug Fixes
- Currency picker's search
<input>field now picks up the dark theme. The element had no explicitbackground/colordeclarations, so it fell back to the browser-default white/black even when the rest of the picker overlay correctly used the dark--mi-*tokens.
[v0.2.1] — 2026-05-17
Bug Fixes
Money.Input.Components.money_input/1no longer raises when the form submits an empty or unknown currency (e.g. the picker's hidden carrier before any selection).normalize_currency_code/1blacklists""and:"", andassign_money_locale_data/1falls back to the locale's natural currency on unknown ISO codes instead ofMatchError.Money.Input.Components.currency_picker/1tolerates an unknown locale —assign_picker/1now falls back to a placeholder rather than crashing on{:ok, _} = ....Dark-mode CSS tokens added —
priv/static/money_input.cssnow ships@media (prefers-color-scheme: dark)and[data-theme="dark"]override blocks so the picker and money input pick up the host page's dark theme instead of staying light-themed.
[v0.2.0] — 2026-05-15
Gettext-backed localization of the picker's UI strings (aria labels, search placeholder, section headers, empty-state). Catalog ships English source plus de, fr, and ja translations. Activated via
Money.Input.Gettextbackend.:gettextis now a required dep when the components are used (it was optional in 0.1).Currency names in the picker rendering localize to the active locale via
Localize.Currency.display_name/2instead of the static English:namefield.Money.Input.Visualizerand the standalone helper have moved to the siblingmoney_input_playgroundpackage (under theMoneyInputPlayground.Visualizernamespace). Drops the:plugand:banditoptional deps from this package. If you embedded the visualizer in your own router viaforward "/money-input", Money.Input.Visualizer, add{:money_input_playground, "~> 0.1", only: :dev}and update the forward target toMoneyInputPlayground.Visualizer.
[v0.1.0] — 2026-05-15
Money.Input.Components.money_input/1andMoney.Input.Components.currency_picker/1— locale-aware money HEEx components backed by an AutoNumeric JS hook, submitting%{"amount", "currency"}maps compatible withMoney.Ecto.Composite.Type.Money.Input.Cast,Money.Input.Validator,Money.Input.Currency, andMoney.Input.Changeset— headless cast/validate layer with currency-aware precision (USD: 2, JPY: 0, BHD: 3) and an Ecto changeset bridge.Money.Input.Visualizer— Plug-based development tool with light/dark theme toggle that demonstrates the components across CLDR locales and currencies.