chore(ui): clear eslint interaction accessibility bucket
Add keyboard handlers and focus support to clickable UI affordances across reader dialogs, metadata views, cards, and layout controls. Keep the existing click behavior intact while making non-button elements operable from the keyboard and clearing the remaining template interaction accessibility backlog. Validation: just ui lint
This commit is contained in:
+12
-2
@@ -33,7 +33,12 @@
|
||||
[placeholder]="t('searchPlaceholder')"
|
||||
/>
|
||||
@if (searchQuery) {
|
||||
<i class="pi pi-times clear-icon" (click)="searchQuery = ''; onSearch()"></i>
|
||||
<i
|
||||
class="pi pi-times clear-icon"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="searchQuery = ''; onSearch()"
|
||||
(keydown.enter)="searchQuery = ''; onSearch()"></i>
|
||||
}
|
||||
</p-iconfield>
|
||||
<p-button
|
||||
@@ -143,7 +148,12 @@
|
||||
(click)="$event.stopPropagation()"
|
||||
/>
|
||||
</div>
|
||||
<label [for]="'folder-' + folder" class="directory-label" (click)="onRowClick(folder)">
|
||||
<label
|
||||
[for]="'folder-' + folder"
|
||||
class="directory-label"
|
||||
tabindex="0"
|
||||
(click)="onRowClick(folder)"
|
||||
(keydown.enter)="onRowClick(folder)">
|
||||
<div class="directory-icon-wrapper">
|
||||
<i class="pi pi-folder directory-icon"></i>
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,9 @@ export type DocType = 'kobo' | 'opds' | 'metadataManager' | 'koReader' | 'email'
|
||||
[tooltipPosition]="tooltipPosition"
|
||||
[style.font-size]="size"
|
||||
(click)="openLink()"
|
||||
(keydown.enter)="openLink()"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
style="cursor: pointer;">
|
||||
</i>
|
||||
`,
|
||||
|
||||
@@ -56,7 +56,10 @@
|
||||
@for (icon of filteredIcons(); track icon) {
|
||||
<div
|
||||
class="icon-item"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="selectIcon(icon)"
|
||||
(keydown.enter)="selectIcon(icon)"
|
||||
[class.selected]="icon === selectedIcon"
|
||||
[title]="icon"
|
||||
>
|
||||
@@ -96,7 +99,10 @@
|
||||
@for (iconName of filteredSvgIcons(); track iconName) {
|
||||
<div
|
||||
class="icon-item svg-icon-item"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="selectSvgIcon(iconName)"
|
||||
(keydown.enter)="selectSvgIcon(iconName)"
|
||||
[class.selected]="iconName === selectedSvgIcon"
|
||||
[title]="iconName"
|
||||
draggable="true"
|
||||
|
||||
@@ -12,7 +12,10 @@
|
||||
}
|
||||
</ul>
|
||||
<i class="pi pi-objects-column sidebar-width-btn"
|
||||
(click)="widthPanel.toggle($event)"></i>
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(click)="widthPanel.toggle($event)"
|
||||
(keydown.enter)="widthPanel.toggle($event)"></i>
|
||||
<p-popover #widthPanel appendTo="body">
|
||||
<div class="sidebar-width-popover">
|
||||
<span class="sidebar-width-popover-label">{{ sidebarWidth }}px</span>
|
||||
@@ -80,6 +83,9 @@
|
||||
<a
|
||||
(click)="openChangelogDialog()"
|
||||
class="update-link"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
(keydown.enter)="openChangelogDialog()"
|
||||
>
|
||||
{{ t('update') }}
|
||||
</a>
|
||||
|
||||
@@ -8,17 +8,23 @@
|
||||
<i
|
||||
class="pi pi-plus plus-icon"
|
||||
(click)="openDialog(item)"
|
||||
(keydown.enter)="openDialog(item)"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
></i>
|
||||
}
|
||||
</div>
|
||||
<i
|
||||
(click)="toggleExpand(key)"
|
||||
(keydown.enter)="toggleExpand(key)"
|
||||
[ngClass]="{
|
||||
'pi': true,
|
||||
'pi-angle-up': isExpanded(key),
|
||||
'pi-angle-down': !isExpanded(key)
|
||||
}"
|
||||
class="expand-icon"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
></i>
|
||||
</div>
|
||||
} @else {
|
||||
@@ -33,6 +39,9 @@
|
||||
class="menu-item-container"
|
||||
[class.active-route-container]="isRouteActive"
|
||||
(click)="triggerLink()"
|
||||
(keydown.enter)="triggerLink()"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
@if ((item.routerLink && !item.items)) {
|
||||
<a
|
||||
@@ -78,13 +87,17 @@
|
||||
<p-button
|
||||
(click)="entitymenu.toggle($event); $event.stopPropagation()"
|
||||
(mouseover)="hovered = true"
|
||||
(focus)="hovered = true"
|
||||
(mouseleave)="hovered = false"
|
||||
(blur)="hovered = false"
|
||||
(keydown.enter)="entitymenu.toggle($event); $event.stopPropagation()"
|
||||
[text]="true"
|
||||
[outlined]="false"
|
||||
[rounded]="true"
|
||||
[label]="hovered ? '' : item.bookCount?.toString() || ''"
|
||||
[icon]="hovered ? 'pi pi-ellipsis-v' : ''"
|
||||
class="entity-menu-button"
|
||||
tabindex="0"
|
||||
></p-button>
|
||||
}
|
||||
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
|
||||
|
||||
@@ -32,21 +32,21 @@
|
||||
@if (user(); as currentUser) {
|
||||
@if (currentUser.permissions?.canAccessBookdrop || currentUser.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="navigateToBookdrop()" [pTooltip]="t('bookdrop')" tooltipPosition="bottom">
|
||||
<a class="topbar-item" role="button" tabindex="0" (click)="navigateToBookdrop()" (keydown.enter)="navigateToBookdrop()" [pTooltip]="t('bookdrop')" tooltipPosition="bottom">
|
||||
<i class="pi pi-inbox topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@if (currentUser.permissions?.canManageLibrary || currentUser.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="openLibraryCreatorDialog()" [pTooltip]="t('createNewLibrary')" tooltipPosition="bottom">
|
||||
<a class="topbar-item" role="button" tabindex="0" (click)="openLibraryCreatorDialog()" (keydown.enter)="openLibraryCreatorDialog()" [pTooltip]="t('createNewLibrary')" tooltipPosition="bottom">
|
||||
<i class="pi pi-plus-circle topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
@if (currentUser.permissions?.canUpload || currentUser.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="openFileUploadDialog()" [pTooltip]="t('uploadBook')" tooltipPosition="bottom">
|
||||
<a class="topbar-item" role="button" tabindex="0" (click)="openFileUploadDialog()" (keydown.enter)="openFileUploadDialog()" [pTooltip]="t('uploadBook')" tooltipPosition="bottom">
|
||||
<i class="pi pi-upload topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
@@ -74,14 +74,14 @@
|
||||
@if (user(); as currentUser) {
|
||||
@if (currentUser.permissions?.canManageLibrary || currentUser.permissions?.admin) {
|
||||
<li>
|
||||
<a class="topbar-item" (click)="navigateToMetadataManager()" [pTooltip]="t('metadataManager')" tooltipPosition="bottom">
|
||||
<a class="topbar-item" role="button" tabindex="0" (click)="navigateToMetadataManager()" (keydown.enter)="navigateToMetadataManager()" [pTooltip]="t('metadataManager')" tooltipPosition="bottom">
|
||||
<i class="pi pi-sparkles topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
<li>
|
||||
<a class="topbar-item" (click)="navigateToSettings()" [pTooltip]="t('settings')" tooltipPosition="bottom">
|
||||
<a class="topbar-item" role="button" tabindex="0" (click)="navigateToSettings()" (keydown.enter)="navigateToSettings()" [pTooltip]="t('settings')" tooltipPosition="bottom">
|
||||
<i class="pi pi-cog topbar-icon"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user