Confirm

Potwierdzenie w miejscu zamiast okna modalnego: tytuł, opis i błąd, najpierw Anuluj, potem Potwierdź, fokus na akcji, Escape anuluje, stan zajętości.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

Remove the lock from “Board”?

Its notes are decrypted and stay readable without Touch ID.

Import

ts
import {
  SoneConfirmActionsDirective,
  SoneConfirmComponent,
  SoneConfirmDescriptionDirective,
  SoneConfirmErrorDirective,
  SoneConfirmTitleDirective,
} from "@surface-one/angular/confirm";

Dokumentacja API

SoneConfirmActionsDirectiveDyrektywa

`[soneConfirmActions]` — extra controls at the start of the button row (a "Don't ask again" checkbox).

Selektor
[soneConfirmActions]

SoneConfirmComponentKomponent

`[soneConfirm]` — an inline confirmation: the shadcn/ui Alert Dialog anatomy (title, description, Cancel then the action) rendered in place, in a row or a list, instead of in a modal. Render it with `@if` when the user asks to delete / discard / leave; it is a `role="alertdialog"` named by its `[soneConfirmTitle]` (or your `aria-label`) and described by its `[soneConfirmDescription]` and `[soneConfirmError]`. The buttons are drawn for you, always Cancel then Confirm. Focus moves to the Confirm button when it opens, Escape cancels, and while `busy` both buttons are `aria-disabled` (focus stays put) and the action shows `busyLabel` with a spinner. Extra controls in `[soneConfirmActions]` sit at the start of the button row. Give focus back to the control that opened it on `(cancel)`.

Selektor
[soneConfirm]
Eksport jako
soneConfirm
Wejścia
NazwaTyp Domyślnie
variant

`destructive` paints the action red (delete, discard, leave).

ConfirmVariant"default"
size

`compact` uses extra-small buttons and tighter spacing — for a list row.

ConfirmSize"default"
layout

`inline`: text and buttons share one wrapping row. `card`: a bordered panel, buttons below.

ConfirmLayout"inline"
confirmLabel

The action button's label.

—$localize`Confirm`
cancelLabel

The cancel button's label.

—$localize`Cancel`
busyLabel

The action button's label while `busy`.

—$localize`Working…`
busy

The action is running: both buttons are disabled and the action shows `busyLabel`.

booleanfalse
autoFocus

Move focus to the Confirm button when the confirmation renders (default `true`).

booleantrue
Wyjścia
NazwaTyp
confirm

The user confirmed (click on the action; never while `busy`).

void
cancel

The user cancelled (the Cancel button or Escape; never while `busy`).

void

SoneConfirmDescriptionDirectiveDyrektywa

`[soneConfirmDescription]` — the consequence ("This cannot be undone.").

Selektor
[soneConfirmDescription]

SoneConfirmErrorDirectiveDyrektywa

`[soneConfirmError]` — why the last attempt failed; announced with `role="alert"`.

Selektor
[soneConfirmError]

SoneConfirmTitleDirectiveDyrektywa

`[soneConfirmTitle]` — the question; names the alertdialog.

Selektor
[soneConfirmTitle]