-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experiment: add LitElement based version of combo-box (#7042)
- Loading branch information
1 parent
5b41105
commit 846454a
Showing
41 changed files
with
589 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2015 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/ | ||
import { css, html, LitElement } from 'lit'; | ||
import { defineCustomElement } from '@vaadin/component-base/src/define.js'; | ||
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js'; | ||
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js'; | ||
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js'; | ||
import { ComboBoxItemMixin } from './vaadin-combo-box-item-mixin.js'; | ||
|
||
/** | ||
* LitElement based version of `<vaadin-combo-box-item>` web component. | ||
* | ||
* ## Disclaimer | ||
* | ||
* This component is an experiment not intended for publishing to npm. | ||
* There is no ETA regarding specific Vaadin version where it'll land. | ||
* Feel free to try this code in your apps as per Apache 2.0 license. | ||
*/ | ||
export class ComboBoxItem extends ComboBoxItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) { | ||
static get is() { | ||
return 'vaadin-combo-box-item'; | ||
} | ||
|
||
static get styles() { | ||
return css` | ||
:host { | ||
display: block; | ||
} | ||
:host([hidden]) { | ||
display: none; | ||
} | ||
`; | ||
} | ||
|
||
/** @protected */ | ||
render() { | ||
return html` | ||
<span part="checkmark" aria-hidden="true"></span> | ||
<div part="content"> | ||
<slot></slot> | ||
</div> | ||
`; | ||
} | ||
} | ||
|
||
defineCustomElement(ComboBoxItem); |
Oops, something went wrong.