通貨入力
通貨記号アドオン、自動桁区切り、小数フォーマットを備えた通貨入力フィールド。 左右の記号配置、国際フォーマット用のカスタマイズ可能な区切り文字、 最小/最大制約に対応し、フォーム送信用に生の数値を格納するhiddenフィールドを備えています。
プレビュー & コード
_currency_input.html.erb
███
████████ █████ █████████ █████████
█████ ████████
███ ██████ ████████████████████████████ █████ ████████ ██
█████ █████ █████ ███ ███████
███ ██████ ████████████████████████████ █████ ████████ ██████ ████████ ██████ ███████ ██
█████ █████ ████████
currency_input_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ████████████████ ██████████████
██████ ██████ █ █
██████████████ █ █████ ███████ ████████ █ ██
██████████████████ █ █████ ███████ ████████ ███ ██
█████████████████ █ █████ ███████ ████████ ███ ██
████ █ █████ ███████ ████████ █████████ ██
████ █ █████ ███████ ████████ ████████ █
currency_input_component.rb
█ ██████████████████████ ████
█████ ██████████████████████ █ ███████████████████
█████ █ █████ ██ ██████████
████████████████ █ ███████ █████████████
███████████ ██████ ███████ ██████████ ████████ █████████████████ ████████████████
████████████████████ ███████████████████ █████ █████ ███████ ██████
███████ ██████████ ██████████ ████████████
currency_input_component.html.erb
████ ██████████ █████████████████ ███ ███ ████████████████████████████████████████ ███
██ ██ ███████████████ ██
██████ ████████ ████████████████ ███ ██████████ █████████████ ████
███ ██████ ██
██ ██ █████████ ██
█████ ███████████████████ ████████████████
██ ███ ██
████████
██ ███ ██
currency_input_controller.js
██████ █ ██████████ █ ████ ████████████████████
██████ ███████ █████ ███████ ██████████ █
██████ ███████ █ ████████████████ ██████████████
██████ ██████ █ █
██████████████ █ █████ ███████ ████████ █ ██
██████████████████ █ █████ ███████ ████████ ███ ██
█████████████████ █ █████ ███████ ████████ ███ ██
████ █ █████ ███████ ████████ █████████ ██
████ █ █████ ███████ ████████ ████████ █
変更履歴
- v1.0.0: Initial release with currency formatting, symbol addon, and hidden value field
- Left/right symbol positioning with proper border radius
- Configurable thousand and decimal separators for international formats
- Min/max constraints enforced on blur
- Keystroke filtering to allow only valid numeric input
- Full dark mode support