multi-select-combo-boxpackage.src.vaadin-multi-select-combo-box-chip.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-webcomponents Show documentation
Show all versions of vaadin-webcomponents Show documentation
Mvnpm composite: Vaadin webcomponents
The newest version!
/**
* @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, PolymerElement } from '@polymer/polymer/polymer-element.js';
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
/**
* An element used by `` to display selected items.
*
* ### Styling
*
* The following shadow DOM parts are available for styling:
*
* Part name | Description
* -----------------|-------------
* `label` | Element containing the label
* `remove-button` | Remove button
*
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
*
* @customElement
* @extends HTMLElement
* @private
*/
class MultiSelectComboBoxChip extends ThemableMixin(PolymerElement) {
static get is() {
return 'vaadin-multi-select-combo-box-chip';
}
static get properties() {
return {
disabled: {
type: Boolean,
reflectToAttribute: true,
},
readonly: {
type: Boolean,
reflectToAttribute: true,
},
label: {
type: String,
},
item: {
type: Object,
},
};
}
static get template() {
return html`
[[label]]
`;
}
/** @private */
_onRemoveClick(event) {
event.stopPropagation();
this.dispatchEvent(
new CustomEvent('item-removed', {
detail: {
item: this.item,
},
bubbles: true,
composed: true,
}),
);
}
}
defineCustomElement(MultiSelectComboBoxChip);