Commit | Line | Data |
---|---|---|
c8fbb8ad | 1 | package Reaction::UI::Widget::Field::Array; |
7b78a39d | 2 | |
3 | use Reaction::UI::WidgetClass; | |
4 | ||
bae75bee | 5 | use namespace::clean -except => [ qw(meta) ]; |
d7b00a50 | 6 | |
d7b00a50 | 7 | |
bae75bee | 8 | before fragment widget { |
d219104c | 9 | arg 'label' => localized $_{viewport}->label; |
bae75bee | 10 | }; |
d7b00a50 | 11 | |
bae75bee | 12 | implements fragment list { |
13 | render 'item' => over $_{viewport}->value_names; | |
14 | }; | |
d7b00a50 | 15 | |
bae75bee | 16 | implements fragment item { |
d219104c | 17 | arg 'name' => localized $_; |
7b78a39d | 18 | }; |
19 | ||
bae75bee | 20 | __PACKAGE__->meta->make_immutable; |
21 | ||
22 | ||
7b78a39d | 23 | 1; |
24 | ||
25 | __END__; | |
26 | ||
5a1a893e | 27 | =head1 NAME |
7b78a39d | 28 | |
c8fbb8ad | 29 | Reaction::UI::Widget::DisplayField::Array |
7b78a39d | 30 | |
5a1a893e | 31 | =head1 DESCRIPTION |
7b78a39d | 32 | |
5a1a893e | 33 | =head1 FRAGMENTS |
7b78a39d | 34 | |
5a1a893e | 35 | =head2 widget |
7b78a39d | 36 | |
5a1a893e | 37 | renders C<label> and C<list> passing additional variable "viewport" |
7b78a39d | 38 | |
5a1a893e | 39 | =head2 label |
40 | ||
41 | C<content> contains the viewport's label | |
42 | ||
43 | =head2 list | |
44 | ||
45 | renders fragment item over the viewport's C<value_names> | |
46 | ||
47 | =head2 item | |
48 | ||
49 | C<content> contains the value of the current item ($_ / $_{_}) | |
50 | ||
51 | =head1 AUTHORS | |
52 | ||
53 | See L<Reaction::Class> for authors. | |
54 | ||
55 | =head1 LICENSE | |
56 | ||
57 | See L<Reaction::Class> for the license. | |
7b78a39d | 58 | |
59 | =cut |