## class: `WyCommentList`, `wy-comment-list`

Comment list component rendering a list of comments and an editor to create comments.

**Used sub components:**

*   [`<wy-button>`](./ui/wy-button)
*   [`<wy-progress-circular>`](./ui/wy-progress-circular)
*   [`<wy-comment>`](./wy-comment)
*   [`<wy-editor-comment>`](./wy-editor-comment)
*   [`<wy-empty>`](./wy-empty)

### Fields

| Name             | Type                           | Default   | Description                                                                                                                                         | Inherited From        |
| ---------------- | ------------------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| `parentId`       | `number \| undefined`          |           | Id of the parent entity (post/file/app) to which comments belong.&#xA;&#xA;Set this to load comments for a specific parent.                         |                       |
| `location`       | `"posts" \| "files" \| "apps"` | `"apps"`  | Location where the comments are stored.                                                                                                             |                       |
| `placeholder`    | `string \| undefined`          |           | Placeholder text for the comment editor input.                                                                                                      |                       |
| `reveal`         | `boolean`                      | `false`   | Whether comments should be revealed (expanded) by default.                                                                                          |                       |
| `padded`         | `boolean`                      | `false`   | Adds padding to the comment list container.                                                                                                         |                       |
| `previousPaging` | `"infinite" \| "paged"`        | `"paged"` | Paging behavior for loading previous comments.&#xA;&#xA;- "infinite" is recommended when the component is placed in an overflowing/scrollable area. |                       |
| `nextPaging`     | `"infinite" \| "paged"`        | `"paged"` | Paging behavior for loading next comments.&#xA;&#xA;- "infinite" is recommended when the component is placed in an overflowing/scrollable area.     |                       |
| `app`            | `AppType \| undefined`         |           | The app data.                                                                                                                                       | WeavySubAppComponent  |
| `apps`           | `AppListType \| undefined`     |           | Multiple apps data.                                                                                                                                 | WeavySubAppComponent  |
| `link`           | `LinkType \| undefined`        |           | Any provided link that should be loaded, shown and highlighted.                                                                                     | WeavySubTypeComponent |

### Methods

| Name             | Description                                          | Parameters                        | Return                       | Inherited From        |
| ---------------- | ---------------------------------------------------- | --------------------------------- | ---------------------------- | --------------------- |
| `whenParentId`   | Resolves when \`parentId\` is available.             |                                   |                              |                       |
| `whenApp`        | Resolves when app data is available.                 |                                   | `Promise<AppType>`           | WeavySubAppComponent  |
| `whenApps`       | Resolves when multiple app data is available.        |                                   | `Promise<AppListType>`       | WeavySubAppComponent  |
| `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-preview-open`  | `WyPreviewOpenEventType`  | Fired when a preview overlay is about to open. |                   |
| `wy-preview-close` | `WyPreviewCloseEventType` | Fired when a preview overlay is closed.        |                   |
| `ready`            | `CustomEvent`             | When the component has rendered.               | WeavySubComponent |

### Attributes

| Name             | Field          | Inherited From |
| ---------------- | -------------- | -------------- |
| `parentId`       | parentId       |                |
| `placeholder`    | placeholder    |                |
| `reveal`         | reveal         |                |
| `padded`         | padded         |                |
| `previousPaging` | previousPaging |                |
| `nextPaging`     | nextPaging     |                |

### CSS Parts

| Name              | Description                     |
| ----------------- | ------------------------------- |
| `wy-comments`     | Container for the comments list |
| `wy-pager`        | Pager container element         |
| `wy-pager-bottom` | Bottom pager modifier           |

### Slots

| Name    | Description                             |
| ------- | --------------------------------------- |
| `empty` | Content when no comments are available. |

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

### Fields

| Name                        | Privacy | Type                                                               | Default                                                                               | Description | Inherited From        |
| --------------------------- | ------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------- | ----------- | --------------------- |
| `#whenParentId`             | private |                                                                    | `new Promise<number>((r) => { this.#resolveParentId = r; })`                          |             |                       |
| `#resolveApp`               | private | `(app: AppType) => void \| undefined`                              |                                                                                       |             | WeavySubAppComponent  |
| `#whenApp`                  | private |                                                                    | `new Promise<AppType>((r) => { this.#resolveApp = r; })`                              |             | WeavySubAppComponent  |
| `#resolveApps`              | private | `(apps: AppListType) => void \| undefined`                         |                                                                                       |             | WeavySubAppComponent  |
| `#whenApps`                 | private |                                                                    | `new Promise<AppListType>((r) => { this.#resolveApps = r; })`                         |             | WeavySubAppComponent  |
| `#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`                        | `WyCommentList`   | WyCommentList | lib/components/wy-comment-list.ts |         |
| `custom-element-definition` | `wy-comment-list` | WyCommentList | lib/components/wy-comment-list.ts |         |
