line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Factory::Control::Text; |
2
|
|
|
|
|
|
|
$Form::Factory::Control::Text::VERSION = '0.022'; |
3
|
1
|
|
|
1
|
|
467
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
with qw( |
6
|
|
|
|
|
|
|
Form::Factory::Control |
7
|
|
|
|
|
|
|
Form::Factory::Control::Role::Labeled |
8
|
|
|
|
|
|
|
Form::Factory::Control::Role::ScalarValue |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: A single line text field |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has '+value' => ( |
15
|
|
|
|
|
|
|
isa => 'Str', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has '+default_value' => ( |
19
|
|
|
|
|
|
|
isa => 'Str', |
20
|
|
|
|
|
|
|
default => '', |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
around has_current_value => sub { |
25
|
|
|
|
|
|
|
my $next = shift; |
26
|
|
|
|
|
|
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return ($self->has_value || $self->has_default_value) |
29
|
|
|
|
|
|
|
&& length($self->current_value) > 0; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding UTF-8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Form::Factory::Control::Text - A single line text field |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 0.022 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
has_control your_name => ( |
51
|
|
|
|
|
|
|
control => 'text', |
52
|
|
|
|
|
|
|
options => { |
53
|
|
|
|
|
|
|
label => 'Your Real Name', |
54
|
|
|
|
|
|
|
default_value => 'Thomas Anderson', |
55
|
|
|
|
|
|
|
}, |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 DESCRIPTION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
A regular text box. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This control implements L<Form::Factory::Control>, L<Form::Factory::Control::Role::Labeled>, and L<Form::Factory::Control::Role::ScalarValue>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 METHODS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 has_current_value |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
We have a current value if it is defined and has a non-zero string length. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Andrew Sterling Hanenkamp <hanenkamp@cpan.org> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Qubling Software LLC. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |