@haiilo/catalyst 14.4.0 → 14.5.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/dist/catalyst/catalyst.css +15 -4
- package/dist/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/{p-CFGROHMy.js → p-7uZgmxXB.js} +2 -2
- package/dist/catalyst/p-7uZgmxXB.js.map +1 -0
- package/dist/catalyst/p-fb92a2f1.entry.js +10 -0
- package/dist/catalyst/p-fb92a2f1.entry.js.map +1 -0
- package/dist/catalyst/scss/core/_nav.scss +2 -1
- package/dist/catalyst/scss/core/sanitize-overwrite.scss +3 -0
- package/dist/catalyst/scss/index.scss +1 -0
- package/dist/cjs/{cat-alert_30.cjs.entry.js → cat-alert_32.cjs.entry.js} +346 -103
- package/dist/cjs/catalyst.cjs.js +2 -2
- package/dist/cjs/{index-B8-TCsLD.js → index-Ddad39qn.js} +7 -4
- package/dist/cjs/index-Ddad39qn.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/cat-alert/cat-alert.js +1 -1
- package/dist/collection/components/cat-badge/cat-badge.js +1 -1
- package/dist/collection/components/cat-button/cat-button.css +9 -2
- package/dist/collection/components/cat-button/cat-button.js +26 -1
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-button-group/cat-button-group.js +1 -1
- package/dist/collection/components/cat-card/cat-card.js +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +2 -2
- package/dist/collection/components/cat-date/cat-date.js +2 -2
- package/dist/collection/components/cat-date-inline/cat-date-inline.js +4 -4
- package/dist/collection/components/cat-datepicker/cat-datepicker.js +3 -3
- package/dist/collection/components/cat-datepicker-inline/cat-datepicker-inline.js +2 -2
- package/dist/collection/components/cat-dropdown/cat-dropdown.js +116 -47
- package/dist/collection/components/cat-dropdown/cat-dropdown.js.map +1 -1
- package/dist/collection/components/cat-menu/cat-menu.css +9 -0
- package/dist/collection/components/cat-menu/cat-menu.js +652 -0
- package/dist/collection/components/cat-menu/cat-menu.js.map +1 -0
- package/dist/collection/components/cat-menu-item/cat-menu-item.js +387 -0
- package/dist/collection/components/cat-menu-item/cat-menu-item.js.map +1 -0
- package/dist/collection/components/cat-pagination/cat-pagination.js +2 -2
- package/dist/collection/components/cat-radio/cat-radio.js +2 -2
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-scrollable/cat-scrollable.js +3 -3
- package/dist/collection/components/cat-select/cat-select.js +14 -18
- package/dist/collection/components/cat-select/cat-select.js.map +1 -1
- package/dist/collection/components/cat-select-demo/cat-select-demo.js +1 -1
- package/dist/collection/components/cat-skeleton/cat-skeleton.js +1 -1
- package/dist/collection/components/cat-spinner/cat-spinner.js +2 -2
- package/dist/collection/components/cat-tab/cat-tab.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-tag/cat-tag.js +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +3 -3
- package/dist/collection/components/cat-time/cat-time.css +0 -9
- package/dist/collection/components/cat-time/cat-time.js +4 -5
- package/dist/collection/components/cat-time/cat-time.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +2 -2
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/scss/core/_nav.scss +2 -1
- package/dist/collection/scss/core/sanitize-overwrite.scss +3 -0
- package/dist/collection/scss/index.scss +1 -0
- package/dist/components/cat-alert.js +1 -1
- package/dist/components/cat-badge.js +1 -1
- package/dist/components/cat-button-group.js +1 -1
- package/dist/components/cat-button2.js +8 -2
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-card.js +1 -1
- package/dist/components/cat-checkbox2.js +2 -2
- package/dist/components/cat-date-inline2.js +4 -4
- package/dist/components/cat-date.js +2 -2
- package/dist/components/cat-datepicker-inline.js +2 -2
- package/dist/components/cat-datepicker.js +3 -3
- package/dist/components/cat-dropdown2.js +69 -44
- package/dist/components/cat-dropdown2.js.map +1 -1
- package/dist/components/cat-menu-item.d.ts +11 -0
- package/dist/components/cat-menu-item.js +9 -0
- package/dist/components/cat-menu-item.js.map +1 -0
- package/dist/components/cat-menu-item2.js +111 -0
- package/dist/components/cat-menu-item2.js.map +1 -0
- package/dist/components/cat-menu.d.ts +11 -0
- package/dist/components/cat-menu.js +9 -0
- package/dist/components/cat-menu.js.map +1 -0
- package/dist/components/cat-menu2.js +227 -0
- package/dist/components/cat-menu2.js.map +1 -0
- package/dist/components/cat-pagination.js +2 -2
- package/dist/components/cat-radio-group.js +1 -1
- package/dist/components/cat-radio.js +2 -2
- package/dist/components/cat-scrollable2.js +3 -3
- package/dist/components/cat-select-demo.js +1 -1
- package/dist/components/cat-select2.js +5 -5
- package/dist/components/cat-select2.js.map +1 -1
- package/dist/components/cat-skeleton2.js +1 -1
- package/dist/components/cat-spinner2.js +2 -2
- package/dist/components/cat-tab.js +1 -1
- package/dist/components/cat-tabs.js +1 -1
- package/dist/components/cat-tag.js +1 -1
- package/dist/components/cat-textarea.js +3 -3
- package/dist/components/cat-time.js +25 -14
- package/dist/components/cat-time.js.map +1 -1
- package/dist/components/cat-toggle.js +2 -2
- package/dist/esm/{cat-alert_30.entry.js → cat-alert_32.entry.js} +345 -104
- package/dist/esm/catalyst.js +3 -3
- package/dist/esm/{index-CFGROHMy.js → index-7uZgmxXB.js} +7 -4
- package/dist/esm/index-7uZgmxXB.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/cat-button/cat-button.d.ts +4 -0
- package/dist/types/components/cat-dropdown/cat-dropdown.d.ts +14 -2
- package/dist/types/components/cat-menu/cat-menu.d.ts +124 -0
- package/dist/types/components/cat-menu-item/cat-menu-item.d.ts +80 -0
- package/dist/types/components/cat-select/cat-select.d.ts +3 -2
- package/dist/types/components.d.ts +426 -7
- package/dist/types/index.d.ts +2 -1
- package/package.json +2 -2
- package/dist/catalyst/p-76436f4e.entry.js +0 -10
- package/dist/catalyst/p-76436f4e.entry.js.map +0 -1
- package/dist/catalyst/p-CFGROHMy.js.map +0 -1
- package/dist/cjs/index-B8-TCsLD.js.map +0 -1
- package/dist/esm/index-CFGROHMy.js.map +0 -1
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
/**
|
|
3
|
+
* A menu component that provides a dropdown with a built-in configurable trigger button
|
|
4
|
+
* and proper ARIA semantics and keyboard navigation for menu items.
|
|
5
|
+
*
|
|
6
|
+
* The trigger is always a cat-button with sensible defaults but fully configurable
|
|
7
|
+
* through trigger-specific props.
|
|
8
|
+
*/
|
|
9
|
+
export class CatMenu {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.catMenuItems = [];
|
|
12
|
+
/**
|
|
13
|
+
* The placement of the dropdown.
|
|
14
|
+
*/
|
|
15
|
+
this.placement = 'bottom-start';
|
|
16
|
+
/**
|
|
17
|
+
* The arrow key navigation direction for menu items.
|
|
18
|
+
*/
|
|
19
|
+
this.arrowNavigation = 'vertical';
|
|
20
|
+
/**
|
|
21
|
+
* The trigger button variant.
|
|
22
|
+
*/
|
|
23
|
+
this.triggerVariant = 'text';
|
|
24
|
+
/**
|
|
25
|
+
* The trigger button size.
|
|
26
|
+
*/
|
|
27
|
+
this.triggerSize = 'm';
|
|
28
|
+
/**
|
|
29
|
+
* The color palette of the trigger button.
|
|
30
|
+
*/
|
|
31
|
+
this.triggerColor = 'secondary';
|
|
32
|
+
/**
|
|
33
|
+
* Disable the menu.
|
|
34
|
+
*/
|
|
35
|
+
this.disabled = false;
|
|
36
|
+
/**
|
|
37
|
+
* Make the dropdown match the width of the reference regardless of its
|
|
38
|
+
* contents. Note that this only applies to the minimum width of the
|
|
39
|
+
* dropdown. The maximum width is still limited by the viewport.
|
|
40
|
+
*/
|
|
41
|
+
this.justify = false;
|
|
42
|
+
/**
|
|
43
|
+
* Do not change the size of the dropdown to ensure it isn’t too big to fit
|
|
44
|
+
* in the viewport (or more specifically, its clipping context).
|
|
45
|
+
*/
|
|
46
|
+
this.noResize = false;
|
|
47
|
+
/**
|
|
48
|
+
* Allow overflow when dropdown is open.
|
|
49
|
+
*/
|
|
50
|
+
this.overflow = false;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the dropdown trigger should be initialized only before first opening.
|
|
53
|
+
* Can be useful when trigger is rendered dynamically.
|
|
54
|
+
*/
|
|
55
|
+
this.delayedTriggerInit = false;
|
|
56
|
+
this.onTriggerClick = (event) => {
|
|
57
|
+
this.catTriggerClick.emit(event.detail);
|
|
58
|
+
};
|
|
59
|
+
this.onMenuOpen = (event) => {
|
|
60
|
+
this.catOpen.emit(event.detail);
|
|
61
|
+
// Set focus to first non-disabled menu item when menu opens
|
|
62
|
+
requestAnimationFrame(() => {
|
|
63
|
+
if (!this.isMenuItemInFocus()) {
|
|
64
|
+
const firstEnabledItem = this.catMenuItems.find(item => !item.disabled);
|
|
65
|
+
firstEnabledItem?.doFocus();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
onFocusOut() {
|
|
71
|
+
if (!this.dropdown?.isOpen) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
requestAnimationFrame(() => {
|
|
75
|
+
if (!this.isMenuItemInFocus()) {
|
|
76
|
+
this.dropdown?.close(false);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
getDeepActiveElement() {
|
|
81
|
+
let active = document.activeElement;
|
|
82
|
+
while (active?.shadowRoot?.activeElement && active.nodeName !== 'CAT-MENU-ITEM') {
|
|
83
|
+
active = active.shadowRoot.activeElement;
|
|
84
|
+
}
|
|
85
|
+
return active;
|
|
86
|
+
}
|
|
87
|
+
onDocumentKeydown(event) {
|
|
88
|
+
const navigationKeys = this.arrowNavigation === 'horizontal'
|
|
89
|
+
? ['ArrowRight', 'ArrowLeft', 'Home', 'End']
|
|
90
|
+
: ['ArrowDown', 'ArrowUp', 'Home', 'End'];
|
|
91
|
+
if (!this.dropdown?.isOpen || !navigationKeys.includes(event.key)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const targetElements = this.catMenuItems.filter(item => !item.disabled);
|
|
95
|
+
if (!targetElements.length) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const activeIdx = targetElements.findIndex(item => this.getDeepActiveElement() === item);
|
|
99
|
+
let targetIdx;
|
|
100
|
+
if (event.key === 'Home') {
|
|
101
|
+
targetIdx = 0;
|
|
102
|
+
}
|
|
103
|
+
else if (event.key === 'End') {
|
|
104
|
+
targetIdx = targetElements.length - 1;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const forwardKey = this.arrowNavigation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';
|
|
108
|
+
const activeOff = event.key === forwardKey ? 1 : -1;
|
|
109
|
+
targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
|
|
110
|
+
}
|
|
111
|
+
targetElements[targetIdx].doFocus();
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
}
|
|
114
|
+
componentDidLoad() {
|
|
115
|
+
this.syncMenuItems();
|
|
116
|
+
this.mutationObserver = new MutationObserver(mutations => mutations.some(value => value.target.nodeName === 'CAT-MENU-ITEM') && this.syncMenuItems());
|
|
117
|
+
this.mutationObserver?.observe(this.hostElement, {
|
|
118
|
+
childList: true,
|
|
119
|
+
attributes: true,
|
|
120
|
+
subtree: true
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
disconnectedCallback() {
|
|
124
|
+
this.mutationObserver?.disconnect();
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Opens the menu.
|
|
128
|
+
*/
|
|
129
|
+
async open() {
|
|
130
|
+
await this.dropdown?.open();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Closes the menu.
|
|
134
|
+
*/
|
|
135
|
+
async close() {
|
|
136
|
+
await this.dropdown?.close();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Toggles the menu.
|
|
140
|
+
*/
|
|
141
|
+
async toggle() {
|
|
142
|
+
await this.dropdown?.toggle();
|
|
143
|
+
}
|
|
144
|
+
isMenuItemInFocus() {
|
|
145
|
+
const activeElement = this.getDeepActiveElement();
|
|
146
|
+
const isInMenu = activeElement && this.catMenuItems.some(item => activeElement === item);
|
|
147
|
+
return !!(activeElement && isInMenu);
|
|
148
|
+
}
|
|
149
|
+
syncMenuItems() {
|
|
150
|
+
this.catMenuItems = Array.from(this.hostElement.querySelectorAll('cat-menu-item'));
|
|
151
|
+
}
|
|
152
|
+
render() {
|
|
153
|
+
return (h(Host, { key: '1659f098d4d11e61119cde4f290bb89bf450f9d9' }, h("cat-dropdown", { key: 'a5ca6e28245167c0f208d1846c9f93a75991dee1', ref: el => (this.dropdown = el), focusTrap: false, placement: this.placement, justify: this.justify, arrowNavigation: "none", noResize: this.noResize, overflow: this.overflow, delayedTriggerInit: this.delayedTriggerInit, onCatOpen: this.onMenuOpen, onCatClose: () => this.catClose.emit() }, h("cat-button", { key: '63986a7d31784fdd59de48c79a5b5777cf198b94', slot: "trigger", part: "trigger", variant: this.triggerVariant, size: this.triggerSize, icon: this.triggerIcon ?? (this.triggerLabel === undefined ? 'more-horizontal-filled' : undefined), iconOnly: this.triggerIconOnly ?? this.triggerLabel === undefined, color: this.triggerColor, a11yLabel: this.triggerA11yLabel ?? this.triggerLabel, class: this.triggerClass, testId: this.triggerTestId, nativeAttributes: {
|
|
154
|
+
...this.triggerNativeAttributes,
|
|
155
|
+
'aria-haspopup': 'menu'
|
|
156
|
+
}, disabled: this.disabled, onCatClick: this.onTriggerClick }, !this.triggerIconOnly && h("slot", { key: 'c10341a8bec971b814ec88044a89aa6752f3be23', name: "trigger-label" }, this.triggerLabel)), h("nav", { key: '265da5937ea993d27ccec21f9c0bc84439208d6c', role: "menu", slot: "content", class: "cat-menu-list", "aria-orientation": this.arrowNavigation }, h("ul", { key: '9b8edcb90028b39690be08961f25ea8c7a769752' }, h("slot", { key: 'f30590ff83386f30ba4539e76d621a80b0aefffd' }))))));
|
|
157
|
+
}
|
|
158
|
+
static get is() { return "cat-menu"; }
|
|
159
|
+
static get encapsulation() { return "shadow"; }
|
|
160
|
+
static get originalStyleUrls() {
|
|
161
|
+
return {
|
|
162
|
+
"$": ["cat-menu.scss"]
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
static get styleUrls() {
|
|
166
|
+
return {
|
|
167
|
+
"$": ["cat-menu.css"]
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
static get properties() {
|
|
171
|
+
return {
|
|
172
|
+
"placement": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "Placement",
|
|
177
|
+
"resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\"",
|
|
178
|
+
"references": {
|
|
179
|
+
"Placement": {
|
|
180
|
+
"location": "import",
|
|
181
|
+
"path": "@floating-ui/dom",
|
|
182
|
+
"id": "../node_modules/.pnpm/@floating-ui+dom@1.6.13/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts::Placement"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "The placement of the dropdown."
|
|
191
|
+
},
|
|
192
|
+
"getter": false,
|
|
193
|
+
"setter": false,
|
|
194
|
+
"reflect": false,
|
|
195
|
+
"attribute": "placement",
|
|
196
|
+
"defaultValue": "'bottom-start'"
|
|
197
|
+
},
|
|
198
|
+
"arrowNavigation": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"mutable": false,
|
|
201
|
+
"complexType": {
|
|
202
|
+
"original": "'horizontal' | 'vertical'",
|
|
203
|
+
"resolved": "\"horizontal\" | \"vertical\"",
|
|
204
|
+
"references": {}
|
|
205
|
+
},
|
|
206
|
+
"required": false,
|
|
207
|
+
"optional": false,
|
|
208
|
+
"docs": {
|
|
209
|
+
"tags": [],
|
|
210
|
+
"text": "The arrow key navigation direction for menu items."
|
|
211
|
+
},
|
|
212
|
+
"getter": false,
|
|
213
|
+
"setter": false,
|
|
214
|
+
"reflect": false,
|
|
215
|
+
"attribute": "arrow-navigation",
|
|
216
|
+
"defaultValue": "'vertical'"
|
|
217
|
+
},
|
|
218
|
+
"triggerVariant": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"mutable": false,
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "'filled' | 'outlined' | 'text'",
|
|
223
|
+
"resolved": "\"filled\" | \"outlined\" | \"text\"",
|
|
224
|
+
"references": {}
|
|
225
|
+
},
|
|
226
|
+
"required": false,
|
|
227
|
+
"optional": false,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "The trigger button variant."
|
|
231
|
+
},
|
|
232
|
+
"getter": false,
|
|
233
|
+
"setter": false,
|
|
234
|
+
"reflect": false,
|
|
235
|
+
"attribute": "trigger-variant",
|
|
236
|
+
"defaultValue": "'text'"
|
|
237
|
+
},
|
|
238
|
+
"triggerSize": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"mutable": false,
|
|
241
|
+
"complexType": {
|
|
242
|
+
"original": "'xs' | 's' | 'm' | 'l' | 'xl'",
|
|
243
|
+
"resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
|
|
244
|
+
"references": {}
|
|
245
|
+
},
|
|
246
|
+
"required": false,
|
|
247
|
+
"optional": false,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": "The trigger button size."
|
|
251
|
+
},
|
|
252
|
+
"getter": false,
|
|
253
|
+
"setter": false,
|
|
254
|
+
"reflect": false,
|
|
255
|
+
"attribute": "trigger-size",
|
|
256
|
+
"defaultValue": "'m'"
|
|
257
|
+
},
|
|
258
|
+
"triggerIcon": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"mutable": false,
|
|
261
|
+
"complexType": {
|
|
262
|
+
"original": "string",
|
|
263
|
+
"resolved": "string | undefined",
|
|
264
|
+
"references": {}
|
|
265
|
+
},
|
|
266
|
+
"required": false,
|
|
267
|
+
"optional": true,
|
|
268
|
+
"docs": {
|
|
269
|
+
"tags": [],
|
|
270
|
+
"text": "The trigger button icon."
|
|
271
|
+
},
|
|
272
|
+
"getter": false,
|
|
273
|
+
"setter": false,
|
|
274
|
+
"reflect": false,
|
|
275
|
+
"attribute": "trigger-icon"
|
|
276
|
+
},
|
|
277
|
+
"triggerIconOnly": {
|
|
278
|
+
"type": "any",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "boolean | Breakpoint",
|
|
282
|
+
"resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\" | boolean | undefined",
|
|
283
|
+
"references": {
|
|
284
|
+
"Breakpoint": {
|
|
285
|
+
"location": "import",
|
|
286
|
+
"path": "../../utils/breakpoints",
|
|
287
|
+
"id": "src/utils/breakpoints.ts::Breakpoint"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": true,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": "Show only the icon in the trigger button."
|
|
296
|
+
},
|
|
297
|
+
"getter": false,
|
|
298
|
+
"setter": false,
|
|
299
|
+
"reflect": false,
|
|
300
|
+
"attribute": "trigger-icon-only"
|
|
301
|
+
},
|
|
302
|
+
"triggerLabel": {
|
|
303
|
+
"type": "string",
|
|
304
|
+
"mutable": false,
|
|
305
|
+
"complexType": {
|
|
306
|
+
"original": "string",
|
|
307
|
+
"resolved": "string | undefined",
|
|
308
|
+
"references": {}
|
|
309
|
+
},
|
|
310
|
+
"required": false,
|
|
311
|
+
"optional": true,
|
|
312
|
+
"docs": {
|
|
313
|
+
"tags": [],
|
|
314
|
+
"text": "The trigger button label."
|
|
315
|
+
},
|
|
316
|
+
"getter": false,
|
|
317
|
+
"setter": false,
|
|
318
|
+
"reflect": false,
|
|
319
|
+
"attribute": "trigger-label"
|
|
320
|
+
},
|
|
321
|
+
"triggerColor": {
|
|
322
|
+
"type": "string",
|
|
323
|
+
"mutable": false,
|
|
324
|
+
"complexType": {
|
|
325
|
+
"original": "'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger'",
|
|
326
|
+
"resolved": "\"danger\" | \"info\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"",
|
|
327
|
+
"references": {}
|
|
328
|
+
},
|
|
329
|
+
"required": false,
|
|
330
|
+
"optional": false,
|
|
331
|
+
"docs": {
|
|
332
|
+
"tags": [],
|
|
333
|
+
"text": "The color palette of the trigger button."
|
|
334
|
+
},
|
|
335
|
+
"getter": false,
|
|
336
|
+
"setter": false,
|
|
337
|
+
"reflect": false,
|
|
338
|
+
"attribute": "trigger-color",
|
|
339
|
+
"defaultValue": "'secondary'"
|
|
340
|
+
},
|
|
341
|
+
"triggerA11yLabel": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"mutable": false,
|
|
344
|
+
"complexType": {
|
|
345
|
+
"original": "string",
|
|
346
|
+
"resolved": "string | undefined",
|
|
347
|
+
"references": {}
|
|
348
|
+
},
|
|
349
|
+
"required": false,
|
|
350
|
+
"optional": true,
|
|
351
|
+
"docs": {
|
|
352
|
+
"tags": [],
|
|
353
|
+
"text": "The trigger button accessibility label. If not set, falls back to triggerLabel."
|
|
354
|
+
},
|
|
355
|
+
"getter": false,
|
|
356
|
+
"setter": false,
|
|
357
|
+
"reflect": false,
|
|
358
|
+
"attribute": "trigger-a-1-1y-label"
|
|
359
|
+
},
|
|
360
|
+
"triggerClass": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "string",
|
|
365
|
+
"resolved": "string | undefined",
|
|
366
|
+
"references": {}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": true,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "Additional CSS class for the trigger button."
|
|
373
|
+
},
|
|
374
|
+
"getter": false,
|
|
375
|
+
"setter": false,
|
|
376
|
+
"reflect": false,
|
|
377
|
+
"attribute": "trigger-class"
|
|
378
|
+
},
|
|
379
|
+
"triggerTestId": {
|
|
380
|
+
"type": "string",
|
|
381
|
+
"mutable": false,
|
|
382
|
+
"complexType": {
|
|
383
|
+
"original": "string",
|
|
384
|
+
"resolved": "string | undefined",
|
|
385
|
+
"references": {}
|
|
386
|
+
},
|
|
387
|
+
"required": false,
|
|
388
|
+
"optional": true,
|
|
389
|
+
"docs": {
|
|
390
|
+
"tags": [],
|
|
391
|
+
"text": "Test ID for the trigger button."
|
|
392
|
+
},
|
|
393
|
+
"getter": false,
|
|
394
|
+
"setter": false,
|
|
395
|
+
"reflect": false,
|
|
396
|
+
"attribute": "trigger-test-id"
|
|
397
|
+
},
|
|
398
|
+
"triggerNativeAttributes": {
|
|
399
|
+
"type": "unknown",
|
|
400
|
+
"mutable": false,
|
|
401
|
+
"complexType": {
|
|
402
|
+
"original": "{ [key: string]: string }",
|
|
403
|
+
"resolved": "undefined | { [key: string]: string; }",
|
|
404
|
+
"references": {}
|
|
405
|
+
},
|
|
406
|
+
"required": false,
|
|
407
|
+
"optional": true,
|
|
408
|
+
"docs": {
|
|
409
|
+
"tags": [],
|
|
410
|
+
"text": "Native attributes for the trigger button."
|
|
411
|
+
},
|
|
412
|
+
"getter": false,
|
|
413
|
+
"setter": false
|
|
414
|
+
},
|
|
415
|
+
"disabled": {
|
|
416
|
+
"type": "boolean",
|
|
417
|
+
"mutable": false,
|
|
418
|
+
"complexType": {
|
|
419
|
+
"original": "boolean",
|
|
420
|
+
"resolved": "boolean",
|
|
421
|
+
"references": {}
|
|
422
|
+
},
|
|
423
|
+
"required": false,
|
|
424
|
+
"optional": false,
|
|
425
|
+
"docs": {
|
|
426
|
+
"tags": [],
|
|
427
|
+
"text": "Disable the menu."
|
|
428
|
+
},
|
|
429
|
+
"getter": false,
|
|
430
|
+
"setter": false,
|
|
431
|
+
"reflect": false,
|
|
432
|
+
"attribute": "disabled",
|
|
433
|
+
"defaultValue": "false"
|
|
434
|
+
},
|
|
435
|
+
"justify": {
|
|
436
|
+
"type": "boolean",
|
|
437
|
+
"mutable": false,
|
|
438
|
+
"complexType": {
|
|
439
|
+
"original": "boolean",
|
|
440
|
+
"resolved": "boolean",
|
|
441
|
+
"references": {}
|
|
442
|
+
},
|
|
443
|
+
"required": false,
|
|
444
|
+
"optional": false,
|
|
445
|
+
"docs": {
|
|
446
|
+
"tags": [],
|
|
447
|
+
"text": "Make the dropdown match the width of the reference regardless of its\ncontents. Note that this only applies to the minimum width of the\ndropdown. The maximum width is still limited by the viewport."
|
|
448
|
+
},
|
|
449
|
+
"getter": false,
|
|
450
|
+
"setter": false,
|
|
451
|
+
"reflect": false,
|
|
452
|
+
"attribute": "justify",
|
|
453
|
+
"defaultValue": "false"
|
|
454
|
+
},
|
|
455
|
+
"noResize": {
|
|
456
|
+
"type": "boolean",
|
|
457
|
+
"mutable": false,
|
|
458
|
+
"complexType": {
|
|
459
|
+
"original": "boolean",
|
|
460
|
+
"resolved": "boolean",
|
|
461
|
+
"references": {}
|
|
462
|
+
},
|
|
463
|
+
"required": false,
|
|
464
|
+
"optional": false,
|
|
465
|
+
"docs": {
|
|
466
|
+
"tags": [],
|
|
467
|
+
"text": "Do not change the size of the dropdown to ensure it isn\u2019t too big to fit\nin the viewport (or more specifically, its clipping context)."
|
|
468
|
+
},
|
|
469
|
+
"getter": false,
|
|
470
|
+
"setter": false,
|
|
471
|
+
"reflect": false,
|
|
472
|
+
"attribute": "no-resize",
|
|
473
|
+
"defaultValue": "false"
|
|
474
|
+
},
|
|
475
|
+
"overflow": {
|
|
476
|
+
"type": "boolean",
|
|
477
|
+
"mutable": false,
|
|
478
|
+
"complexType": {
|
|
479
|
+
"original": "boolean",
|
|
480
|
+
"resolved": "boolean",
|
|
481
|
+
"references": {}
|
|
482
|
+
},
|
|
483
|
+
"required": false,
|
|
484
|
+
"optional": false,
|
|
485
|
+
"docs": {
|
|
486
|
+
"tags": [],
|
|
487
|
+
"text": "Allow overflow when dropdown is open."
|
|
488
|
+
},
|
|
489
|
+
"getter": false,
|
|
490
|
+
"setter": false,
|
|
491
|
+
"reflect": false,
|
|
492
|
+
"attribute": "overflow",
|
|
493
|
+
"defaultValue": "false"
|
|
494
|
+
},
|
|
495
|
+
"delayedTriggerInit": {
|
|
496
|
+
"type": "boolean",
|
|
497
|
+
"mutable": false,
|
|
498
|
+
"complexType": {
|
|
499
|
+
"original": "boolean",
|
|
500
|
+
"resolved": "boolean",
|
|
501
|
+
"references": {}
|
|
502
|
+
},
|
|
503
|
+
"required": false,
|
|
504
|
+
"optional": false,
|
|
505
|
+
"docs": {
|
|
506
|
+
"tags": [],
|
|
507
|
+
"text": "Whether the dropdown trigger should be initialized only before first opening.\nCan be useful when trigger is rendered dynamically."
|
|
508
|
+
},
|
|
509
|
+
"getter": false,
|
|
510
|
+
"setter": false,
|
|
511
|
+
"reflect": false,
|
|
512
|
+
"attribute": "delayed-trigger-init",
|
|
513
|
+
"defaultValue": "false"
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
static get events() {
|
|
518
|
+
return [{
|
|
519
|
+
"method": "catOpen",
|
|
520
|
+
"name": "catOpen",
|
|
521
|
+
"bubbles": true,
|
|
522
|
+
"cancelable": true,
|
|
523
|
+
"composed": true,
|
|
524
|
+
"docs": {
|
|
525
|
+
"tags": [],
|
|
526
|
+
"text": "Emitted when the dropdown is opened."
|
|
527
|
+
},
|
|
528
|
+
"complexType": {
|
|
529
|
+
"original": "FocusEvent",
|
|
530
|
+
"resolved": "FocusEvent",
|
|
531
|
+
"references": {
|
|
532
|
+
"FocusEvent": {
|
|
533
|
+
"location": "global",
|
|
534
|
+
"id": "global::FocusEvent"
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}, {
|
|
539
|
+
"method": "catClose",
|
|
540
|
+
"name": "catClose",
|
|
541
|
+
"bubbles": true,
|
|
542
|
+
"cancelable": true,
|
|
543
|
+
"composed": true,
|
|
544
|
+
"docs": {
|
|
545
|
+
"tags": [],
|
|
546
|
+
"text": "Emitted when the dropdown is closed."
|
|
547
|
+
},
|
|
548
|
+
"complexType": {
|
|
549
|
+
"original": "FocusEvent",
|
|
550
|
+
"resolved": "FocusEvent",
|
|
551
|
+
"references": {
|
|
552
|
+
"FocusEvent": {
|
|
553
|
+
"location": "global",
|
|
554
|
+
"id": "global::FocusEvent"
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}, {
|
|
559
|
+
"method": "catTriggerClick",
|
|
560
|
+
"name": "catTriggerClick",
|
|
561
|
+
"bubbles": true,
|
|
562
|
+
"cancelable": true,
|
|
563
|
+
"composed": true,
|
|
564
|
+
"docs": {
|
|
565
|
+
"tags": [],
|
|
566
|
+
"text": "Emitted when the trigger button is clicked."
|
|
567
|
+
},
|
|
568
|
+
"complexType": {
|
|
569
|
+
"original": "MouseEvent",
|
|
570
|
+
"resolved": "MouseEvent",
|
|
571
|
+
"references": {
|
|
572
|
+
"MouseEvent": {
|
|
573
|
+
"location": "global",
|
|
574
|
+
"id": "global::MouseEvent"
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}];
|
|
579
|
+
}
|
|
580
|
+
static get methods() {
|
|
581
|
+
return {
|
|
582
|
+
"open": {
|
|
583
|
+
"complexType": {
|
|
584
|
+
"signature": "() => Promise<void>",
|
|
585
|
+
"parameters": [],
|
|
586
|
+
"references": {
|
|
587
|
+
"Promise": {
|
|
588
|
+
"location": "global",
|
|
589
|
+
"id": "global::Promise"
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"return": "Promise<void>"
|
|
593
|
+
},
|
|
594
|
+
"docs": {
|
|
595
|
+
"text": "Opens the menu.",
|
|
596
|
+
"tags": []
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
"close": {
|
|
600
|
+
"complexType": {
|
|
601
|
+
"signature": "() => Promise<void>",
|
|
602
|
+
"parameters": [],
|
|
603
|
+
"references": {
|
|
604
|
+
"Promise": {
|
|
605
|
+
"location": "global",
|
|
606
|
+
"id": "global::Promise"
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
"return": "Promise<void>"
|
|
610
|
+
},
|
|
611
|
+
"docs": {
|
|
612
|
+
"text": "Closes the menu.",
|
|
613
|
+
"tags": []
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
"toggle": {
|
|
617
|
+
"complexType": {
|
|
618
|
+
"signature": "() => Promise<void>",
|
|
619
|
+
"parameters": [],
|
|
620
|
+
"references": {
|
|
621
|
+
"Promise": {
|
|
622
|
+
"location": "global",
|
|
623
|
+
"id": "global::Promise"
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
"return": "Promise<void>"
|
|
627
|
+
},
|
|
628
|
+
"docs": {
|
|
629
|
+
"text": "Toggles the menu.",
|
|
630
|
+
"tags": []
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
static get elementRef() { return "hostElement"; }
|
|
636
|
+
static get listeners() {
|
|
637
|
+
return [{
|
|
638
|
+
"name": "focusout",
|
|
639
|
+
"method": "onFocusOut",
|
|
640
|
+
"target": undefined,
|
|
641
|
+
"capture": false,
|
|
642
|
+
"passive": false
|
|
643
|
+
}, {
|
|
644
|
+
"name": "keydown",
|
|
645
|
+
"method": "onDocumentKeydown",
|
|
646
|
+
"target": "document",
|
|
647
|
+
"capture": false,
|
|
648
|
+
"passive": false
|
|
649
|
+
}];
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
//# sourceMappingURL=cat-menu.js.map
|