- hello world
+
+
+ Hello World \(0o0)/
+
+
+
+ I'm a sum of all the clickies:
+
+
+
+
+
+
diff --git a/awesome_owl/static/src/todoitem/todoitem.js b/awesome_owl/static/src/todoitem/todoitem.js
new file mode 100644
index 0000000000..c78fc7b51e
--- /dev/null
+++ b/awesome_owl/static/src/todoitem/todoitem.js
@@ -0,0 +1,15 @@
+import { Component,useState } from "@odoo/owl";
+
+export class ToDoItem extends Component {
+ static template = "awesome_owl.todoitem";
+
+ static props = {
+ todo : {type: Object, optional: true},
+ todo_index : {type: Number, optional: true},
+ }
+
+ removeTodo() {
+ this.props.todo.splice("props.todo_index", 1);
+ }
+
+}
diff --git a/awesome_owl/static/src/todoitem/todoitem.xml b/awesome_owl/static/src/todoitem/todoitem.xml
new file mode 100644
index 0000000000..cbe19912bd
--- /dev/null
+++ b/awesome_owl/static/src/todoitem/todoitem.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/awesome_owl/static/src/todolist/todolist.js b/awesome_owl/static/src/todolist/todolist.js
new file mode 100644
index 0000000000..5416e85fc3
--- /dev/null
+++ b/awesome_owl/static/src/todolist/todolist.js
@@ -0,0 +1,27 @@
+import { Component,useState, useRef, onMounted } from "@odoo/owl";
+import { ToDoItem } from "../todoitem/todoitem";
+import { useAutofocus } from '../utils.js';
+
+
+export class ToDoList extends Component {
+ static template = "awesome_owl.todolist";
+ static components = { ToDoItem };
+
+ setup (){
+ this.todos = useState({todos_list:[], current_input: ""});
+ useAutofocus('focus')
+ // alternative way
+ // this.focusRef = useRef('focus');
+ // onMounted(() => {
+ // this.focus.el.focus()
+ // })
+ }
+
+ addTodo (ev){
+ if (ev.keyCode === 13 && this.todos.current_input){
+ this.todos.todos_list.push({ description: this.todos.current_input , isCompleted: false})
+ this.todos.current_input = ''
+ }
+ }
+
+}
diff --git a/awesome_owl/static/src/todolist/todolist.xml b/awesome_owl/static/src/todolist/todolist.xml
new file mode 100644
index 0000000000..a640ebc284
--- /dev/null
+++ b/awesome_owl/static/src/todolist/todolist.xml
@@ -0,0 +1,12 @@
+
+
+
+
+ To Do List
+
+
+
+
+
+
+
diff --git a/awesome_owl/static/src/utils.js b/awesome_owl/static/src/utils.js
new file mode 100644
index 0000000000..6e2d86e2e3
--- /dev/null
+++ b/awesome_owl/static/src/utils.js
@@ -0,0 +1,16 @@
+import { useRef, useEffect } from "@odoo/owl";
+
+function useAutofocus(refname) {
+
+ let ref = useRef(refname);
+ useEffect(
+ (el) => el && el.focus(),
+ () => [ref.el]
+ );
+
+
+ }
+
+export {
+ useAutofocus
+};