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