added Reaction::UI::(Widget|ViewPort)::Data classes
edenc [Tue, 27 Jan 2009 21:58:58 +0000 (21:58 +0000)]
lib/Reaction/UI/ViewPort/Data.pm [new file with mode: 0644]
lib/Reaction/UI/Widget/Data.pm [new file with mode: 0644]

diff --git a/lib/Reaction/UI/ViewPort/Data.pm b/lib/Reaction/UI/ViewPort/Data.pm
new file mode 100644 (file)
index 0000000..affb856
--- /dev/null
@@ -0,0 +1,10 @@
+package Reaction::UI::ViewPort::Data;
+
+use Reaction::Class;
+extends 'Reaction::UI::ViewPort';
+
+use namespace::clean -except => [qw(meta)];
+
+has args => ( isa => 'HashRef', is => 'ro', default => sub{{}} );
+
+1;
diff --git a/lib/Reaction/UI/Widget/Data.pm b/lib/Reaction/UI/Widget/Data.pm
new file mode 100644 (file)
index 0000000..95da53c
--- /dev/null
@@ -0,0 +1,13 @@
+package Reaction::UI::Widget::Data;
+
+use Reaction::UI::WidgetClass;
+use namespace::clean -except => [qw(meta)];
+
+extends 'Reaction::UI::Widget::Container';
+
+before fragment widget {
+  my $data = $_{viewport}->args;
+  arg $_ => $data->{$_} for keys %$data;
+};
+
+1;