Commit | Line | Data |
e22de101 |
1 | package Reaction::UI::Widget::Value; |
2 | |
3 | use Reaction::UI::WidgetClass; |
4 | |
bae75bee |
5 | use namespace::clean -except => [ qw(meta) ]; |
aa8c0c90 |
6 | |
aa8c0c90 |
7 | |
bae75bee |
8 | before 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 |
19 | 1; |
20 | |
21 | __END__; |
22 | |
23 | =head1 NAME |
24 | |
25 | Reaction::UI::Widget::Value |
26 | |
27 | =head1 DESCRIPTION |
28 | |
f9b32c83 |
29 | This widget provides the return value of the C<vlues_string> or C<value> |
30 | method on the viewport (depending on which is available first) via the |
31 | C<value> argument to widget. |
32 | |
33 | =head1 INCLUDED SUBCLASSES |
34 | |
35 | =over |
36 | |
37 | =item L<Reaction::UI::Widget::Value::Boolean> |
38 | |
39 | Will simply display the C<value>. |
40 | |
41 | =item L<Reaction::UI::Widget::Value::Collection> |
42 | |
43 | This widget iterates over a collection of values provided by the viewport |
44 | and renders an unordered list out of them. |
45 | |
46 | =item L<Reaction::UI::Widget::Value::DateTime> |
47 | |
48 | A simple subclass of L<Reaction::UI::Widget::Value>, currently not doing |
49 | much. |
50 | |
51 | =item L<Reaction::UI::Widget::Value::Image> |
52 | |
53 | Provides C<has_image> and C<no_image> blocks that will be rendered depending |
54 | on the viewports C<value_string> attribute. The defaults are to either render |
55 | an image tag, or to output nothing at all. |
56 | |
57 | =item L<Reaction::UI::Widget::Value::Number> |
58 | |
59 | A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet. |
60 | |
61 | =item L<Reaction::UI::Widget::Value::RelatedObject> |
62 | |
63 | A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet. |
64 | |
65 | =item L<Reaction::UI::Widget::Value::String> |
66 | |
67 | A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet. |
68 | |
69 | =item L<Reaction::UI::Widget::Value::Text> |
70 | |
71 | A 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 |
79 | Additional 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 | |
89 | See L<Reaction::Class> for authors. |
90 | |
91 | =head1 LICENSE |
92 | |
93 | See L<Reaction::Class> for the license. |
94 | |
95 | =cut |