joop.web.alpine_js — joop 0.0.1 documentation

# Source code for joop.web.alpine_js

    from joop.web.html import HTMLComponent
    from typing import Optional
    from joop.abstract import exclude_fields_from_my_init

    class InitJS(HTMLComponent):
        _template_location = "table/init.js"

        class Inputs(HTMLComponent.Inputs):
            pass

        class Data(HTMLComponent.Data):

            @classmethod
            def from_inputs(cls, inputs):
                return super()._from_inputs(inputs)

        class SubComponents(HTMLComponent.SubComponents): pass

    class AlpineDefinition(HTMLComponent):

        class Inputs(HTMLComponent.Inputs): pass

        class Data(HTMLComponent.Data):
            definition_name : str
            display_text : Optional[str]

            @classmethod
            def from_inputs(cls, inputs):
                return super()._from_inputs(inputs)

        class SubComponents(HTMLComponent.SubComponents):
            init_js : InitJS = InitJS()