search spec components factored out of T365
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Value.pm
CommitLineData
e22de101 1package Reaction::UI::Widget::Value;
2
3use Reaction::UI::WidgetClass;
4
bae75bee 5use namespace::clean -except => [ qw(meta) ];
aa8c0c90 6
aa8c0c90 7
bae75bee 8before fragment widget {
9 if ($_{viewport}->can('value_string')) {
10 arg value => $_{viewport}->value_string;
11 } elsif($_{viewport}->can('value')) {
12 arg value => $_{viewport}->value;
13 }
e22de101 14};
15
bae75bee 16__PACKAGE__->meta->make_immutable;
17
18
e22de101 191;
20
21__END__;
22
23=head1 NAME
24
25Reaction::UI::Widget::Value
26
27=head1 DESCRIPTION
28
f9b32c83 29This widget provides the return value of the C<vlues_string> or C<value>
30method on the viewport (depending on which is available first) via the
31C<value> argument to widget.
32
33=head1 INCLUDED SUBCLASSES
34
35=over
36
37=item L<Reaction::UI::Widget::Value::Boolean>
38
39Will simply display the C<value>.
40
41=item L<Reaction::UI::Widget::Value::Collection>
42
43This widget iterates over a collection of values provided by the viewport
44and renders an unordered list out of them.
45
46=item L<Reaction::UI::Widget::Value::DateTime>
47
48A simple subclass of L<Reaction::UI::Widget::Value>, currently not doing
49much.
50
51=item L<Reaction::UI::Widget::Value::Image>
52
53Provides C<has_image> and C<no_image> blocks that will be rendered depending
54on the viewports C<value_string> attribute. The defaults are to either render
55an image tag, or to output nothing at all.
56
57=item L<Reaction::UI::Widget::Value::Number>
58
59A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.
60
61=item L<Reaction::UI::Widget::Value::RelatedObject>
62
63A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.
64
65=item L<Reaction::UI::Widget::Value::String>
66
67A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.
68
69=item L<Reaction::UI::Widget::Value::Text>
70
71A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.
72
73=back
74
e22de101 75=head1 FRAGMENTS
76
77=head2 widget
78
49170400 79Additional available arguments
e22de101 80
49170400 81=over 4
e22de101 82
8154c987 83=item B<value> - The C<value_string> or C<value> of the viewport
e22de101 84
49170400 85=back
e22de101 86
87=head1 AUTHORS
88
89See L<Reaction::Class> for authors.
90
91=head1 LICENSE
92
93See L<Reaction::Class> for the license.
94
95=cut