github.com/vugu/vugu@v0.3.6-0.20240430171613-3f6f402e014b/vgform/vgform.go (about)

     1  /*
     2  Package vgform has Vugu components that wrap HTML form controls for convenience.
     3  
     4  NOTES: It would be tempting to wrap every HTML form control that exists.
     5  However, I think we're going to find as things move forward that there is a
     6  high value in keeping things as much "just HTML" as possible.  For a button,
     7  for instance, I can't think of anything a wrapper component can do that
     8  a regular HTML button tag can't.  In this case, we don't provide a component
     9  because it doesn't do anything.  The core idea is that keeping things simple and
    10  not wrapping things that don't need wrapping is more important than keeping
    11  things "consistent" by wrapping everything.  The aim here is to provide
    12  components that are as close to the regular HTML tag as possible while
    13  still providing useful functionality as it relates to integrating it with
    14  the data in your Go program.  If a component doesn't do that, it should
    15  not be included here.  That's the general idea anyway.  If it turns
    16  out that this ends up wrapping 90% of the form controls anyway,
    17  then maybe we just do 100% and the "consistency" argument wins.
    18  Nonetheless, I still think this concern about not unnecessarily
    19  abstracting things is important to Vugu component design.  Using forms
    20  (and hopefully other components) should read as "it's basically HTML with
    21  this additional functionality" rather than an entirely new language
    22  to learn.  This will also come heavily into play in the design
    23  of things like a library that works with Bootstrap CSS.
    24  */
    25  package vgform
    26  
    27  /*
    28  Components:
    29  
    30  Select
    31  Input
    32  	Text
    33  	Password
    34  	Email
    35      Checkbox - the only differnce here is the bool, might be better to just find a good way to bind a bool value
    36  	Color
    37  	Number
    38  	Radio
    39  	Range
    40  	Search
    41  	Tel
    42  	Url
    43  
    44  Textarea
    45  
    46  
    47  https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
    48  Ones we're not doing because it would not add functionality:
    49  Button
    50  Output
    51  
    52  Probably should add but needs more thought:
    53  File
    54  Date
    55  Datetime-local
    56  hidden
    57  image
    58  month
    59  time
    60  week
    61  
    62  */