Log inGet started
Package

fs.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

detailsList

The right pane of the two-pane Explorer: a details list of one directory's entries with an icon, name, and kind column. Folders sort first (warm accent), then files. Stateless — the caller passes the entries (each already carrying its absolute path) and a callback prefix, and receives a scrollable column of clickable rows.

A row click emits <onActivate>-<d|f>-<path> — the d/f marker tells the handler folder-vs-file without a second lookup, and the absolute path is carried verbatim. Each row shows a phosphor icon, a clickable name button, and a kind column derived from the file extension.

The module returns the builder function directly.

Builder

build(entries?, opts?) -> widget node.

  • entries — array of { name, isDirectory?, path } (path = the entry's absolute path).
  • opts (DetailsListOpts) — id, onActivate (callback prefix; rows emit <onActivate>-<d|f>-<path>), selectedPath (the highlighted row), maxHeight (caps the scroll height; otherwise the pane fills available height via flex), showHeader (the Name · Kind header row, default on).

Returns a scroll-wrapped column with an optional header row and one row per entry; an empty list renders (empty).

Usage

Z.fs.detailsList(entries, {
    onActivate   = "files-list",
    selectedPath = state.selectedPath,
})