| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Moonshine::Bootstrap::Component::NavItem; |
|
2
|
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
269740
|
use Moonshine::Magic; |
|
|
9
|
|
|
|
|
133037
|
|
|
|
9
|
|
|
|
|
84
|
|
|
4
|
9
|
|
|
9
|
|
6156
|
use Params::Validate qw/HASHREF/; |
|
|
9
|
|
|
|
|
22
|
|
|
|
9
|
|
|
|
|
808
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends ( |
|
7
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component', |
|
8
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component::LinkedLi', |
|
9
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component::DropdownUl', |
|
10
|
|
|
|
|
|
|
); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has( |
|
13
|
|
|
|
|
|
|
nav_item_spec => sub { |
|
14
|
|
|
|
|
|
|
{ |
|
15
|
|
|
|
|
|
|
role => { default => "presentation" }, |
|
16
|
|
|
|
|
|
|
link => { default => '#', base => 1 }, |
|
17
|
|
|
|
|
|
|
disable => { base => 1, optional => 1 }, |
|
18
|
|
|
|
|
|
|
dropdown => { build => 1, type => HASHREF, optional => 1 } |
|
19
|
|
|
|
|
|
|
}; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub nav_item { |
|
24
|
86
|
|
|
86
|
|
26690
|
my ($self) = shift; |
|
25
|
|
|
|
|
|
|
|
|
26
|
86
|
|
50
|
|
|
833
|
my ( $base_args, $build_args ) = $self->validate_build( |
|
27
|
|
|
|
|
|
|
{ |
|
28
|
|
|
|
|
|
|
params => $_[0] // {}, |
|
29
|
|
|
|
|
|
|
spec => $self->nav_item_spec, |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
86
|
|
|
|
|
1103
|
my $li = $self->linked_li($base_args); |
|
34
|
|
|
|
|
|
|
|
|
35
|
86
|
100
|
|
|
|
647
|
if ( my $dropdown = $build_args->{dropdown} ) { |
|
36
|
5
|
|
|
|
|
21
|
my $a = $li->children->[0]; |
|
37
|
5
|
|
|
|
|
72
|
$a->set( |
|
38
|
|
|
|
|
|
|
{ |
|
39
|
|
|
|
|
|
|
class => 'dropdown-toggle', |
|
40
|
|
|
|
|
|
|
role => 'button', |
|
41
|
|
|
|
|
|
|
aria_haspopup => 'true', |
|
42
|
|
|
|
|
|
|
aria_expanded => 'false', |
|
43
|
|
|
|
|
|
|
data_toggle => 'dropdown' |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
); |
|
46
|
5
|
|
|
|
|
407
|
$li->add_child( $self->dropdown_ul($dropdown) ); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
86
|
|
|
|
|
815
|
return $li; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |