@chromvoid/uikit 0.1.0
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.
- package/LICENSE +8 -0
- package/README.md +96 -0
- package/dist/components/cv-accordion-item.d.ts +69 -0
- package/dist/components/cv-accordion-item.js +176 -0
- package/dist/components/cv-accordion.d.ts +79 -0
- package/dist/components/cv-accordion.js +310 -0
- package/dist/components/cv-alert-dialog.d.ts +86 -0
- package/dist/components/cv-alert-dialog.js +393 -0
- package/dist/components/cv-alert.d.ts +48 -0
- package/dist/components/cv-alert.js +156 -0
- package/dist/components/cv-badge.d.ts +56 -0
- package/dist/components/cv-badge.js +280 -0
- package/dist/components/cv-breadcrumb-item.d.ts +35 -0
- package/dist/components/cv-breadcrumb-item.js +64 -0
- package/dist/components/cv-breadcrumb.d.ts +39 -0
- package/dist/components/cv-breadcrumb.js +160 -0
- package/dist/components/cv-button.d.ts +83 -0
- package/dist/components/cv-button.js +541 -0
- package/dist/components/cv-callout.d.ts +32 -0
- package/dist/components/cv-callout.js +221 -0
- package/dist/components/cv-card.d.ts +48 -0
- package/dist/components/cv-card.js +269 -0
- package/dist/components/cv-carousel-slide.d.ts +25 -0
- package/dist/components/cv-carousel-slide.js +51 -0
- package/dist/components/cv-carousel.d.ts +96 -0
- package/dist/components/cv-carousel.js +457 -0
- package/dist/components/cv-checkbox.d.ts +84 -0
- package/dist/components/cv-checkbox.js +274 -0
- package/dist/components/cv-combobox-group.d.ts +15 -0
- package/dist/components/cv-combobox-group.js +34 -0
- package/dist/components/cv-combobox-option.d.ts +30 -0
- package/dist/components/cv-combobox-option.js +66 -0
- package/dist/components/cv-combobox.d.ts +135 -0
- package/dist/components/cv-combobox.js +834 -0
- package/dist/components/cv-command-item.d.ts +30 -0
- package/dist/components/cv-command-item.js +68 -0
- package/dist/components/cv-command-palette.d.ts +105 -0
- package/dist/components/cv-command-palette.js +578 -0
- package/dist/components/cv-context-menu.d.ts +98 -0
- package/dist/components/cv-context-menu.js +515 -0
- package/dist/components/cv-copy-button.d.ts +61 -0
- package/dist/components/cv-copy-button.js +318 -0
- package/dist/components/cv-date-picker.d.ts +161 -0
- package/dist/components/cv-date-picker.js +803 -0
- package/dist/components/cv-dialog.d.ts +89 -0
- package/dist/components/cv-dialog.js +459 -0
- package/dist/components/cv-disclosure.d.ts +57 -0
- package/dist/components/cv-disclosure.js +241 -0
- package/dist/components/cv-drawer.d.ts +102 -0
- package/dist/components/cv-drawer.js +595 -0
- package/dist/components/cv-feed-article.d.ts +26 -0
- package/dist/components/cv-feed-article.js +52 -0
- package/dist/components/cv-feed.d.ts +62 -0
- package/dist/components/cv-feed.js +310 -0
- package/dist/components/cv-grid-cell.d.ts +30 -0
- package/dist/components/cv-grid-cell.js +57 -0
- package/dist/components/cv-grid-column.d.ts +30 -0
- package/dist/components/cv-grid-column.js +43 -0
- package/dist/components/cv-grid-row.d.ts +30 -0
- package/dist/components/cv-grid-row.js +42 -0
- package/dist/components/cv-grid.d.ts +119 -0
- package/dist/components/cv-grid.js +567 -0
- package/dist/components/cv-icon.d.ts +57 -0
- package/dist/components/cv-icon.js +352 -0
- package/dist/components/cv-input.d.ts +127 -0
- package/dist/components/cv-input.js +482 -0
- package/dist/components/cv-landmark.d.ts +32 -0
- package/dist/components/cv-landmark.js +62 -0
- package/dist/components/cv-link.d.ts +22 -0
- package/dist/components/cv-link.js +99 -0
- package/dist/components/cv-listbox-group.d.ts +15 -0
- package/dist/components/cv-listbox-group.js +42 -0
- package/dist/components/cv-listbox.d.ts +81 -0
- package/dist/components/cv-listbox.js +388 -0
- package/dist/components/cv-menu-button.d.ts +118 -0
- package/dist/components/cv-menu-button.js +822 -0
- package/dist/components/cv-menu-group.d.ts +20 -0
- package/dist/components/cv-menu-group.js +48 -0
- package/dist/components/cv-menu-item.d.ts +52 -0
- package/dist/components/cv-menu-item.js +105 -0
- package/dist/components/cv-menu.d.ts +62 -0
- package/dist/components/cv-menu.js +414 -0
- package/dist/components/cv-meter.d.ts +66 -0
- package/dist/components/cv-meter.js +154 -0
- package/dist/components/cv-number.d.ts +139 -0
- package/dist/components/cv-number.js +553 -0
- package/dist/components/cv-option.d.ts +30 -0
- package/dist/components/cv-option.js +84 -0
- package/dist/components/cv-popover.d.ts +87 -0
- package/dist/components/cv-popover.js +373 -0
- package/dist/components/cv-progress-ring.d.ts +45 -0
- package/dist/components/cv-progress-ring.js +169 -0
- package/dist/components/cv-progress.d.ts +45 -0
- package/dist/components/cv-progress.js +148 -0
- package/dist/components/cv-radio-group.d.ts +79 -0
- package/dist/components/cv-radio-group.js +398 -0
- package/dist/components/cv-radio.d.ts +36 -0
- package/dist/components/cv-radio.js +123 -0
- package/dist/components/cv-select-group.d.ts +15 -0
- package/dist/components/cv-select-group.js +44 -0
- package/dist/components/cv-select-option.d.ts +30 -0
- package/dist/components/cv-select-option.js +66 -0
- package/dist/components/cv-select.d.ts +128 -0
- package/dist/components/cv-select.js +666 -0
- package/dist/components/cv-sidebar-item.d.ts +26 -0
- package/dist/components/cv-sidebar-item.js +142 -0
- package/dist/components/cv-sidebar.d.ts +171 -0
- package/dist/components/cv-sidebar.js +767 -0
- package/dist/components/cv-slider-multi-thumb.d.ts +73 -0
- package/dist/components/cv-slider-multi-thumb.js +374 -0
- package/dist/components/cv-slider.d.ts +84 -0
- package/dist/components/cv-slider.js +328 -0
- package/dist/components/cv-spinbutton.d.ts +121 -0
- package/dist/components/cv-spinbutton.js +486 -0
- package/dist/components/cv-spinner.d.ts +18 -0
- package/dist/components/cv-spinner.js +95 -0
- package/dist/components/cv-switch.d.ts +81 -0
- package/dist/components/cv-switch.js +285 -0
- package/dist/components/cv-tab-panel.d.ts +20 -0
- package/dist/components/cv-tab-panel.js +37 -0
- package/dist/components/cv-tab.d.ts +40 -0
- package/dist/components/cv-tab.js +132 -0
- package/dist/components/cv-table-cell.d.ts +31 -0
- package/dist/components/cv-table-cell.js +49 -0
- package/dist/components/cv-table-column.d.ts +37 -0
- package/dist/components/cv-table-column.js +63 -0
- package/dist/components/cv-table-row.d.ts +30 -0
- package/dist/components/cv-table-row.js +45 -0
- package/dist/components/cv-table.d.ts +147 -0
- package/dist/components/cv-table.js +607 -0
- package/dist/components/cv-tabs.d.ts +70 -0
- package/dist/components/cv-tabs.js +524 -0
- package/dist/components/cv-textarea.d.ts +108 -0
- package/dist/components/cv-textarea.js +328 -0
- package/dist/components/cv-toast-region.d.ts +39 -0
- package/dist/components/cv-toast-region.js +162 -0
- package/dist/components/cv-toast.d.ts +67 -0
- package/dist/components/cv-toast.js +315 -0
- package/dist/components/cv-toolbar-item.d.ts +25 -0
- package/dist/components/cv-toolbar-item.js +72 -0
- package/dist/components/cv-toolbar-separator.d.ts +25 -0
- package/dist/components/cv-toolbar-separator.js +45 -0
- package/dist/components/cv-toolbar.d.ts +63 -0
- package/dist/components/cv-toolbar.js +295 -0
- package/dist/components/cv-tooltip.d.ts +83 -0
- package/dist/components/cv-tooltip.js +455 -0
- package/dist/components/cv-treegrid-cell.d.ts +30 -0
- package/dist/components/cv-treegrid-cell.js +57 -0
- package/dist/components/cv-treegrid-column.d.ts +37 -0
- package/dist/components/cv-treegrid-column.js +53 -0
- package/dist/components/cv-treegrid-row.d.ts +55 -0
- package/dist/components/cv-treegrid-row.js +90 -0
- package/dist/components/cv-treegrid.d.ts +96 -0
- package/dist/components/cv-treegrid.js +632 -0
- package/dist/components/cv-treeitem.d.ts +58 -0
- package/dist/components/cv-treeitem.js +144 -0
- package/dist/components/cv-treeview.d.ts +70 -0
- package/dist/components/cv-treeview.js +396 -0
- package/dist/components/cv-window-splitter.d.ts +79 -0
- package/dist/components/cv-window-splitter.js +316 -0
- package/dist/components/index.d.ts +94 -0
- package/dist/components/index.js +79 -0
- package/dist/dialog/create-dialog-controller.d.ts +31 -0
- package/dist/dialog/create-dialog-controller.js +320 -0
- package/dist/dialog/index.d.ts +2 -0
- package/dist/dialog/index.js +1 -0
- package/dist/form-associated/FormAssociatedReatomElement.d.ts +25 -0
- package/dist/form-associated/FormAssociatedReatomElement.js +70 -0
- package/dist/form-associated/withFormAssociated.d.ts +5 -0
- package/dist/form-associated/withFormAssociated.js +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/reatom-lit/ReatomLitElement.d.ts +27 -0
- package/dist/reatom-lit/ReatomLitElement.js +118 -0
- package/dist/reatom-lit/html.d.ts +4 -0
- package/dist/reatom-lit/html.js +10 -0
- package/dist/reatom-lit/index.d.ts +4 -0
- package/dist/reatom-lit/index.js +4 -0
- package/dist/reatom-lit/watch.d.ts +15 -0
- package/dist/reatom-lit/watch.js +40 -0
- package/dist/reatom-lit/withReatomElement.d.ts +4 -0
- package/dist/reatom-lit/withReatomElement.js +57 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +84 -0
- package/dist/styles/component-styles.d.ts +4 -0
- package/dist/styles/component-styles.js +78 -0
- package/dist/theme/cv-theme-provider.d.ts +32 -0
- package/dist/theme/cv-theme-provider.js +110 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/theme-engine.d.ts +4 -0
- package/dist/theme/theme-engine.js +67 -0
- package/dist/theme/tokens.css +265 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/types.js +1 -0
- package/dist/toast/create-toast-controller.d.ts +12 -0
- package/dist/toast/create-toast-controller.js +12 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +1 -0
- package/package.json +146 -0
- package/specs/_template.md +110 -0
- package/specs/components/accordion.md +207 -0
- package/specs/components/alert.md +83 -0
- package/specs/components/badge.md +183 -0
- package/specs/components/breadcrumb.md +152 -0
- package/specs/components/button.md +227 -0
- package/specs/components/callout.md +153 -0
- package/specs/components/card.md +192 -0
- package/specs/components/carousel.md +232 -0
- package/specs/components/checkbox.md +141 -0
- package/specs/components/combobox.md +427 -0
- package/specs/components/context-menu.md +375 -0
- package/specs/components/copy-button.md +236 -0
- package/specs/components/date-picker.md +290 -0
- package/specs/components/dialog.md +184 -0
- package/specs/components/disclosure.md +151 -0
- package/specs/components/drawer.md +216 -0
- package/specs/components/feed.md +266 -0
- package/specs/components/grid.md +423 -0
- package/specs/components/input.md +237 -0
- package/specs/components/landmark.md +92 -0
- package/specs/components/link.md +117 -0
- package/specs/components/listbox.md +327 -0
- package/specs/components/menu.md +508 -0
- package/specs/components/meter.md +148 -0
- package/specs/components/number.md +268 -0
- package/specs/components/option.md +167 -0
- package/specs/components/popover.md +207 -0
- package/specs/components/progress-ring.md +134 -0
- package/specs/components/progress.md +110 -0
- package/specs/components/radio.md +208 -0
- package/specs/components/select.md +305 -0
- package/specs/components/sidebar.md +204 -0
- package/specs/components/spinbutton.md +157 -0
- package/specs/components/spinner.md +83 -0
- package/specs/components/switch.md +145 -0
- package/specs/components/table.md +372 -0
- package/specs/components/tabs.md +242 -0
- package/specs/components/textarea.md +166 -0
- package/specs/components/theme.md +364 -0
- package/specs/components/toast.md +198 -0
- package/specs/components/toolbar.md +258 -0
- package/specs/components/tooltip.md +152 -0
- package/specs/components/treegrid.md +363 -0
- package/specs/components/treeview.md +263 -0
- package/specs/components/window-splitter.md +225 -0
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import { createCommandPalette } from '@chromvoid/headless-ui/command-palette';
|
|
2
|
+
import { css, html, nothing } from 'lit';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
import { CVCommandItem } from './cv-command-item.js';
|
|
5
|
+
const commandPaletteKeysToPrevent = new Set(['ArrowUp', 'ArrowDown', 'Home', 'End', 'Enter', 'Escape']);
|
|
6
|
+
let cvCommandPaletteNonce = 0;
|
|
7
|
+
export class CVCommandPalette extends ReatomLitElement {
|
|
8
|
+
static elementName = 'cv-command-palette';
|
|
9
|
+
static get properties() {
|
|
10
|
+
return {
|
|
11
|
+
value: { type: String, reflect: true },
|
|
12
|
+
inputValue: { type: String, attribute: 'input-value' },
|
|
13
|
+
open: { type: Boolean, reflect: true },
|
|
14
|
+
lastExecutedValue: { attribute: false },
|
|
15
|
+
placeholder: { type: String },
|
|
16
|
+
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
17
|
+
openShortcutKey: { type: String, attribute: 'open-shortcut-key' },
|
|
18
|
+
closeOnExecute: { type: Boolean, attribute: 'close-on-execute', reflect: true },
|
|
19
|
+
closeOnOutsidePointer: { type: Boolean, attribute: 'close-on-outside-pointer', reflect: true },
|
|
20
|
+
listenGlobalShortcut: { type: Boolean, attribute: 'listen-global-shortcut', reflect: true },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
idBase = `cv-command-palette-${++cvCommandPaletteNonce}`;
|
|
24
|
+
itemRecords = [];
|
|
25
|
+
itemListeners = new WeakMap();
|
|
26
|
+
model;
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.value = '';
|
|
30
|
+
this.inputValue = '';
|
|
31
|
+
this.open = false;
|
|
32
|
+
this.lastExecutedValue = null;
|
|
33
|
+
this.placeholder = '';
|
|
34
|
+
this.ariaLabel = '';
|
|
35
|
+
this.openShortcutKey = 'k';
|
|
36
|
+
this.closeOnExecute = true;
|
|
37
|
+
this.closeOnOutsidePointer = true;
|
|
38
|
+
this.listenGlobalShortcut = true;
|
|
39
|
+
}
|
|
40
|
+
static styles = [
|
|
41
|
+
css `
|
|
42
|
+
:host {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[part='base'] {
|
|
47
|
+
display: inline-grid;
|
|
48
|
+
gap: var(--cv-space-1, 4px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[part='trigger'] {
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
min-block-size: 36px;
|
|
56
|
+
padding: 0 var(--cv-space-3, 12px);
|
|
57
|
+
border-radius: var(--cv-radius-sm, 6px);
|
|
58
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
59
|
+
background: var(--cv-color-surface, #141923);
|
|
60
|
+
color: var(--cv-color-text, #e8ecf6);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[part='trigger']:focus-visible {
|
|
64
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
65
|
+
outline-offset: 1px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[part='dialog'] {
|
|
69
|
+
position: fixed;
|
|
70
|
+
inset-inline: 16px;
|
|
71
|
+
inset-block-start: 10vh;
|
|
72
|
+
z-index: 90;
|
|
73
|
+
inline-size: min(640px, calc(100vw - 32px));
|
|
74
|
+
margin-inline: auto;
|
|
75
|
+
display: grid;
|
|
76
|
+
gap: var(--cv-space-2, 8px);
|
|
77
|
+
padding: var(--cv-space-3, 12px);
|
|
78
|
+
border-radius: var(--cv-radius-lg, 14px);
|
|
79
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
80
|
+
background: var(--cv-color-surface-elevated, #1d2432);
|
|
81
|
+
box-shadow: var(--cv-shadow-2, 0 8px 30px rgba(0, 0, 0, 0.35));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[part='dialog'][hidden] {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[part='input'] {
|
|
89
|
+
inline-size: 100%;
|
|
90
|
+
min-block-size: 38px;
|
|
91
|
+
border-radius: var(--cv-radius-sm, 6px);
|
|
92
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
93
|
+
background: var(--cv-color-surface, #141923);
|
|
94
|
+
color: var(--cv-color-text, #e8ecf6);
|
|
95
|
+
padding: 0 var(--cv-space-3, 12px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[part='input']:focus-visible {
|
|
99
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
100
|
+
outline-offset: 1px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[part='listbox'] {
|
|
104
|
+
display: grid;
|
|
105
|
+
gap: var(--cv-space-1, 4px);
|
|
106
|
+
max-block-size: min(420px, 60vh);
|
|
107
|
+
overflow: auto;
|
|
108
|
+
padding: var(--cv-space-1, 4px);
|
|
109
|
+
border-radius: var(--cv-radius-md, 10px);
|
|
110
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
111
|
+
background: var(--cv-color-surface, #141923);
|
|
112
|
+
}
|
|
113
|
+
`,
|
|
114
|
+
];
|
|
115
|
+
static define() {
|
|
116
|
+
if (!customElements.get(this.elementName)) {
|
|
117
|
+
customElements.define(this.elementName, this);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
connectedCallback() {
|
|
121
|
+
super.connectedCallback();
|
|
122
|
+
if (!this.model) {
|
|
123
|
+
this.rebuildModelFromSlot(false, false);
|
|
124
|
+
}
|
|
125
|
+
this.syncOutsidePointerListener();
|
|
126
|
+
this.syncGlobalShortcutListener();
|
|
127
|
+
}
|
|
128
|
+
disconnectedCallback() {
|
|
129
|
+
super.disconnectedCallback();
|
|
130
|
+
this.detachItemListeners();
|
|
131
|
+
this.syncOutsidePointerListener(true);
|
|
132
|
+
this.syncGlobalShortcutListener(true);
|
|
133
|
+
}
|
|
134
|
+
willUpdate(changedProperties) {
|
|
135
|
+
super.willUpdate(changedProperties);
|
|
136
|
+
if (changedProperties.has('ariaLabel') ||
|
|
137
|
+
changedProperties.has('openShortcutKey') ||
|
|
138
|
+
changedProperties.has('closeOnExecute') ||
|
|
139
|
+
changedProperties.has('closeOnOutsidePointer')) {
|
|
140
|
+
this.rebuildModelFromSlot(true, false);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (!this.model)
|
|
144
|
+
return;
|
|
145
|
+
if (changedProperties.has('open') && this.model.state.isOpen() !== this.open) {
|
|
146
|
+
const previous = this.captureState();
|
|
147
|
+
if (this.open) {
|
|
148
|
+
this.model.actions.open();
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
this.model.actions.close();
|
|
152
|
+
}
|
|
153
|
+
this.applyInteractionResult(previous);
|
|
154
|
+
}
|
|
155
|
+
if (changedProperties.has('value')) {
|
|
156
|
+
const normalized = this.value.trim();
|
|
157
|
+
if (this.value !== normalized) {
|
|
158
|
+
this.value = normalized;
|
|
159
|
+
}
|
|
160
|
+
if (normalized.length > 0 && normalized !== this.model.state.selectedId()) {
|
|
161
|
+
const previous = this.captureState();
|
|
162
|
+
this.model.actions.execute(normalized);
|
|
163
|
+
this.applyInteractionResult(previous);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (changedProperties.has('inputValue') && this.model.state.inputValue() !== this.inputValue) {
|
|
167
|
+
const previous = this.captureState();
|
|
168
|
+
this.model.actions.setInputValue(this.inputValue);
|
|
169
|
+
this.applyInteractionResult(previous);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
updated(changedProperties) {
|
|
173
|
+
super.updated(changedProperties);
|
|
174
|
+
this.syncOutsidePointerListener();
|
|
175
|
+
this.syncGlobalShortcutListener();
|
|
176
|
+
if (!changedProperties.has('open') &&
|
|
177
|
+
!changedProperties.has('value') &&
|
|
178
|
+
!changedProperties.has('inputValue')) {
|
|
179
|
+
this.syncItemElements();
|
|
180
|
+
}
|
|
181
|
+
if (changedProperties.has('open') && this.open) {
|
|
182
|
+
this.focusInput();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
openPalette() {
|
|
186
|
+
if (!this.model)
|
|
187
|
+
return;
|
|
188
|
+
const previous = this.captureState();
|
|
189
|
+
this.model.actions.open();
|
|
190
|
+
this.applyInteractionResult(previous);
|
|
191
|
+
}
|
|
192
|
+
closePalette() {
|
|
193
|
+
if (!this.model)
|
|
194
|
+
return;
|
|
195
|
+
const previous = this.captureState();
|
|
196
|
+
this.model.actions.close();
|
|
197
|
+
this.applyInteractionResult(previous);
|
|
198
|
+
}
|
|
199
|
+
getItemElements() {
|
|
200
|
+
return Array.from(this.children).filter((element) => element.tagName.toLowerCase() === CVCommandItem.elementName);
|
|
201
|
+
}
|
|
202
|
+
ensureItemValue(item, index) {
|
|
203
|
+
const normalized = item.value?.trim();
|
|
204
|
+
if (normalized)
|
|
205
|
+
return normalized;
|
|
206
|
+
const fallback = `command-${index + 1}`;
|
|
207
|
+
item.value = fallback;
|
|
208
|
+
return fallback;
|
|
209
|
+
}
|
|
210
|
+
rebuildModelFromSlot(preserveState, requestRender = true) {
|
|
211
|
+
const itemElements = this.getItemElements();
|
|
212
|
+
const previous = preserveState
|
|
213
|
+
? this.captureState()
|
|
214
|
+
: {
|
|
215
|
+
value: this.value.trim() || null,
|
|
216
|
+
inputValue: this.inputValue,
|
|
217
|
+
activeId: null,
|
|
218
|
+
open: this.open,
|
|
219
|
+
lastExecutedValue: this.lastExecutedValue,
|
|
220
|
+
restoreTargetId: null,
|
|
221
|
+
};
|
|
222
|
+
this.detachItemListeners();
|
|
223
|
+
this.itemRecords = itemElements.map((element, index) => {
|
|
224
|
+
const id = this.ensureItemValue(element, index);
|
|
225
|
+
const label = element.textContent?.trim() || id;
|
|
226
|
+
return {
|
|
227
|
+
id,
|
|
228
|
+
label,
|
|
229
|
+
disabled: element.disabled,
|
|
230
|
+
element,
|
|
231
|
+
};
|
|
232
|
+
});
|
|
233
|
+
const validIds = new Set(this.itemRecords.map((record) => record.id));
|
|
234
|
+
const validEnabledIds = new Set(this.itemRecords.filter((record) => !record.disabled).map((record) => record.id));
|
|
235
|
+
this.model = createCommandPalette({
|
|
236
|
+
idBase: this.idBase,
|
|
237
|
+
commands: this.itemRecords.map((record) => ({
|
|
238
|
+
id: record.id,
|
|
239
|
+
label: record.label,
|
|
240
|
+
disabled: record.disabled,
|
|
241
|
+
})),
|
|
242
|
+
ariaLabel: this.ariaLabel || undefined,
|
|
243
|
+
initialOpen: previous.open,
|
|
244
|
+
openShortcutKey: this.openShortcutKey,
|
|
245
|
+
closeOnExecute: this.closeOnExecute,
|
|
246
|
+
closeOnOutsidePointer: this.closeOnOutsidePointer,
|
|
247
|
+
});
|
|
248
|
+
if (previous.value && validIds.has(previous.value)) {
|
|
249
|
+
this.model.state.selectedId.set(previous.value);
|
|
250
|
+
}
|
|
251
|
+
if (previous.activeId && validEnabledIds.has(previous.activeId)) {
|
|
252
|
+
this.model.state.activeId.set(previous.activeId);
|
|
253
|
+
}
|
|
254
|
+
if (previous.inputValue.length > 0) {
|
|
255
|
+
this.model.state.inputValue.set(previous.inputValue);
|
|
256
|
+
}
|
|
257
|
+
if (previous.lastExecutedValue && validIds.has(previous.lastExecutedValue)) {
|
|
258
|
+
this.model.state.lastExecutedId.set(previous.lastExecutedValue);
|
|
259
|
+
}
|
|
260
|
+
this.attachItemListeners();
|
|
261
|
+
this.syncItemElements();
|
|
262
|
+
this.value = this.model.state.selectedId() ?? '';
|
|
263
|
+
this.inputValue = this.model.state.inputValue();
|
|
264
|
+
this.open = this.model.state.isOpen();
|
|
265
|
+
this.lastExecutedValue = this.model.state.lastExecutedId();
|
|
266
|
+
if (requestRender) {
|
|
267
|
+
this.requestUpdate();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
detachItemListeners() {
|
|
271
|
+
for (const record of this.itemRecords) {
|
|
272
|
+
const listeners = this.itemListeners.get(record.element);
|
|
273
|
+
if (!listeners)
|
|
274
|
+
continue;
|
|
275
|
+
record.element.removeEventListener('click', listeners.click);
|
|
276
|
+
this.itemListeners.delete(record.element);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
attachItemListeners() {
|
|
280
|
+
if (!this.model)
|
|
281
|
+
return;
|
|
282
|
+
for (const record of this.itemRecords) {
|
|
283
|
+
const click = (event) => {
|
|
284
|
+
event.preventDefault();
|
|
285
|
+
this.handleItemClick(record.id);
|
|
286
|
+
};
|
|
287
|
+
record.element.addEventListener('click', click);
|
|
288
|
+
this.itemListeners.set(record.element, { click });
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
syncItemElements() {
|
|
292
|
+
if (!this.model)
|
|
293
|
+
return;
|
|
294
|
+
const visibleIds = new Set(this.model.contracts.getVisibleCommands().map((command) => command.id));
|
|
295
|
+
const currentSelectedId = this.model.state.selectedId();
|
|
296
|
+
for (const record of this.itemRecords) {
|
|
297
|
+
const props = this.model.contracts.getOptionProps(record.id);
|
|
298
|
+
record.element.id = props.id;
|
|
299
|
+
record.element.setAttribute('role', props.role);
|
|
300
|
+
record.element.setAttribute('tabindex', props.tabindex);
|
|
301
|
+
// Use selectedId directly because command palette execute() sets selectedId
|
|
302
|
+
// but the underlying combobox getOptionProps uses selectedIds which may not be in sync.
|
|
303
|
+
const isSelected = currentSelectedId === record.id;
|
|
304
|
+
record.element.setAttribute('aria-selected', isSelected ? 'true' : 'false');
|
|
305
|
+
if (props['aria-disabled']) {
|
|
306
|
+
record.element.setAttribute('aria-disabled', props['aria-disabled']);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
record.element.removeAttribute('aria-disabled');
|
|
310
|
+
}
|
|
311
|
+
record.element.setAttribute('data-active', props['data-active']);
|
|
312
|
+
record.element.active = props['data-active'] === 'true';
|
|
313
|
+
record.element.selected = isSelected;
|
|
314
|
+
record.element.disabled = props['aria-disabled'] === 'true';
|
|
315
|
+
record.element.hidden = !this.open || !visibleIds.has(record.id);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
captureState() {
|
|
319
|
+
return {
|
|
320
|
+
value: this.model?.state.selectedId() ?? (this.value.trim() || null),
|
|
321
|
+
inputValue: this.model?.state.inputValue() ?? this.inputValue,
|
|
322
|
+
activeId: this.model?.state.activeId() ?? null,
|
|
323
|
+
open: this.model?.state.isOpen() ?? this.open,
|
|
324
|
+
lastExecutedValue: this.model?.state.lastExecutedId() ?? this.lastExecutedValue,
|
|
325
|
+
restoreTargetId: this.model?.state.restoreTargetId() ?? null,
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
dispatchInput(detail) {
|
|
329
|
+
this.dispatchEvent(new CustomEvent('cv-input', {
|
|
330
|
+
detail,
|
|
331
|
+
bubbles: true,
|
|
332
|
+
composed: true,
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
335
|
+
dispatchChange(detail) {
|
|
336
|
+
this.dispatchEvent(new CustomEvent('cv-change', {
|
|
337
|
+
detail,
|
|
338
|
+
bubbles: true,
|
|
339
|
+
composed: true,
|
|
340
|
+
}));
|
|
341
|
+
}
|
|
342
|
+
dispatchExecute(detail) {
|
|
343
|
+
this.dispatchEvent(new CustomEvent('cv-execute', {
|
|
344
|
+
detail,
|
|
345
|
+
bubbles: true,
|
|
346
|
+
composed: true,
|
|
347
|
+
}));
|
|
348
|
+
}
|
|
349
|
+
focusInput() {
|
|
350
|
+
const input = this.shadowRoot?.querySelector('[part="input"]');
|
|
351
|
+
input?.focus();
|
|
352
|
+
}
|
|
353
|
+
applyInteractionResult(previous) {
|
|
354
|
+
if (!this.model)
|
|
355
|
+
return;
|
|
356
|
+
const next = this.captureState();
|
|
357
|
+
this.value = next.value ?? '';
|
|
358
|
+
this.inputValue = next.inputValue;
|
|
359
|
+
this.open = next.open;
|
|
360
|
+
this.lastExecutedValue = next.lastExecutedValue;
|
|
361
|
+
this.syncItemElements();
|
|
362
|
+
const valueChanged = previous.value !== next.value;
|
|
363
|
+
const inputChanged = previous.inputValue !== next.inputValue;
|
|
364
|
+
const activeChanged = previous.activeId !== next.activeId;
|
|
365
|
+
const openChanged = previous.open !== next.open;
|
|
366
|
+
const executedChanged = previous.lastExecutedValue !== next.lastExecutedValue;
|
|
367
|
+
if (valueChanged || inputChanged || activeChanged || openChanged || executedChanged) {
|
|
368
|
+
const detail = {
|
|
369
|
+
value: next.value,
|
|
370
|
+
inputValue: next.inputValue,
|
|
371
|
+
activeId: next.activeId,
|
|
372
|
+
open: next.open,
|
|
373
|
+
lastExecutedValue: next.lastExecutedValue,
|
|
374
|
+
};
|
|
375
|
+
this.dispatchInput(detail);
|
|
376
|
+
if (valueChanged) {
|
|
377
|
+
this.dispatchChange(detail);
|
|
378
|
+
}
|
|
379
|
+
if (executedChanged && next.lastExecutedValue) {
|
|
380
|
+
this.dispatchExecute(detail);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (!next.open && next.restoreTargetId && previous.restoreTargetId !== next.restoreTargetId) {
|
|
384
|
+
const trigger = this.shadowRoot?.querySelector(`[id="${next.restoreTargetId}"]`);
|
|
385
|
+
trigger?.focus();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
syncOutsidePointerListener(forceOff = false) {
|
|
389
|
+
const shouldListen = !forceOff && this.open;
|
|
390
|
+
if (shouldListen) {
|
|
391
|
+
document.addEventListener('pointerdown', this.handleDocumentPointerDown);
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
document.removeEventListener('pointerdown', this.handleDocumentPointerDown);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
syncGlobalShortcutListener(forceOff = false) {
|
|
398
|
+
const shouldListen = !forceOff && this.listenGlobalShortcut;
|
|
399
|
+
if (shouldListen) {
|
|
400
|
+
document.addEventListener('keydown', this.handleDocumentKeyDown);
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
document.removeEventListener('keydown', this.handleDocumentKeyDown);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
handleDocumentPointerDown = (event) => {
|
|
407
|
+
if (!this.model || !this.model.state.isOpen())
|
|
408
|
+
return;
|
|
409
|
+
const path = event.composedPath();
|
|
410
|
+
if (path.includes(this))
|
|
411
|
+
return;
|
|
412
|
+
const previous = this.captureState();
|
|
413
|
+
this.model.actions.handleOutsidePointer();
|
|
414
|
+
this.applyInteractionResult(previous);
|
|
415
|
+
};
|
|
416
|
+
handleDocumentKeyDown = (event) => {
|
|
417
|
+
if (!this.model || !this.listenGlobalShortcut)
|
|
418
|
+
return;
|
|
419
|
+
const isShortcut = (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === this.openShortcutKey.toLowerCase();
|
|
420
|
+
if (!isShortcut)
|
|
421
|
+
return;
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
const previous = this.captureState();
|
|
424
|
+
this.model.actions.handleGlobalKeyDown({
|
|
425
|
+
key: event.key,
|
|
426
|
+
shiftKey: event.shiftKey,
|
|
427
|
+
ctrlKey: event.ctrlKey,
|
|
428
|
+
metaKey: event.metaKey,
|
|
429
|
+
altKey: event.altKey,
|
|
430
|
+
});
|
|
431
|
+
this.applyInteractionResult(previous);
|
|
432
|
+
};
|
|
433
|
+
handleTriggerClick() {
|
|
434
|
+
if (!this.model)
|
|
435
|
+
return;
|
|
436
|
+
const previous = this.captureState();
|
|
437
|
+
this.model.contracts.getTriggerProps().onClick();
|
|
438
|
+
this.applyInteractionResult(previous);
|
|
439
|
+
}
|
|
440
|
+
handleTriggerKeyDown(event) {
|
|
441
|
+
if (!this.model)
|
|
442
|
+
return;
|
|
443
|
+
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
444
|
+
event.preventDefault();
|
|
445
|
+
const previous = this.captureState();
|
|
446
|
+
this.model.contracts.getTriggerProps().onClick();
|
|
447
|
+
this.applyInteractionResult(previous);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
handleDialogKeyDown(event) {
|
|
451
|
+
if (!this.model)
|
|
452
|
+
return;
|
|
453
|
+
if (commandPaletteKeysToPrevent.has(event.key)) {
|
|
454
|
+
event.preventDefault();
|
|
455
|
+
}
|
|
456
|
+
const previous = this.captureState();
|
|
457
|
+
this.model.contracts.getDialogProps().onKeyDown({
|
|
458
|
+
key: event.key,
|
|
459
|
+
shiftKey: event.shiftKey,
|
|
460
|
+
ctrlKey: event.ctrlKey,
|
|
461
|
+
metaKey: event.metaKey,
|
|
462
|
+
altKey: event.altKey,
|
|
463
|
+
});
|
|
464
|
+
this.applyInteractionResult(previous);
|
|
465
|
+
}
|
|
466
|
+
handleInputChange(event) {
|
|
467
|
+
if (!this.model)
|
|
468
|
+
return;
|
|
469
|
+
const previous = this.captureState();
|
|
470
|
+
this.model.actions.setInputValue(event.currentTarget.value);
|
|
471
|
+
this.applyInteractionResult(previous);
|
|
472
|
+
}
|
|
473
|
+
handleInputKeyDown(event) {
|
|
474
|
+
event.stopPropagation();
|
|
475
|
+
this.handleDialogKeyDown(event);
|
|
476
|
+
}
|
|
477
|
+
handleItemClick(id) {
|
|
478
|
+
if (!this.model)
|
|
479
|
+
return;
|
|
480
|
+
const previous = this.captureState();
|
|
481
|
+
this.model.contracts.getOptionProps(id).onClick();
|
|
482
|
+
this.applyInteractionResult(previous);
|
|
483
|
+
}
|
|
484
|
+
handleSlotChange() {
|
|
485
|
+
this.rebuildModelFromSlot(true, true);
|
|
486
|
+
}
|
|
487
|
+
render() {
|
|
488
|
+
const triggerProps = this.model?.contracts.getTriggerProps() ?? {
|
|
489
|
+
id: `${this.idBase}-trigger`,
|
|
490
|
+
role: 'button',
|
|
491
|
+
tabindex: '0',
|
|
492
|
+
'aria-haspopup': 'dialog',
|
|
493
|
+
'aria-expanded': this.open ? 'true' : 'false',
|
|
494
|
+
'aria-controls': `${this.idBase}-dialog`,
|
|
495
|
+
};
|
|
496
|
+
const dialogProps = this.model?.contracts.getDialogProps() ?? {
|
|
497
|
+
id: `${this.idBase}-dialog`,
|
|
498
|
+
role: 'dialog',
|
|
499
|
+
tabindex: '-1',
|
|
500
|
+
hidden: !this.open,
|
|
501
|
+
'aria-modal': 'true',
|
|
502
|
+
'aria-label': this.ariaLabel || undefined,
|
|
503
|
+
};
|
|
504
|
+
const inputProps = this.model?.contracts.getInputProps() ?? {
|
|
505
|
+
id: `${this.idBase}-input`,
|
|
506
|
+
role: 'combobox',
|
|
507
|
+
tabindex: '0',
|
|
508
|
+
'aria-haspopup': 'listbox',
|
|
509
|
+
'aria-expanded': this.open ? 'true' : 'false',
|
|
510
|
+
'aria-controls': `${this.idBase}-listbox`,
|
|
511
|
+
'aria-autocomplete': 'list',
|
|
512
|
+
'aria-activedescendant': undefined,
|
|
513
|
+
'aria-label': this.ariaLabel || undefined,
|
|
514
|
+
};
|
|
515
|
+
const listboxProps = this.model?.contracts.getListboxProps() ?? {
|
|
516
|
+
id: `${this.idBase}-listbox`,
|
|
517
|
+
role: 'listbox',
|
|
518
|
+
tabindex: '-1',
|
|
519
|
+
'aria-label': this.ariaLabel || undefined,
|
|
520
|
+
};
|
|
521
|
+
return html `
|
|
522
|
+
<div part="base">
|
|
523
|
+
<button
|
|
524
|
+
id=${triggerProps.id}
|
|
525
|
+
role=${triggerProps.role}
|
|
526
|
+
tabindex=${triggerProps.tabindex}
|
|
527
|
+
aria-haspopup=${triggerProps['aria-haspopup']}
|
|
528
|
+
aria-expanded=${triggerProps['aria-expanded']}
|
|
529
|
+
aria-controls=${triggerProps['aria-controls']}
|
|
530
|
+
part="trigger"
|
|
531
|
+
type="button"
|
|
532
|
+
@click=${this.handleTriggerClick}
|
|
533
|
+
@keydown=${this.handleTriggerKeyDown}
|
|
534
|
+
>
|
|
535
|
+
<slot name="trigger">Command palette</slot>
|
|
536
|
+
</button>
|
|
537
|
+
|
|
538
|
+
<div
|
|
539
|
+
id=${dialogProps.id}
|
|
540
|
+
role=${dialogProps.role}
|
|
541
|
+
tabindex=${dialogProps.tabindex}
|
|
542
|
+
aria-modal=${dialogProps['aria-modal']}
|
|
543
|
+
aria-label=${dialogProps['aria-label'] ?? nothing}
|
|
544
|
+
?hidden=${dialogProps.hidden}
|
|
545
|
+
part="dialog"
|
|
546
|
+
@keydown=${this.handleDialogKeyDown}
|
|
547
|
+
>
|
|
548
|
+
<input
|
|
549
|
+
id=${inputProps.id}
|
|
550
|
+
role=${inputProps.role}
|
|
551
|
+
tabindex=${inputProps.tabindex}
|
|
552
|
+
aria-haspopup=${inputProps['aria-haspopup']}
|
|
553
|
+
aria-expanded=${inputProps['aria-expanded']}
|
|
554
|
+
aria-controls=${inputProps['aria-controls']}
|
|
555
|
+
aria-autocomplete=${inputProps['aria-autocomplete']}
|
|
556
|
+
aria-activedescendant=${inputProps['aria-activedescendant'] ?? nothing}
|
|
557
|
+
aria-label=${inputProps['aria-label'] ?? nothing}
|
|
558
|
+
.value=${this.inputValue}
|
|
559
|
+
placeholder=${this.placeholder}
|
|
560
|
+
part="input"
|
|
561
|
+
@input=${this.handleInputChange}
|
|
562
|
+
@keydown=${this.handleInputKeyDown}
|
|
563
|
+
/>
|
|
564
|
+
|
|
565
|
+
<div
|
|
566
|
+
id=${listboxProps.id}
|
|
567
|
+
role=${listboxProps.role}
|
|
568
|
+
tabindex=${listboxProps.tabindex}
|
|
569
|
+
aria-label=${listboxProps['aria-label'] ?? nothing}
|
|
570
|
+
part="listbox"
|
|
571
|
+
>
|
|
572
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
</div>
|
|
576
|
+
`;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
|
+
export interface CVContextMenuEventDetail {
|
|
4
|
+
value: string | null;
|
|
5
|
+
activeId: string | null;
|
|
6
|
+
open: boolean;
|
|
7
|
+
anchorX: number;
|
|
8
|
+
anchorY: number;
|
|
9
|
+
openedBy: string | null;
|
|
10
|
+
}
|
|
11
|
+
export declare class CVContextMenu extends ReatomLitElement {
|
|
12
|
+
static elementName: string;
|
|
13
|
+
static get properties(): {
|
|
14
|
+
value: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
reflect: boolean;
|
|
17
|
+
};
|
|
18
|
+
open: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
reflect: boolean;
|
|
21
|
+
};
|
|
22
|
+
ariaLabel: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
attribute: string;
|
|
25
|
+
};
|
|
26
|
+
closeOnSelect: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
attribute: string;
|
|
29
|
+
reflect: boolean;
|
|
30
|
+
};
|
|
31
|
+
closeOnOutsidePointer: {
|
|
32
|
+
type: BooleanConstructor;
|
|
33
|
+
attribute: string;
|
|
34
|
+
reflect: boolean;
|
|
35
|
+
};
|
|
36
|
+
anchorX: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
attribute: string;
|
|
39
|
+
reflect: boolean;
|
|
40
|
+
};
|
|
41
|
+
anchorY: {
|
|
42
|
+
type: NumberConstructor;
|
|
43
|
+
attribute: string;
|
|
44
|
+
reflect: boolean;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
value: string;
|
|
48
|
+
open: boolean;
|
|
49
|
+
ariaLabel: string;
|
|
50
|
+
closeOnSelect: boolean;
|
|
51
|
+
closeOnOutsidePointer: boolean;
|
|
52
|
+
anchorX: number;
|
|
53
|
+
anchorY: number;
|
|
54
|
+
private readonly idBase;
|
|
55
|
+
private itemRecords;
|
|
56
|
+
private itemListeners;
|
|
57
|
+
private model?;
|
|
58
|
+
/**
|
|
59
|
+
* Context menus open with no visually-active item; the first arrow key press
|
|
60
|
+
* activates the first (ArrowDown) or last (ArrowUp) enabled item.
|
|
61
|
+
* The headless menu always sets an initial active on open, so the UIKit layer
|
|
62
|
+
* suppresses the visual active state until the first navigation key is pressed.
|
|
63
|
+
*/
|
|
64
|
+
private _suppressActiveUntilNav;
|
|
65
|
+
/**
|
|
66
|
+
* Guards against duplicate willUpdate processing when value was already
|
|
67
|
+
* applied by an interaction handler (click, keyboard, imperative).
|
|
68
|
+
*/
|
|
69
|
+
private _valueAppliedByInteraction;
|
|
70
|
+
constructor();
|
|
71
|
+
static styles: import("lit").CSSResult[];
|
|
72
|
+
static define(): void;
|
|
73
|
+
connectedCallback(): void;
|
|
74
|
+
disconnectedCallback(): void;
|
|
75
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
76
|
+
updated(changedProperties: PropertyValues): void;
|
|
77
|
+
openAt(x: number, y: number): void;
|
|
78
|
+
close(): void;
|
|
79
|
+
private getItemElements;
|
|
80
|
+
private ensureItemValue;
|
|
81
|
+
private rebuildModelFromSlot;
|
|
82
|
+
private detachItemListeners;
|
|
83
|
+
private attachItemListeners;
|
|
84
|
+
private syncItemElements;
|
|
85
|
+
private captureState;
|
|
86
|
+
private dispatchInput;
|
|
87
|
+
private dispatchChange;
|
|
88
|
+
private focusActiveItem;
|
|
89
|
+
private applyInteractionResult;
|
|
90
|
+
private syncOutsidePointerListener;
|
|
91
|
+
private handleDocumentPointerDown;
|
|
92
|
+
private handleTargetContextMenu;
|
|
93
|
+
private handleTargetKeyDown;
|
|
94
|
+
private handleMenuKeyDown;
|
|
95
|
+
private handleItemClick;
|
|
96
|
+
private handleSlotChange;
|
|
97
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
98
|
+
}
|