# Path: wdom/themes/bootstrap3.py

# 
# Path: wdom/themes/bootstrap3.py

# 
# Path: wdom/themes/bootstrap3.py

# 
# Path: wdom/document.py
# def get_document() -> Document:
#     """Get current root document object.
# 
#     :rtype: Document
#     """
#     return rootDocument
# 
# class Document(Node, ParentNode, EventTarget):
#     """Base class for Document node."""
# 
#     nodeType = Node.DOCUMENT_NODE
#     nodeName = '#document'
# 
#     def __init__(self, *,
#                  doctype: str = 'html',
#                  default_class: type = HTMLElement,
#                  **kwargs: Any) -> None:
#         """Create new Document node.
# 
#         :arg str doctype: Document type of this document.
#         :arg type default_class: Default class created by
#             :py:meth:`createElement` method.
#         """
#         super().__init__()
#         self.__window = Window(self)
#         self._default_class = default_class
# 
#         self.__doctype = DocumentType(doctype, parent=self)
#         self.__html = Html(parent=self)
#         self.__head = Head(parent=self.documentElement)
#         self.__body = Body(parent=self.documentElement)
# 
#     @property
#     def defaultView(self) -> Window:
#         """Return :class:`Window` class of this document."""
#         return self.__window
# 
#     @property
#     def doctype(self) -> DocumentType:
#         """Return DocumentType element of this document."""
#         return self.__doctype
# 
#     @property
#     def documentElement(self) -> Element:
#         """Return <html> element of this document."""
#         return self.__html
# 
#     @property
#     def head(self) -> Element:
#         """Return <head> element of this document."""
#         return self.__head
# 
#     def _find_charset_node(self) -> Optional[Element]:
#         for child in self.head:
#             if child.localName == 'meta' and child.hasAttribute('charset'):
#                 return child
#         return None
# 
#     @property
#     def characterSet(self) -> str:
#         """Get/Set charset of this document."""
#         charset = self._find_charset_node()
#         if charset:
#             return charset.getAttribute('charset')  # type: ignore
#         return ''
# 
#     @characterSet.setter
#     def characterSet(self, charset: str) -> None:
#         """Set character set of this document."""
#         charset_node = self._find_charset_node() or Meta(parent=self.head)
#         charset_node.setAttribute('charset', charset)
# 
#     @property
#     def body(self) -> Element:
#         """Return <body> element of this document."""
#         return self.__body
# 
#     @property
#     def title(self) -> str:
#         """Get/Set title string of this document."""
#         title_element = _find_tag(self.head, 'title')
#         if title_element:
#             return title_element.textContent
#         return ''
# 
#     @title.setter
#     def title(self, new_title: str) -> None:
#         _title = _find_tag(self.head, 'title')
#         title_element = _title or Title(parent=self.head)
#         title_element.textContent = new_title
# 
#     def getElementsBy(self, cond: Callable[[Element], bool]) -> NodeList:
#         """Get elements in this document which matches condition."""
#         return getElementsBy(self, cond)
# 
#     def getElementsByTagName(self, tag: str) -> NodeList:
#         """Get elements with tag name in this document."""
#         return getElementsByTagName(self, tag)
# 
#     def getElementsByClassName(self, class_name: str) -> NodeList:
#         """Get elements with class name in this document."""
#         return getElementsByClassName(self, class_name)
# 
#     def getElementById(self, id: str) -> Optional[Node]:
#         """Get element by ``id``.
# 
#         If this document does not have the element with the id, return None.
#         """
#         elm = getElementById(id)
#         if elm and elm.ownerDocument is self:
#             return elm
#         return None
# 
#     def createDocumentFragment(self) -> DocumentFragment:
#         """Create empty document fragment."""
#         return DocumentFragment()
# 
#     def createTextNode(self, text: str) -> Text:
#         """Create text node with ``text``."""
#         return Text(text)
# 
#     def createComment(self, comment: str) -> Comment:
#         """Create comment node with ``comment``."""
#         return Comment(comment)
# 
#     def createElement(self, tag: str) -> Node:
#         """Create new element whose tag name is ``tag``."""
#         return create_element(tag, base=self._default_class)
# 
#     def createEvent(self, event: str) -> Event:
#         """Create Event object with ``event`` type."""
#         return Event(event)
# 
#     def createAttribute(self, name: str) -> Attr:
#         """Create Attribute object with ``name``."""
#         return Attr(name)
# 
#     def querySelector(self, selectors: str) -> Node:
#         """Not Implemented."""
#         return querySelector(self, selectors)
# 
#     def querySelectorAll(self, selectors: str) -> NodeList:
#         """Not Implemented."""
#         return querySelectorAll(self, selectors)


from wdom.themes.bootstrap3 import Tag, H1, Button, Div
from wdom.themes.bootstrap3 import Container, FormGroup, TextInput
from wdom.themes.bootstrap3 import css_files, js_files
from wdom.document import get_document, Document
#!/usr/bin/env python3
# -*- coding: utf-8 -*-



class Item(Tag):
    tag = 'span'

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)


def sample_page(**kwargs) -> Document:
    app = Container()
    title = H1(parent=app)
    title.textContent = 'Todo example'
    form = FormGroup(parent=app)
    text_input = TextInput()
    form.append(text_input)
    add_button = Button(parent=form)
    add_button.textContent = 'ADD'

# Path: wdom/themes/bootstrap3.py

