import { html, css } from '@lion/core'; import { renderLitAsNode } from '@lion/helpers'; import { LionOption } from '@lion/listbox'; import { LionCombobox } from '../../src/LionCombobox.js'; class WaOption extends LionOption { static get properties() { return { title: String, text: String, time: String, image: String, isUserText: { attribute: 'is-user-text', reflect: true, type: Boolean }, isUserTextRead: { attribute: 'is-user-text-read', reflect: true, type: Boolean }, }; } static get styles() { return [ super.styles, css` :host { --background-default: white; --background-default-active: gray; --secondary: #777; --secondary-lighter: #aaa; --chatlist-icon: #aaa; background-color: var(--background-default); cursor: pointer; color: rgb(74, 74, 74); padding: 0; transition: max-height 0.4s ease, opacity 0.3s ease; max-height: 500px; } :host([checked]) { background-color: #eee; } :host(:hover) { background-color: #f6f6f6; } .wa-option { position: relative; display: flex; flex-direction: row; height: 72px; pointer-events: all; } .wa-option__image { display: flex; flex: none; align-items: center; margin-top: -1px; padding: 0 15px 0 13px; } .wa-option__image-inner { position: relative; overflow: hidden; background-color: var(--avatar-background); border-radius: 50%; height: 49px; width: 49px; } .wa-option__image-inner img, .wa-option__image-inner svg { width: 100%; height: 100%; } .wa-option__image-inner-inner { position: absolute; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; } .wa-option__content { display: flex; flex-basis: auto; flex-direction: column; flex-grow: 1; justify-content: center; min-width: 0; border-bottom: 1px solid #eee; padding-right: 15px; } .wa-option__content-row1 { display: flex; align-items: center; line-height: normal; text-align: left; } .wa-option__content-row1-title { display: flex; flex-grow: 1; overflow: hidden; color: var(--primary-strong); font-weight: 400; font-size: 17px; line-height: 21px; } .wa-option__content-row1-time { line-height: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 6px; margin-top: 3px; flex: none; max-width: 100%; color: var(--secondary-lighter); font-size: 12px; line-height: 20px; } .wa-option__content-row2 { display: flex; align-items: center; min-height: 20px; color: var(--secondary); font-size: 13px; line-height: 20px; margin-top: 2px; /* color: var(--secondary-stronger); */ } .wa-option__content-row2-text { flex-grow: 1; overflow: hidden; font-weight: 400; font-size: 14px; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; } .wa-option__content-row2-text-inner { display: flex; align-items: flex-start; } .wa-option__content-row2-text-inner-icon { display: none; flex: none; color: var(--chatlist-icon); vertical-align: top; margin-right: 2px; } :host([is-user-text]) .wa-option__content-row2-text-inner-icon { display: inline-block; } :host([is-user-text-read]) .wa-option__content-row2-text-inner-icon { color: lightblue; } /* .wa-option__content-row2-menu { } */ `, ]; } render() { return html`