exlab_wizard.ui.components.credential_field#

Credential field component (Frontend Spec §7.4.1).

Three resting / transient states:

  • not_setStatus: Not set with a [Set] button.

  • setStatus: Set with [Replace] and [Clear].

  • editing – inline password input with Save / Cancel.

Never displays a stored secret.

Functions

credential_field(*, label, on_save, on_clear)

Build a credential row.

credential_props(state)

Compute the visible labels / button names for a state.

Classes

CredentialState([state, pending_value])

In-memory state for a credential row.

class exlab_wizard.ui.components.credential_field.CredentialState(state='not_set', pending_value=None)[source]#

Bases: object

In-memory state for a credential row.

Parameters:
pending_value: str | None = None#
state: str = 'not_set'#
exlab_wizard.ui.components.credential_field.credential_field(*, label, on_save, on_clear, initial_state=None)[source]#

Build a credential row.

The on_save callback is invoked with the typed password when the operator clicks Save while editing; on_clear is invoked when the operator confirms the Clear action.

Parameters:
Return type:

Any

exlab_wizard.ui.components.credential_field.credential_props(state)[source]#

Compute the visible labels / button names for a state.

Returns a dict with state, label, primary_button, secondary_button (optional), and input_visible keys.

Parameters:

state (CredentialState)

Return type:

dict[str, Any]