Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.3k stars 533 forks source link

[2.0] Proposal: rename TextEdit into Input #5765

Open stsrki opened 1 month ago

stsrki commented 1 month ago

For simple string value types, I find the Input component name good alternative. Based on my research no other component library seems to have the same name. Even the built-in components don't conflict with the naming so there should not be any problems. I still need to see if maybe Input is a reserved keyword in razor. For example Link name has some limitations when used.

Old:

<TextEdit @bind-Text="@hello" />

New:

<Input  @bind-Value="@hello" />

This can be done after the https://github.com/Megabit/Blazorise/pull/5732 is merged.

MrX101 commented 1 month ago

TextInput would be better. Personally I would do this for everything with Edit in the name.(Date Edit, Color Edit etc)

David-Moreira commented 1 month ago

Input seems too generic to me personally, almost feels like anything can go in there, while it's just supposed to be text/strings. I agree with @MrX101 I'd still keep the familiar prefixes, whatever suffix we come up with.

Also Edit suffix has been out for so long and people have become acquainted, I'd probably not bother renaming. Although I do like Input suffix a bit better since it's more similar to the html naming.

mrpmorris commented 1 month ago

Input alone is abstract. It suggests the suitable specific type of editor will be used.

string isn't the default data type, it's just an equal member of a set of data types. It's illogical to treat it differently.

DarthPedro commented 1 month ago

I like the Input name because it matches the HTML element name. Agree with @MrX101 that it should be part of the name and applied to other Edit components. I prefer the name formatting: Input[type]... for example InputText, InputColor, InputDate, InputNumber, ...

stsrki commented 1 month ago

Everything is still in the proposal phase, so nothing is set in stone.

The general idea with the new naming scheme is to match the native HTML naming as close as possible. That way the naming, I believe, will better communicate what and how the component would be used. And what are its limitations when dealing with in native HTML and browser mode.

When we work with native <input /> and when we don't specify type, the input element will render as a textual element, so, we can only enter strings in this input. Once we define a type, it will render other input elements like date, time, file, etc.

That same idea should apply to the new component naming scheme.

HTML Blazorise
<input /> <Input />
<input type="date" /> <DateInput />
<input type="time" /> <TimeInput />
<input type="file" /> <FileInput />

We can still consider TextInput as it still makes perfect sense.

HTML Blazorise
<input /> <TextInput />

That being said. We're still months till we start with the actual work. So until then, we're going to discuss it in detail and listen for any feedback.