Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9f0d1cd0

Von Cem Aydin vor mehr als 1 Jahr hinzugefügt

  • ID 9f0d1cd0a5c7096a54620592f930f2860e2fd4c5
  • Vorgänger 54d02a32
  • Nachfolger 2cb40cda

Mobile Design: MaterialComponents Presenter textarea input hinzugefügt

Unterschiede anzeigen:

SL/Presenter/MaterialComponents.pm
our @EXPORT_OK = qw(
button_tag
input_tag
textarea_tag
date_tag
submit_tag
icon
......
);
}
sub textarea_tag {
my ($name, $value, %attributes) = @_;
_set_id_attribute(\%attributes, $attributes{name});
my $class = delete $attributes{class};
my $icon = $attributes{icon}
? icon(delete $attributes{icon}, class => 'prefix')
: '';
my $label = $attributes{label}
? html_tag('label', delete $attributes{label}, for => $attributes{id})
: '';
html_tag('div',
$icon .
html_tag('textarea', $value, class => 'materialize-textarea', %attributes, name => $name) .
$label,
class => [ grep $_, $class, INPUT_FIELD ],
);
}
sub date_tag {
my ($name, $value, %attributes) = @_;
templates/mobile_webpages/test/components.html
[% P.M.input_tag("", "", placeholder="with placeholder", label="test input with placeholder") %]
[% P.M.input_tag("", "default value", placeholder="with placeholder", label="test input with placeholder and default value") %]
<h3>Textarea:</h3>
[% P.M.textarea_tag("", "", label="Notes") %]
[% P.M.textarea_tag("", "default value\nmulti-line", label="Notes with multi-line default value") %]
[% P.M.textarea_tag("", "", placeholder="with placeholder", label="Notes with placeholder") %]
[% P.M.textarea_tag("", "default value\nmulti-line", placeholder="with placeholder", label="Notes with placeholder and multi-line default value") %]
<h3>With grid:</h3>
<div class="row">
[% P.M.input_tag("", "", label="2 cols", class="col s6") %]

Auch abrufbar als: Unified diff