-
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 checkbox-group
- Loading branch information
1 parent
f38b8b3
commit e5d1e9a
Showing
10 changed files
with
114 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2017 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/ | ||
export * from './vaadin-checkbox-group.js'; |
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,62 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2018 - 2024 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/ | ||
import '@vaadin/checkbox/src/vaadin-lit-checkbox.js'; | ||
import { html, LitElement } from 'lit'; | ||
import { defineCustomElement } from '@vaadin/component-base/src/define.js'; | ||
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js'; | ||
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js'; | ||
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js'; | ||
import { CheckboxGroupMixin } from './vaadin-checkbox-group-mixin.js'; | ||
import { checkboxGroupStyles } from './vaadin-checkbox-group-styles.js'; | ||
|
||
/** | ||
* LitElement based version of `<vaadin-checkbox-group>` web component. | ||
* | ||
* ## Disclaimer | ||
* | ||
* This component is an experiment and not yet a part of Vaadin platform. | ||
* 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. | ||
*/ | ||
class CheckboxGroup extends CheckboxGroupMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) { | ||
static get is() { | ||
return 'vaadin-checkbox-group'; | ||
} | ||
|
||
static get styles() { | ||
return checkboxGroupStyles; | ||
} | ||
|
||
/** @protected */ | ||
render() { | ||
return html` | ||
<div class="vaadin-group-field-container"> | ||
<div part="label"> | ||
<slot name="label"></slot> | ||
<span part="required-indicator" aria-hidden="true"></span> | ||
</div> | ||
<div part="group-field"> | ||
<slot></slot> | ||
</div> | ||
<div part="helper-text"> | ||
<slot name="helper"></slot> | ||
</div> | ||
<div part="error-message"> | ||
<slot name="error-message"></slot> | ||
</div> | ||
</div> | ||
<slot name="tooltip"></slot> | ||
`; | ||
} | ||
} | ||
|
||
defineCustomElement(CheckboxGroup); | ||
|
||
export { CheckboxGroup }; |
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,2 @@ | ||
import '../src/vaadin-lit-checkbox-group.js'; | ||
import './checkbox-group.common.js'; |
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,2 @@ | ||
import '../src/vaadin-checkbox-group.js'; | ||
import './checkbox-group.common.js'; |
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,2 @@ | ||
import '../src/vaadin-lit-checkbox-group.js'; | ||
import './validation.common.js'; |
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,2 @@ | ||
import '../src/vaadin-checkbox-group.js'; | ||
import './validation.common.js'; |
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