-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added button-type & input-type HTML attribute values.
- Loading branch information
1 parent
babdc2d
commit 69ff862
Showing
4 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
stdlib/source/library/lux/web/html/attribute/type/button.lux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. | ||
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
(.require | ||
[library | ||
[lux (.except Type) | ||
[meta | ||
[macro | ||
["[0]" template]]]]]) | ||
|
||
... https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attributes | ||
(every .public Type | ||
Text) | ||
|
||
(with_template [<name>] | ||
[(the .public <name> | ||
Type | ||
(template.text [<name>]))] | ||
|
||
[submit] | ||
[reset] | ||
[button] | ||
) |
47 changes: 47 additions & 0 deletions
47
stdlib/source/library/lux/web/html/attribute/type/input.lux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. | ||
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
(.require | ||
[library | ||
[lux (.except Type) | ||
[data | ||
["[0]" text]] | ||
[meta | ||
[macro | ||
["[0]" template]]]]]) | ||
|
||
... https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types | ||
(every .public Type | ||
Text) | ||
|
||
(with_template [<name>] | ||
[(the .public <name> | ||
Type | ||
(|> (template.text [<name>]) | ||
(text.replaced "local_date_time" "datetime-local") | ||
(text.replaced "telephone" "tel") | ||
(text.replaced "_" "")))] | ||
|
||
[button] | ||
[check_box] | ||
[color] | ||
[date] | ||
[local_date_time] | ||
[email] | ||
[file] | ||
[hidden] | ||
[image] | ||
[month] | ||
[number] | ||
[password] | ||
[radio] | ||
[range] | ||
[reset] | ||
[search] | ||
[submit] | ||
[telephone] | ||
[text] | ||
[time] | ||
[url] | ||
[week] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. | ||
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
(.require | ||
[library | ||
[lux (.except) | ||
[abstract | ||
[monad (.only do)]] | ||
[data | ||
["[0]" text] | ||
[collection | ||
["[0]" list] | ||
["[0]" set]]] | ||
[math | ||
["[0]" random (.only Random)] | ||
[number | ||
["n" nat]]] | ||
[test | ||
["_" property (.only Test)]]]] | ||
[\\library | ||
["[0]" /]]) | ||
|
||
(with_expansions [<tags> (with_template [<name>] | ||
[<name>] | ||
|
||
[/.submit] | ||
[/.reset] | ||
[/.button] | ||
)] | ||
(the .public test | ||
Test | ||
(<| (_.covering /._) | ||
(do [! random.monad] | ||
[]) | ||
(_.for [/.Type]) | ||
(all _.and | ||
(_.coverage [<tags>] | ||
(let [all (is (List /.Type) | ||
(list <tags>)) | ||
uniques (set.of_list text.hash all)] | ||
(n.= (list.size all) | ||
(set.size uniques)))) | ||
)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. | ||
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
(.require | ||
[library | ||
[lux (.except) | ||
[abstract | ||
[monad (.only do)]] | ||
[data | ||
["[0]" text] | ||
[collection | ||
["[0]" list] | ||
["[0]" set]]] | ||
[math | ||
["[0]" random (.only Random)] | ||
[number | ||
["n" nat]]] | ||
[test | ||
["_" property (.only Test)]]]] | ||
[\\library | ||
["[0]" /]]) | ||
|
||
(with_expansions [<tags> (with_template [<name>] | ||
[<name>] | ||
|
||
[/.button] | ||
[/.check_box] | ||
[/.color] | ||
[/.date] | ||
[/.local_date_time] | ||
[/.email] | ||
[/.file] | ||
[/.hidden] | ||
[/.image] | ||
[/.month] | ||
[/.number] | ||
[/.password] | ||
[/.radio] | ||
[/.range] | ||
[/.reset] | ||
[/.search] | ||
[/.submit] | ||
[/.telephone] | ||
[/.text] | ||
[/.time] | ||
[/.url] | ||
[/.week] | ||
)] | ||
(the .public test | ||
Test | ||
(<| (_.covering /._) | ||
(do [! random.monad] | ||
[]) | ||
(_.for [/.Type]) | ||
(all _.and | ||
(_.coverage [<tags>] | ||
(let [all (is (List /.Type) | ||
(list <tags>)) | ||
uniques (set.of_list text.hash all)] | ||
(n.= (list.size all) | ||
(set.size uniques)))) | ||
)))) |