Mercurial > urweb
comparison lib/ur/basis.urs @ 2220:794017f378de
Merge.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Mon, 24 Nov 2014 20:47:38 -0500 |
parents | f05fcb206571 |
children | 5439b35c5d0b |
comparison
equal
deleted
inserted
replaced
2219:ff38b3e0cdfd | 2220:794017f378de |
---|---|
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 = bool, Autofocus = bool] | |
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) |
955 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, | 959 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit, |
956 Ontext = transaction unit] ++ boxAttrs) | 960 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) |
957 | 961 |
958 val checkbox : formTag bool [] ([Checked = bool, Onchange = transaction unit] ++ boxAttrs) | 962 val checkbox : formTag bool [] ([Checked = bool, Onchange = transaction unit] ++ boxAttrs) |
963 | |
964 (* HTML5 widgets galore! *) | |
965 | |
966 type textWidget = formTag string [] ([Value = string, Size = int, Placeholder = string, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
967 | |
968 val email : textWidget | |
969 val search : textWidget | |
970 val url_ : textWidget | |
971 val tel : textWidget | |
972 val color : textWidget | |
973 | |
974 val number : formTag float [] ([Value = float, Min = float, Max = float, Step = float, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
975 val range : formTag float [] ([Value = float, Min = float, Max = float, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
976 val date : formTag string [] ([Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
977 val datetime : formTag string [] ([Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
978 val datetime_local : formTag string [] ([Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
979 val month : formTag string [] ([Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
980 val week : formTag string [] ([Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
981 val timeInput : formTag string [] ([Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) | |
982 | |
983 | |
959 | 984 |
960 type file | 985 type file |
961 val fileName : file -> option string | 986 val fileName : file -> option string |
962 val fileMimeType : file -> string | 987 val fileMimeType : file -> string |
963 val fileData : file -> blob | 988 val fileData : file -> blob |
1009 con cformTag = fn (attrs :: {Type}) (inner :: {Unit}) => | 1034 con cformTag = fn (attrs :: {Type}) (inner :: {Unit}) => |
1010 ctx ::: {Unit} | 1035 ctx ::: {Unit} |
1011 -> [[Body] ~ ctx] => [[Body] ~ inner] => | 1036 -> [[Body] ~ ctx] => [[Body] ~ inner] => |
1012 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ inner) [] [] | 1037 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ inner) [] [] |
1013 | 1038 |
1014 val ctextbox : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, | 1039 type ctext = cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, |
1015 Ontext = transaction unit] ++ boxAttrs) [] | 1040 Onchange = transaction unit, Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1016 val cpassword : cformTag ([Value = string, Size = int, Source = source string, Placeholder = string, Onchange = transaction unit, | 1041 |
1017 Ontext = transaction unit] ++ boxAttrs) [] | 1042 val ctextbox : ctext |
1043 val cpassword : ctext | |
1044 val cemail : ctext | |
1045 val csearch : ctext | |
1046 val curl : ctext | |
1047 val ctel : ctext | |
1048 val ccolor : ctext | |
1049 | |
1050 val cnumber : cformTag ([Source = source float, Value = float, Min = float, Max = float, Step = float, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1051 val crange : cformTag ([Source = source float, Value = float, Min = float, Max = float, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1052 val cdate : cformTag ([Source = source string, Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1053 val cdatetime : cformTag ([Source = source string, Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1054 val cdatetime_local : cformTag ([Source = source string, Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1055 val cmonth : cformTag ([Source = source string, Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1056 val cweek : cformTag ([Source = source string, Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1057 val ctime : cformTag ([Source = source string, Value = string, Min = string, Max = string, Size = int, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] | |
1058 | |
1018 val button : cformTag ([Value = string] ++ boxAttrs) [] | 1059 val button : cformTag ([Value = string] ++ boxAttrs) [] |
1019 | 1060 |
1020 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool, Onchange = transaction unit] ++ boxAttrs) [] | 1061 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool, Onchange = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1021 | 1062 |
1022 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) [Cselect] | 1063 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxAttrs) [Cselect] |
1023 val coption : unit -> tag [Value = string, Selected = bool] [Cselect, Body] [] [] [] | 1064 val coption : unit -> tag [Value = string, Selected = bool] [Cselect, Body] [] [] [] |
1024 | 1065 |
1025 val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit, | 1066 val ctextarea : cformTag ([Value = string, Rows = int, Cols = int, Source = source string, Onchange = transaction unit, |
1026 Ontext = transaction unit] ++ boxAttrs) [] | 1067 Ontext = transaction unit] ++ boxAttrs ++ inputAttrs) [] |
1027 | 1068 |
1028 (*** Tables *) | 1069 (*** Tables *) |
1029 | 1070 |
1030 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit | 1071 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit |
1031 -> tag ([Border = int] ++ boxAttrs) | 1072 -> tag ([Border = int] ++ boxAttrs) |