## class: `WyFilesTable`, `wy-files-table`

Table view for file lists.

**Used sub components:**

*   [`<wy-file-menu>`](./wy-file-menu)
*   [`<wy-file-draft-badge>`](./wy-file-draft-badge)
*   [`<wy-icon>`](./ui/wy-icon)
*   [`<wy-button>`](./ui/wy-button)

### Fields

| Name               | Type                     | Default                             | Description                                                     | Inherited From        |
| ------------------ | ------------------------ | ----------------------------------- | --------------------------------------------------------------- | --------------------- |
| `order`            | `FileOrderType`          | `{ by: "name", descending: false }` | Active sort order for the table.                                |                       |
| `selectedId`       | `number \| undefined`    | `NaN`                               | File id that is selected.                                       |                       |
| `previousPagerRef` | `RefOrCallback<Element>` |                                     | Reference to the pager element for loading previous items.      |                       |
| `nextPagerRef`     | `RefOrCallback<Element>` |                                     | Reference to the pager element for loading next items.          |                       |
| `link`             | `LinkType \| undefined`  |                                     | Any provided link that should be loaded, shown and highlighted. | WeavySubTypeComponent |

### Methods

| Name                     | Description                                           | Parameters                                                                                                    | Return                       | Inherited From        |
| ------------------------ | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------- |
| `dispatchOrder`          | Emit an \`order\` event with the provided sort order. | `order: FileOrderType`                                                                                        |                              |                       |
| `renderFileTable`        | Render the complete file table layout.                | `files: FileType[], order: FileOrderType, isRenamingId: number, highlightId: number, highlightRef`            |                              |                       |
| `renderFileTableHeaders` | Render table header cells with sorting affordances.   | `order: FileOrderType`                                                                                        |                              |                       |
| `renderFileTableRow`     | Render a single file table row.                       | `weavy: WeavyType \| undefined, { file }: { file: FileType }, isRenamingId: number, highlightId: number, row` |                              |                       |
| `whenLink`               | Resolves when a provided link is available.           |                                                                                                               | `Promise<LinkType>`          | WeavySubTypeComponent |
| `whenReady`              | Resolves when the component has rendered first time.  |                                                                                                               | `Promise<WeavySubComponent>` | WeavySubComponent     |
| `dispatchAction`         | Dispatch a \`wy-action\` event on the component.      | `detail: WyActionEventDetailType`                                                                             | `boolean`                    | WeavySubComponent     |

### Events

| Name        | Type                            | Description                                       | Inherited From    |
| ----------- | ------------------------------- | ------------------------------------------------- | ----------------- |
| `wy-action` | `WyActionEventType`             | Emitted when an action is performed on an entity. |                   |
| `order`     | `OrderEventType<FileOrderType>` | Emitted when the user changes sort order.         |                   |
| `ready`     | `CustomEvent`                   | When the component has rendered.                  | WeavySubComponent |

### Attributes

| Name         | Field      | Inherited From |
| ------------ | ---------- | -------------- |
| `selectedId` | selectedId |                |

### CSS Parts

| Name                   | Description                                    |
| ---------------------- | ---------------------------------------------- |
| `wy-table`             | Table root element                             |
| `wy-table-interactive` | Modifier for hoverable rows                    |
| `wy-tr`                | Table rows                                     |
| `wy-th`                | Table header cells                             |
| `wy-col-icon`          | Cells that contain icons/actions               |
| `wy-col-icon-content`  | Content in icon/action cells                   |
| `wy-col-name`          | Cells that contain name                        |
| `wy-col-time`          | Cells that contain time                        |
| `wy-col-kind`          | Cells that contain kind                        |
| `wy-col-size`          | Cells that contain size                        |
| `wy-sort-link`         | Sortable table header cell                     |
| `wy-input`             | Input field for file rename.                   |
| `wy-highlight`         | Modifier for highlighted row                   |
| `wy-trashed`           | Modifier for trashed row.                      |
| `wy-badge`             | Badge used for comment counts                  |
| `wy-pager`             | Pager anchor for infinite scrolling detection. |
| `wy-pager-overlay`     | Modifier for overlaying pager.                 |
| `wy-pager-top`         | Modifier for pager placed in the top.          |
| `wy-pager-bottom`      | Modifier for pager placed in the bottom.       |

<details><summary>Private API</summary>

### Fields

| Name                        | Privacy | Type                                                               | Default                                                                               | Description | Inherited From        |
| --------------------------- | ------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | ----------- | --------------------- |
| `#resolveContextDataBlobs`  | private | `(blobs: ContextDataBlobsType) => void \| undefined`               |                                                                                       |             | WeavySubTypeComponent |
| `#whenContextDataBlobs`     | private |                                                                    | `new Promise<ContextDataBlobsType>((r) => { this.#resolveContextDataBlobs = r; })`    |             | WeavySubTypeComponent |
| `#resolveComponentFeatures` | private | `(componentFeatures: ComponentFeaturePolicy) => void \| undefined` |                                                                                       |             | WeavySubTypeComponent |
| `#whenComponentFeatures`    | private |                                                                    | `new Promise<ComponentFeaturePolicy>((r) => { this.#resolveComponentFeatures = r; })` |             | WeavySubTypeComponent |
| `#resolveLink`              | private | `(link: LinkType) => void \| undefined`                            |                                                                                       |             | WeavySubTypeComponent |
| `#whenLink`                 | private |                                                                    | `new Promise<LinkType>((r) => { this.#resolveLink = r; })`                            |             | WeavySubTypeComponent |
| `#resolveSettings`          | private | `(settings: WeavyComponentSettingsType) => void \| undefined`      |                                                                                       |             | WeavySubTypeComponent |
| `#whenSettings`             | private |                                                                    | `new Promise<WeavyComponentSettingsType>((r) => { this.#resolveSettings = r; })`      |             | WeavySubTypeComponent |
| `#resolveContextId`         | private | `(contextId: ContextIdType) => void \| undefined`                  |                                                                                       |             | WeavySubComponent     |
| `#whenContextId`            | private |                                                                    | `new Promise<ContextIdType>((r) => { this.#resolveContextId = r; })`                  |             | WeavySubComponent     |
| `#resolveUser`              | private | `(user: UserType) => void \| undefined`                            |                                                                                       |             | WeavySubComponent     |
| `#whenUser`                 | private |                                                                    | `new Promise<UserType>((r) => { this.#resolveUser = r; })`                            |             | WeavySubComponent     |
| `#resolveWeavy`             | private | `(weavy: WeavyType) => void \| undefined`                          |                                                                                       |             | WeavySubComponent     |
| `#whenWeavy`                | private |                                                                    | `new Promise<WeavyType>((r) => { this.#resolveWeavy = r; })`                          |             | WeavySubComponent     |
| `#resolveReady`             | private | `(component: WeavySubComponent) => void \| undefined`              |                                                                                       |             | WeavySubComponent     |
| `#whenReady`                | private |                                                                    | `new Promise<WeavySubComponent>((r) => { this.#resolveReady = r; })`                  |             | WeavySubComponent     |

</details>

<hr/>

## Exports

| Kind                        | Name             | Declaration  | Module                           | Package |
| --------------------------- | ---------------- | ------------ | -------------------------------- | ------- |
| `js`                        | `WyFilesTable`   | WyFilesTable | lib/components/wy-files-table.ts |         |
| `custom-element-definition` | `wy-files-table` | WyFilesTable | lib/components/wy-files-table.ts |         |
