@cngx/ui 0.1.0-rc.6 → 0.1.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +112 -1
  2. package/a11y/README.md +87 -0
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +224 -0
  7. package/context-menu/README.md +98 -0
  8. package/data-grid-accordion/README.md +103 -2
  9. package/feedback/README.md +42 -0
  10. package/fesm2022/cngx-ui-a11y.mjs +452 -0
  11. package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-accordion.mjs +116 -38
  13. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  14. package/fesm2022/cngx-ui-action-button.mjs +115 -50
  15. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  16. package/fesm2022/cngx-ui-breadcrumb.mjs +181 -96
  17. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-chart-panel.mjs +586 -0
  19. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-collection.mjs +207 -66
  21. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  22. package/fesm2022/cngx-ui-command-palette.mjs +1281 -0
  23. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
  24. package/fesm2022/cngx-ui-context-menu.mjs +857 -0
  25. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -111
  27. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  28. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  29. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  30. package/fesm2022/cngx-ui-feedback.mjs +1095 -521
  31. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  32. package/fesm2022/cngx-ui-layout.mjs +18 -9
  33. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  34. package/fesm2022/cngx-ui-mat-accordion.mjs +84 -16
  35. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  36. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  37. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  38. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  39. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  40. package/fesm2022/cngx-ui-mat-tabs.mjs +370 -203
  41. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  42. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  43. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  44. package/fesm2022/cngx-ui-paginator.mjs +501 -182
  45. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  46. package/fesm2022/cngx-ui-sidenav.mjs +327 -106
  47. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  48. package/fesm2022/cngx-ui-skeleton.mjs +22 -21
  49. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  50. package/fesm2022/cngx-ui-speak.mjs +107 -8
  51. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  52. package/fesm2022/cngx-ui-stat-card.mjs +718 -0
  53. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
  54. package/fesm2022/cngx-ui-stepper.mjs +217 -76
  55. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  56. package/fesm2022/cngx-ui-tabs.mjs +40 -19
  57. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  58. package/fesm2022/cngx-ui-timeline.mjs +548 -0
  59. package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
  60. package/fesm2022/cngx-ui-toc.mjs +748 -0
  61. package/fesm2022/cngx-ui-toc.mjs.map +1 -0
  62. package/fesm2022/cngx-ui.mjs +16 -21
  63. package/fesm2022/cngx-ui.mjs.map +1 -1
  64. package/mat-accordion/README.md +1 -1
  65. package/mat-paginator/README.md +9 -2
  66. package/mat-tabs/styles/mat-tabs.css +29 -27
  67. package/overlay/README.md +9 -4
  68. package/package.json +32 -1
  69. package/paginator/README.md +8 -4
  70. package/sidenav/README.md +33 -11
  71. package/skeleton/README.md +2 -0
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +15 -3
  74. package/timeline/README.md +350 -0
  75. package/toc/README.md +186 -0
  76. package/types/cngx-ui-a11y.d.ts +394 -0
  77. package/types/cngx-ui-accordion.d.ts +100 -30
  78. package/types/cngx-ui-action-button.d.ts +47 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +159 -58
  80. package/types/cngx-ui-chart-panel.d.ts +382 -0
  81. package/types/cngx-ui-collection.d.ts +159 -58
  82. package/types/cngx-ui-command-palette.d.ts +565 -0
  83. package/types/cngx-ui-context-menu.d.ts +559 -0
  84. package/types/cngx-ui-data-grid-accordion.d.ts +344 -51
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +664 -73
  87. package/types/cngx-ui-layout.d.ts +8 -3
  88. package/types/cngx-ui-mat-accordion.d.ts +32 -4
  89. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  90. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  91. package/types/cngx-ui-mat-tabs.d.ts +218 -23
  92. package/types/cngx-ui-overlay.d.ts +56 -10
  93. package/types/cngx-ui-paginator.d.ts +416 -132
  94. package/types/cngx-ui-sidenav.d.ts +248 -74
  95. package/types/cngx-ui-skeleton.d.ts +18 -7
  96. package/types/cngx-ui-speak.d.ts +118 -5
  97. package/types/cngx-ui-stat-card.d.ts +411 -0
  98. package/types/cngx-ui-stepper.d.ts +81 -29
  99. package/types/cngx-ui-tabs.d.ts +22 -6
  100. package/types/cngx-ui-timeline.d.ts +495 -0
  101. package/types/cngx-ui-toc.d.ts +581 -0
  102. package/types/cngx-ui.d.ts +8 -5
