CngxCommandPalette
cngx-command-palette
projects/ui/command-palette/palette/command-palette.component.ts
Import#
import { CngxCommandPalette } from '@cngx/ui/command-palette'
Description#
The opinionated Cmd/Ctrl+K command palette preset. Renders the panel body +
async-state shell inside a native modal <dialog cngxDialog>, so focus
trapping, trigger storage at open, and focus restore after the close
transition are handled by CngxDialog and the platform - no hand-rolled
focus machinery. The palette provides CNGX_COMMAND_PALETTE_HOST so the
panel can dismiss it when a command runs.
Type-to-filter runs over the merged command registry (injectCommands) plus
the consumer's async [results]; the palette commits no form value - it
fires command.run(), the locked demarcation from CngxCombobox. The global
Cmd/Ctrl+K open combo is wired by the keybinding factory, not here.
<cngx-command-palette #palette [results]="results()" />
<button [cngxCommandPaletteTrigger]="palette">Search commands</button>Metadata#
Providers#
CNGX_COMMAND_PALETTE_HOST- useExisting
CngxCommandPalette
Relationships
Index#
Properties
Inputs#
string | undefinedPer-instance open combo (parsed via parseKeyCombo, e.g. 'mod+shift+p').
Wins over CNGX_COMMAND_PALETTE_CONFIG.openShortcut (withPaletteShortcut),
which wins over the 'mod+k' default. Changing it live re-installs the
listener. For a full listener swap, override CNGX_PALETTE_KEYBINDING_FACTORY.
CngxAsyncState | undefined Consumer-derived async result source.