| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Moonshine::Bootstrap::Component::Navbar; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
333737
|
use Moonshine::Magic; |
|
|
5
|
|
|
|
|
180374
|
|
|
|
5
|
|
|
|
|
50
|
|
|
4
|
5
|
|
|
5
|
|
2852
|
use Moonshine::Util; |
|
|
5
|
|
|
|
|
12
|
|
|
|
5
|
|
|
|
|
91
|
|
|
5
|
5
|
|
|
5
|
|
2971
|
use Params::Validate qw/ARRAYREF SCALAR/; |
|
|
5
|
|
|
|
|
11
|
|
|
|
5
|
|
|
|
|
553
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
5
|
|
|
5
|
|
1082
|
use Switch::Back; |
|
|
5
|
|
|
|
|
1347356
|
|
|
|
5
|
|
|
|
|
50
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends( |
|
10
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component', |
|
11
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component::Nav', |
|
12
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component::NavbarHeader', |
|
13
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component::NavbarCollapse', |
|
14
|
|
|
|
|
|
|
); |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has( |
|
17
|
|
|
|
|
|
|
navbar_spec => sub { |
|
18
|
|
|
|
|
|
|
{ |
|
19
|
|
|
|
|
|
|
tag => { default => 'nav' }, |
|
20
|
|
|
|
|
|
|
mid => 0, |
|
21
|
|
|
|
|
|
|
class_base => { default => 'navbar' }, |
|
22
|
|
|
|
|
|
|
switch => { default => 'default' }, |
|
23
|
|
|
|
|
|
|
switch_base => { default => 'navbar-' }, |
|
24
|
|
|
|
|
|
|
navs => { type => ARRAYREF }, |
|
25
|
|
|
|
|
|
|
fixed => { type => SCALAR, optional => 1 }, |
|
26
|
|
|
|
|
|
|
fixed_base => { default => 'navbar-fixed-' }, |
|
27
|
|
|
|
|
|
|
static => { type => SCALAR, optional => 1 }, |
|
28
|
|
|
|
|
|
|
static_base => { default => 'navbar-static-' }, |
|
29
|
|
|
|
|
|
|
}; |
|
30
|
|
|
|
|
|
|
}, |
|
31
|
|
|
|
|
|
|
); |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub navbar { |
|
34
|
25
|
|
|
25
|
|
346791
|
my ($self) = shift; |
|
35
|
|
|
|
|
|
|
|
|
36
|
25
|
|
50
|
|
|
296
|
my ( $base_args, $build_args ) = $self->validate_build( |
|
37
|
|
|
|
|
|
|
{ |
|
38
|
|
|
|
|
|
|
params => $_[0] // {}, |
|
39
|
|
|
|
|
|
|
spec => $self->navbar_spec, |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
); |
|
42
|
|
|
|
|
|
|
|
|
43
|
25
|
|
|
|
|
375
|
for (qw/fixed static/) { |
|
44
|
50
|
100
|
|
|
|
458
|
if ( my $class = |
|
45
|
|
|
|
|
|
|
join_class( $build_args->{ $_ . '_base' }, $build_args->{$_} ) ) |
|
46
|
|
|
|
|
|
|
{ |
|
47
|
8
|
|
|
|
|
85
|
$base_args->{class} = prepend_str( $class, $base_args->{class} ); |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
25
|
|
|
|
|
382
|
my $base_element = Moonshine::Element->new($base_args); |
|
52
|
|
|
|
|
|
|
|
|
53
|
25
|
|
|
|
|
85496
|
my $container = $base_element->add_child( |
|
54
|
|
|
|
|
|
|
Moonshine::Element->new( { tag => 'div', class => 'container-fluid' } ) |
|
55
|
|
|
|
|
|
|
); |
|
56
|
|
|
|
|
|
|
|
|
57
|
25
|
|
|
|
|
71619
|
for my $nav ( @{ $build_args->{navs} } ) { |
|
|
25
|
|
|
|
|
151
|
|
|
|
27
|
|
|
|
|
126
|
|
|
58
|
27
|
100
|
|
|
|
73
|
given ( delete $nav->{nav_type} ) { |
|
|
27
|
100
|
|
|
|
470
|
|
|
|
27
|
50
|
|
|
|
228
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
0
|
when ('header') { |
|
60
|
7
|
100
|
|
|
|
1488
|
$nav->{mid} = $build_args->{mid} if $build_args->{mid}; |
|
61
|
7
|
|
|
|
|
87
|
$container->add_child( $self->navbar_header($nav) ); |
|
62
|
|
|
|
|
|
|
} |
|
63
|
|
|
|
|
|
|
when ('collapse') { |
|
64
|
2
|
50
|
|
|
|
553
|
$nav->{id} = $build_args->{mid} if $build_args->{mid}; |
|
65
|
2
|
|
|
|
|
63
|
$container->add_child( $self->navbar_collapse($nav) ); |
|
66
|
|
|
|
|
|
|
} |
|
67
|
|
|
|
|
|
|
when ('nav') { |
|
68
|
0
|
|
|
|
|
0
|
$container->add_child( $self->nav($nav) ); |
|
69
|
|
|
|
|
|
|
} |
|
70
|
|
|
|
|
|
|
when ('button') { |
|
71
|
2
|
|
|
|
|
1819
|
$container->add_child( $self->navbar_button($nav) ); |
|
72
|
|
|
|
|
|
|
} |
|
73
|
|
|
|
|
|
|
when ('form') { |
|
74
|
2
|
|
|
|
|
1847
|
$container->add_child( $self->navbar_form($nav) ); |
|
75
|
|
|
|
|
|
|
} |
|
76
|
|
|
|
|
|
|
when ('text') { |
|
77
|
2
|
|
|
|
|
1461
|
$container->add_child( $self->navbar_text($nav) ); |
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
when ('text_link') { |
|
80
|
12
|
|
|
|
|
9525
|
$container->add_child( $self->navbar_text_link($nav) ); |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
} |
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
|
|
85
|
25
|
|
|
|
|
12829
|
return $base_element; |
|
86
|
|
|
|
|
|
|
} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
1; |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
__END__ |