Commit | Line | Data |
ddccc6a2 |
1 | package Reaction::UI::ViewPort::Collection::Grid; |
2 | |
3 | use Reaction::Class; |
4 | |
5 | use aliased 'Reaction::InterfaceModel::Collection' => 'IM_Collection'; |
d738d11f |
6 | use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member'; |
ddccc6a2 |
7 | |
81393881 |
8 | use namespace::clean -except => [ qw(meta) ]; |
7b5e71ad |
9 | use MooseX::Types::Moose qw/ArrayRef HashRef Int/; |
81393881 |
10 | extends 'Reaction::UI::ViewPort::Collection'; |
ddccc6a2 |
11 | |
463e51d0 |
12 | with 'Reaction::UI::ViewPort::Role::FieldArgs'; |
81393881 |
13 | |
f46fa4fd |
14 | has member_action_count => ( |
15 | is => 'rw', |
7b5e71ad |
16 | isa => Int, |
f46fa4fd |
17 | required => 1, |
18 | lazy => 1, |
19 | default => sub { |
20 | my $self = shift; |
21 | for (@{ $self->members }) { |
22 | my $protos = $_->action_prototypes; |
37728bba |
23 | return scalar(keys(%$protos)); |
f46fa4fd |
24 | } |
25 | return 1; |
26 | }, |
27 | ); |
81393881 |
28 | |
d738d11f |
29 | sub _build_member_class { Member }; |
f46fa4fd |
30 | |
81393881 |
31 | __PACKAGE__->meta->make_immutable; |
32 | |
33 | |
2dba7201 |
34 | 1; |
ddccc6a2 |
35 | |
2dba7201 |
36 | __END__; |
ddccc6a2 |
37 | |
2dba7201 |
38 | =head1 NAME |
39 | |
40 | Reaction::UI::ViewPort::Collection |
41 | |
42 | =head1 DESCRIPTION |
43 | |
44 | This subclass of L<Reaction::UI::ViewPort::Collection> allows you to display a |
45 | homogenous collection of Reaction::InterfaceModel::Objects as a grid. |
46 | |
47 | =head1 ATTRIBUTES |
48 | |
49 | =head2 field_order |
50 | |
51 | =head2 excluded_fields |
52 | |
f5e2ab69 |
53 | List of field names to exclude. |
54 | |
55 | =head2 included_fields |
56 | |
57 | List of field names to include. If both C<included_fields> and |
58 | C<excluded_fields> are specified the result is those fields which |
59 | are in C<included_fields> and not in C<excluded_fields>. |
60 | |
61 | =head2 included_fields |
62 | |
63 | List of field names to include. If both C<included_fields> and |
64 | C<excluded_fields> are specified the result is those fields which |
65 | are in C<included_fields> and not in C<excluded_fields>. |
66 | |
67 | |
2dba7201 |
68 | =head2 field_labels |
69 | |
7460b544 |
70 | =head2 _raw_field_labels |
71 | |
2dba7201 |
72 | =head2 computed_field_order |
73 | |
7460b544 |
74 | =head2 member_action_count |
75 | |
2dba7201 |
76 | =head1 INTERNAL METHODS |
77 | |
78 | These methods, although stable, are subject to change without notice. These are meant |
79 | to be used only by developers. End users should refrain from using these methods to |
80 | avoid potential breakages. |
81 | |
82 | =head1 SEE ALSO |
83 | |
84 | L<Reaction::UI::ViewPort::Collection> |
85 | |
86 | =head1 AUTHORS |
87 | |
88 | See L<Reaction::Class> for authors. |
89 | |
90 | =head1 LICENSE |
91 | |
92 | See L<Reaction::Class> for the license. |
93 | |
94 | =cut |