0.9.1-alpha.67
Alpha@xaui/native@0.9.1-alpha.67
Patch Changes
-
3a5fd0e: feat(mask-field): a value typed into a shape
MaskFieldis theTextFieldwith its box masked: the same root, the same variants and sizes, the same label, description and error slots, and only the field differs. There is one representation — the accepted characters, in order — andmaskInputis the only thing that turns them into text, which is what makes the field survive a paste, a punctuation keyboard and a backspace over a separator.maskis a preset or a pattern.'date','time','datetime'and'credit-card'carry their own rules — the date order and separator from the locale throughIntl, and a part clamped as it completes and never raised. A date that cannot exist stays out of the box the moment the month is known. Anything else is a pattern string:#a digit,Aa letter,*either, every other character a literal put back in as the parts fill.The value is the masked string.
convertis the one plug that turns it into a value of your own —parseMaskedDateandparseMaskedTimeare exported for thedateandtimeshapes, andMASK_FIELD_MASKSlists the presets.useOptionalFieldGroupjoinsuseFieldGroup, so a field can leave a decorator its room without requiring one — the shapeuseOptionalChartalready has.