Skip to content

CSS complete #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 117 additions & 11 deletions react/cmd/coreGen/elements.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ var templates = map[string]map[string]*Attr{
"Style": &Attr{Type: "*CSS", HTMLConvert: "parseCSS"},

// Events
"OnBlur": &Attr{Type: "OnBlur", IsEvent: true},
"OnFocus": &Attr{Type: "OnFocus", IsEvent: true},
"OnChange": &Attr{Type: "OnChange", IsEvent: true},
"OnClick": &Attr{Type: "OnClick", IsEvent: true},
},
Expand Down Expand Up @@ -213,7 +215,19 @@ var elements = map[string]*Elem{
},
"Button": &Elem{
Attributes: map[string]*Attr{
"Type": &Attr{},
"AutoFocus": &Attr{React: "autofocus", Type: "bool", HTML: "autofocus"},
"Disabled": &Attr{React: "disabled", Type: "bool", HTML: "disabled"},
"FormAction": &Attr{React: "formAction", Type: "string", HTML: "formaction"},
"FormEncType": &Attr{React: "formEncType", Type: "string", HTML: "formenctype"},
"FormMethod": &Attr{React: "formMethod", Type: "string", HTML: "formmethod"},
"FormNoValidate": &Attr{React: "formNoValidate", Type: "bool", HTML: "formnovalidate"},
"FormTarget": &Attr{React: "formTarget", Type: "string", HTML: "formtarget"},
"Name": &Attr{React: "name", Type: "string", HTML: "name"},
"TabIndex": &Attr{React: "tabIndex", Type: "int", HTML: "tabindex"},
"Type": &Attr{React: "type", Type: "string", HTML: "type"},
"ValidationMessage": &Attr{React: "validationMessage", Type: "string", HTML: "validationmessage"},
"Value": &Attr{React: "value", Type: "string", HTML: "value"},
"WillValidate": &Attr{React: "willValidate", Type: "bool", HTML: "willvalidate"},
},
},
"Caption": &Elem{
Expand All @@ -232,7 +246,24 @@ var elements = map[string]*Elem{
},
"Form": &Elem{
Attributes: map[string]*Attr{
"OnSubmit": &Attr{Type: "OnSubmit", IsEvent: true},
"AcceptCharset": &Attr{React: "acceptCharset", Type: "string", HTML: "acceptcharset"},
"Action": &Attr{React: "action", Type: "string", HTML: "action"},
"Autocomplete": &Attr{React: "autocomplete", Type: "string", HTML: "autocomplete"},
"Encoding": &Attr{React: "encoding", Type: "string", HTML: "encoding"},
"Enctype": &Attr{React: "enctype", Type: "string", HTML: "enctype"},
"Length": &Attr{React: "length", Type: "int", HTML: "length"},
"Method": &Attr{React: "method", Type: "string", HTML: "method"},
"Name": &Attr{React: "name", Type: "string", HTML: "name"},
"NoValidate": &Attr{React: "noValidate", Type: "bool", HTML: "novalidate"},
"Target": &Attr{React: "target", Type: "string", HTML: "target"},

"OnContextMenu": &Attr{Type: "OnContextMenu", IsEvent: true},
"OnInput": &Attr{Type: "OnInput", IsEvent: true},
"OnInvalid": &Attr{Type: "OnInvalid", IsEvent: true},
"OnSearch": &Attr{Type: "OnSearch", IsEvent: true},
"OnSelect": &Attr{Type: "OnSelect", IsEvent: true},
"OnReset": &Attr{Type: "OnReset", IsEvent: true},
"OnSubmit": &Attr{Type: "OnSubmit", IsEvent: true},
},
},
"H1": &Elem{
Expand Down Expand Up @@ -265,21 +296,70 @@ var elements = map[string]*Elem{
},
"IFrame": &Elem{
Attributes: map[string]*Attr{
"SrcDoc": &Attr{},
"Width": &Attr{React: "width", Type: "string", HTML: "width"},
"Height": &Attr{React: "height", Type: "string", HTML: "height"},
"Name": &Attr{React: "name", Type: "string", HTML: "name"},
"Src": &Attr{React: "src", Type: "string", HTML: "src"},
"SrcDoc": &Attr{React: "srcdoc", Type: "string", HTML: "srcdoc"},
"Seamless": &Attr{React: "seamless", Type: "bool", HTML: "seamless"},
},
},
"Img": &Elem{
Dom: "HTMLImageElement",
Attributes: map[string]*Attr{
"Src": &Attr{},
"Alt": &Attr{},
"Alt": &Attr{},
"Complete": &Attr{React: "complete", Type: "bool", HTML: "complete"},
"CrossOrigin": &Attr{React: "crossOrigin", Type: "string", HTML: "crossorigin"},
"Height": &Attr{React: "height", Type: "int", HTML: "height"},
"IsMap": &Attr{React: "isMap", Type: "bool", HTML: "ismap"},
"NaturalHeight": &Attr{React: "naturalHeight", Type: "int", HTML: "naturalheight"},
"NaturalWidth": &Attr{React: "naturalWidth", Type: "int", HTML: "naturalwidth"},
"Src": &Attr{React: "src", Type: "string", HTML: "src"},
"UseMap": &Attr{React: "useMap", Type: "string", HTML: "usemap"},
"Width": &Attr{React: "width", Type: "int", HTML: "width"},
},
},
"Input": &Elem{
Attributes: map[string]*Attr{
"Placeholder": &Attr{},
"Type": &Attr{},
"Value": &Attr{},
"Accept": &Attr{React: "accept", Type: "string", HTML: "accept"},
"Alt": &Attr{React: "alt", Type: "string", HTML: "alt"},
"Autocomplete": &Attr{React: "autocomplete", Type: "string", HTML: "autocomplete"},
"Autofocus": &Attr{React: "autofocus", Type: "bool", HTML: "autofocus"},
"Checked": &Attr{React: "checked", Type: "bool", HTML: "checked"},
"DefaultChecked": &Attr{React: "defaultChecked", Type: "bool", HTML: "defaultchecked"},
"DefaultValue": &Attr{React: "defaultValue", Type: "string", HTML: "defaultvalue"},
"DirName": &Attr{React: "dirName", Type: "string", HTML: "dirname"},
"Disabled": &Attr{React: "disabled", Type: "bool", HTML: "disabled"},
"FormAction": &Attr{React: "formAction", Type: "string", HTML: "formaction"},
"FormEncType": &Attr{React: "formEncType", Type: "string", HTML: "formenctype"},
"FormMethod": &Attr{React: "formMethod", Type: "string", HTML: "formmethod"},
"FormNoValidate": &Attr{React: "formNoValidate", Type: "bool", HTML: "formnovalidate"},
"FormTarget": &Attr{React: "formTarget", Type: "string", HTML: "formtarget"},
"Height": &Attr{React: "height", Type: "string", HTML: "height"},
"Indeterminate": &Attr{React: "indeterminate", Type: "bool", HTML: "indeterminate"},
"Max": &Attr{React: "max", Type: "string", HTML: "max"},
"MaxLength": &Attr{React: "maxLength", Type: "int", HTML: "maxlength"},
"Min": &Attr{React: "min", Type: "string", HTML: "min"},
"Multiple": &Attr{React: "multiple", Type: "bool", HTML: "multiple"},
"Name": &Attr{React: "name", Type: "string", HTML: "name"},
"Pattern": &Attr{React: "pattern", Type: "string", HTML: "pattern"},
"Placeholder": &Attr{React: "placeholder", Type: "string", HTML: "placeholder"},
"ReadOnly": &Attr{React: "readOnly", Type: "bool", HTML: "readonly"},
"Required": &Attr{React: "required", Type: "bool", HTML: "required"},
"SelectionDirection": &Attr{React: "selectionDirection", Type: "string", HTML: "selectiondirection"},
"SelectionEnd": &Attr{React: "selectionEnd", Type: "int", HTML: "selectionend"},
"SelectionStart": &Attr{React: "selectionStart", Type: "int", HTML: "selectionstart"},
"Size": &Attr{React: "size", Type: "int", HTML: "size"},
"Src": &Attr{React: "src", Type: "string", HTML: "src"},
"Step": &Attr{React: "step", Type: "string", HTML: "step"},
"TabIndex": &Attr{React: "tabIndex", Type: "int", HTML: "tabindex"},
"Type": &Attr{React: "type", Type: "string", HTML: "type"},
"ValidationMessage": &Attr{React: "validationMessage", Type: "string", HTML: "validationmessage"},
"Value": &Attr{React: "value", Type: "string", HTML: "value"},
"ValueAsDate": &Attr{React: "valueAsDate", Type: "time", HTML: "valueasdate"},
"ValueAsNumber": &Attr{React: "valueAsNumber", Type: "float64", HTML: "valueasnumber"},
"Width": &Attr{React: "width", Type: "string", HTML: "width"},
"WillValidate": &Attr{React: "willValidate", Type: "bool", HTML: "willvalidate"},
},
},
"Label": &Elem{
Expand All @@ -301,7 +381,13 @@ var elements = map[string]*Elem{
},
"Option": &Elem{
Attributes: map[string]*Attr{
"Value": &Attr{},
"DefaultSelected": &Attr{React: "defaultSelected", Type: "bool", HTML: "defaultselected"},
"Disabled": &Attr{React: "disabled", Type: "bool", HTML: "disabled"},
"Index": &Attr{React: "index", Type: "int", HTML: "index"},
"Label": &Attr{React: "label", Type: "string", HTML: "label"},
"Selected": &Attr{React: "selected", Type: "bool", HTML: "selected"},
"Text": &Attr{React: "text", Type: "string", HTML: "text"},
"Value": &Attr{React: "value", Type: "string", HTML: "value"},
},
},
"P": &Elem{
Expand Down Expand Up @@ -334,8 +420,28 @@ var elements = map[string]*Elem{
},
"TextArea": &Elem{
Attributes: map[string]*Attr{
"Placeholder": &Attr{},
"Value": &Attr{},
"Autocomplete": &Attr{React: "autocomplete", Type: "string", HTML: "autocomplete"},
"Autofocus": &Attr{React: "autofocus", Type: "bool", HTML: "autofocus"},
"Cols": &Attr{React: "cols", Type: "int", HTML: "cols"},
"DefaultValue": &Attr{React: "defaultValue", Type: "string", HTML: "defaultvalue"},
"DirName": &Attr{React: "dirName", Type: "string", HTML: "dirname"},
"Disabled": &Attr{React: "disabled", Type: "bool", HTML: "disabled"},
"MaxLength": &Attr{React: "maxLength", Type: "int", HTML: "maxlength"},
"Name": &Attr{React: "name", Type: "string", HTML: "name"},
"Placeholder": &Attr{React: "placeholder", Type: "string", HTML: "placeholder"},
"ReadOnly": &Attr{React: "readOnly", Type: "bool", HTML: "readonly"},
"Required": &Attr{React: "required", Type: "bool", HTML: "required"},
"Rows": &Attr{React: "rows", Type: "int", HTML: "rows"},
"SelectionDirection": &Attr{React: "selectionDirection", Type: "string", HTML: "selectiondirection"},
"SelectionStart": &Attr{React: "selectionStart", Type: "int", HTML: "selectionstart"},
"SelectionEnd": &Attr{React: "selectionEnd", Type: "int", HTML: "selectionend"},
"TabIndex": &Attr{React: "tabIndex", Type: "int", HTML: "tabindex"},
"TextLength": &Attr{React: "textLength", Type: "int", HTML: "textlength"},
"Type": &Attr{React: "type", Type: "string", HTML: "type"},
"ValidationMessage": &Attr{React: "validationMessage", Type: "string", HTML: "validationmessage"},
"Value": &Attr{React: "value", Type: "string", HTML: "value"},
"WillValidate": &Attr{React: "willValidate", Type: "bool", HTML: "willvalidate"},
"Wrap": &Attr{React: "wrap", Type: "string", HTML: "wrap"},
},
},
"Th": &Elem{
Expand Down
Loading