panels/file-manager
Functions
request()
function request(url, body?): Promise<any>;Defined in: panels/file-manager.tsx:116
One call to the file manager's API with the session's credentials: a GET, or
a POST of body as JSON. Resolves to the reply, or throws its message when
the route refuses or fails.
Parameters
| Parameter | Type |
|---|---|
url | string |
body? | unknown |
Returns
Promise<any>
FileManager()
function FileManager(props): Element;Defined in: panels/file-manager.tsx:153
The file manager over the JSON file API: one directory at a time, in whichever
of the three layouts the user picked, with the upload and mkdir actions in the
header and a download on every row. The breadcrumb and the back button move
between directories; cwd is the one on screen and the one uploads and new
folders land in, and its listing is fetched the first time it is opened.
A row is one truncating line with its controls beside it, so a phone's width
stays usable: the details table drops its size column below sm and its
modification time below lg, and the row's actions become icon-only buttons
below sm. Nothing here needs a fixed-width grid track, which is what used to
make the columns collide.
Those columns are hidden with max-sm:hidden and max-lg:hidden rather than
hidden sm:block. Both cores inject a stylesheet of their own that carries an
unscoped .hidden { display: none !important }, which outranks every Tailwind
variant that would reveal the column; a max-* variant never puts the hidden
class on the element, so nothing here depends on that rule being scoped.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | FileManagerProps | The permissions, translator and class name. |
Returns
Element
FileRow()
function FileRow(props): Element;Defined in: panels/file-manager.tsx:575
One entry of the pane's directory, in the details table or as a card.
The details table's columns are per-breakpoint rather than fixed: the name
truncates and the size appears from sm and the modification time from lg,
so the row never needs more width than the viewport has. Below sm it is the
name and the download button, which is all a phone can usefully show.
The trailing column is pinned to the download button's width, and the header
repeats the same template with an empty cell there: left auto, the header's
empty cell would collapse the track and every label would sit a button's width
right of the values under it.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | FileRowProps | The entry, the layout, whether files may be fetched, and the two things the row can be asked to do. |
Returns
Element