Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* @license
* Copyright (c) 2021 - 2024 Vaadin Ltd.
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
import { html as legacyHtml, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { html, render } from 'lit';
import { ifDefined } from 'lit/directives/if-defined.js';
import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
import { Message } from './vaadin-message.js';
/**
* `` is a Web Component for showing an ordered list of messages. The messages are rendered as
*
* ### Example
*
* To create a new message list, add the component to the page:
*
* ```html
*
* ```
*
* Provide the messages to the message list with the [`items`](#/elements/vaadin-message-list#property-items) property.
*
* ```js
* document.querySelector('vaadin-message-list').items = [
* { text: 'Hello list', time: 'yesterday', userName: 'Matt Mambo', userAbbr: 'MM', userColorIndex: 1 },
* { text: 'Another message', time: 'right now', userName: 'Linsey Listy', userAbbr: 'LL', userColorIndex: 2, userImg: '/static/img/avatar.jpg' }
* ];
* ```
*
* ### Styling
*
* The following shadow DOM parts are available for styling:
*
* Part name | Description
* ----------|----------------
* `list` | The container wrapping messages.
*
* See the [``](#/elements/vaadin-message) documentation for the available
* state attributes and stylable shadow parts of message elements.
*
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
*
* @customElement
* @extends HTMLElement
* @mixes ThemableMixin
* @mixes ElementMixin
* @mixes KeyboardDirectionMixin
*/
class MessageList extends KeyboardDirectionMixin(ElementMixin(ThemableMixin(PolymerElement))) {
static get is() {
return 'vaadin-message-list';
}
static get properties() {
return {
/**
* An array of objects which will be rendered as messages.
* The message objects can have the following properties:
* ```js
* Array<{
* text: string,
* time: string,
* userName: string,
* userAbbr: string,
* userImg: string,
* userColorIndex: number,
* className: string,
* theme: string
* }>
* ```
*/
items: {
type: Array,
value: () => [],
observer: '_itemsChanged',
},
};
}
static get template() {
return legacyHtml`