dialogs

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseCallback

type CloseCallback interface {
	Close() tea.Cmd
}

CloseCallback allows dialogs to perform cleanup when closed.

type CloseDialogMsg

type CloseDialogMsg struct{}

CloseDialogMsg is sent to close the topmost dialog.

type DialogCmp

type DialogCmp interface {
	util.Model

	Dialogs() []DialogModel
	HasDialogs() bool
	GetLayers() []*lipgloss.Layer
	ActiveModel() util.Model
	ActiveDialogID() DialogID
}

DialogCmp manages a stack of dialogs with keyboard navigation.

func NewDialogCmp

func NewDialogCmp() DialogCmp

NewDialogCmp creates a new dialog manager.

type DialogID

type DialogID string

type DialogModel

type DialogModel interface {
	util.Model
	Position() (int, int)
	ID() DialogID
}

DialogModel represents a dialog component that can be displayed.

type KeyMap

type KeyMap struct {
	Close key.Binding
}

KeyMap defines keyboard bindings for dialog management.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

FullHelp implements help.KeyMap.

func (KeyMap) KeyBindings

func (k KeyMap) KeyBindings() []key.Binding

KeyBindings implements layout.KeyMapProvider

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

ShortHelp implements help.KeyMap.

type OpenDialogMsg

type OpenDialogMsg struct {
	Model DialogModel
}

OpenDialogMsg is sent to open a new dialog with specified dimensions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL