Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@
[(value)]="searchString" [(expanded)]="popupExpanded" (click)="popupExpanded.set(true)" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{options().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}" [cdkConnectedOverlayOpen]="true"
[cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox">
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox example-popup" focusMode="activedescendant"
<div class="example-popup">
@if (options().length === 0) {
<div class="example-no-results">No results found</div>
}
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox" focusMode="activedescendant"
[tabindex]="-1" [(value)]="selectedOption" (click)="onCommit()" (keydown.enter)="onCommit()"
[activeDescendant]="listbox.activeDescendant()">
[activeDescendant]="listbox.activeDescendant()"
[class.example-empty]="options().length === 0">
@for (option of options(); track option) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option" [label]="option">
<span>{{option}}</span>
<span aria-hidden="true" class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
}
</div>
</div>
</ng-template>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,29 @@
placeholder="Search..." [(ngModel)]="searchString" [alwaysExpanded]="true"
(keydown.escape)="onSearchEscape($event)" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{options().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template ngComboboxPopup [combobox]="innerCombobox">
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox" focusMode="activedescendant"
tabindex="-1" selectionMode="explicit" [(value)]="selectedStates" (click)="onCommit()"
(keydown.enter)="onCommit()" [activeDescendant]="listbox.activeDescendant()">
@for (option of options(); track option) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option"
[label]="option">
<span>{{option}}</span>
<span aria-hidden="true"
class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
<div class="example-popup example-popup-no-margin">
@if (options().length === 0) {
<div class="example-no-results">No results found</div>
}
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox" focusMode="activedescendant"
tabindex="-1" selectionMode="explicit" [(value)]="selectedStates" (click)="onCommit()"
(keydown.enter)="onCommit()" [activeDescendant]="listbox.activeDescendant()"
[class.example-empty]="options().length === 0">
@for (option of options(); track option) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option"
[label]="option">
<span>{{option}}</span>
<span aria-hidden="true"
class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
}
</div>
</div>
</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,20 @@ ul[role='group'] {
.example-grid-row[aria-selected='true'] .example-selected-icon {
visibility: visible;
}

.example-no-results {
padding: 1rem;
}

.example-empty {
position: absolute;
visibility: hidden;
pointer-events: none;
height: 0;
width: 0;
overflow: hidden;
}

.example-popup-no-margin {
margin-block-start: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,38 @@
[(value)]="searchString" [(expanded)]="popupExpanded" (blur)="onBlur()" (click)="popupExpanded.set(true)" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{filteredItems().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}" [cdkConnectedOverlayOpen]="true"
[cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox">
<div ngComboboxWidget ngGrid focusMode="activedescendant" [tabindex]="-1" class="example-popup"
colWrap="continuous" #grid="ngGrid" [activeDescendant]="grid.activeDescendant()">
@for (item of filteredItems(); track item.label; let i = $index) {
<div ngGridRow class="example-grid-row" [attr.aria-selected]="item === selectedItem()">
<div ngGridCell [id]="item.label + '-label'" [rowIndex]="i" [colIndex]="0"
class="example-cell-label example-cell" (activated)="selectItem(item)">
<button ngGridCellWidget class="example-label-button example-no-active-outline" (click)="selectItem(item)">
{{item.label}}
</button>
<mat-icon class="example-selected-icon">check</mat-icon>
</div>
<div ngGridCell [id]="item.label + '-delete'" [rowIndex]="i" [colIndex]="1"
class="example-cell-button example-cell " (activated)="removeItem(item)">
<button ngGridCellWidget class="example-button example-no-active-outline" (click)="removeItem(item)"
(pointerdown)="$event.preventDefault()">
<mat-icon>close</mat-icon>
</button>
<div class="example-popup">
@if (filteredItems().length === 0) {
<div class="example-no-results">No results found</div>
}
<div ngComboboxWidget ngGrid focusMode="activedescendant" [tabindex]="-1"
colWrap="continuous" #grid="ngGrid" [activeDescendant]="grid.activeDescendant()">
@for (item of filteredItems(); track item.label; let i = $index) {
<div ngGridRow class="example-grid-row" [attr.aria-selected]="item === selectedItem()">
<div ngGridCell [id]="item.label + '-label'" [rowIndex]="i" [colIndex]="0"
class="example-cell-label example-cell" (activated)="selectItem(item)">
<button ngGridCellWidget class="example-label-button example-no-active-outline" (click)="selectItem(item)">
{{item.label}}
</button>
<mat-icon class="example-selected-icon">check</mat-icon>
</div>
<div ngGridCell [id]="item.label + '-delete'" [rowIndex]="i" [colIndex]="1"
class="example-cell-button example-cell " (activated)="removeItem(item)">
<button ngGridCellWidget class="example-button example-no-active-outline" (click)="removeItem(item)"
(pointerdown)="$event.preventDefault()">
<mat-icon>close</mat-icon>
</button>
</div>
</div>
}
</div>
}
</div>
</ng-template>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,29 @@
[inlineSuggestion]="(searchString() || navigated()) ? selectedOption()[0] : undefined" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{options().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}" [cdkConnectedOverlayOpen]="true"
[cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox">
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox example-popup"
focusMode="activedescendant" [tabindex]="-1" [(value)]="selectedOption" (click)="onCommit()"
(keydown.enter)="onCommit()" [activeDescendant]="listbox.activeDescendant()">
@for (option of options(); track option.name) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option.name"
[label]="option.name" [disabled]="option.disabled">
<span>{{option.name}}</span>
<span aria-hidden="true" class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
<div class="example-popup">
@if (options().length === 0) {
<div class="example-no-results">No results found</div>
}
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox"
focusMode="activedescendant" [tabindex]="-1" [(value)]="selectedOption" (click)="onCommit()"
(keydown.enter)="onCommit()" [activeDescendant]="listbox.activeDescendant()"
[class.example-empty]="options().length === 0">
@for (option of options(); track option.name) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option.name"
[label]="option.name" [disabled]="option.disabled">
<span>{{option.name}}</span>
<span aria-hidden="true" class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
}
</div>
</div>
</ng-template>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@
[(value)]="searchString" [(expanded)]="popupExpanded" (click)="popupExpanded.set(true)" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{options().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}" [cdkConnectedOverlayOpen]="true"
[cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox">
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox example-popup" focusMode="activedescendant"
[tabindex]="-1" selectionMode="explicit" [(value)]="selectedOption" (click)="onCommit()"
(keydown.enter)="onCommit()" [activeDescendant]="listbox.activeDescendant()">
@for (option of options(); track option) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option" [label]="option">
<span>{{option}}</span>
<span aria-hidden="true" class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
<div class="example-popup">
@if (options().length === 0) {
<div class="example-no-results">No results found</div>
}
<div #listbox="ngListbox" ngListbox ngComboboxWidget class="example-listbox" focusMode="activedescendant"
[tabindex]="-1" selectionMode="explicit" [(value)]="selectedOption" (click)="onCommit()"
(keydown.enter)="onCommit()" [activeDescendant]="listbox.activeDescendant()"
[class.example-empty]="options().length === 0">
@for (option of options(); track option) {
<div class="example-option example-selectable example-stateful" ngOption [value]="option" [label]="option">
<span>{{option}}</span>
<span aria-hidden="true" class="material-symbols-outlined example-icon example-selected-icon">check</span>
</div>
}
</div>
</div>
</ng-template>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@
[(value)]="searchString" [(expanded)]="popupExpanded" (click)="popupExpanded.set(true)" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{filteredGroups().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}"
[cdkConnectedOverlayOpen]="popupExpanded()" [cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox" popupType="tree">
<ul ngTree ngComboboxWidget class="example-tree example-popup" focusMode="activedescendant" [tabindex]="-1"
selectionMode="follow" [(value)]="selectedValues" (click)="onCommit()" (keydown.enter)="onCommit()"
#tree="ngTree" [activeDescendant]="tree.activeDescendant()">
<ng-template [ngTemplateOutlet]="treeNodes"
[ngTemplateOutletContext]="{nodes: filteredGroups(), parent: tree}" />
</ul>
<div class="example-popup">
@if (filteredGroups().length === 0) {
<div class="example-no-results">No results found</div>
}
<ul ngTree ngComboboxWidget class="example-tree" focusMode="activedescendant" [tabindex="-1"
selectionMode="follow" [(value)]="selectedValues" (click)="onCommit()" (keydown.enter)="onCommit()"
#tree="ngTree" [activeDescendant]="tree.activeDescendant()"
[class.example-empty]="filteredGroups().length === 0">
<ng-template [ngTemplateOutlet]="treeNodes"
[ngTemplateOutletContext]="{nodes: filteredGroups(), parent: tree}" />
</ul>
</div>
</ng-template>
</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@
[inlineSuggestion]="(searchString() || navigated()) ? selectedValues()[0] : undefined" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{filteredGroups().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}" [cdkConnectedOverlayOpen]="true"
[cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox" popupType="tree">
<ul ngTree ngComboboxWidget class="example-tree example-popup" focusMode="activedescendant" [tabindex]="-1"
selectionMode="follow" [(value)]="selectedValues" (click)="onCommit()" (keydown.enter)="onCommit()"
#tree="ngTree" [activeDescendant]="tree.activeDescendant()">
<ng-template [ngTemplateOutlet]="treeNodes"
[ngTemplateOutletContext]="{nodes: filteredGroups(), parent: tree}" />
</ul>
<div class="example-popup">
@if (filteredGroups().length === 0) {
<div class="example-no-results">No results found</div>
}
<ul ngTree ngComboboxWidget class="example-tree" focusMode="activedescendant" [tabindex]="-1"
selectionMode="follow" [(value)]="selectedValues" (click)="onCommit()" (keydown.enter)="onCommit()"
#tree="ngTree" [activeDescendant]="tree.activeDescendant()"
[class.example-empty]="filteredGroups().length === 0">
<ng-template [ngTemplateOutlet]="treeNodes"
[ngTemplateOutletContext]="{nodes: filteredGroups(), parent: tree}" />
</ul>
</div>
</ng-template>
</ng-template>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@
[(expanded)]="popupExpanded" (click)="popupExpanded.set(true)" />
</div>

<div aria-live="polite" class="cdk-visually-hidden">
{{filteredGroups().length === 0 ? 'No results found for ' + searchString() : ''}}
</div>

<ng-template [cdkConnectedOverlay]="{origin, usePopover: 'inline', matchWidth: true}"
[cdkConnectedOverlayOpen]="popupExpanded()" [cdkConnectedOverlayDisableClose]="true">
<ng-template ngComboboxPopup [combobox]="combobox" popupType="tree">
<ul ngTree ngComboboxWidget class="example-tree example-popup" focusMode="activedescendant" [tabindex]="-1"
selectionMode="explicit" [(value)]="selectedValues" (click)="onCommit()" (keydown.enter)="onCommit()" #tree="ngTree"
[activeDescendant]="tree.activeDescendant()">
<ng-template [ngTemplateOutlet]="treeNodes" [ngTemplateOutletContext]="{nodes: filteredGroups(), parent: tree}" />
</ul>
<div class="example-popup">
@if (filteredGroups().length === 0) {
<div class="example-no-results">No results found</div>
}
<ul ngTree ngComboboxWidget class="example-tree" focusMode="activedescendant" [tabindex]="-1"
selectionMode="explicit" [(value)]="selectedValues" (click)="onCommit()" (keydown.enter)="onCommit()" #tree="ngTree"
[activeDescendant]="tree.activeDescendant()"
[class.example-empty]="filteredGroups().length === 0">
<ng-template [ngTemplateOutlet]="treeNodes" [ngTemplateOutletContext]="{nodes: filteredGroups(), parent: tree}" />
</ul>
</div>
</ng-template>
</ng-template>
</div>
Expand Down
Loading