-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from IgniteUI/simeonoff/combo
Feat: Combo Component
- Loading branch information
Showing
47 changed files
with
2,924 additions
and
98 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,20 @@ | ||
import { html, LitElement } from 'lit'; | ||
import { themes } from '../../theming/theming-decorator.js'; | ||
import { styles } from './themes/light/header/combo-header.base.css.js'; | ||
import { styles as bootstrap } from '../dropdown/themes/light/dropdown-header.bootstrap.css.js'; | ||
import { styles as fluent } from '../dropdown/themes/light/dropdown-header.fluent.css.js'; | ||
|
||
@themes({ bootstrap, fluent }) | ||
export default class IgcComboHeaderComponent extends LitElement { | ||
public static readonly tagName: string = 'igc-combo-header'; | ||
public static override styles = styles; | ||
|
||
protected override render() { | ||
return html`<slot></slot>`; | ||
} | ||
} | ||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'igc-combo-header': IgcComboHeaderComponent; | ||
} | ||
} |
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,67 @@ | ||
import { html, LitElement } from 'lit'; | ||
import { themes } from '../../theming/theming-decorator.js'; | ||
import { styles } from './themes/light/item/combo-item.base.css.js'; | ||
import { styles as bootstrap } from '../dropdown/themes/light/dropdown-item.bootstrap.css.js'; | ||
import { styles as fluent } from '../dropdown/themes/light/dropdown-item.fluent.css.js'; | ||
import { styles as indigo } from '../dropdown/themes/light/dropdown-item.indigo.css.js'; | ||
import { property } from 'lit/decorators.js'; | ||
import { watch } from '../common/decorators/watch.js'; | ||
import IgcCheckboxComopnent from '../checkbox/checkbox.js'; | ||
import { defineComponents } from '../common/definitions/defineComponents.js'; | ||
|
||
defineComponents(IgcCheckboxComopnent); | ||
|
||
@themes({ bootstrap, fluent, indigo }) | ||
export default class IgcComboItemComponent extends LitElement { | ||
public static readonly tagName: string = 'igc-combo-item'; | ||
public static override styles = styles; | ||
|
||
@property({ attribute: false }) | ||
public index!: number; | ||
|
||
/** | ||
* Determines whether the item is selected. | ||
*/ | ||
@property({ type: Boolean, reflect: true }) | ||
public selected = false; | ||
|
||
/** | ||
* Determines whether the item is active. | ||
*/ | ||
@property({ type: Boolean, reflect: true }) | ||
public active = false; | ||
|
||
@watch('selected') | ||
protected selectedChange() { | ||
this.selected | ||
? this.setAttribute('aria-selected', 'true') | ||
: this.removeAttribute('aria-selected'); | ||
} | ||
|
||
public override connectedCallback() { | ||
super.connectedCallback(); | ||
this.setAttribute('role', 'option'); | ||
} | ||
|
||
protected override render() { | ||
return html` | ||
<section part="prefix"> | ||
<igc-checkbox | ||
aria-hidden="true" | ||
?checked=${this.selected} | ||
tabindex="-1" | ||
exportparts="control: checkbox, indicator: checkbox-indicator, checked" | ||
></igc-checkbox> | ||
</section> | ||
<section id="content" part="content"> | ||
<slot></slot> | ||
</section> | ||
`; | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'igc-combo-item': IgcComboItemComponent; | ||
} | ||
} |
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,18 @@ | ||
import { LitVirtualizer } from '@lit-labs/virtualizer'; | ||
|
||
export default class IgcComboListComponent extends LitVirtualizer { | ||
public static readonly tagName = 'igc-combo-list'; | ||
public override scroller = true; | ||
|
||
public override connectedCallback() { | ||
super.connectedCallback(); | ||
this.setAttribute('tabindex', '0'); | ||
this.setAttribute('role', 'listbox'); | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'igc-combo-list': IgcComboListComponent; | ||
} | ||
} |
Oops, something went wrong.