Mercurial > urweb
comparison lib/ur/basis.urs @ 2074:e48e09a1f583
HTML5 input attributes: placeholder, required, autofocus; email input type (without cformTag equivalent)
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Sun, 12 Oct 2014 10:03:36 +0000 |
parents | 795b5b75453c |
children | fde864eacd47 |
comparison
equal
deleted
inserted
replaced
2073:1839df6ed755 | 2074:e48e09a1f583 |
---|---|
946 con formTag = fn (ty :: Type) (inner :: {Unit}) (attrs :: {Type}) => | 946 con formTag = fn (ty :: Type) (inner :: {Unit}) (attrs :: {Type}) => |
947 ctx ::: {Unit} | 947 ctx ::: {Unit} |
948 -> [[Form] ~ ctx] => | 948 -> [[Form] ~ ctx] => |
949 nm :: Name -> unit | 949 nm :: Name -> unit |
950 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty] | 950 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty] |
951 | |
952 con inputAttrs = [Required = string, Autofocus = string] | |
953 | |
954 | |
951 val hidden : formTag string [] [Data = data_attr, Id = string, Value = string] | 955 val hidden : formTag string [] [Data = data_attr, Id = string, Value = string] |
952 val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit, | 956 val textbox : formTag string [] ([Value = string, Size = int, Placeholder = string, Source = source string, Onchange = transaction unit, |
953 Ontext = transaction unit] ++ boxAttrs) | 957 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) |
954 val password : formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs) | 958 val password : formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) |
959 val email : formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
955 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, | 960 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, |
956 Ontext = transaction unit] ++ boxAttrs) | 961 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) |
957 | 962 |
958 val checkbox : formTag bool [] ([Checked = bool, Onchange = transaction unit] ++ boxAttrs) | 963 val checkbox : formTag bool [] ([Checked = bool, Onchange = transaction unit, Value = string] ++ boxAttrs) |
959 | 964 |
960 type file | 965 type file |
961 val fileName : file -> option string | 966 val fileName : file -> option string |
962 val fileMimeType : file -> string | 967 val fileMimeType : file -> string |
963 val fileData : file -> blob | 968 val fileData : file -> blob |
1010 ctx ::: {Unit} | 1015 ctx ::: {Unit} |
1011 -> [[Body] ~ ctx] => [[Body] ~ inner] => | 1016 -> [[Body] ~ ctx] => [[Body] ~ inner] => |
1012 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ inner) [] [] | 1017 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ inner) [] [] |
1013 | 1018 |
1014 val ctextbox : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, | 1019 val ctextbox : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, |
1015 Ontext = transaction unit] ++ boxAttrs) [] | 1020 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1016 val cpassword : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, | 1021 val cpassword : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, |
1017 Ontext = transaction unit] ++ boxAttrs) [] | 1022 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1018 val button : cformTag ([Value = string] ++ boxAttrs) [] | 1023 val button : cformTag ([Value = string] ++ boxAttrs) [] |
1019 | 1024 |
1020 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool, Onchange = transaction unit] ++ boxAttrs) [] | 1025 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1021 | 1026 |
1022 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) [Cselect] | 1027 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) [Cselect] |
1023 val coption : unit -> tag [Value = string, Selected = bool] [Cselect, Body] [] [] [] | 1028 val coption : unit -> tag [Value = string, Selected = bool] [Cselect, Body] [] [] [] |
1024 | 1029 |
1025 val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit, | 1030 val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit, |
1026 Ontext = transaction unit] ++ boxAttrs) [] | 1031 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1027 | 1032 |
1028 (*** Tables *) | 1033 (*** Tables *) |
1029 | 1034 |
1030 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit | 1035 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit |
1031 -> tag ([Border = int] ++ boxAttrs) | 1036 -> tag ([Border = int] ++ boxAttrs) |