mtrl 0.5.4 → 0.5.5
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/components/menu/features/keyboard.d.ts +1 -0
- package/dist/components/menu/features/position.d.ts +1 -1
- package/dist/components/menu/types.d.ts +11 -6
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +6 -6
- package/dist/index.js +15 -15
- package/dist/index.js.map +6 -6
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +1 -1
- package/src/styles/components/_menu.scss +229 -223
|
@@ -15,6 +15,7 @@ export declare const createKeyboardNavigation: (component: any) => {
|
|
|
15
15
|
setupKeyboardHandlers: (menuElement: HTMLElement, state: any, actions: any) => void;
|
|
16
16
|
isTabNavigationActive: () => boolean;
|
|
17
17
|
getFocusableElements: () => HTMLElement[];
|
|
18
|
+
resetTypeahead: () => void;
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* Adds keyboard navigation functionality to the menu component
|
|
@@ -35,7 +35,7 @@ export declare const MENU_POSITION: {
|
|
|
35
35
|
*
|
|
36
36
|
* @category Components
|
|
37
37
|
*/
|
|
38
|
-
export type MenuPosition = typeof MENU_POSITION[keyof typeof MENU_POSITION];
|
|
38
|
+
export type MenuPosition = (typeof MENU_POSITION)[keyof typeof MENU_POSITION];
|
|
39
39
|
/**
|
|
40
40
|
* Configuration interface for a menu item
|
|
41
41
|
*
|
|
@@ -91,7 +91,7 @@ export interface MenuDivider {
|
|
|
91
91
|
/**
|
|
92
92
|
* Type must be 'divider' to differentiate from regular menu items
|
|
93
93
|
*/
|
|
94
|
-
type:
|
|
94
|
+
type: "divider";
|
|
95
95
|
/**
|
|
96
96
|
* Optional ID for the divider (for accessibility)
|
|
97
97
|
*/
|
|
@@ -140,6 +140,11 @@ export interface MenuConfig {
|
|
|
140
140
|
* @default true
|
|
141
141
|
*/
|
|
142
142
|
closeOnEscape?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the menu should close when the window is resized
|
|
145
|
+
* @default false
|
|
146
|
+
*/
|
|
147
|
+
closeOnResize?: boolean;
|
|
143
148
|
/**
|
|
144
149
|
* Whether submenus should open on hover
|
|
145
150
|
* @default true
|
|
@@ -244,7 +249,7 @@ export interface MenuComponent {
|
|
|
244
249
|
* @param interactionType - The type of interaction that triggered the open ('mouse' or 'keyboard')
|
|
245
250
|
* @returns The menu component for chaining
|
|
246
251
|
*/
|
|
247
|
-
open: (event?: Event, interactionType?:
|
|
252
|
+
open: (event?: Event, interactionType?: "mouse" | "keyboard") => MenuComponent;
|
|
248
253
|
/**
|
|
249
254
|
* Closes the menu
|
|
250
255
|
* @param event - Optional event that triggered the close
|
|
@@ -332,7 +337,7 @@ export interface MenuComponent {
|
|
|
332
337
|
* @internal
|
|
333
338
|
*/
|
|
334
339
|
export interface MenuEvents {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
340
|
+
open: (event: MenuEvent) => void;
|
|
341
|
+
close: (event: MenuEvent) => void;
|
|
342
|
+
select: (event: MenuSelectEvent) => void;
|
|
338
343
|
}
|