mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-02 18:17:46 +01:00
Fix broken Storybook: Change ng-template to ng-container for ngIf and rename icon directive (#4816)
* remove added template for ngIf and rename icon directive * fix regression in product switcher * fix text color of bulk delete in org vault * use ng-container for *ngIf
This commit is contained in:
parent
7317661457
commit
84d211fb56
@ -62,11 +62,13 @@
|
|||||||
<i class="bwi bwi-fw bwi-undo" aria-hidden="true"></i>
|
<i class="bwi bwi-fw bwi-undo" aria-hidden="true"></i>
|
||||||
{{ "restoreSelected" | i18n }}
|
{{ "restoreSelected" | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<button bitMenuItem class="tw-text-danger" (click)="bulkDelete()">
|
<button bitMenuItem (click)="bulkDelete()">
|
||||||
<i class="bwi bwi-fw bwi-trash" aria-hidden="true"></i>
|
<span class="tw-text-danger">
|
||||||
{{
|
<i class="bwi bwi-fw bwi-trash" aria-hidden="true"></i>
|
||||||
(activeFilter.isDeleted ? "permanentlyDeleteSelected" : "deleteSelected") | i18n
|
{{
|
||||||
}}
|
(activeFilter.isDeleted ? "permanentlyDeleteSelected" : "deleteSelected") | i18n
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</bit-menu>
|
</bit-menu>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<bit-simple-dialog>
|
<bit-simple-dialog>
|
||||||
<i bit-dialog-icon class="bwi tw-text-3xl" [class]="iconClasses" aria-hidden="true"></i>
|
<i bitDialogIcon class="bwi tw-text-3xl" [class]="iconClasses" aria-hidden="true"></i>
|
||||||
|
|
||||||
<span bitDialogTitle>{{ title }}</span>
|
<span bitDialogTitle>{{ title }}</span>
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
@fadeIn
|
@fadeIn
|
||||||
>
|
>
|
||||||
<div class="tw-flex tw-flex-col tw-items-center tw-gap-2 tw-px-4 tw-pt-4 tw-text-center">
|
<div class="tw-flex tw-flex-col tw-items-center tw-gap-2 tw-px-4 tw-pt-4 tw-text-center">
|
||||||
<ng-template *ngIf="hasIcon; else elseBlock">
|
<ng-container *ngIf="hasIcon; else elseBlock">
|
||||||
<ng-content select="[bit-dialog-icon]"></ng-content>
|
<ng-content select="[bitDialogIcon]"></ng-content>
|
||||||
</ng-template>
|
</ng-container>
|
||||||
<ng-template #elseBlock>
|
<ng-template #elseBlock>
|
||||||
<i class="bwi bwi-exclamation-triangle tw-text-3xl tw-text-warning" aria-hidden="true"></i>
|
<i class="bwi bwi-exclamation-triangle tw-text-3xl tw-text-warning" aria-hidden="true"></i>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@ -2,7 +2,7 @@ import { Component, ContentChild, Directive } from "@angular/core";
|
|||||||
|
|
||||||
import { fadeIn } from "../animations";
|
import { fadeIn } from "../animations";
|
||||||
|
|
||||||
@Directive({ selector: "[bit-dialog-icon]" })
|
@Directive({ selector: "[bitDialogIcon]" })
|
||||||
export class IconDirective {}
|
export class IconDirective {}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -42,7 +42,7 @@ const TemplateWithIcon: Story<SimpleDialogComponent> = (args: SimpleDialogCompon
|
|||||||
props: args,
|
props: args,
|
||||||
template: `
|
template: `
|
||||||
<bit-simple-dialog>
|
<bit-simple-dialog>
|
||||||
<i bit-dialog-icon class="bwi bwi-star tw-text-3xl tw-text-success" aria-hidden="true"></i>
|
<i bitDialogIcon class="bwi bwi-star tw-text-3xl tw-text-success" aria-hidden="true"></i>
|
||||||
<span bitDialogTitle>Premium Subscription Available</span>
|
<span bitDialogTitle>Premium Subscription Available</span>
|
||||||
<span bitDialogContent> Message Content</span>
|
<span bitDialogContent> Message Content</span>
|
||||||
<div bitDialogFooter class="tw-flex tw-flex-row tw-gap-2">
|
<div bitDialogFooter class="tw-flex tw-flex-row tw-gap-2">
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
[attr.role]="ariaRole"
|
[attr.role]="ariaRole"
|
||||||
[attr.aria-label]="ariaLabel"
|
[attr.aria-label]="ariaLabel"
|
||||||
cdkTrapFocus
|
cdkTrapFocus
|
||||||
|
[cdkTrapFocusAutoCapture]="ariaRole === 'dialog'"
|
||||||
>
|
>
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user