playcanvas / pcui

UI component library for web-based tools
http://playcanvas.github.io/pcui
MIT License
664 stars 62 forks source link

InputElement class #281

Closed ellthompson closed 1 year ago

ellthompson commented 1 year ago

Creates the InputElement class which both TextInput and NumericInput can extend. This allows us to tighten up the value property type of each class (string to TextInput and number for NumericInput). It also removes all text validation related functionality from the NumericInput, which was only ever necessary for the TextInput.

Fixes #248

willeastcott commented 1 year ago

Can Input be merged into InputField? And can Label just inherit directly from Element (feels weird that a Label would be considered an 'input')?

willeastcott commented 1 year ago

Also, just throwing ideas out here, but would InputElement be a better name than InputField (since it's a specialization of Element and we don't really use the 'field` terminology except for in label group).

willeastcott commented 1 year ago

Worth marking this PR as [BREAKING]? And listing what changes a user might have to make to their app code? I'm thinking of any changes to CSS class names but maybe there's other things to list too? Not sure...

ellthompson commented 1 year ago

Worth marking this PR as [BREAKING]? And listing what changes a user might have to make to their app code? I'm thinking of any changes to CSS class names but maybe there's other things to list too? Not sure...

The functionality of NumericInput and TextInput shouldn't change. They'll both still have the same class names attached to them so it shouldn't break end users css, it'll now also include an additional pcui-input-element class. The only thing I can think of which could break is if users are building their own version of the styling using the distributed scss files, as some scss rules would have their names changed. That process has never been documented publicly though.