Secret Field
Ein Geheimnis wie einen API-Schlüssel eingeben, speichern und löschen, mit Status gesetzt / nicht gesetzt.
Verfügbar für
Angular: verfügbar Vue: verfügbar React: verfügbar React Native: noch nicht verfügbar
Verwendung
API key Not set
Stored in the system keychain and never logged.
Workspace token Not set
The keychain refused the write. Try again.
<div class="demo-stack" style="max-width: 28rem">
<sone-secret-field
label="API key"
placeholder="Paste your API key"
help="Stored in the system keychain and never logged."
clearable
[hasKey]="hasKey()"
[busy]="busy()"
(save)="save($event)"
(clear)="hasKey.set(false)"
/>
<sone-secret-field
label="Workspace token"
placeholder="tok_…"
setLabel="Token set ✓"
saveLabel="Save"
[hasKey]="false"
error="The keychain refused the write. Try again."
/>
</div>Import
import {
SoneSecretFieldComponent,
} from "@surface-one/angular/secret-field";API-Referenz
SoneSecretFieldComponentKomponente
| Name | Typ | Standard |
|---|---|---|
hasKey | boolean | null | null |
busy | boolean | false |
error | string | null | null |
label | — | $localize`Status` |
placeholder | string | "" |
ariaLabel | string | null | null |
help | string | null | null |
setLabel | — | $localize`Key set ✓` |
unsetLabel | — | $localize`Not set` |
saveLabel | — | $localize`Save key` |
autocomplete | string | "off" |
clearable | boolean | false |
| Name | Typ |
|---|---|
saveThe parent must not log or store this outside the Keychain. | string |
clear | void |