@@ -0,0 +1,1281 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, inject, makeEnvironmentProviders, SkipSelf, Optional, isSignal, computed, input, model, DestroyRef, viewChild, signal, untracked, afterNextRender, effect, ViewEncapsulation, ChangeDetectionStrategy, Component, output, TemplateRef, Directive, contentChild } from '@angular/core';
4
+ import { CngxDialog } from '@cngx/common/dialog';
5
+ import { coerceSignal, nextUid, matchesKeyCombo, parseKeyCombo } from '@cngx/core/utils';
6
+ import { recordEqual } from '@cngx/utils';
7
+ import { formatMessage, createLanguageSection, createSectionBundle } from '@cngx/core/i18n';
8
+ import { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
9
+ import { injectCommands, CNGX_COMMAND_MATCH_FACTORY } from '@cngx/common/command';
10
+ import { CngxListbox, CngxSearch, CngxOption } from '@cngx/common/interactive';
11
+ import { CngxHighlight } from '@cngx/common/layout';
12
+ import { resolveAsyncView } from '@cngx/common/data';
13
+
14
+ /**
15
+ * The English command-palette section: the single source of the palette's
16
+ * English copy. The `CNGX_COMMAND_PALETTE_CONFIG` copy keys default to it.
17
+ *
18
+ * @category ui/command-palette/i18n
19
+ * @since 0.1.0
20
+ * @relatedTo CNGX_COMMAND_PALETTE_CONFIG
21
+ */
22
+ const CNGX_COMMAND_PALETTE_LANGUAGE_EN = {
23
+ searchPlaceholder: 'Type a command or search…',
24
+ listboxLabel: 'Commands',
25
+ emptyLabel: 'No matching commands',
26
+ loadingLabel: 'Loading commands…',
27
+ errorLabel: 'Could not load commands',
28
+ retryLabel: 'Retry',
29
+ paletteLabel: 'Command palette',
30
+ resultCount: { one: '{count} result', other: '{count} results' },
31
+ navigateKeys: '↑ ↓',
32
+ navigateKeysSpoken: 'Up and Down arrows',
33
+ navigateLabel: 'Navigate',
34
+ runKeys: 'Enter',
35
+ runLabel: 'Run',
36
+ closeKeys: 'Esc',
37
+ closeLabel: 'Close',
38
+ legendEntry: '{keys} {label}',
39
+ };
40
+
41
+ /** @internal Turns a command-palette section into the config copy for a locale. Pure. */
42
+ function commandPaletteCopyFrom(section, locale) {
43
+ return {
44
+ searchPlaceholder: section.searchPlaceholder,
45
+ listboxLabel: section.listboxLabel,
46
+ emptyLabel: section.emptyLabel,
47
+ loadingLabel: section.loadingLabel,
48
+ errorLabel: section.errorLabel,
49
+ retryLabel: section.retryLabel,
50
+ paletteLabel: section.paletteLabel,
51
+ resultCount: (count) => formatMessage(section.resultCount, { count }, locale),
52
+ footerLegend: [
53
+ {
54
+ keys: section.navigateKeys,
55
+ spokenKeys: section.navigateKeysSpoken,
56
+ label: section.navigateLabel,
57
+ },
58
+ { keys: section.runKeys, label: section.runLabel },
59
+ { keys: section.closeKeys, label: section.closeLabel },
60
+ ],
61
+ legendEntry: (keys, label) => formatMessage(section.legendEntry, { keys, label }, locale),
62
+ };
63
+ }
64
+ /** @internal The command-palette section of the active pack over the English section. */
65
+ const injectCommandPaletteLanguage = createLanguageSection('commandPalette', CNGX_COMMAND_PALETTE_LANGUAGE_EN);
66
+ /** @internal Builds and reads the section copy, formatted for the reading locale. */
67
+ const commandPaletteBundle = createSectionBundle({
68
+ section: injectCommandPaletteLanguage,
69
+ toBundle: commandPaletteCopyFrom,
70
+ });
71
+ /**
72
+ * @internal The command-palette copy of the active pack, formatted for the app
73
+ * locale. Private: consumers override copy through the config features.
74
+ */
75
+ const COMMAND_PALETTE_SECTION_COPY = new InjectionToken('CngxCommandPaletteSectionCopy', { providedIn: 'root', factory: () => commandPaletteBundle.build() });
76
+ /**
77
+ * @internal The command-palette copy at the reading site: the active pack's
78
+ * section formatted for the locale of the injector that reads it. Injection
79
+ * context required.
80
+ */
81
+ function injectCommandPaletteSiteCopy() {
82
+ return commandPaletteBundle.resolve(inject(COMMAND_PALETTE_SECTION_COPY));
83
+ }
84
+
85
+ /** @internal */
86
+ const CNGX_COMMAND_PALETTE_DEFAULTS = {
87
+ openShortcut: 'mod+k',
88
+ };
89
+
90
+ /**
91
+ * Library-default palette configuration. Carries no copy: the copy defaults
92
+ * are the `commandPalette` section of the language pack.
93
+ *
94
+ * @category ui/command-palette
95
+ * @since 0.1.0
96
+ */
97
+ const DEFAULT_COMMAND_PALETTE_CONFIG = {
98
+ openShortcut: CNGX_COMMAND_PALETTE_DEFAULTS.openShortcut,
99
+ };
100
+ /**
101
+ * DI token carrying the resolved {@link CngxCommandPaletteConfig}. Defaults to
102
+ * {@link DEFAULT_COMMAND_PALETTE_CONFIG} at root; override app-wide via
103
+ * {@link provideCommandPaletteConfig} or per-scope via
104
+ * {@link provideCommandPaletteConfigAt}.
105
+ *
106
+ * @category ui/command-palette
107
+ * @since 0.1.0
108
+ */
109
+ const CNGX_COMMAND_PALETTE_CONFIG = new InjectionToken('CngxCommandPaletteConfig', { providedIn: 'root', factory: () => DEFAULT_COMMAND_PALETTE_CONFIG });
110
+ /** @internal */
111
+ function applyFeatures(base, features) {
112
+ return features.reduce((config, feature) => feature(config), base);
113
+ }
114
+ /**
115
+ * Provide a palette configuration at app root.
116
+ *
117
+ * ```ts
118
+ * provideCommandPaletteConfig(
119
+ * withCommandPaletteLabels({ emptyLabel: 'Keine Treffer.' }),
120
+ * withKeyboardLegend([{ keys: 'enter', label: 'Ausführen' }]),
121
+ * )
122
+ * ```
123
+ *
124
+ * @category ui/command-palette
125
+ * @since 0.1.0
126
+ */
127
+ function provideCommandPaletteConfig(...features) {
128
+ return makeEnvironmentProviders([
129
+ {
130
+ provide: CNGX_COMMAND_PALETTE_CONFIG,
131
+ useFactory: () => applyFeatures(DEFAULT_COMMAND_PALETTE_CONFIG, features),
132
+ },
133
+ ]);
134
+ }
135
+ /**
136
+ * Component-scoped palette configuration override. Features merge on top of the
137
+ * enclosing scope (root or a parent `viewProviders`).
138
+ *
139
+ * @category ui/command-palette
140
+ * @since 0.1.0
141
+ */
142
+ function provideCommandPaletteConfigAt(...features) {
143
+ return [
144
+ {
145
+ provide: CNGX_COMMAND_PALETTE_CONFIG,
146
+ useFactory: (parent) => applyFeatures(parent ?? DEFAULT_COMMAND_PALETTE_CONFIG, features),
147
+ deps: [[new SkipSelf(), new Optional(), CNGX_COMMAND_PALETTE_CONFIG]],
148
+ },
149
+ ];
150
+ }
151
+ /**
152
+ * Resolves the {@link CngxCommandPaletteConfig} from the current injection
153
+ * scope. Must run in an injection context.
154
+ *
155
+ * @category ui/command-palette
156
+ * @since 0.1.0
157
+ */
158
+ function injectCommandPaletteConfig() {
159
+ return inject(CNGX_COMMAND_PALETTE_CONFIG);
160
+ }
161
+ const valueOf = (source) => (isSignal(source) ? source() : source);
162
+ const RESOLVED_COPY = new WeakMap();
163
+ /**
164
+ * @internal - one Signal of the config's copy keys, each unwrapped, over the
165
+ * `commandPalette` section of the active pack at the reading site's locale, so
166
+ * a language switch reaches every reader. A key the config leaves unset reads
167
+ * the section. Memoized per site copy and config object: every palette part
168
+ * under one injector reads the same `computed()`. Injection context required;
169
+ * read the result inside a `computed()`, a template or a handler.
170
+ */
171
+ function resolveCommandPaletteCopy(config) {
172
+ const site = injectCommandPaletteSiteCopy();
173
+ let byConfig = RESOLVED_COPY.get(site);
174
+ if (!byConfig) {
175
+ byConfig = new WeakMap();
176
+ RESOLVED_COPY.set(site, byConfig);
177
+ }
178
+ const cached = byConfig.get(config);
179
+ if (cached) {
180
+ return cached;
181
+ }
182
+ const copy = computed(() => {
183
+ const defaults = site();
184
+ return {
185
+ ...config,
186
+ searchPlaceholder: valueOf(config.searchPlaceholder) ?? defaults.searchPlaceholder,
187
+ listboxLabel: valueOf(config.listboxLabel) ?? defaults.listboxLabel,
188
+ emptyLabel: valueOf(config.emptyLabel) ?? defaults.emptyLabel,
189
+ loadingLabel: valueOf(config.loadingLabel) ?? defaults.loadingLabel,
190
+ errorLabel: valueOf(config.errorLabel) ?? defaults.errorLabel,
191
+ retryLabel: valueOf(config.retryLabel) ?? defaults.retryLabel,
192
+ paletteLabel: valueOf(config.paletteLabel) ?? defaults.paletteLabel,
193
+ resultCount: valueOf(config.resultCount) ?? defaults.resultCount,
194
+ footerLegend: valueOf(config.footerLegend) ?? defaults.footerLegend,
195
+ legendEntry: defaults.legendEntry,
196
+ };
197
+ }, { ...(ngDevMode ? { debugName: "copy" } : /* istanbul ignore next */ {}), equal: recordEqual });
198
+ byConfig.set(config, copy);
199
+ return copy;
200
+ }
201
+ const LABEL_KEYS = [
202
+ 'searchPlaceholder',
203
+ 'listboxLabel',
204
+ 'emptyLabel',
205
+ 'loadingLabel',
206
+ 'errorLabel',
207
+ 'retryLabel',
208
+ 'paletteLabel',
209
+ ];
210
+ /**
211
+ * Override any subset of the palette's text labels. Unset labels keep the
212
+ * inherited value. Pass a `Signal` of the overrides to switch the language at
213
+ * runtime; a key the Signal sets wins over the inherited value, an unset key
214
+ * follows it.
215
+ *
216
+ * @category ui/command-palette
217
+ * @since 0.1.0
218
+ */
219
+ function withCommandPaletteLabels(labels) {
220
+ if (!isSignal(labels)) {
221
+ return (config) => ({ ...config, ...labels });
222
+ }
223
+ return (config) => {
224
+ const next = { ...config };
225
+ for (const key of LABEL_KEYS) {
226
+ const inherited = coerceSignal(config[key]);
227
+ next[key] = computed(() => {
228
+ const patch = labels();
229
+ return key in patch ? patch[key] : inherited();
230
+ });
231
+ }
232
+ return next;
233
+ };
234
+ }
235
+ /**
236
+ * Set the combo that opens the palette (parsed via `parseKeyCombo`, e.g.
237
+ * `'mod+k'`, `'mod+shift+p'`). Applies app-wide via `provideCommandPaletteConfig`
238
+ * or per-scope via `provideCommandPaletteConfigAt`. A per-instance
239
+ * `[openShortcut]` input still wins over this.
240
+ *
241
+ * @category ui/command-palette
242
+ * @since 0.1.0
243
+ */
244
+ function withPaletteShortcut(combo) {
245
+ return (config) => ({ ...config, openShortcut: combo });
246
+ }
247
+ /**
248
+ * Replace the footer keyboard legend. Pass a `Signal` to switch the language at
249
+ * runtime.
250
+ *
251
+ * @category ui/command-palette
252
+ * @since 0.1.0
253
+ */
254
+ function withKeyboardLegend(entries) {
255
+ return (config) => ({ ...config, footerLegend: entries });
256
+ }
257
+ /**
258
+ * Replace the `aria-live` result-count formatter (e.g. for pluralisation in
259
+ * another locale). Pass a `Signal` of the formatter to switch the language at
260
+ * runtime; the live count speaks the new formatter on its next change.
261
+ *
262
+ * @category ui/command-palette
263
+ * @since 0.1.0
264
+ */
265
+ function withResultCountFormatter(formatter) {
266
+ return (config) => ({ ...config, resultCount: formatter });
267
+ }
268
+ /**
269
+ * Register global default slot templates. Merged over any already set; a
270
+ * per-instance `*cngxCommand*` slot still wins over these.
271
+ *
272
+ * @category ui/command-palette
273
+ * @since 0.1.0
274
+ */
275
+ function withCommandPaletteTemplates(templates) {
276
+ return (config) => ({
277
+ ...config,
278
+ templates: { ...config.templates, ...templates },
279
+ });
280
+ }
281
+
282
+ /**
283
+ * DI token the panel injects (optional) to reach its hosting palette surface.
284
+ *
285
+ * @category ui/command-palette
286
+ * @since 0.1.0
287
+ */
288
+ const CNGX_COMMAND_PALETTE_HOST = new InjectionToken('CNGX_COMMAND_PALETTE_HOST');
289
+
290
+ /**
291
+ * @internal
292
+ * The command-palette result body: a `role=combobox` search input driving a
293
+ * `role=listbox` of ranked commands with `aria-activedescendant`, grouped
294
+ * results, match highlighting, a bound scope chip, and a polite result-count
295
+ * live region. Composes existing atoms - `CngxSearch` (debounced term),
296
+ * `CngxListbox` + `CngxOption` (navigation over the ranked list in final DOM
297
+ * order via the listbox's own `CngxActiveDescendant`), `CngxHighlight` (match
298
+ * marking) - with no reinvented debounce, navigation, or ranking engine.
299
+ *
300
+ * The ranked list is a `computed()` over the `equal`-guarded registry, the
301
+ * swappable matcher, `term`, `scope`, and the consumer's async result source;
302
+ * the per-option `matchFn` never runs, so there is no double-filter.
303
+ */
304
+ class CngxCommandPanel {
305
+ /** Consumer-derived async result source, merged in with the static registry. */
306
+ results = input(undefined, ...(ngDevMode ? [{ debugName: "results" }] : /* istanbul ignore next */ []));
307
+ /** Persistent scope; feeds the matcher's scope filter and renders as a chip. */
308
+ scope = model(undefined, ...(ngDevMode ? [{ debugName: "scope" }] : /* istanbul ignore next */ []));
309
+ /** Debounce for the search input (proxied to `CngxSearch`). */
310
+ debounceMs = input(150, ...(ngDevMode ? [{ debugName: "debounceMs" }] : /* istanbul ignore next */ []));
311
+ /** Resolved row slot template (instance > config > null). Built-in default when null. */
312
+ rowTpl = input(null, ...(ngDevMode ? [{ debugName: "rowTpl" }] : /* istanbul ignore next */ []));
313
+ /** Resolved group-header slot template. Built-in default when null. */
314
+ groupHeaderTpl = input(null, ...(ngDevMode ? [{ debugName: "groupHeaderTpl" }] : /* istanbul ignore next */ []));
315
+ /**
316
+ * Resolved empty slot template. Rendered by the panel itself (below the
317
+ * listbox, input stays mounted) whenever the result count is zero - this
318
+ * covers both the static-registry mode, where the shell has no async state
319
+ * to switch on, and an empty async success.
320
+ */
321
+ emptyTpl = input(null, ...(ngDevMode ? [{ debugName: "emptyTpl" }] : /* istanbul ignore next */ []));
322
+ copy = resolveCommandPaletteCopy(injectCommandPaletteConfig());
323
+ listboxId = nextUid('cngx-command-listbox');
324
+ commands = injectCommands();
325
+ matcher = inject(CNGX_COMMAND_MATCH_FACTORY)();
326
+ host = inject(CNGX_COMMAND_PALETTE_HOST, { optional: true });
327
+ destroyRef = inject(DestroyRef);
328
+ listbox = viewChild(CngxListbox, ...(ngDevMode ? [{ debugName: "listbox" }] : /* istanbul ignore next */ []));
329
+ search = viewChild(CngxSearch, ...(ngDevMode ? [{ debugName: "search" }] : /* istanbul ignore next */ []));
330
+ termState = signal('', ...(ngDevMode ? [{ debugName: "termState" }] : /* istanbul ignore next */ []));
331
+ /** Current debounced search term. Exposed for the consumer's result derivation. */
332
+ term = this.termState.asReadonly();
333
+ /** Stable dedupe-key to DOM-id map behind {@link domGroupId}. */
334
+ groupDomIds = new Map();
335
+ /** Stable command-id to reason-DOM-id map behind {@link reasonId}. */
336
+ reasonDomIds = new Map();
337
+ /** Grouped, ranked results: consumer async groups first, then the ranked registry. */
338
+ groups = computed(() => {
339
+ const ranked = this.matcher(this.commands(), this.term(), this.scope());
340
+ const asyncState = this.results();
341
+ const asyncGroups = asyncState ? toRawGroups(asyncState.data() ?? []) : [];
342
+ const raws = [...asyncGroups, ...groupRanked(ranked)];
343
+ this.pruneDomIds(raws);
344
+ return raws.map((raw) => ({
345
+ id: this.domGroupId(raw.key),
346
+ label: raw.label,
347
+ items: raw.items,
348
+ slot: {
349
+ id: raw.slotId,
350
+ label: raw.label ?? '',
351
+ commands: raw.items.map((entry) => entry.command),
352
+ },
353
+ }));
354
+ }, { ...(ngDevMode ? { debugName: "groups" } : /* istanbul ignore next */ {}), equal: renderGroupsEqual });
355
+ /**
356
+ * Drop id-map entries whose group key / command id left the result set, so
357
+ * the memoized maps stay bounded when a long-lived palette streams rotating
358
+ * async group ids. Ids remain stable while their key is present; a key that
359
+ * leaves and returns simply gets a fresh id.
360
+ */
361
+ pruneDomIds(raws) {
362
+ const groupKeys = new Set(raws.map((raw) => raw.key));
363
+ for (const key of this.groupDomIds.keys()) {
364
+ if (!groupKeys.has(key)) {
365
+ this.groupDomIds.delete(key);
366
+ }
367
+ }
368
+ const commandIds = new Set(raws.flatMap((raw) => raw.items.map((entry) => entry.command.id)));
369
+ for (const key of this.reasonDomIds.keys()) {
370
+ if (!commandIds.has(key)) {
371
+ this.reasonDomIds.delete(key);
372
+ }
373
+ }
374
+ }
375
+ /** Flat ranked list in render order, for count + command lookup. */
376
+ flatItems = computed(() => this.groups().flatMap((group) => group.items), { ...(ngDevMode ? { debugName: "flatItems" } : /* istanbul ignore next */ {}), equal: rankedListEqual });
377
+ /** Number of results across every group. Exposed for the consumer. */
378
+ resultCount = computed(() => this.flatItems().length, ...(ngDevMode ? [{ debugName: "resultCount" }] : /* istanbul ignore next */ []));
379
+ /**
380
+ * @internal - polite live-region text. The count is the only tracked source; the
381
+ * formatter is read and called untracked, so a language switch never re-speaks
382
+ * the shown count and the next count change speaks the new language.
383
+ */
384
+ countMessage = computed(() => {
385
+ const count = this.resultCount();
386
+ return untracked(() => this.copy().resultCount(count));
387
+ }, ...(ngDevMode ? [{ debugName: "countMessage" }] : /* istanbul ignore next */ []));
388
+ /** The command id the user last saw highlighted; `null` after a term reset. */
389
+ lastHighlightedId = null;
390
+ /** The AD item registry the highlight bookkeeping last saw (identity). */
391
+ lastRegistry = null;
392
+ constructor() {
393
+ // Click on an option routes through the listbox's active-descendant, which
394
+ // emits `activated`; Enter forwards through the same `activateCurrent` path.
395
+ // One subscription runs the matching command for both. externalActivation
396
+ // stops the listbox writing its own value on activation.
397
+ afterNextRender(() => {
398
+ const lb = this.listbox();
399
+ if (lb) {
400
+ outputToObservable(lb.ad.activated)
401
+ .pipe(takeUntilDestroyed(this.destroyRef))
402
+ .subscribe((value) => this.runById(value));
403
+ }
404
+ });
405
+ // Async groups PREPEND above the static results, and the highlight is
406
+ // index-based - a prepend would silently move it onto a different command.
407
+ // Re-resolve by VALUE whenever the AD item registry changes (the registry,
408
+ // not the data list: options only register during change detection, and
409
+ // the index goes stale exactly when the registry re-orders) so Enter runs
410
+ // the item the user saw; when that item left the result set, reset so
411
+ // autoHighlightFirst re-fires on the fresh list.
412
+ effect(() => {
413
+ const lb = this.listbox();
414
+ if (!lb) {
415
+ return;
416
+ }
417
+ const registry = lb.ad.resolvedItems();
418
+ // Tracked so navigation keeps the bookkeeping current between registry changes.
419
+ const active = lb.ad.activeValue();
420
+ untracked(() => {
421
+ const wanted = this.lastHighlightedId;
422
+ const registryChanged = registry !== this.lastRegistry;
423
+ if (registryChanged && wanted !== null && active !== wanted) {
424
+ if (registry.some((item) => item.value === wanted)) {
425
+ lb.ad.highlightByValue(wanted);
426
+ }
427
+ else {
428
+ lb.ad.resetHighlight();
429
+ }
430
+ }
431
+ this.lastRegistry = registry;
432
+ const current = lb.ad.activeValue();
433
+ this.lastHighlightedId = typeof current === 'string' ? current : null;
434
+ });
435
+ });
436
+ // The palette dialog keeps its content mounted across close, so term and
437
+ // highlight would leak into the next open. Reset when the host closes;
438
+ // clear() feeds searchChange, which routes through onTerm.
439
+ effect(() => {
440
+ const open = this.host?.isOpen() ?? true;
441
+ if (!open) {
442
+ untracked(() => this.search()?.clear());
443
+ }
444
+ });
445
+ }
446
+ onTerm(term, lb) {
447
+ this.termState.set(term);
448
+ // Reset the highlight so autoHighlightFirst re-fires the top result after a
449
+ // re-rank shrinks the list below the previously active index. The value
450
+ // bookkeeping resets too - a new term means the old highlight is void.
451
+ this.lastHighlightedId = null;
452
+ lb.ad.resetHighlight();
453
+ }
454
+ /** Panel-unique DOM id for a group dedupe key. Stable per key for the panel's lifetime. */
455
+ domGroupId(key) {
456
+ let id = this.groupDomIds.get(key);
457
+ if (!id) {
458
+ id = `${this.listboxId}-g${this.groupDomIds.size}`;
459
+ this.groupDomIds.set(key, id);
460
+ }
461
+ return id;
462
+ }
463
+ onKeydown(event, lb) {
464
+ // Never hijack browser/app shortcuts: modified combos pass through
465
+ // untouched - the same guard the nav strategies apply. Without it,
466
+ // Ctrl+ArrowDown in the input would navigate and swallow the event.
467
+ if (event.ctrlKey || event.metaKey || event.altKey) {
468
+ return;
469
+ }
470
+ const ad = lb.ad;
471
+ switch (event.key) {
472
+ case 'ArrowDown':
473
+ event.preventDefault();
474
+ ad.highlightNext();
475
+ return;
476
+ case 'ArrowUp':
477
+ event.preventDefault();
478
+ ad.highlightPrev();
479
+ return;
480
+ case 'Home':
481
+ event.preventDefault();
482
+ ad.highlightFirst();
483
+ return;
484
+ case 'End':
485
+ event.preventDefault();
486
+ ad.highlightLast();
487
+ return;
488
+ case 'Enter':
489
+ if (ad.activeItem()) {
490
+ event.preventDefault();
491
+ ad.activateCurrent();
492
+ }
493
+ return;
494
+ }
495
+ // Space, printable characters, and Backspace fall through to the input so
496
+ // the search term picks them up.
497
+ }
498
+ isDisabled(command) {
499
+ return command.disabled?.() ?? false;
500
+ }
501
+ reasonId(command) {
502
+ // Minted, never derived from the raw command id - user strings can carry
503
+ // characters that break DOM ids and aria-describedby references.
504
+ let id = this.reasonDomIds.get(command.id);
505
+ if (!id) {
506
+ id = `${this.listboxId}-reason-${this.reasonDomIds.size}`;
507
+ this.reasonDomIds.set(command.id, id);
508
+ }
509
+ return id;
510
+ }
511
+ describedBy(command) {
512
+ return this.isDisabled(command) && command.disabledReason ? this.reasonId(command) : null;
513
+ }
514
+ runById(value) {
515
+ const command = this.flatItems().find((entry) => entry.command.id === value)?.command;
516
+ if (!command || this.isDisabled(command)) {
517
+ return;
518
+ }
519
+ void command.run();
520
+ this.host?.dismiss();
521
+ }
522
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
523
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxCommandPanel, isStandalone: true, selector: "cngx-command-panel", inputs: { results: { classPropertyName: "results", publicName: "results", isSignal: true, isRequired: false, transformFunction: null }, scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, rowTpl: { classPropertyName: "rowTpl", publicName: "rowTpl", isSignal: true, isRequired: false, transformFunction: null }, groupHeaderTpl: { classPropertyName: "groupHeaderTpl", publicName: "groupHeaderTpl", isSignal: true, isRequired: false, transformFunction: null }, emptyTpl: { classPropertyName: "emptyTpl", publicName: "emptyTpl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scope: "scopeChange" }, host: { classAttribute: "cngx-command-panel" }, viewQueries: [{ propertyName: "listbox", first: true, predicate: CngxListbox, descendants: true, isSignal: true }, { propertyName: "search", first: true, predicate: CngxSearch, descendants: true, isSignal: true }], ngImport: i0, template: `
524
+ <div class="cngx-command-panel-input-row">
525
+ @if (scope(); as activeScope) {
526
+ <span class="cngx-command-scope-chip">{{ activeScope }}</span>
527
+ }
528
+ <input
529
+ cngxSearch
530
+ class="cngx-command-panel-input"
531
+ type="text"
532
+ role="combobox"
533
+ autocomplete="off"
534
+ aria-autocomplete="list"
535
+ [attr.aria-expanded]="true"
536
+ [attr.aria-controls]="listboxId"
537
+ [attr.aria-activedescendant]="lb.ad.activeId()"
538
+ [attr.aria-label]="copy().searchPlaceholder"
539
+ [placeholder]="copy().searchPlaceholder"
540
+ [debounceMs]="debounceMs()"
541
+ (searchChange)="onTerm($event, lb)"
542
+ (keydown)="onKeydown($event, lb)"
543
+ />
544
+ </div>
545
+
546
+ <div
547
+ cngxListbox
548
+ #lb="cngxListbox"
549
+ [id]="listboxId"
550
+ class="cngx-command-panel-listbox"
551
+ [label]="copy().listboxLabel"
552
+ [autoHighlightFirst]="true"
553
+ [externalActivation]="true"
554
+ >
555
+ @for (group of groups(); track group.id) {
556
+ <div role="group" [attr.aria-labelledby]="group.label ? group.id + '-h' : null">
557
+ @if (group.label; as header) {
558
+ <div class="cngx-command-group-header" [id]="group.id + '-h'">
559
+ @if (groupHeaderTpl(); as tpl) {
560
+ <ng-container
561
+ [ngTemplateOutlet]="tpl"
562
+ [ngTemplateOutletContext]="{ $implicit: group.slot }"
563
+ />
564
+ } @else {
565
+ {{ header }}
566
+ }
567
+ </div>
568
+ }
569
+ @for (entry of group.items; track entry.command.id) {
570
+ <div
571
+ cngxOption
572
+ class="cngx-command-row"
573
+ [value]="entry.command.id"
574
+ [label]="entry.command.label"
575
+ [disabled]="isDisabled(entry.command)"
576
+ [attr.aria-describedby]="describedBy(entry.command)"
577
+ >
578
+ @if (rowTpl(); as tpl) {
579
+ <ng-container
580
+ [ngTemplateOutlet]="tpl"
581
+ [ngTemplateOutletContext]="{
582
+ $implicit: entry,
583
+ term: term(),
584
+ data: entry.command.data,
585
+ active: lb.ad.activeValue() === entry.command.id,
586
+ }"
587
+ />
588
+ } @else {
589
+ <span class="cngx-command-row-label" [cngxHighlight]="term()">{{
590
+ entry.command.label
591
+ }}</span>
592
+ }
593
+ @if (entry.command.disabledReason; as reason) {
594
+ <!-- Target stays in the DOM whenever a reason exists; only the
595
+ aria-describedby reference (describedBy) is gated on disabled
596
+ state, so no referenced node ever appears/disappears mid-interaction. -->
597
+ <span class="cngx-sr-only" [id]="reasonId(entry.command)">{{ reason }}</span>
598
+ }
599
+ </div>
600
+ }
601
+ </div>
602
+ }
603
+ </div>
604
+
605
+ @if (resultCount() === 0) {
606
+ @if (emptyTpl(); as tpl) {
607
+ <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ term: term() }" />
608
+ } @else {
609
+ <div class="cngx-command-state cngx-command-state--empty">{{ copy().emptyLabel }}</div>
610
+ }
611
+ }
612
+
613
+ <span class="cngx-sr-only" aria-live="polite">{{ countMessage() }}</span>
614
+ `, isInline: true, styles: [".cngx-command-panel{display:block;--cngx-command-input-gap: var(--cngx-space-sm, .5rem);--cngx-command-input-pad: var(--cngx-space-md, 1rem);--cngx-command-row-gap: var(--cngx-space-sm, .5rem);--cngx-command-row-pad: var(--cngx-space-sm, .5rem);--cngx-command-listbox-pad: var(--cngx-space-xs, .25rem);--cngx-command-chip-pad: var(--cngx-space-sm, .5rem)}.cngx-command-panel-input-row{display:flex;align-items:center;gap:var(--cngx-command-input-gap, var(--cngx-space-sm, .5rem));padding:var(--cngx-command-input-pad, var(--cngx-space-md, 1rem));border-block-end:var(--cngx-command-border-width, 1px) solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb))}.cngx-command-panel-input{flex:1 1 auto;min-inline-size:0;font:inherit;color:var(--cngx-command-input-color, inherit);background:transparent;border:0;outline:none}.cngx-command-panel-input::placeholder{color:var(--cngx-command-placeholder-color, var(--cngx-color-muted-foreground, #9ca3af))}.cngx-command-scope-chip{display:inline-flex;align-items:center;min-block-size:var(--cngx-target-min, 0px);padding-inline:var(--cngx-command-chip-pad, var(--cngx-space-sm, .5rem));border-radius:var(--cngx-command-chip-radius, var(--cngx-radius-sm, .25rem));background:var(--cngx-command-chip-bg, var(--cngx-color-muted, #f3f4f6));color:var(--cngx-command-chip-color, inherit);font-size:var(--cngx-command-chip-size, .8125rem)}.cngx-command-panel-listbox{display:block;max-block-size:var(--cngx-command-listbox-max-h, 22rem);overflow-y:auto;padding:var(--cngx-command-listbox-pad, var(--cngx-space-xs, .25rem))}.cngx-command-group-header{padding-block:var(--cngx-command-header-pad-y, var(--cngx-space-xs, .25rem));padding-inline:var(--cngx-command-header-pad-x, var(--cngx-space-sm, .5rem));font-size:var(--cngx-command-header-size, .75rem);font-weight:var(--cngx-command-header-weight, 600);color:var(--cngx-command-header-color, var(--cngx-color-muted-foreground, #6b7280));text-transform:uppercase;letter-spacing:.04em}.cngx-command-row{display:flex;align-items:center;gap:var(--cngx-command-row-gap, var(--cngx-space-sm, .5rem));min-block-size:var(--cngx-target-min, 0px);padding:var(--cngx-command-row-pad, var(--cngx-space-sm, .5rem));border-radius:var(--cngx-command-row-radius, var(--cngx-radius-sm, .25rem));cursor:pointer;color:var(--cngx-command-row-color, inherit)}.cngx-command-row.cngx-option--highlighted{background:var(--cngx-command-row-active-bg, var(--cngx-color-accent, #eef2ff));color:var(--cngx-command-row-active-color, inherit)}.cngx-command-row.cngx-option--disabled{cursor:not-allowed;color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}@media(forced-colors:active){.cngx-command-row.cngx-option--highlighted{background:Highlight;color:HighlightText;forced-color-adjust:none}.cngx-command-row.cngx-option--highlighted :is(mark,kbd){background:transparent;color:inherit;border-color:currentColor}.cngx-command-row.cngx-option--highlighted mark{text-decoration:underline}.cngx-command-row.cngx-option--disabled{color:GrayText}.cngx-command-row.cngx-option--disabled mark{background:transparent;color:inherit;text-decoration:underline}}.cngx-command-row-label mark{background:var(--cngx-command-mark-bg, var(--cngx-color-highlight, #fde68a));color:inherit}.cngx-command-panel-input:focus-visible,.cngx-command-row:focus-visible{outline:var(--cngx-command-focus-outline, 2px solid var(--cngx-color-focus, #2563eb));outline-offset:var(--cngx-command-focus-offset, 2px)}.cngx-sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"], dependencies: [{ kind: "directive", type: CngxSearch, selector: "input[cngxSearch]", inputs: ["debounceMs"], outputs: ["searchChange"], exportAs: ["cngxSearch"] }, { kind: "directive", type: CngxListbox, selector: "[cngxListbox]", inputs: ["label", "value", "selectedValues", "multiple", "compareWith", "cngxSearchRef", "externalActivation", "explicitOptions"], outputs: ["valueChange", "selectedValuesChange"], exportAs: ["cngxListbox"] }, { kind: "directive", type: CngxOption, selector: "[cngxOption]", inputs: ["value", "disabled", "label"], exportAs: ["cngxOption"] }, { kind: "directive", type: CngxHighlight, selector: "[cngxHighlight]", inputs: ["cngxHighlight", "highlightCaseSensitive"], exportAs: ["cngxHighlight"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
615
+ }
616
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPanel, decorators: [{
617
+ type: Component,
618
+ args: [{ selector: 'cngx-command-panel', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CngxSearch, CngxListbox, CngxOption, CngxHighlight, NgTemplateOutlet], host: { class: 'cngx-command-panel' }, template: `
619
+ <div class="cngx-command-panel-input-row">
620
+ @if (scope(); as activeScope) {
621
+ <span class="cngx-command-scope-chip">{{ activeScope }}</span>
622
+ }
623
+ <input
624
+ cngxSearch
625
+ class="cngx-command-panel-input"
626
+ type="text"
627
+ role="combobox"
628
+ autocomplete="off"
629
+ aria-autocomplete="list"
630
+ [attr.aria-expanded]="true"
631
+ [attr.aria-controls]="listboxId"
632
+ [attr.aria-activedescendant]="lb.ad.activeId()"
633
+ [attr.aria-label]="copy().searchPlaceholder"
634
+ [placeholder]="copy().searchPlaceholder"
635
+ [debounceMs]="debounceMs()"
636
+ (searchChange)="onTerm($event, lb)"
637
+ (keydown)="onKeydown($event, lb)"
638
+ />
639
+ </div>
640
+
641
+ <div
642
+ cngxListbox
643
+ #lb="cngxListbox"
644
+ [id]="listboxId"
645
+ class="cngx-command-panel-listbox"
646
+ [label]="copy().listboxLabel"
647
+ [autoHighlightFirst]="true"
648
+ [externalActivation]="true"
649
+ >
650
+ @for (group of groups(); track group.id) {
651
+ <div role="group" [attr.aria-labelledby]="group.label ? group.id + '-h' : null">
652
+ @if (group.label; as header) {
653
+ <div class="cngx-command-group-header" [id]="group.id + '-h'">
654
+ @if (groupHeaderTpl(); as tpl) {
655
+ <ng-container
656
+ [ngTemplateOutlet]="tpl"
657
+ [ngTemplateOutletContext]="{ $implicit: group.slot }"
658
+ />
659
+ } @else {
660
+ {{ header }}
661
+ }
662
+ </div>
663
+ }
664
+ @for (entry of group.items; track entry.command.id) {
665
+ <div
666
+ cngxOption
667
+ class="cngx-command-row"
668
+ [value]="entry.command.id"
669
+ [label]="entry.command.label"
670
+ [disabled]="isDisabled(entry.command)"
671
+ [attr.aria-describedby]="describedBy(entry.command)"
672
+ >
673
+ @if (rowTpl(); as tpl) {
674
+ <ng-container
675
+ [ngTemplateOutlet]="tpl"
676
+ [ngTemplateOutletContext]="{
677
+ $implicit: entry,
678
+ term: term(),
679
+ data: entry.command.data,
680
+ active: lb.ad.activeValue() === entry.command.id,
681
+ }"
682
+ />
683
+ } @else {
684
+ <span class="cngx-command-row-label" [cngxHighlight]="term()">{{
685
+ entry.command.label
686
+ }}</span>
687
+ }
688
+ @if (entry.command.disabledReason; as reason) {
689
+ <!-- Target stays in the DOM whenever a reason exists; only the
690
+ aria-describedby reference (describedBy) is gated on disabled
691
+ state, so no referenced node ever appears/disappears mid-interaction. -->
692
+ <span class="cngx-sr-only" [id]="reasonId(entry.command)">{{ reason }}</span>
693
+ }
694
+ </div>
695
+ }
696
+ </div>
697
+ }
698
+ </div>
699
+
700
+ @if (resultCount() === 0) {
701
+ @if (emptyTpl(); as tpl) {
702
+ <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{ term: term() }" />
703
+ } @else {
704
+ <div class="cngx-command-state cngx-command-state--empty">{{ copy().emptyLabel }}</div>
705
+ }
706
+ }
707
+
708
+ <span class="cngx-sr-only" aria-live="polite">{{ countMessage() }}</span>
709
+ `, styles: [".cngx-command-panel{display:block;--cngx-command-input-gap: var(--cngx-space-sm, .5rem);--cngx-command-input-pad: var(--cngx-space-md, 1rem);--cngx-command-row-gap: var(--cngx-space-sm, .5rem);--cngx-command-row-pad: var(--cngx-space-sm, .5rem);--cngx-command-listbox-pad: var(--cngx-space-xs, .25rem);--cngx-command-chip-pad: var(--cngx-space-sm, .5rem)}.cngx-command-panel-input-row{display:flex;align-items:center;gap:var(--cngx-command-input-gap, var(--cngx-space-sm, .5rem));padding:var(--cngx-command-input-pad, var(--cngx-space-md, 1rem));border-block-end:var(--cngx-command-border-width, 1px) solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb))}.cngx-command-panel-input{flex:1 1 auto;min-inline-size:0;font:inherit;color:var(--cngx-command-input-color, inherit);background:transparent;border:0;outline:none}.cngx-command-panel-input::placeholder{color:var(--cngx-command-placeholder-color, var(--cngx-color-muted-foreground, #9ca3af))}.cngx-command-scope-chip{display:inline-flex;align-items:center;min-block-size:var(--cngx-target-min, 0px);padding-inline:var(--cngx-command-chip-pad, var(--cngx-space-sm, .5rem));border-radius:var(--cngx-command-chip-radius, var(--cngx-radius-sm, .25rem));background:var(--cngx-command-chip-bg, var(--cngx-color-muted, #f3f4f6));color:var(--cngx-command-chip-color, inherit);font-size:var(--cngx-command-chip-size, .8125rem)}.cngx-command-panel-listbox{display:block;max-block-size:var(--cngx-command-listbox-max-h, 22rem);overflow-y:auto;padding:var(--cngx-command-listbox-pad, var(--cngx-space-xs, .25rem))}.cngx-command-group-header{padding-block:var(--cngx-command-header-pad-y, var(--cngx-space-xs, .25rem));padding-inline:var(--cngx-command-header-pad-x, var(--cngx-space-sm, .5rem));font-size:var(--cngx-command-header-size, .75rem);font-weight:var(--cngx-command-header-weight, 600);color:var(--cngx-command-header-color, var(--cngx-color-muted-foreground, #6b7280));text-transform:uppercase;letter-spacing:.04em}.cngx-command-row{display:flex;align-items:center;gap:var(--cngx-command-row-gap, var(--cngx-space-sm, .5rem));min-block-size:var(--cngx-target-min, 0px);padding:var(--cngx-command-row-pad, var(--cngx-space-sm, .5rem));border-radius:var(--cngx-command-row-radius, var(--cngx-radius-sm, .25rem));cursor:pointer;color:var(--cngx-command-row-color, inherit)}.cngx-command-row.cngx-option--highlighted{background:var(--cngx-command-row-active-bg, var(--cngx-color-accent, #eef2ff));color:var(--cngx-command-row-active-color, inherit)}.cngx-command-row.cngx-option--disabled{cursor:not-allowed;color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}@media(forced-colors:active){.cngx-command-row.cngx-option--highlighted{background:Highlight;color:HighlightText;forced-color-adjust:none}.cngx-command-row.cngx-option--highlighted :is(mark,kbd){background:transparent;color:inherit;border-color:currentColor}.cngx-command-row.cngx-option--highlighted mark{text-decoration:underline}.cngx-command-row.cngx-option--disabled{color:GrayText}.cngx-command-row.cngx-option--disabled mark{background:transparent;color:inherit;text-decoration:underline}}.cngx-command-row-label mark{background:var(--cngx-command-mark-bg, var(--cngx-color-highlight, #fde68a));color:inherit}.cngx-command-panel-input:focus-visible,.cngx-command-row:focus-visible{outline:var(--cngx-command-focus-outline, 2px solid var(--cngx-color-focus, #2563eb));outline-offset:var(--cngx-command-focus-offset, 2px)}.cngx-sr-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
710
+ }], ctorParameters: () => [], propDecorators: { results: [{ type: i0.Input, args: [{ isSignal: true, alias: "results", required: false }] }], scope: [{ type: i0.Input, args: [{ isSignal: true, alias: "scope", required: false }] }, { type: i0.Output, args: ["scopeChange"] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], rowTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowTpl", required: false }] }], groupHeaderTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "groupHeaderTpl", required: false }] }], emptyTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTpl", required: false }] }], listbox: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CngxListbox), { isSignal: true }] }], search: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CngxSearch), { isSignal: true }] }] } });
711
+ /** @internal Groups ranked results by their `group` key, preserving rank order. */
712
+ function groupRanked(ranked) {
713
+ const groups = [];
714
+ const index = new Map();
715
+ for (const entry of ranked) {
716
+ const key = entry.command.group ?? '';
717
+ let bucket = index.get(key);
718
+ if (!bucket) {
719
+ bucket = [];
720
+ index.set(key, bucket);
721
+ groups.push({
722
+ key: `s:${key}`,
723
+ slotId: key,
724
+ label: entry.command.group ?? null,
725
+ items: bucket,
726
+ });
727
+ }
728
+ bucket.push(entry);
729
+ }
730
+ return groups;
731
+ }
732
+ /** @internal Maps consumer async command groups into raw render groups (score 0). */
733
+ function toRawGroups(source) {
734
+ return source.map((group) => ({
735
+ key: `a:${group.id}`,
736
+ slotId: group.id,
737
+ label: group.label,
738
+ items: group.commands.map((command) => ({ command, score: 0 })),
739
+ }));
740
+ }
741
+ /** @internal Length + id + per-command identity across groups. */
742
+ function renderGroupsEqual(a, b) {
743
+ if (a === b) {
744
+ return true;
745
+ }
746
+ if (a.length !== b.length) {
747
+ return false;
748
+ }
749
+ return a.every((group, i) => {
750
+ const other = b[i];
751
+ return group.id === other.id && group.label === other.label && rankedListEqual(group.items, other.items);
752
+ });
753
+ }
754
+ /** @internal Length + per-command identity. */
755
+ function rankedListEqual(a, b) {
756
+ if (a === b) {
757
+ return true;
758
+ }
759
+ if (a.length !== b.length) {
760
+ return false;
761
+ }
762
+ return a.every((entry, i) => entry.command === b[i].command && entry.score === b[i].score);
763
+ }
764
+
765
+ /**
766
+ * @internal
767
+ * Async-state view switch that wraps {@link CngxCommandPanel}. Maps the
768
+ * consumer's `CngxAsyncState<CngxCommandGroup[]>` through `resolveAsyncView()` to
769
+ * the six-state enum and renders the matching state: `skeleton` on first load,
770
+ * `error` on a first-load failure, and the projected panel for everything
771
+ * else. `content+error` keeps the stale results visible while a re-query on
772
+ * the next keystroke errors. An empty success maps to `content` too: the
773
+ * search input must stay mounted (the user keeps typing to refine the term),
774
+ * so the panel itself renders the empty slot keyed on its own result count.
775
+ *
776
+ * Each state resolves its slot template (instance > config > built-in default),
777
+ * passed down from the palette. With no `[results]` bound (static registry
778
+ * only) the view is always `content`, so the panel renders unconditionally.
779
+ */
780
+ class CngxCommandPanelShell {
781
+ /** Consumer-derived async result state driving the view switch. */
782
+ results = input(undefined, ...(ngDevMode ? [{ debugName: "results" }] : /* istanbul ignore next */ []));
783
+ /** Resolved slot templates (instance > config > null). Built-in default when null. */
784
+ loadingTpl = input(null, ...(ngDevMode ? [{ debugName: "loadingTpl" }] : /* istanbul ignore next */ []));
785
+ errorTpl = input(null, ...(ngDevMode ? [{ debugName: "errorTpl" }] : /* istanbul ignore next */ []));
786
+ /** Fired when the user clicks Retry in the error state. */
787
+ retry = output();
788
+ copy = resolveCommandPaletteCopy(injectCommandPaletteConfig());
789
+ /** The resolved view. `content` when no async source is bound. */
790
+ view = computed(() => {
791
+ const state = this.results();
792
+ if (!state) {
793
+ return 'content';
794
+ }
795
+ const view = resolveAsyncView(state.status(), state.isFirstLoad(), state.isEmpty());
796
+ // An empty success keeps the panel (and its search input) mounted; the
797
+ // panel renders the empty slot off its own result count instead.
798
+ return view === 'empty' ? 'content' : view;
799
+ }, ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
800
+ errorValue = computed(() => this.results()?.error(), ...(ngDevMode ? [{ debugName: "errorValue" }] : /* istanbul ignore next */ []));
801
+ /**
802
+ * @internal - copy of the `role="alert"` error regions, keyed on the view. Read
803
+ * untracked, so a language switch never re-speaks a shown error; the next error
804
+ * speaks the new language.
805
+ */
806
+ errorText = computed(() => {
807
+ this.view();
808
+ return untracked(() => this.copy().errorLabel);
809
+ }, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
810
+ /** @internal - retry-button copy inside the error region, keyed like {@link errorText}. */
811
+ retryText = computed(() => {
812
+ this.view();
813
+ return untracked(() => this.copy().retryLabel);
814
+ }, ...(ngDevMode ? [{ debugName: "retryText" }] : /* istanbul ignore next */ []));
815
+ /** Stable bound callback for the error slot's `retry`. */
816
+ emitRetry = () => this.retry.emit();
817
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPanelShell, deps: [], target: i0.ɵɵFactoryTarget.Component });
818
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxCommandPanelShell, isStandalone: true, selector: "cngx-command-panel-shell", inputs: { results: { classPropertyName: "results", publicName: "results", isSignal: true, isRequired: false, transformFunction: null }, loadingTpl: { classPropertyName: "loadingTpl", publicName: "loadingTpl", isSignal: true, isRequired: false, transformFunction: null }, errorTpl: { classPropertyName: "errorTpl", publicName: "errorTpl", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { retry: "retry" }, ngImport: i0, template: `
819
+ @switch (view()) {
820
+ @case ('skeleton') {
821
+ @if (loadingTpl(); as tpl) {
822
+ <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{}" />
823
+ } @else {
824
+ <div class="cngx-command-state" aria-busy="true">{{ copy().loadingLabel }}</div>
825
+ }
826
+ }
827
+ @case ('error') {
828
+ @if (errorTpl(); as tpl) {
829
+ <ng-container
830
+ [ngTemplateOutlet]="tpl"
831
+ [ngTemplateOutletContext]="{ error: errorValue(), retry: emitRetry }"
832
+ />
833
+ } @else {
834
+ <div class="cngx-command-state cngx-command-state--error" role="alert">
835
+ <span>{{ errorText() }}</span>
836
+ <button type="button" class="cngx-command-retry" (click)="retry.emit()">
837
+ {{ retryText() }}
838
+ </button>
839
+ </div>
840
+ }
841
+ }
842
+ @default {
843
+ @if (view() === 'content+error') {
844
+ <div class="cngx-command-state--error-banner" role="alert">{{ errorText() }}</div>
845
+ }
846
+ <ng-content />
847
+ }
848
+ }
849
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
850
+ }
851
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPanelShell, decorators: [{
852
+ type: Component,
853
+ args: [{
854
+ selector: 'cngx-command-panel-shell',
855
+ standalone: true,
856
+ changeDetection: ChangeDetectionStrategy.OnPush,
857
+ encapsulation: ViewEncapsulation.None,
858
+ imports: [NgTemplateOutlet],
859
+ template: `
860
+ @switch (view()) {
861
+ @case ('skeleton') {
862
+ @if (loadingTpl(); as tpl) {
863
+ <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{}" />
864
+ } @else {
865
+ <div class="cngx-command-state" aria-busy="true">{{ copy().loadingLabel }}</div>
866
+ }
867
+ }
868
+ @case ('error') {
869
+ @if (errorTpl(); as tpl) {
870
+ <ng-container
871
+ [ngTemplateOutlet]="tpl"
872
+ [ngTemplateOutletContext]="{ error: errorValue(), retry: emitRetry }"
873
+ />
874
+ } @else {
875
+ <div class="cngx-command-state cngx-command-state--error" role="alert">
876
+ <span>{{ errorText() }}</span>
877
+ <button type="button" class="cngx-command-retry" (click)="retry.emit()">
878
+ {{ retryText() }}
879
+ </button>
880
+ </div>
881
+ }
882
+ }
883
+ @default {
884
+ @if (view() === 'content+error') {
885
+ <div class="cngx-command-state--error-banner" role="alert">{{ errorText() }}</div>
886
+ }
887
+ <ng-content />
888
+ }
889
+ }
890
+ `,
891
+ }]
892
+ }], propDecorators: { results: [{ type: i0.Input, args: [{ isSignal: true, alias: "results", required: false }] }], loadingTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingTpl", required: false }] }], errorTpl: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorTpl", required: false }] }], retry: [{ type: i0.Output, args: ["retry"] }] } });
893
+
894
+ /**
895
+ * Overrides the default command row. Project as content of
896
+ * `<cngx-command-palette>`:
897
+ *
898
+ * ```html
899
+ * <cngx-command-palette>
900
+ * <ng-template cngxCommandRow let-entry let-active="active">
901
+ * <my-icon [name]="entry.command.icon" />
902
+ * <span>{{ entry.command.label }}</span>
903
+ * </ng-template>
904
+ * </cngx-command-palette>
905
+ * ```
906
+ *
907
+ * @category ui/command-palette
908
+ * @since 0.1.0
909
+ */
910
+ class CngxCommandRow {
911
+ templateRef = inject(TemplateRef);
912
+ static ngTemplateContextGuard(_dir, ctx) {
913
+ return true;
914
+ }
915
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandRow, deps: [], target: i0.ɵɵFactoryTarget.Directive });
916
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxCommandRow, isStandalone: true, selector: "[cngxCommandRow]", ngImport: i0 });
917
+ }
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandRow, decorators: [{
919
+ type: Directive,
920
+ args: [{ selector: '[cngxCommandRow]', standalone: true }]
921
+ }] });
922
+ /**
923
+ * Overrides the default group header.
924
+ *
925
+ * @category ui/command-palette
926
+ * @since 0.1.0
927
+ */
928
+ class CngxCommandGroupHeader {
929
+ templateRef = inject(TemplateRef);
930
+ static ngTemplateContextGuard(_dir, ctx) {
931
+ return true;
932
+ }
933
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandGroupHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive });
934
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxCommandGroupHeader, isStandalone: true, selector: "[cngxCommandGroupHeader]", ngImport: i0 });
935
+ }
936
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandGroupHeader, decorators: [{
937
+ type: Directive,
938
+ args: [{ selector: '[cngxCommandGroupHeader]', standalone: true }]
939
+ }] });
940
+ /**
941
+ * Overrides the default empty state.
942
+ *
943
+ * @category ui/command-palette
944
+ * @since 0.1.0
945
+ */
946
+ class CngxCommandPaletteEmpty {
947
+ templateRef = inject(TemplateRef);
948
+ static ngTemplateContextGuard(_dir, ctx) {
949
+ return true;
950
+ }
951
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteEmpty, deps: [], target: i0.ɵɵFactoryTarget.Directive });
952
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxCommandPaletteEmpty, isStandalone: true, selector: "[cngxCommandPaletteEmpty]", ngImport: i0 });
953
+ }
954
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteEmpty, decorators: [{
955
+ type: Directive,
956
+ args: [{ selector: '[cngxCommandPaletteEmpty]', standalone: true }]
957
+ }] });
958
+ /**
959
+ * Overrides the default first-load skeleton.
960
+ *
961
+ * @category ui/command-palette
962
+ * @since 0.1.0
963
+ */
964
+ class CngxCommandPaletteLoading {
965
+ templateRef = inject(TemplateRef);
966
+ static ngTemplateContextGuard(_dir, ctx) {
967
+ return true;
968
+ }
969
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteLoading, deps: [], target: i0.ɵɵFactoryTarget.Directive });
970
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxCommandPaletteLoading, isStandalone: true, selector: "[cngxCommandPaletteLoading]", ngImport: i0 });
971
+ }
972
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteLoading, decorators: [{
973
+ type: Directive,
974
+ args: [{ selector: '[cngxCommandPaletteLoading]', standalone: true }]
975
+ }] });
976
+ /**
977
+ * Overrides the default error state. Wire `retry` to your reload path.
978
+ *
979
+ * @category ui/command-palette
980
+ * @since 0.1.0
981
+ */
982
+ class CngxCommandPaletteError {
983
+ templateRef = inject(TemplateRef);
984
+ static ngTemplateContextGuard(_dir, ctx) {
985
+ return true;
986
+ }
987
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteError, deps: [], target: i0.ɵɵFactoryTarget.Directive });
988
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxCommandPaletteError, isStandalone: true, selector: "[cngxCommandPaletteError]", ngImport: i0 });
989
+ }
990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteError, decorators: [{
991
+ type: Directive,
992
+ args: [{ selector: '[cngxCommandPaletteError]', standalone: true }]
993
+ }] });
994
+ /**
995
+ * Overrides the default keyboard-legend footer.
996
+ *
997
+ * @category ui/command-palette
998
+ * @since 0.1.0
999
+ */
1000
+ class CngxCommandPaletteFooter {
1001
+ templateRef = inject(TemplateRef);
1002
+ static ngTemplateContextGuard(_dir, ctx) {
1003
+ return true;
1004
+ }
1005
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteFooter, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1006
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxCommandPaletteFooter, isStandalone: true, selector: "[cngxCommandPaletteFooter]", ngImport: i0 });
1007
+ }
1008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteFooter, decorators: [{
1009
+ type: Directive,
1010
+ args: [{ selector: '[cngxCommandPaletteFooter]', standalone: true }]
1011
+ }] });
1012
+
1013
+ /**
1014
+ * Default palette keybinding: installs a document keydown listener that calls
1015
+ * `onOpen` whenever the combo is pressed (matched via `matchesKeyCombo`).
1016
+ * Side-effectful by design - it owns the global listener - so its `teardown`
1017
+ * must be called on destroy.
1018
+ *
1019
+ * `isMac` defaults to platform detection; pass it explicitly for deterministic
1020
+ * tests.
1021
+ *
1022
+ * @category ui/command-palette
1023
+ * @since 0.1.0
1024
+ */
1025
+ function createPaletteKeybinding(combo, onOpen, isMac = detectMac()) {
1026
+ // SSR: no document, no global listener - an inert handle keeps the
1027
+ // palette's effect/teardown cycle uniform across platforms.
1028
+ if (typeof document === 'undefined') {
1029
+ return { teardown: () => undefined };
1030
+ }
1031
+ const handler = (event) => {
1032
+ if (matchesKeyCombo(event, combo, isMac)) {
1033
+ event.preventDefault();
1034
+ onOpen();
1035
+ }
1036
+ };
1037
+ document.addEventListener('keydown', handler);
1038
+ return { teardown: () => document.removeEventListener('keydown', handler) };
1039
+ }
1040
+ /**
1041
+ * Swappable open-trigger seam. Defaults to {@link createPaletteKeybinding}.
1042
+ * Override it to install an enterprise key-capture policy without touching the
1043
+ * palette. To only change the *combo*, prefer `withPaletteShortcut(...)` or the
1044
+ * `[openShortcut]` input - this token is for replacing the whole listener.
1045
+ *
1046
+ * @category ui/command-palette
1047
+ * @since 0.1.0
1048
+ */
1049
+ const CNGX_PALETTE_KEYBINDING_FACTORY = new InjectionToken('CNGX_PALETTE_KEYBINDING_FACTORY', { providedIn: 'root', factory: () => createPaletteKeybinding });
1050
+ /** @internal Best-effort macOS detection; overridable via the `isMac` argument. */
1051
+ function detectMac() {
1052
+ return typeof navigator !== 'undefined' && /mac/i.test(navigator.platform);
1053
+ }
1054
+
1055
+ /**
1056
+ * The opinionated Cmd/Ctrl+K command palette preset. Renders the panel body +
1057
+ * async-state shell inside a native modal `<dialog cngxDialog>`, so focus
1058
+ * trapping, trigger storage at open, and focus restore after the close
1059
+ * transition are handled by `CngxDialog` and the platform - no hand-rolled
1060
+ * focus machinery. The palette provides `CNGX_COMMAND_PALETTE_HOST` so the
1061
+ * panel can dismiss it when a command runs.
1062
+ *
1063
+ * Type-to-filter runs over the merged command registry (`injectCommands`) plus
1064
+ * the consumer's async `[results]`; the palette commits no form value - it
1065
+ * fires `command.run()`, the locked demarcation from `CngxCombobox`. The global
1066
+ * Cmd/Ctrl+K open combo is wired by the keybinding factory, not here.
1067
+ *
1068
+ * ```html
1069
+ * <cngx-command-palette #palette [results]="results()" />
1070
+ * <button [cngxCommandPaletteTrigger]="palette">Search commands</button>
1071
+ * ```
1072
+ *
1073
+ * @category ui/command-palette
1074
+ * @docsKind primary
1075
+ * @wcag AA
1076
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/command-palette/palette/command-palette.component.ts
1077
+ * @selector cngx-command-palette
1078
+ * @since 0.1.0
1079
+ * @relatedTo CngxCommandPaletteTrigger, provideCommands, CngxDialog
1080
+ */
1081
+ class CngxCommandPalette {
1082
+ /** Consumer-derived async result source. */
1083
+ results = input(undefined, ...(ngDevMode ? [{ debugName: "results" }] : /* istanbul ignore next */ []));
1084
+ /** Two-way scope; feeds the matcher's scope filter and the panel chip. */
1085
+ scope = model(undefined, ...(ngDevMode ? [{ debugName: "scope" }] : /* istanbul ignore next */ []));
1086
+ /** Debounce for the search input. */
1087
+ debounceMs = input(150, ...(ngDevMode ? [{ debugName: "debounceMs" }] : /* istanbul ignore next */ []));
1088
+ config = injectCommandPaletteConfig();
1089
+ copy = resolveCommandPaletteCopy(this.config);
1090
+ /**
1091
+ * Accessible name for the dialog. Unbound, `paletteLabel` from
1092
+ * `CNGX_COMMAND_PALETTE_CONFIG` (`withCommandPaletteLabels`) applies.
1093
+ */
1094
+ ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1095
+ /** @internal */
1096
+ resolvedAriaLabel = computed(() => this.ariaLabel() ?? this.copy().paletteLabel, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
1097
+ /**
1098
+ * Per-instance open combo (parsed via `parseKeyCombo`, e.g. `'mod+shift+p'`).
1099
+ * Wins over `CNGX_COMMAND_PALETTE_CONFIG.openShortcut` (`withPaletteShortcut`),
1100
+ * which wins over the `'mod+k'` default. Changing it live re-installs the
1101
+ * listener. For a full listener swap, override `CNGX_PALETTE_KEYBINDING_FACTORY`.
1102
+ */
1103
+ openShortcut = input(undefined, ...(ngDevMode ? [{ debugName: "openShortcut" }] : /* istanbul ignore next */ []));
1104
+ /** Fired when the user asks to retry a failed result load. */
1105
+ retry = output();
1106
+ // Instance slot directives (content-projected). contentChild must be a direct
1107
+ // field initializer (AOT NG8110). Each resolves instance > config > null.
1108
+ rowSlot = contentChild(CngxCommandRow, ...(ngDevMode ? [{ debugName: "rowSlot" }] : /* istanbul ignore next */ []));
1109
+ groupHeaderSlot = contentChild(CngxCommandGroupHeader, ...(ngDevMode ? [{ debugName: "groupHeaderSlot" }] : /* istanbul ignore next */ []));
1110
+ emptySlot = contentChild(CngxCommandPaletteEmpty, ...(ngDevMode ? [{ debugName: "emptySlot" }] : /* istanbul ignore next */ []));
1111
+ loadingSlot = contentChild(CngxCommandPaletteLoading, ...(ngDevMode ? [{ debugName: "loadingSlot" }] : /* istanbul ignore next */ []));
1112
+ errorSlot = contentChild(CngxCommandPaletteError, ...(ngDevMode ? [{ debugName: "errorSlot" }] : /* istanbul ignore next */ []));
1113
+ footerSlot = contentChild(CngxCommandPaletteFooter, ...(ngDevMode ? [{ debugName: "footerSlot" }] : /* istanbul ignore next */ []));
1114
+ rowTpl = computed(() => this.rowSlot()?.templateRef ?? this.config.templates?.row ?? null, ...(ngDevMode ? [{ debugName: "rowTpl" }] : /* istanbul ignore next */ []));
1115
+ groupHeaderTpl = computed(() => this.groupHeaderSlot()?.templateRef ?? this.config.templates?.groupHeader ?? null, ...(ngDevMode ? [{ debugName: "groupHeaderTpl" }] : /* istanbul ignore next */ []));
1116
+ emptyTpl = computed(() => this.emptySlot()?.templateRef ?? this.config.templates?.empty ?? null, ...(ngDevMode ? [{ debugName: "emptyTpl" }] : /* istanbul ignore next */ []));
1117
+ loadingTpl = computed(() => this.loadingSlot()?.templateRef ?? this.config.templates?.loading ?? null, ...(ngDevMode ? [{ debugName: "loadingTpl" }] : /* istanbul ignore next */ []));
1118
+ errorTpl = computed(() => this.errorSlot()?.templateRef ?? this.config.templates?.error ?? null, ...(ngDevMode ? [{ debugName: "errorTpl" }] : /* istanbul ignore next */ []));
1119
+ footerTpl = computed(() => this.footerSlot()?.templateRef ?? this.config.templates?.footer ?? null, ...(ngDevMode ? [{ debugName: "footerTpl" }] : /* istanbul ignore next */ []));
1120
+ dialog = viewChild(CngxDialog, ...(ngDevMode ? [{ debugName: "dialog" }] : /* istanbul ignore next */ []));
1121
+ /** Whether the palette is open. Part of the {@link CngxCommandPaletteHost} contract. */
1122
+ isOpen = computed(() => (this.dialog()?.lifecycle() ?? 'closed') !== 'closed', ...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
1123
+ /** Resolved open combo: instance input > config > `'mod+k'` default. */
1124
+ resolvedShortcut = computed(() => this.openShortcut() ?? this.config.openShortcut, ...(ngDevMode ? [{ debugName: "resolvedShortcut" }] : /* istanbul ignore next */ []));
1125
+ constructor() {
1126
+ // The swappable factory installs the global open combo and calls back to
1127
+ // open the palette. The effect re-installs the listener whenever the
1128
+ // resolved combo changes; onCleanup tears down the previous listener (and
1129
+ // the last one on destroy), so nothing leaks document-wide.
1130
+ const factory = inject(CNGX_PALETTE_KEYBINDING_FACTORY);
1131
+ effect((onCleanup) => {
1132
+ const keybinding = factory(parseKeyCombo(this.resolvedShortcut()), () => this.open());
1133
+ onCleanup(() => keybinding.teardown());
1134
+ });
1135
+ }
1136
+ /** Open the palette. */
1137
+ open() {
1138
+ this.dialog()?.open();
1139
+ }
1140
+ /** Dismiss the palette. Focus returns to the trigger via `CngxDialog`. */
1141
+ dismiss() {
1142
+ this.dialog()?.dismiss();
1143
+ }
1144
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPalette, deps: [], target: i0.ɵɵFactoryTarget.Component });
1145
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxCommandPalette, isStandalone: true, selector: "cngx-command-palette", inputs: { results: { classPropertyName: "results", publicName: "results", isSignal: true, isRequired: false, transformFunction: null }, scope: { classPropertyName: "scope", publicName: "scope", isSignal: true, isRequired: false, transformFunction: null }, debounceMs: { classPropertyName: "debounceMs", publicName: "debounceMs", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, openShortcut: { classPropertyName: "openShortcut", publicName: "openShortcut", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { scope: "scopeChange", retry: "retry" }, providers: [{ provide: CNGX_COMMAND_PALETTE_HOST, useExisting: CngxCommandPalette }], queries: [{ propertyName: "rowSlot", first: true, predicate: CngxCommandRow, descendants: true, isSignal: true }, { propertyName: "groupHeaderSlot", first: true, predicate: CngxCommandGroupHeader, descendants: true, isSignal: true }, { propertyName: "emptySlot", first: true, predicate: CngxCommandPaletteEmpty, descendants: true, isSignal: true }, { propertyName: "loadingSlot", first: true, predicate: CngxCommandPaletteLoading, descendants: true, isSignal: true }, { propertyName: "errorSlot", first: true, predicate: CngxCommandPaletteError, descendants: true, isSignal: true }, { propertyName: "footerSlot", first: true, predicate: CngxCommandPaletteFooter, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "dialog", first: true, predicate: CngxDialog, descendants: true, isSignal: true }], ngImport: i0, template: `
1146
+ <dialog
1147
+ cngxDialog
1148
+ #dialog="cngxDialog"
1149
+ class="cngx-command-palette"
1150
+ [attr.aria-label]="resolvedAriaLabel()"
1151
+ >
1152
+ <cngx-command-panel-shell
1153
+ [results]="results()"
1154
+ [loadingTpl]="loadingTpl()"
1155
+ [errorTpl]="errorTpl()"
1156
+ (retry)="retry.emit()"
1157
+ >
1158
+ <cngx-command-panel
1159
+ [results]="results()"
1160
+ [(scope)]="scope"
1161
+ [debounceMs]="debounceMs()"
1162
+ [rowTpl]="rowTpl()"
1163
+ [groupHeaderTpl]="groupHeaderTpl()"
1164
+ [emptyTpl]="emptyTpl()"
1165
+ />
1166
+ </cngx-command-panel-shell>
1167
+ <footer class="cngx-command-footer">
1168
+ @if (footerTpl(); as tpl) {
1169
+ <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{}" />
1170
+ } @else {
1171
+ @for (entry of copy().footerLegend; track entry.label) {
1172
+ <span class="cngx-command-legend">
1173
+ <kbd aria-hidden="true">{{ entry.keys }}</kbd>
1174
+ <span aria-hidden="true">{{ entry.label }}</span>
1175
+ <span class="cngx-sr-only">{{
1176
+ copy().legendEntry(entry.spokenKeys ?? entry.keys, entry.label)
1177
+ }}</span>
1178
+ </span>
1179
+ }
1180
+ }
1181
+ </footer>
1182
+ </dialog>
1183
+ `, isInline: true, styles: [".cngx-command-palette{--cngx-command-footer-gap: var(--cngx-space-md, 1rem);--cngx-command-footer-pad-y: var(--cngx-space-sm, .5rem);--cngx-command-footer-pad-x: var(--cngx-space-md, 1rem);--cngx-command-state-pad: var(--cngx-space-lg, 1.5rem);padding:0;inline-size:var(--cngx-command-width, min(40rem, calc(100vw - 2rem) ));max-block-size:var(--cngx-command-max-h, min(32rem, calc(100vh - 6rem) ));overflow:hidden;border:var(--cngx-command-border-width, 1px) solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb));border-radius:var(--cngx-command-radius, var(--cngx-radius-lg, .75rem));background:var(--cngx-command-bg, var(--cngx-color-surface, #ffffff));color:var(--cngx-command-color, inherit);box-shadow:var(--cngx-command-shadow, 0 10px 40px rgb(0 0 0 / .2))}.cngx-command-palette[open]{display:flex;flex-direction:column}.cngx-command-palette::backdrop{background:var(--cngx-command-backdrop, rgb(0 0 0 / .4))}@media(forced-colors:active){.cngx-command-palette{border-color:CanvasText}}.cngx-command-state{padding:var(--cngx-command-state-pad, var(--cngx-space-lg, 1.5rem));text-align:center;color:var(--cngx-command-state-color, var(--cngx-color-muted-foreground, #6b7280))}.cngx-command-state--error{color:var(--cngx-command-error-color, var(--cngx-color-danger, #dc2626))}.cngx-command-state--error-banner{padding:var(--cngx-space-sm, .5rem) var(--cngx-space-md, 1rem);color:var(--cngx-command-error-color, var(--cngx-color-danger, #dc2626))}.cngx-command-retry{min-block-size:var(--cngx-target-min, 0px);margin-inline-start:var(--cngx-space-sm, .5rem);padding-inline:var(--cngx-space-md, 1rem);font:inherit;color:inherit;cursor:pointer;background:var(--cngx-command-retry-bg, transparent);border:1px solid currentColor;border-radius:var(--cngx-radius-sm, .25rem)}.cngx-command-retry:focus-visible{outline:var(--cngx-command-focus-outline, 2px solid var(--cngx-color-focus, #2563eb));outline-offset:2px}.cngx-command-footer{display:flex;flex-wrap:wrap;gap:var(--cngx-command-footer-gap, var(--cngx-space-md, 1rem));padding:var(--cngx-command-footer-pad-y, var(--cngx-space-sm, .5rem)) var(--cngx-command-footer-pad-x, var(--cngx-space-md, 1rem));border-block-start:var(--cngx-command-border-width, 1px) solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb));font-size:var(--cngx-command-footer-size, .75rem);color:var(--cngx-command-footer-color, var(--cngx-color-muted-foreground, #6b7280))}.cngx-command-legend{display:inline-flex;align-items:center;gap:var(--cngx-space-xs, .25rem)}.cngx-command-legend kbd{padding:.1em .4em;font-family:inherit;font-size:.9em;color:var(--cngx-command-kbd-color, inherit);background:var(--cngx-command-kbd-bg, var(--cngx-color-muted, #f3f4f6));border:1px solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb));border-radius:var(--cngx-radius-xs, .1875rem)}\n"], dependencies: [{ kind: "directive", type: CngxDialog, selector: "dialog[cngxDialog]", inputs: ["modal", "closeOnBackdropClick", "closeOnEscape", "autoFocus", "focusFallback", "state", "submitAction", "error"], exportAs: ["cngxDialog"] }, { kind: "component", type: CngxCommandPanelShell, selector: "cngx-command-panel-shell", inputs: ["results", "loadingTpl", "errorTpl"], outputs: ["retry"] }, { kind: "component", type: CngxCommandPanel, selector: "cngx-command-panel", inputs: ["results", "scope", "debounceMs", "rowTpl", "groupHeaderTpl", "emptyTpl"], outputs: ["scopeChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1184
+ }
1185
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPalette, decorators: [{
1186
+ type: Component,
1187
+ args: [{ selector: 'cngx-command-palette', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CngxDialog, CngxCommandPanelShell, CngxCommandPanel, NgTemplateOutlet], providers: [{ provide: CNGX_COMMAND_PALETTE_HOST, useExisting: CngxCommandPalette }], template: `
1188
+ <dialog
1189
+ cngxDialog
1190
+ #dialog="cngxDialog"
1191
+ class="cngx-command-palette"
1192
+ [attr.aria-label]="resolvedAriaLabel()"
1193
+ >
1194
+ <cngx-command-panel-shell
1195
+ [results]="results()"
1196
+ [loadingTpl]="loadingTpl()"
1197
+ [errorTpl]="errorTpl()"
1198
+ (retry)="retry.emit()"
1199
+ >
1200
+ <cngx-command-panel
1201
+ [results]="results()"
1202
+ [(scope)]="scope"
1203
+ [debounceMs]="debounceMs()"
1204
+ [rowTpl]="rowTpl()"
1205
+ [groupHeaderTpl]="groupHeaderTpl()"
1206
+ [emptyTpl]="emptyTpl()"
1207
+ />
1208
+ </cngx-command-panel-shell>
1209
+ <footer class="cngx-command-footer">
1210
+ @if (footerTpl(); as tpl) {
1211
+ <ng-container [ngTemplateOutlet]="tpl" [ngTemplateOutletContext]="{}" />
1212
+ } @else {
1213
+ @for (entry of copy().footerLegend; track entry.label) {
1214
+ <span class="cngx-command-legend">
1215
+ <kbd aria-hidden="true">{{ entry.keys }}</kbd>
1216
+ <span aria-hidden="true">{{ entry.label }}</span>
1217
+ <span class="cngx-sr-only">{{
1218
+ copy().legendEntry(entry.spokenKeys ?? entry.keys, entry.label)
1219
+ }}</span>
1220
+ </span>
1221
+ }
1222
+ }
1223
+ </footer>
1224
+ </dialog>
1225
+ `, styles: [".cngx-command-palette{--cngx-command-footer-gap: var(--cngx-space-md, 1rem);--cngx-command-footer-pad-y: var(--cngx-space-sm, .5rem);--cngx-command-footer-pad-x: var(--cngx-space-md, 1rem);--cngx-command-state-pad: var(--cngx-space-lg, 1.5rem);padding:0;inline-size:var(--cngx-command-width, min(40rem, calc(100vw - 2rem) ));max-block-size:var(--cngx-command-max-h, min(32rem, calc(100vh - 6rem) ));overflow:hidden;border:var(--cngx-command-border-width, 1px) solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb));border-radius:var(--cngx-command-radius, var(--cngx-radius-lg, .75rem));background:var(--cngx-command-bg, var(--cngx-color-surface, #ffffff));color:var(--cngx-command-color, inherit);box-shadow:var(--cngx-command-shadow, 0 10px 40px rgb(0 0 0 / .2))}.cngx-command-palette[open]{display:flex;flex-direction:column}.cngx-command-palette::backdrop{background:var(--cngx-command-backdrop, rgb(0 0 0 / .4))}@media(forced-colors:active){.cngx-command-palette{border-color:CanvasText}}.cngx-command-state{padding:var(--cngx-command-state-pad, var(--cngx-space-lg, 1.5rem));text-align:center;color:var(--cngx-command-state-color, var(--cngx-color-muted-foreground, #6b7280))}.cngx-command-state--error{color:var(--cngx-command-error-color, var(--cngx-color-danger, #dc2626))}.cngx-command-state--error-banner{padding:var(--cngx-space-sm, .5rem) var(--cngx-space-md, 1rem);color:var(--cngx-command-error-color, var(--cngx-color-danger, #dc2626))}.cngx-command-retry{min-block-size:var(--cngx-target-min, 0px);margin-inline-start:var(--cngx-space-sm, .5rem);padding-inline:var(--cngx-space-md, 1rem);font:inherit;color:inherit;cursor:pointer;background:var(--cngx-command-retry-bg, transparent);border:1px solid currentColor;border-radius:var(--cngx-radius-sm, .25rem)}.cngx-command-retry:focus-visible{outline:var(--cngx-command-focus-outline, 2px solid var(--cngx-color-focus, #2563eb));outline-offset:2px}.cngx-command-footer{display:flex;flex-wrap:wrap;gap:var(--cngx-command-footer-gap, var(--cngx-space-md, 1rem));padding:var(--cngx-command-footer-pad-y, var(--cngx-space-sm, .5rem)) var(--cngx-command-footer-pad-x, var(--cngx-space-md, 1rem));border-block-start:var(--cngx-command-border-width, 1px) solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb));font-size:var(--cngx-command-footer-size, .75rem);color:var(--cngx-command-footer-color, var(--cngx-color-muted-foreground, #6b7280))}.cngx-command-legend{display:inline-flex;align-items:center;gap:var(--cngx-space-xs, .25rem)}.cngx-command-legend kbd{padding:.1em .4em;font-family:inherit;font-size:.9em;color:var(--cngx-command-kbd-color, inherit);background:var(--cngx-command-kbd-bg, var(--cngx-color-muted, #f3f4f6));border:1px solid var(--cngx-command-border, var(--cngx-color-border, #e5e7eb));border-radius:var(--cngx-radius-xs, .1875rem)}\n"] }]
1226
+ }], ctorParameters: () => [], propDecorators: { results: [{ type: i0.Input, args: [{ isSignal: true, alias: "results", required: false }] }], scope: [{ type: i0.Input, args: [{ isSignal: true, alias: "scope", required: false }] }, { type: i0.Output, args: ["scopeChange"] }], debounceMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounceMs", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], openShortcut: [{ type: i0.Input, args: [{ isSignal: true, alias: "openShortcut", required: false }] }], retry: [{ type: i0.Output, args: ["retry"] }], rowSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxCommandRow), { isSignal: true }] }], groupHeaderSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxCommandGroupHeader), { isSignal: true }] }], emptySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxCommandPaletteEmpty), { isSignal: true }] }], loadingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxCommandPaletteLoading), { isSignal: true }] }], errorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxCommandPaletteError), { isSignal: true }] }], footerSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxCommandPaletteFooter), { isSignal: true }] }], dialog: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CngxDialog), { isSignal: true }] }] } });
1227
+
1228
+ /**
1229
+ * Optional explicit trigger for a {@link CngxCommandPalette}. Opens the palette
1230
+ * on click and advertises the popup relationship to assistive tech:
1231
+ * `aria-haspopup="dialog"` plus `aria-expanded` derived from the palette's
1232
+ * `isOpen()` host seam, so the trigger communicates the open state without any
1233
+ * synced local flag. Pass the palette by template reference - orthogonal
1234
+ * composition, no ancestor injection.
1235
+ *
1236
+ * ```html
1237
+ * <button [cngxCommandPaletteTrigger]="palette">
1238
+ * Search <kbd>Cmd K</kbd>
1239
+ * </button>
1240
+ * <cngx-command-palette #palette />
1241
+ * ```
1242
+ *
1243
+ * @category ui/command-palette
1244
+ * @wcag AA
1245
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/command-palette/palette/command-palette-trigger.directive.ts
1246
+ * @since 0.1.0
1247
+ * @relatedTo CngxCommandPalette
1248
+ */
1249
+ class CngxCommandPaletteTrigger {
1250
+ /** The palette this trigger opens. */
1251
+ palette = input.required({ ...(ngDevMode ? { debugName: "palette" } : /* istanbul ignore next */ {}), alias: 'cngxCommandPaletteTrigger' });
1252
+ open() {
1253
+ this.palette().open();
1254
+ }
1255
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1256
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxCommandPaletteTrigger, isStandalone: true, selector: "[cngxCommandPaletteTrigger]", inputs: { palette: { classPropertyName: "palette", publicName: "cngxCommandPaletteTrigger", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "open()" }, properties: { "attr.aria-haspopup": "\"dialog\"", "attr.aria-expanded": "palette().isOpen()" } }, exportAs: ["cngxCommandPaletteTrigger"], ngImport: i0 });
1257
+ }
1258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCommandPaletteTrigger, decorators: [{
1259
+ type: Directive,
1260
+ args: [{
1261
+ selector: '[cngxCommandPaletteTrigger]',
1262
+ exportAs: 'cngxCommandPaletteTrigger',
1263
+ standalone: true,
1264
+ host: {
1265
+ '[attr.aria-haspopup]': '"dialog"',
1266
+ '[attr.aria-expanded]': 'palette().isOpen()',
1267
+ '(click)': 'open()',
1268
+ },
1269
+ }]
1270
+ }], propDecorators: { palette: [{ type: i0.Input, args: [{ isSignal: true, alias: "cngxCommandPaletteTrigger", required: true }] }] } });
1271
+
1272
+ /**
1273
+ * @module @cngx/ui/command-palette
1274
+ */
1275
+
1276
+ /**
1277
+ * Generated bundle index. Do not edit.
1278
+ */
1279
+
1280
+ export { CNGX_COMMAND_PALETTE_CONFIG, CNGX_COMMAND_PALETTE_HOST, CNGX_COMMAND_PALETTE_LANGUAGE_EN, CNGX_PALETTE_KEYBINDING_FACTORY, CngxCommandGroupHeader, CngxCommandPalette, CngxCommandPaletteEmpty, CngxCommandPaletteError, CngxCommandPaletteFooter, CngxCommandPaletteLoading, CngxCommandPaletteTrigger, CngxCommandRow, createPaletteKeybinding, injectCommandPaletteConfig, provideCommandPaletteConfig, provideCommandPaletteConfigAt, withCommandPaletteLabels, withCommandPaletteTemplates, withKeyboardLegend, withPaletteShortcut, withResultCountFormatter };
1281
+ //# sourceMappingURL=cngx-ui-command-palette.mjs.map