Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected _renderPrecedingTriggerContent() {
const { clearSelectionLabel } = this;
const selectedItemsCount = this.querySelectorAll((this.constructor as typeof BXMultiSelect).selectorItemSelected).length;
return selectedItemsCount === 0
? undefined
: html`
<div title="${clearSelectionLabel}" tabindex="0" class="${prefix}--list-box__selection ${prefix}--list-box__selection--multi ${prefix}--tag--filter" role="button">
${selectedItemsCount} ${Close16({ 'aria-label': clearSelectionLabel })}
</div>
`;
}
protected _renderFollowingTriggerContent(): TemplateResult | void {
const { clearSelectionLabel, _filterInputValue: filterInputValue } = this;
return filterInputValue.length === 0
? undefined
: html`
<div title="${clearSelectionLabel}" tabindex="0" class="${prefix}--list-box__selection" role="button">
${Close16({ 'aria-label': clearSelectionLabel })}
</div>
`;
}
render() {
const { disabled, title, type } = this;
const classes = classMap({
[`${prefix}--tag`]: true,
[`${prefix}--tag--${type}`]: true,
[`${prefix}--tag--filter`]: true,
[`${prefix}--tag--disabled`]: disabled,
});
return html`
<span tabindex="0" title="${title}" class="${classes}">
${Close16({ 'aria-label': title })}
</span>
`;
}