| 1 | package Data::HTML::Element::Textarea; | ||
| 2 | |||
| 3 | 16 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 16 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 0 | ▶ | use Mo qw(build is); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | use Mo::utils 0.26 qw(check_bool check_number); | ||
| 8 | use Mo::utils::CSS 0.02 qw(check_css_class); | ||
| 9 | |||
| 10 | our $VERSION = 0.17; | ||
| 11 | |||
| 12 | has autofocus => ( | ||
| 13 | is => 'ro', | ||
| 14 | ); | ||
| 15 | |||
| 16 | has cols => ( | ||
| 17 | is => 'ro', | ||
| 18 | ); | ||
| 19 | |||
| 20 | has css_class => ( | ||
| 21 | is => 'ro', | ||
| 22 | ); | ||
| 23 | |||
| 24 | has disabled => ( | ||
| 25 | is => 'ro', | ||
| 26 | ); | ||
| 27 | |||
| 28 | has form => ( | ||
| 29 | is => 'ro', | ||
| 30 | ); | ||
| 31 | |||
| 32 | has id => ( | ||
| 33 | is => 'ro', | ||
| 34 | ); | ||
| 35 | |||
| 36 | has label => ( | ||
| 37 | is => 'ro', | ||
| 38 | ); | ||
| 39 | |||
| 40 | has name => ( | ||
| 41 | is => 'ro', | ||
| 42 | ); | ||
| 43 | |||
| 44 | has placeholder => ( | ||
| 45 | is => 'ro', | ||
| 46 | ); | ||
| 47 | |||
| 48 | has readonly => ( | ||
| 49 | is => 'ro', | ||
| 50 | ); | ||
| 51 | |||
| 52 | has required => ( | ||
| 53 | is => 'ro', | ||
| 54 | ); | ||
| 55 | |||
| 56 | has rows => ( | ||
| 57 | is => 'ro', | ||
| 58 | ); | ||
| 59 | |||
| 60 | has value => ( | ||
| 61 | is => 'ro', | ||
| 62 | ); | ||
| 63 | |||
| 64 | sub BUILD { | ||
| 65 | my $self = shift; | ||
| 66 | |||
| 67 | # Check autofocus. | ||
| 68 | if (! defined $self->{'autofocus'}) { | ||
| 69 | $self->{'autofocus'} = 0; | ||
| 70 | } | ||
| 71 | check_bool($self, 'autofocus'); | ||
| 72 | |||
| 73 | # Check css_class. | ||
| 74 | check_css_class($self, 'css_class'); | ||
| 75 | |||
| 76 | # Check cols. | ||
| 77 | check_number($self, 'cols'); | ||
| 78 | |||
| 79 | # Check disabled. | ||
| 80 | if (! defined $self->{'disabled'}) { | ||
| 81 | $self->{'disabled'} = 0; | ||
| 82 | } | ||
| 83 | check_bool($self, 'disabled'); | ||
| 84 | |||
| 85 | # Check readonly. | ||
| 86 | if (! defined $self->{'readonly'}) { | ||
| 87 | $self->{'readonly'} = 0; | ||
| 88 | } | ||
| 89 | check_bool($self, 'readonly'); | ||
| 90 | |||
| 91 | # Check required. | ||
| 92 | if (! defined $self->{'required'}) { | ||
| 93 | $self->{'required'} = 0; | ||
| 94 | } | ||
| 95 | check_bool($self, 'required'); | ||
| 96 | |||
| 97 | # Check rows. | ||
| 98 | check_number($self, 'rows'); | ||
| 99 | |||
| 100 | return; | ||
| 101 | } | ||
| 102 | |||
| 103 | 1; | ||
| 104 | |||
| 105 | __END__ | ||