| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Moonshine::Bootstrap::Component::InputGroup; |
|
2
|
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
265322
|
use Moonshine::Magic; |
|
|
5
|
|
|
|
|
195922
|
|
|
|
5
|
|
|
|
|
44
|
|
|
4
|
5
|
|
|
5
|
|
3029
|
use Moonshine::Util; |
|
|
5
|
|
|
|
|
18
|
|
|
|
5
|
|
|
|
|
64
|
|
|
5
|
5
|
|
|
5
|
|
3264
|
use Params::Validate qw/HASHREF/; |
|
|
5
|
|
|
|
|
13
|
|
|
|
5
|
|
|
|
|
466
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
lazy_components('label'); |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends( |
|
10
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component', |
|
11
|
|
|
|
|
|
|
'Moonshine::Bootstrap::Component::InputGroupAddon' |
|
12
|
|
|
|
|
|
|
); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has( |
|
15
|
|
|
|
|
|
|
input_group_spec => sub { |
|
16
|
|
|
|
|
|
|
{ |
|
17
|
|
|
|
|
|
|
tag => { default => 'div' }, |
|
18
|
|
|
|
|
|
|
mid => 1, |
|
19
|
|
|
|
|
|
|
lid => 0, |
|
20
|
|
|
|
|
|
|
sizing_base => { default => 'input-group-' }, |
|
21
|
|
|
|
|
|
|
class_base => { default => 'input-group' }, |
|
22
|
|
|
|
|
|
|
label => { type => HASHREF, optional => 1, build => 1 }, |
|
23
|
|
|
|
|
|
|
left => { type => HASHREF, optional => 1 }, |
|
24
|
|
|
|
|
|
|
right => { type => HASHREF, optional => 1 }, |
|
25
|
|
|
|
|
|
|
input => { type => HASHREF, default => { } }, |
|
26
|
|
|
|
|
|
|
}; |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub input_group { |
|
31
|
11
|
|
|
11
|
|
93675
|
my ($self) = shift; |
|
32
|
|
|
|
|
|
|
|
|
33
|
11
|
|
50
|
|
|
91
|
my ( $base_args, $build_args ) = $self->validate_build( |
|
34
|
|
|
|
|
|
|
{ |
|
35
|
|
|
|
|
|
|
params => $_[0] // {}, |
|
36
|
|
|
|
|
|
|
spec => $self->input_group_spec, |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
); |
|
39
|
|
|
|
|
|
|
|
|
40
|
11
|
|
|
|
|
154
|
my $input_group = Moonshine::Element->new($base_args); |
|
41
|
|
|
|
|
|
|
|
|
42
|
11
|
100
|
|
|
|
28388
|
if ( $build_args->{label} ) { |
|
43
|
|
|
|
|
|
|
$label = $input_group->add_before_element( |
|
44
|
|
|
|
|
|
|
$self->label( $build_args->{label} ) |
|
45
|
3
|
|
|
|
|
19
|
); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
11
|
100
|
|
|
|
5533
|
if ( $build_args->{left} ) { |
|
49
|
7
|
|
|
|
|
23
|
$build_args->{left}->{id} = $build_args->{mid}; |
|
50
|
|
|
|
|
|
|
$input_group->add_child( |
|
51
|
|
|
|
|
|
|
$self->input_group_addon( $build_args->{left} ) |
|
52
|
7
|
|
|
|
|
56
|
); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
11
|
100
|
|
|
|
287
|
if ( my $lid = $build_args->{lid} ) { |
|
56
|
3
|
|
|
|
|
9
|
$build_args->{input}->{id} = $lid; |
|
57
|
3
|
|
|
|
|
14
|
$label->for($lid); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
11
|
|
|
|
|
62
|
$build_args->{input}->{aria_describedby} = $build_args->{mid}; |
|
61
|
11
|
|
|
|
|
77
|
$input_group->add_child( $self->input( $build_args->{input} ) ); |
|
62
|
|
|
|
|
|
|
|
|
63
|
11
|
100
|
|
|
|
23012
|
if ( $build_args->{right} ) { |
|
64
|
9
|
|
|
|
|
35
|
$build_args->{right}->{id} = $build_args->{mid}; |
|
65
|
|
|
|
|
|
|
$input_group->add_child( |
|
66
|
|
|
|
|
|
|
$self->input_group_addon( $build_args->{right} ) |
|
67
|
9
|
|
|
|
|
46
|
); |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
11
|
|
|
|
|
357
|
return $input_group; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
__END__ |