line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Factory::Interface::HTML::Widget::Input; |
2
|
|
|
|
|
|
|
$Form::Factory::Interface::HTML::Widget::Input::VERSION = '0.022'; |
3
|
1
|
|
|
1
|
|
17
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
extends qw( Form::Factory::Interface::HTML::Widget::Element ); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: HTML interface widget helper |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has '+tag_name' => ( |
11
|
|
|
|
|
|
|
default => 'input', |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has type => ( |
15
|
|
|
|
|
|
|
is => 'ro', |
16
|
|
|
|
|
|
|
isa => 'Str', |
17
|
|
|
|
|
|
|
required => 1, |
18
|
|
|
|
|
|
|
default => 'text', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has name => ( |
22
|
|
|
|
|
|
|
is => 'ro', |
23
|
|
|
|
|
|
|
isa => 'Str', |
24
|
|
|
|
|
|
|
required => 1, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has value => ( |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
isa => 'Str', |
30
|
|
|
|
|
|
|
required => 1, |
31
|
|
|
|
|
|
|
default => '', |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has size => ( |
35
|
|
|
|
|
|
|
is => 'ro', |
36
|
|
|
|
|
|
|
isa => 'Int', |
37
|
|
|
|
|
|
|
predicate => 'has_size', |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has maxlength => ( |
41
|
|
|
|
|
|
|
is => 'ro', |
42
|
|
|
|
|
|
|
isa => 'Int', |
43
|
|
|
|
|
|
|
predicate => 'has_maxlength', |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
has disabled => ( |
47
|
|
|
|
|
|
|
is => 'ro', |
48
|
|
|
|
|
|
|
isa => 'Bool', |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
has readonly => ( |
52
|
|
|
|
|
|
|
is => 'ro', |
53
|
|
|
|
|
|
|
isa => 'Bool', |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has tabindex => ( |
57
|
|
|
|
|
|
|
is => 'ro', |
58
|
|
|
|
|
|
|
isa => 'Int', |
59
|
|
|
|
|
|
|
predicate => 'has_tabindex', |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
has alt => ( |
63
|
|
|
|
|
|
|
is => 'ro', |
64
|
|
|
|
|
|
|
isa => 'Str', |
65
|
|
|
|
|
|
|
predicate => 'has_alt', |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
has checked => ( |
69
|
|
|
|
|
|
|
is => 'ro', |
70
|
|
|
|
|
|
|
isa => 'Bool', |
71
|
|
|
|
|
|
|
); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub consume_control { |
74
|
134
|
|
|
134
|
0
|
250
|
my ($self, %options) = @_; |
75
|
134
|
|
|
|
|
206
|
my $params = $options{params}; |
76
|
134
|
|
|
|
|
4749
|
my $name = $self->name; |
77
|
|
|
|
|
|
|
|
78
|
134
|
|
|
|
|
1185
|
return { $name => $params->{ $name } }; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
override more_attributes => sub { |
82
|
|
|
|
|
|
|
my $self = shift; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
my %attributes = ( |
85
|
|
|
|
|
|
|
type => $self->type, |
86
|
|
|
|
|
|
|
name => $self->name, |
87
|
|
|
|
|
|
|
value => $self->value, |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
$attributes{size} = $self->size if $self->has_size; |
91
|
|
|
|
|
|
|
$attributes{maxlength} = $self->maxlength if $self->has_maxlength; |
92
|
|
|
|
|
|
|
$attributes{disabled} = 'disabled' if $self->disabled; |
93
|
|
|
|
|
|
|
$attributes{readonly} = 'readonly' if $self->readonly; |
94
|
|
|
|
|
|
|
$attributes{tabindex} = $self->tabindex if $self->has_tabindex; |
95
|
|
|
|
|
|
|
$attributes{alt} = $self->alt if $self->has_alt; |
96
|
|
|
|
|
|
|
$attributes{checked} = 'checked' if $self->checked; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
return \%attributes; |
99
|
|
|
|
|
|
|
}; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
__END__ |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=pod |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=encoding UTF-8 |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 NAME |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Form::Factory::Interface::HTML::Widget::Input - HTML interface widget helper |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 VERSION |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
version 0.022 |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 DESCRIPTION |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Move along. Nothing to see here. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=for Pod::Coverage .* |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Andrew Sterling Hanenkamp <hanenkamp@cpan.org> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Qubling Software LLC. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
133
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |