do not include .git directory
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Collection / Grid.pm
CommitLineData
ddccc6a2 1package Reaction::UI::ViewPort::Collection::Grid;
2
3use Reaction::Class;
4
5use aliased 'Reaction::InterfaceModel::Collection' => 'IM_Collection';
d738d11f 6use aliased 'Reaction::UI::ViewPort::Collection::Grid::Member';
ddccc6a2 7
81393881 8use namespace::clean -except => [ qw(meta) ];
7b5e71ad 9use MooseX::Types::Moose qw/ArrayRef HashRef Int/;
81393881 10extends 'Reaction::UI::ViewPort::Collection';
ddccc6a2 11
463e51d0 12with 'Reaction::UI::ViewPort::Role::FieldArgs';
81393881 13
f46fa4fd 14has 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 29sub _build_member_class { Member };
f46fa4fd 30
81393881 31__PACKAGE__->meta->make_immutable;
32
33
2dba7201 341;
ddccc6a2 35
2dba7201 36__END__;
ddccc6a2 37
2dba7201 38=head1 NAME
39
40Reaction::UI::ViewPort::Collection
41
42=head1 DESCRIPTION
43
44This subclass of L<Reaction::UI::ViewPort::Collection> allows you to display a
45homogenous collection of Reaction::InterfaceModel::Objects as a grid.
46
47=head1 ATTRIBUTES
48
49=head2 field_order
50
51=head2 excluded_fields
52
f5e2ab69 53List of field names to exclude.
54
55=head2 included_fields
56
57List of field names to include. If both C<included_fields> and
58C<excluded_fields> are specified the result is those fields which
59are in C<included_fields> and not in C<excluded_fields>.
60
61=head2 included_fields
62
63List of field names to include. If both C<included_fields> and
64C<excluded_fields> are specified the result is those fields which
65are 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
78These methods, although stable, are subject to change without notice. These are meant
79to be used only by developers. End users should refrain from using these methods to
80avoid potential breakages.
81
82=head1 SEE ALSO
83
84L<Reaction::UI::ViewPort::Collection>
85
86=head1 AUTHORS
87
88See L<Reaction::Class> for authors.
89
90=head1 LICENSE
91
92See L<Reaction::Class> for the license.
93
94=cut