Source code for ll.xist.ns.form

# -*- coding: utf-8 -*-
# cython: language_level=3, always_allow_keywords=True

## Copyright 1999-2018 by LivingLogic AG, Bayreuth/Germany
## Copyright 1999-2018 by Walter Dörwald
##
## All Rights Reserved
##
## See ll/xist/__init__.py for the license


"""
This XIST module contains convenience classes for form elements. These are
just abbreviations for the various ``<input type="...">`` elements.
"""


from ll.xist import xsc
from ll.xist.ns import html


__docformat__ = "reStructuredText"


xmlns = "http://xmlns.livinglogic.de/xist/ns/form"


[docs]class text(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def convert(self, converter): e = html.input(self.attrs, type="text") return e.convert(converter)
[docs]class checkbox(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def convert(self, converter): e = html.input(self.attrs, type="checkbox") return e.convert(converter)
[docs]class radio(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def convert(self, converter): e = html.input(self.attrs, type="radio") return e.convert(converter)
[docs]class file(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def convert(self, converter): e = html.input(self.attrs, type="file") return e.convert(converter)
[docs]class submit(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def convert(self, converter): e = html.input(self.attrs, type="submit") return e.convert(converter)
[docs]class button(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def convert(self, converter): e = html.input(self.attrs, type="button") return e.convert(converter)
[docs]class textarea(html.textarea): xmlns = xmlns
[docs] class Attrs(html.textarea.Attrs):
[docs] class value(xsc.TextAttr): pass
[docs] def convert(self, converter): e = html.textarea(self.attrs.value, self.attrs.withoutnames("value")) return e.convert(converter)
[docs]class hidden(html.input): xmlns = xmlns
[docs] class Attrs(html.input.Attrs): type = None
[docs] def __str__(self): return ""
[docs] def convert(self, converter): e = html.input(self.attrs, type="hidden") return e.convert(converter)