FileList (drop v0.1.0)

Copy Markdown

Summary

Functions

Returns the initial internal state for this widget.

Returns true for widget modules with view callbacks.

Creates a :file_list widget.

Creates a new canvas widget instance.

Functions

__initial_state__()

@spec __initial_state__() :: map()

Returns the initial internal state for this widget.

__widget__?()

@spec __widget__?() :: true

Returns true for widget modules with view callbacks.

file_list(id, opts \\ [])

(macro)

Creates a :file_list widget.

Shorthand for new/2. Import this macro to use the widget name directly in view functions:

import FileList, only: [file_list: 2]

file_list("my-id", prop: value)

new(id, opts \\ [])

@spec new(id :: String.t(), opts :: keyword()) :: %FileList{
  __explicit_nil_props__: term(),
  active_file: term(),
  files: term(),
  id: term()
}

Creates a new canvas widget instance.

Returns a struct that participates in the standard Widget protocol pipeline: struct -> to_node -> normalize. The widget is rendered during tree normalization with stored internal state (or initial defaults on first render).

view(id, props)