From 4cbfd3c2518d049351598bcc5bf58dcde081caee Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sat, 23 Mar 2019 12:58:43 -0400 Subject: [PATCH] basic nodes --- jael_web/example/main.dart | 2 +- jael_web/lib/jael_web.dart | 6 +++++- jael_web/lib/src/builder_node.dart | 8 ++++++++ jael_web/lib/src/component.dart | 15 +++++++++++++++ jael_web/lib/src/dom_node.dart | 3 +++ jael_web/lib/src/fn.dart | 10 ++++++++++ 6 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 jael_web/lib/src/builder_node.dart create mode 100644 jael_web/lib/src/component.dart create mode 100644 jael_web/lib/src/dom_node.dart create mode 100644 jael_web/lib/src/fn.dart diff --git a/jael_web/example/main.dart b/jael_web/example/main.dart index 56b835fd..b82b7e86 100644 --- a/jael_web/example/main.dart +++ b/jael_web/example/main.dart @@ -1,3 +1,3 @@ import 'package:jael_web/jael_web.dart'; -void main() {} +void main() {} \ No newline at end of file diff --git a/jael_web/lib/jael_web.dart b/jael_web/lib/jael_web.dart index 15d44cf4..98c7b7f7 100644 --- a/jael_web/lib/jael_web.dart +++ b/jael_web/lib/jael_web.dart @@ -1 +1,5 @@ -export 'src/dom_builder.dart'; \ No newline at end of file +export 'src/builder_node.dart'; +export 'src/component.dart'; +export 'src/dom_builder.dart'; +export 'src/dom_node.dart'; +export 'src/fn.dart'; diff --git a/jael_web/lib/src/builder_node.dart b/jael_web/lib/src/builder_node.dart new file mode 100644 index 00000000..555187ff --- /dev/null +++ b/jael_web/lib/src/builder_node.dart @@ -0,0 +1,8 @@ +import 'dom_builder.dart'; +import 'dom_node.dart'; + +abstract class BuilderNode extends DomNode { + DomBuilderElement build(DomBuilder dom); + + void destroy(DomBuilderElement el); +} diff --git a/jael_web/lib/src/component.dart b/jael_web/lib/src/component.dart new file mode 100644 index 00000000..4c55336e --- /dev/null +++ b/jael_web/lib/src/component.dart @@ -0,0 +1,15 @@ +import 'dom_node.dart'; + +abstract class Component { + State state; + + DomNode render(); + + void afterMount() {} + + void beforeDestroy() {} + + void setState(State newState) { + // TODO: + } +} diff --git a/jael_web/lib/src/dom_node.dart b/jael_web/lib/src/dom_node.dart new file mode 100644 index 00000000..4da291df --- /dev/null +++ b/jael_web/lib/src/dom_node.dart @@ -0,0 +1,3 @@ +abstract class DomNode { + +} \ No newline at end of file diff --git a/jael_web/lib/src/fn.dart b/jael_web/lib/src/fn.dart new file mode 100644 index 00000000..9d7d4ca5 --- /dev/null +++ b/jael_web/lib/src/fn.dart @@ -0,0 +1,10 @@ +// TODO: Lambda/anonymous component +// +// import 'component.dart'; +// import 'dom_node.dart'; + +// class Fn extends Component { +// final DomNode Function(T) f; + +// Fn(this.f); +// } \ No newline at end of file