Selecto.Extensions (Selecto v0.3.8)

Shared extension loading and callback dispatch for the Selecto ecosystem.

Link to this section Summary

Types

Normalized extension entries: {module, opts}

Functions

Return additional selecto_components views contributed by extensions.

Deep-merge maps recursively.

Resolve extension-provided Ecto->Selecto type mapping.

Extract normalized extension specs from a domain-like map.

Extract normalized extension specs from a selecto/domain-like value.

Apply merge_domain/2 callbacks for extensions in declaration order.

Apply updato_domain/2 callbacks for extensions in declaration order.

Normalize extension specs from any supported format.

Return additional overlay DSL import modules from extension callbacks.

Build and deep-merge extension overlay fragments.

Execute compile-time overlay_setup/2 callbacks.

Link to this section Types

Link to this type

normalized_spec()

@type normalized_spec() :: {module(), keyword()}

Normalized extension entries: {module, opts}

Link to this section Functions

Link to this function

components_views(selecto_or_domain, specs)

@spec components_views(term(), [normalized_spec()]) :: [tuple()]

Return additional selecto_components views contributed by extensions.

Link to this function

deep_merge(left, right)

@spec deep_merge(map(), map()) :: map()

Deep-merge maps recursively.

Link to this function

ecto_type_to_selecto_type(ecto_type, specs)

@spec ecto_type_to_selecto_type(term(), [normalized_spec()]) :: atom() | nil

Resolve extension-provided Ecto->Selecto type mapping.

Returns the first non-nil mapping from extensions in declaration order.

Link to this function

from_domain(domain)

@spec from_domain(map()) :: [normalized_spec()]

Extract normalized extension specs from a domain-like map.

Link to this function

from_source(domain)

@spec from_source(term()) :: [normalized_spec()]

Extract normalized extension specs from a selecto/domain-like value.

Link to this function

merge_domain_extensions(domain, specs)

@spec merge_domain_extensions(map(), [normalized_spec()]) :: map()

Apply merge_domain/2 callbacks for extensions in declaration order.

Link to this function

merge_updato_domain_extensions(domain, specs)

@spec merge_updato_domain_extensions(map(), [normalized_spec()]) :: map()

Apply updato_domain/2 callbacks for extensions in declaration order.

Link to this function

normalize_specs(specs)

@spec normalize_specs(term()) :: [normalized_spec()]

Normalize extension specs from any supported format.

Supported entries:

  • MyExtension
  • {MyExtension, key: "value"}
  • %{module: MyExtension, opts: [...]}
Link to this function

overlay_dsl_modules(specs)

@spec overlay_dsl_modules([normalized_spec()]) :: [module()]

Return additional overlay DSL import modules from extension callbacks.

Link to this function

overlay_fragments(overlay_module, specs)

@spec overlay_fragments(module(), [normalized_spec()]) :: map()

Build and deep-merge extension overlay fragments.

Link to this function

setup_overlay_extensions(overlay_module, specs)

@spec setup_overlay_extensions(module(), [normalized_spec()]) :: :ok

Execute compile-time overlay_setup/2 callbacks.