PhoenixKitCatalogue.Web.TableQuery (PhoenixKitCatalogue v0.10.0)

Copy Markdown View Source

Pure, in-memory search → filter → sort pipeline over a list of row maps (catalogues/suppliers/manufacturers already loaded by the LiveView).

Summary

Functions

apply(rows, scope, opts)

@spec apply([map()], PhoenixKitCatalogue.Web.TableConfig.scope(), map()) :: [map()]

enum_options(rows, scope, id)

@spec enum_options([map()], PhoenixKitCatalogue.Web.TableConfig.scope(), String.t()) ::
  [
    {String.t(), String.t()}
  ]

filter(rows, scope, filters)

@spec filter([map()], PhoenixKitCatalogue.Web.TableConfig.scope(), map()) :: [map()]

search(rows, q, field_fn \\ & &1.name)

@spec search([map()], String.t() | nil, (map() -> String.t() | nil)) :: [map()]

sort(rows, scope, sort_by, dir)

@spec sort(
  [map()],
  PhoenixKitCatalogue.Web.TableConfig.scope(),
  String.t() | nil,
  :asc | :desc
) :: [
  map()
]

unfiled_folder_value()

@spec unfiled_folder_value() :: String.t()