--- /dev/null
+package Reaction::UI::Widget::Field;
+
+use Reaction::UI::WidgetClass;
+
+class Field, which {
+
+ has id => (isa => 'Str', is => 'ro', lazy_build => 1);
+ has name => (isa => 'Str', is => 'ro', lazy_build => 1);
+
+ implements build_id => as { shift->viewport->event_id_for('value'); };
+ implements build_name => as { shift->viewport->event_id_for('value'); };
+
+ widget renders [qw/label field message/
+ => { id => func('self', 'id'),
+ name => func('self', 'name'),
+ viewport => func('self', 'viewport'), }
+ ];
+
+ label renders [ string { $_{viewport}->label }, ];
+ message renders [ string { $_{viewport}->message }, ];
+
+ field renders [ string { $_{viewport}->value }, ];
+
+};
+
+1;
+
--- /dev/null
+package Reaction::UI::Widget::Field::Boolean;
+
+use Reaction::UI::WidgetClass;
+
+class Boolean is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<input type="checkbox" name="[% name %]" id="[% id %]" />
+ [% content | html %]
+</textarea>
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::ChooseMany;
+
+use Reaction::UI::WidgetClass;
+
+class ChooseMany is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+TODO
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::ChooseOne;
+
+use Reaction::UI::WidgetClass;
+
+class ChooseOne is 'Reaction::UI::Widget::Field', which {
+
+ field renders [ option over func('viewport', 'values_list') ,
+ {name_map => func('viewport', 'value_to_name_map') }
+ ],
+ { is_required => sub{ $_{viewport}->attribute->required } };
+
+ option renders
+ [
+ { v_value => sub { $_{viewport}->obj_to_str($_) },
+ v_name => sub { $_{name_map}->{ $_{viewport}->obj_to_str($_) } },
+ is_selected => sub { my $v_value = $_{viewport}->obj_to_str($_);
+ $_{viewport}->is_current_value($v_value) ||
+ $_{viewport}->value eq $v_value;
+ }
+ }
+ ];
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<select name="[% name %]" id="[% id %]">
+ [% IF is_required %]
+ <option value="">--</option>
+ [% content %]
+</select>
+
+=for layout option
+
+ [% IF is_selected;
+ selected = ' selected="selected"';
+ ELSE;
+ selected = '';
+ END;
+ %]
+ <!-- I should convert this stuff to process_attrs to keep it cleaner -->
+ <option value="[% v_value | html%]" [% selected %]> [% v_name | html %]</option>
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::DateTime;
+
+use Reaction::UI::WidgetClass;
+
+class DateTime is 'Reaction::UI::Widget::Field', which {
+
+ field renders [ string { $_{viewport}->value_string }, ];
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<input type="text" name="[% name %]" id="[% id %]" value="[% content | html %]" />
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::File;
+
+use Reaction::UI::WidgetClass;
+
+class File is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+TODO
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::HiddenArray;
+
+use Reaction::UI::WidgetClass;
+
+class HiddenArray is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+TODO
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::Number;
+
+use Reaction::UI::WidgetClass;
+
+class Number is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<input type="text" name="[% name %]" id="[% id %]" value="[% content | html %]" />
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::Password;
+
+use Reaction::UI::WidgetClass;
+
+class Password is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<input type="password" name="[% name %]" id="[% id %]" value="[% content | html %]" />
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::String;
+
+use Reaction::UI::WidgetClass;
+
+class String is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<input type="text" name="[% name %]" id="[% id %]" value="[% content | html %]" />
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::Text;
+
+use Reaction::UI::WidgetClass;
+
+class Text is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+<!-- We need a replacement for process_attrs -->
+<textarea name="[% name %]" id="[% id %]">
+ [% content | html %]
+</textarea>
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut
--- /dev/null
+package Reaction::UI::Widget::Field::TimeRange;
+
+use Reaction::UI::WidgetClass;
+
+class TimeRange is 'Reaction::UI::Widget::Field', which {
+
+};
+
+1;
+
+
+=for layout widget
+
+[% label %] [% field %] [% message %] <br>
+
+=for layout field
+
+TODO
+
+=for layout label
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <label for="[% id %]"> [% content | html %]: </label>
+[% END %]
+
+=for layout message
+
+<!-- This conditional goes away when mst comes up with something better -->
+[% IF content %]
+ <span> [% content | html %] </span>
+[% END %]
+
+=cut