Aurora.Uix.Templates.Basic.ModulesGenerator (Aurora UIX v0.1.0)
Dynamic LiveView module generator for creating CRUD-oriented user interfaces.
Transforms configuration maps into fully-functional, dynamically generated LiveView modules for index, show, and form UI components. Generates modules with event handling, form validation, and flexible rendering. All code generation is performed at compile time.
Delegates actual code generation to specialized sub-generators: FormGenerator, IndexGenerator, and ShowGenerator.
Summary
Functions
Generates a LiveView module for the specified UI component type.
Returns the handler module or the default one.
Generates a module name by concatenating the caller, module name, and suffix.
Removes fields marked as omitted from the parsed options.
Functions
Generates a LiveView module for the specified UI component type.
Parameters
parsed_opts(map()) - Generation options withlayout_tree.tagand component configuration.
Returns
Macro.t() - The generated LiveView module code.
Examples
Aurora.Uix.Templates.Basic.ModulesGenerator.generate_module(
%{layout_tree: %{tag: :index}, name: :product,
modules: %{caller: MyAppWeb, context: MyApp.Accounts, module: MyApp.User, web: MyAppWeb}
}
}
)If the tag is not implemented, returns a quoted block with no generation logic.
Returns the handler module or the default one.
Generates a module name by concatenating the caller, module name, and suffix.
Parameters
modules(map()) - Module configuration with caller reference.parsed_opts(map()) - Options containingmodule_name.suffix(binary()) - String to append to module name.
Returns
module()- The generated module name.
Examples
Aurora.Uix.Templates.Basic.ModulesGenerator.module_name(
%{caller: MyAppWeb}, %{module_name: "User"}, ".Index"
)
# => MyAppWeb.User.Index
Removes fields marked as omitted from the parsed options.
Parameters
parsed_options(map()) - Options with fields to filter.
Returns
- map() - Options with omitted fields removed.
Examples
Aurora.Uix.Templates.Basic.ModulesGenerator.remove_omitted_fields(%{
fields: [
%{name: :foo, omitted: true},
%{name: :bar, omitted: false}
]
})
# => %{fields: [%{name: :bar, omitted: false}]}