bitwarden-desktop/src/app/vault/add-edit-custom-fields.comp...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

119 lines
4.1 KiB
HTML
Raw Normal View History

<div class="box">
<div class="box-header">
{{ "customFields" | i18n }}
</div>
<div class="box-content">
<div cdkDropList (cdkDropListDropped)="drop($event)" *ngIf="cipher.hasFields">
<div
class="box-content-row box-content-row-multi box-draggable-row"
cdkDrag
*ngFor="let f of cipher.fields; let i = index; trackBy: trackByFunction"
[ngClass]="{ 'box-content-row-checkbox': f.type === fieldType.Boolean }"
>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
<button
type="button"
appStopClick
(click)="removeField(f)"
appA11yTitle="{{ 'remove' | i18n }}"
>
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
</button>
<label for="fieldName{{ i }}" class="sr-only">{{ "name" | i18n }}</label>
<label for="fieldValue{{ i }}" class="sr-only">{{ "value" | i18n }}</label>
<div class="row-main">
<input
id="fieldName{{ i }}"
type="text"
name="Field.Name{{ i }}"
[(ngModel)]="f.name"
class="row-label"
placeholder="{{ 'name' | i18n }}"
appInputVerbatim
/>
<!-- Text -->
<input
id="fieldValue{{ i }}"
type="text"
name="Field.Value{{ i }}"
[(ngModel)]="f.value"
*ngIf="f.type === fieldType.Text"
placeholder="{{ 'value' | i18n }}"
appInputVerbatim
/>
<!-- Password -->
<input
id="fieldValue{{ i }}"
type="{{ f.showValue ? 'text' : 'password' }}"
name="Field.Value{{ i }}"
[(ngModel)]="f.value"
class="monospaced"
*ngIf="f.type === fieldType.Hidden"
placeholder="{{ 'value' | i18n }}"
[disabled]="!cipher.viewPassword && !f.newField"
appInputVerbatim
/>
<!-- Linked -->
<select
id="fieldValue{{ i }}"
name="Field.Value{{ i }}"
[(ngModel)]="f.linkedId"
*ngIf="f.type === fieldType.Linked && cipher.linkedFieldOptions != null"
>
<option *ngFor="let o of linkedFieldOptions" [ngValue]="o.value">{{ o.name }}</option>
</select>
</div>
<!-- Boolean -->
<input
id="fieldValue{{ i }}"
name="Field.Value{{ i }}"
type="checkbox"
[(ngModel)]="f.value"
*ngIf="f.type === fieldType.Boolean"
appTrueFalseValue
trueValue="true"
falseValue="false"
/>
<div
class="action-buttons"
*ngIf="f.type === fieldType.Hidden && (cipher.viewPassword || f.newField)"
>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
<button
type="button"
class="row-btn"
appStopClick
appA11yTitle="{{ 'toggleVisibility' | i18n }}"
[attr.aria-pressed]="f.showValue"
(click)="toggleFieldValue(f)"
>
<i
class="bwi bwi-lg"
aria-hidden="true"
[ngClass]="{ 'bwi-eye': !f.showValue, 'bwi-eye-slash': f.showValue }"
></i>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
</button>
</div>
<div class="drag-handle" appA11yTitle="{{ 'dragToSort' | i18n }}" cdkDragHandle>
<i class="bwi bwi-hamburger" aria-hidden="true"></i>
</div>
2021-12-20 15:47:17 +01:00
</div>
</div>
<!-- Add new custom field -->
<div class="box-content-row" appBoxRow>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
<button type="button" appStopClick (click)="addField()">
<i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i>
{{ "newCustomField" | i18n }}
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
</button>
<label for="addFieldType" class="sr-only">{{ "type" | i18n }}</label>
<select id="addFieldType" name="AddFieldType" [(ngModel)]="addFieldType" class="field-type">
<option *ngFor="let o of addFieldTypeOptions" [ngValue]="o.value">{{ o.name }}</option>
2021-12-20 15:47:17 +01:00
<option
*ngIf="cipher.linkedFieldOptions != null"
[ngValue]="addFieldLinkedTypeOption.value"
2021-12-20 15:47:17 +01:00
>
{{ addFieldLinkedTypeOption.name }}
</option>
</select>
</div>
2021-12-20 15:47:17 +01:00
</div>
</div>