Updated code based on review
This commit is contained in:
@@ -17,13 +17,13 @@ inherit
|
|||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
min: detachable READABLE_STRING_32
|
min: detachable READABLE_STRING_8
|
||||||
-- minimun value accepted by Current field.
|
-- minimun value accepted by Current field.
|
||||||
|
|
||||||
max: detachable READABLE_STRING_32
|
max: detachable READABLE_STRING_8
|
||||||
-- maximun value accepted by Current field.
|
-- maximun value accepted by Current field.
|
||||||
|
|
||||||
step: detachable READABLE_STRING_32
|
step: detachable READABLE_STRING_8
|
||||||
-- step is the increment that the value should adjust up or down, with the default step value being 1.
|
-- step is the increment that the value should adjust up or down, with the default step value being 1.
|
||||||
|
|
||||||
feature -- Element Change
|
feature -- Element Change
|
||||||
@@ -52,28 +52,46 @@ feature -- Element Change
|
|||||||
step_set: attached step as l_step implies l_step.same_string (a_val.out)
|
step_set: attached step as l_step implies l_step.same_string (a_val.out)
|
||||||
end
|
end
|
||||||
|
|
||||||
set_min_string (a_val: READABLE_STRING_32)
|
set_min_string (a_val: READABLE_STRING_GENERAL)
|
||||||
-- Set `min' with `a_val'.
|
-- Set `min' with `a_val'.
|
||||||
|
require
|
||||||
|
is_valid_number: a_val.is_integer
|
||||||
do
|
do
|
||||||
min := a_val
|
if a_val.is_string_32 then
|
||||||
|
min := html_encoder.encoded_string (a_val.as_string_32)
|
||||||
|
elseif a_val.is_string_8 then
|
||||||
|
min := a_val.as_string_8
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
min_set: attached min as l_min implies l_min = a_val
|
min_set: attached min as l_min implies l_min.same_string_general (a_val)
|
||||||
end
|
end
|
||||||
|
|
||||||
set_max_string (a_val: READABLE_STRING_32)
|
set_max_string (a_val: READABLE_STRING_GENERAL)
|
||||||
-- Set `max' with `a_val'.
|
-- Set `max' with `a_val'.
|
||||||
|
require
|
||||||
|
is_valid_number: a_val.is_integer
|
||||||
do
|
do
|
||||||
max := a_val
|
if a_val.is_string_32 then
|
||||||
|
max := html_encoder.encoded_string (a_val.as_string_32)
|
||||||
|
elseif a_val.is_string_8 then
|
||||||
|
max := a_val.as_string_8
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
max_set: attached max as l_max implies l_max = a_val
|
max_set: attached max as l_max implies l_max.same_string_general (a_val)
|
||||||
end
|
end
|
||||||
|
|
||||||
set_step_string (a_val: READABLE_STRING_32)
|
set_step_string (a_val: READABLE_STRING_GENERAL)
|
||||||
-- Set `step' with `a_val'.
|
-- Set `step' with `a_val'.
|
||||||
|
require
|
||||||
|
is_valid_sequence: a_val.is_number_sequence or else a_val.is_real_sequence
|
||||||
do
|
do
|
||||||
step := a_val
|
if a_val.is_string_32 then
|
||||||
|
step := html_encoder.encoded_string (a_val.as_string_32)
|
||||||
|
elseif a_val.is_string_8 then
|
||||||
|
step := a_val.as_string_8
|
||||||
|
end
|
||||||
ensure
|
ensure
|
||||||
step_set: attached step as l_step implies l_step = a_val
|
step_set: attached step as l_step implies l_step.same_string_general (a_val)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -85,21 +103,21 @@ feature {NONE} -- Conversion
|
|||||||
--min
|
--min
|
||||||
if attached min as l_min then
|
if attached min as l_min then
|
||||||
a_target.append (" min=%"")
|
a_target.append (" min=%"")
|
||||||
a_target.append (html_encoder.encoded_string (l_min))
|
a_target.append(l_min)
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
|
|
||||||
--max
|
--max
|
||||||
if attached max as l_max then
|
if attached max as l_max then
|
||||||
a_target.append (" max=%"")
|
a_target.append (" max=%"")
|
||||||
a_target.append (html_encoder.encoded_string (l_max))
|
a_target.append (l_max)
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
|
|
||||||
--step
|
--step
|
||||||
if attached step as l_step then
|
if attached step as l_step then
|
||||||
a_target.append (" step=%"")
|
a_target.append (" step=%"")
|
||||||
a_target.append (html_encoder.encoded_string (l_step))
|
a_target.append (l_step)
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ feature -- Change element
|
|||||||
end
|
end
|
||||||
|
|
||||||
disable_autocomplete
|
disable_autocomplete
|
||||||
-- Turn off the autocompelte. The default behavior is on.
|
-- Turn off the autocomplete. The default behavior is on.
|
||||||
do
|
do
|
||||||
autocomplete := True
|
autocomplete := True
|
||||||
ensure
|
ensure
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
note
|
note
|
||||||
description: "Summary description for {WSF_FORM_MONTH_INPUT}."
|
description: "[
|
||||||
|
Represent an input type Month
|
||||||
|
Example:
|
||||||
|
<input id="expiry" name="expiry" type="month" required>
|
||||||
|
]"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
EIS: "name=month", "src=https://html.spec.whatwg.org/multipage/forms.html#month-state-(type=month)"
|
EIS: "name=month", "src=https://html.spec.whatwg.org/multipage/forms.html#month-state-(type=month)"
|
||||||
|
|||||||
Reference in New Issue
Block a user