# 
# Path: wdom/themes/bootstrap3.py

# 
# Path: wdom/themes/bootstrap3.py

# 
# Path: wdom/document.py
# def get_document() -> Document:
#     """Get current root document object.
# 
#     :rtype: Document
#     """
#     return rootDocument
# 
# class Document(Node, ParentNode, EventTarget):
#     """Base class for Document node."""
# 
#     nodeType = Node.DOCUMENT_NODE
#     nodeName = '#document'
# 
#     def __init__(self, *,
#                  doctype: str = 'html',
#                  default_class: type = HTMLElement,
#                  **kwargs: Any) -> None:
#         """Create new Document node.
# 
#         :arg str doctype: Document type of this document.
#         :arg type default_class: Default class created by
#             :py:meth:`createElement` method.
#         """
#         super().__init__()
#         self.__window = Window(self)
#         self._default_class = default_class
# 
#         self.__doctype = DocumentType(doctype, parent=self)
#         self.__html = Html(parent=self)
#         self.__head = Head(parent=self.documentElement)
#         self.__body = Body(parent=self.documentElement)
# 
#     @property
#     def defaultView(self) -> Window:
#         """Return :class:`Window` class of this document."""
#         return self.__window
# 
#     @property
#     def doctype(self) -> DocumentType:
#         """Return DocumentType element of this document."""
#         return self.__doctype
# 
#     @property
#     def documentElement(self) -> Element:
#         """Return <html> element of this document."""
#         return self.__html
# 
#     @property
#     def head(self) -> Element:
#         """Return <head> element of this document."""
#         return self.__head
# 
#     def _find_charset_node(self) -> Optional[Element]:
#         for child in self.head:
#             if child.localName == 'meta' and child.hasAttribute('charset'):
#                 return child
#         return None
# 
#     @property
#     def characterSet(self) -> str:
#         """Get/Set charset of this document."""
#         charset = self._find_charset_node()
#         if charset:
#             return charset.getAttribute('charset')  # type: ignore
#         return ''
# 
#     @characterSet.setter
#     def characterSet(self, charset: str) -> None:
#         """Set character set of this document."""
#         charset_node = self._find_charset_node() or Meta(parent=self.head)
#         charset_node.setAttribute('charset', charset)
# 
#     @property
#     def body(self) -> Element:
#         """Return <body> element of this document."""
#         return self.__body
# 
#     @property
#     def title(self) -> str:
#         """Get/Set title string of this document."""
#         title_element = _find_tag(self.head, 'title')
#         if title_element:
#             return title_element.textContent
#         return ''
# 
#     @title.setter
#     def title(self, new_title: str) -> None:
#         _title = _find_tag(self.head, 'title')
#         title_element = _title or Title(parent=self.head)
#         title_element.textContent = new_title
# 
#     def getElementsBy(self, cond: Callable[[Element], bool]) -> NodeList:
#         """Get elements in this document which matches condition."""
#         return getElementsBy(self, cond)
# 
#     def getElementsByTagName(self, tag: str) -> NodeList:
#         """Get elements with tag name in this document."""
#         return getElementsByTagName(self, tag)
# 
#     def getElementsByClassName(self, class_name: str) -> NodeList:
#         """Get elements with class name in this document."""
#         return getElementsByClassName(self, class_name)
# 
#     def getElementById(self, id: str) -> Optional[Node]:
#         """Get element by ``id``.
# 
#         If this document does not have the element with the id, return None.
#         """
#         elm = getElementById(id)
#         if elm and elm.ownerDocument is self:
#             return elm
#         return None
# 
#     def createDocumentFragment(self) -> DocumentFragment:
#         """Create empty document fragment."""
#         return DocumentFragment()
# 
#     def createTextNode(self, text: str) -> Text:
#         """Create text node with ``text``."""
#         return Text(text)
# 
#     def createComment(self, comment: str) -> Comment:
#         """Create comment node with ``comment``."""
#         return Comment(comment)
# 
#     def createElement(self, tag: str) -> Node:
#         """Create new element whose tag name is ``tag``."""
#         return create_element(tag, base=self._default_class)
# 
#     def createEvent(self, event: str) -> Event:
#         """Create Event object with ``event`` type."""
#         return Event(event)
# 
#     def createAttribute(self, name: str) -> Attr:
#         """Create Attribute object with ``name``."""
#         return Attr(name)
# 
#     def querySelector(self, selectors: str) -> Node:
#         """Not Implemented."""
#         return querySelector(self, selectors)
# 
#     def querySelectorAll(self, selectors: str) -> NodeList:
#         """Not Implemented."""
#         return querySelectorAll(self, selectors)


# Path: wdom/examples/todo.py
from wdom.themes.bootstrap3 import Tag, H1, Button, Div
from wdom.themes.bootstrap3 import Container, FormGroup, TextInput
from wdom.themes.bootstrap3 import css_files, js_files
from wdom.document import get_document, Document

#!/usr/bin/env python3
# -*- coding: utf-8 -*-



class Item(Tag):
    tag = 'span'

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)


def sample_page(**kwargs) -> Document:
    app = Container()
    title = H1(parent=app)
    title.textContent = 'Todo example'
    form = FormGroup(parent=app)
    text_input = TextInput()
    form.append(text_input)
    add_button = Button(parent=form)
    add_button.textContent = 'ADD'

    todo_list = Div(parent=app)