@instructure/ui-menu 8.13.1-snapshot.9 → 8.14.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/CHANGELOG.md +4 -0
- package/es/Menu/MenuItem/index.js +28 -21
- package/es/Menu/MenuItem/props.js +0 -23
- package/es/Menu/MenuItemGroup/index.js +17 -13
- package/es/Menu/MenuItemGroup/props.js +1 -30
- package/es/Menu/MenuItemSeparator/index.js +6 -2
- package/es/Menu/index.js +59 -56
- package/es/Menu/props.js +1 -113
- package/es/MenuContext.js +3 -3
- package/lib/Menu/MenuItem/index.js +28 -21
- package/lib/Menu/MenuItem/props.js +0 -23
- package/lib/Menu/MenuItemGroup/index.js +17 -13
- package/lib/Menu/MenuItemGroup/props.js +1 -30
- package/lib/Menu/MenuItemSeparator/index.js +6 -2
- package/lib/Menu/index.js +61 -56
- package/lib/Menu/props.js +1 -113
- package/lib/MenuContext.js +2 -2
- package/package.json +21 -22
- package/src/Menu/MenuItem/index.tsx +24 -34
- package/src/Menu/MenuItem/props.ts +36 -27
- package/src/Menu/MenuItemGroup/index.tsx +28 -48
- package/src/Menu/MenuItemGroup/props.ts +37 -30
- package/src/Menu/MenuItemSeparator/index.tsx +2 -4
- package/src/Menu/index.tsx +81 -135
- package/src/Menu/props.ts +79 -84
- package/src/MenuContext.ts +3 -2
- package/tsconfig.build.json +25 -2
- package/tsconfig.build.tsbuildinfo +1 -0
- package/types/Menu/MenuItem/MenuItemLocator.d.ts +52 -52
- package/types/Menu/MenuItem/index.d.ts +24 -23
- package/types/Menu/MenuItem/index.d.ts.map +1 -1
- package/types/Menu/MenuItem/props.d.ts +30 -7
- package/types/Menu/MenuItem/props.d.ts.map +1 -1
- package/types/Menu/MenuItemGroup/MenuItemGroupLocator.d.ts +182 -182
- package/types/Menu/MenuItemGroup/index.d.ts +22 -22
- package/types/Menu/MenuItemGroup/index.d.ts.map +1 -1
- package/types/Menu/MenuItemGroup/props.d.ts +33 -8
- package/types/Menu/MenuItemGroup/props.d.ts.map +1 -1
- package/types/Menu/MenuItemSeparator/index.d.ts.map +1 -1
- package/types/Menu/MenuLocator.d.ts +576 -576
- package/types/Menu/index.d.ts +58 -68
- package/types/Menu/index.d.ts.map +1 -1
- package/types/Menu/props.d.ts +94 -16
- package/types/Menu/props.d.ts.map +1 -1
- package/types/MenuContext.d.ts +3 -2
- package/types/MenuContext.d.ts.map +1 -1
- package/LICENSE.md +0 -27
package/types/Menu/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Component
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { Popover } from '@instructure/ui-popover';
|
|
3
4
|
import { MenuItem } from './MenuItem';
|
|
5
|
+
import type { OnMenuItemSelect, MenuItemProps } from './MenuItem/props';
|
|
4
6
|
import { MenuItemGroup } from './MenuItemGroup';
|
|
5
7
|
import { MenuItemSeparator } from './MenuItemSeparator';
|
|
6
8
|
import { jsx } from '@instructure/emotion';
|
|
@@ -9,30 +11,29 @@ import type { MenuProps } from './props';
|
|
|
9
11
|
---
|
|
10
12
|
category: components
|
|
11
13
|
---
|
|
14
|
+
@tsProps
|
|
12
15
|
**/
|
|
13
16
|
declare class Menu extends Component<MenuProps> {
|
|
14
17
|
static readonly componentId = "Menu";
|
|
15
18
|
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
16
|
-
children?:
|
|
19
|
+
children?: React.ReactNode;
|
|
17
20
|
label?: string | undefined;
|
|
18
21
|
disabled?: boolean | undefined;
|
|
19
|
-
trigger?:
|
|
22
|
+
trigger?: React.ReactNode;
|
|
20
23
|
placement?: import("@instructure/ui-position").PlacementPropValues | undefined;
|
|
21
24
|
defaultShow?: boolean | undefined;
|
|
22
|
-
show?:
|
|
23
|
-
onToggle?: ((
|
|
24
|
-
onSelect?:
|
|
25
|
-
onDismiss?: ((
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
popoverRef?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
show?: boolean | undefined;
|
|
26
|
+
onToggle?: ((show: boolean, menu: Menu) => void) | undefined;
|
|
27
|
+
onSelect?: OnMenuItemSelect | undefined;
|
|
28
|
+
onDismiss?: ((event: React.UIEvent<Element, UIEvent> | React.FocusEvent<Element, Element>, documentClick: boolean) => void) | undefined;
|
|
29
|
+
onFocus?: ((event: React.FocusEvent<Element, Element>) => void) | undefined;
|
|
30
|
+
onMouseOver?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
31
|
+
onKeyDown?: ((event: React.KeyboardEvent<HTMLUListElement>) => void) | undefined;
|
|
32
|
+
onKeyUp?: ((event: React.KeyboardEvent<HTMLUListElement>) => void) | undefined;
|
|
33
|
+
menuRef?: ((el: HTMLUListElement | null) => void) | undefined;
|
|
34
|
+
popoverRef?: ((el: Popover | null) => void) | undefined;
|
|
33
35
|
mountNode?: import("@instructure/ui-position").PositionMountNode | undefined;
|
|
34
36
|
constrain?: import("@instructure/ui-position").PositionConstraint | undefined;
|
|
35
|
-
liveRegion?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | ((...args: any[]) => any) | undefined;
|
|
36
37
|
shouldHideOnSelect?: boolean | undefined;
|
|
37
38
|
shouldFocusTriggerOnClose?: boolean | undefined;
|
|
38
39
|
type?: "flyout" | undefined;
|
|
@@ -42,26 +43,24 @@ declare class Menu extends Component<MenuProps> {
|
|
|
42
43
|
offsetY?: string | number | undefined;
|
|
43
44
|
}>;
|
|
44
45
|
static allowedProps: readonly (keyof {
|
|
45
|
-
children?:
|
|
46
|
+
children?: React.ReactNode;
|
|
46
47
|
label?: string | undefined;
|
|
47
48
|
disabled?: boolean | undefined;
|
|
48
|
-
trigger?:
|
|
49
|
+
trigger?: React.ReactNode;
|
|
49
50
|
placement?: import("@instructure/ui-position").PlacementPropValues | undefined;
|
|
50
51
|
defaultShow?: boolean | undefined;
|
|
51
|
-
show?:
|
|
52
|
-
onToggle?: ((
|
|
53
|
-
onSelect?:
|
|
54
|
-
onDismiss?: ((
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
popoverRef?: ((...args: any[]) => any) | undefined;
|
|
52
|
+
show?: boolean | undefined;
|
|
53
|
+
onToggle?: ((show: boolean, menu: Menu) => void) | undefined;
|
|
54
|
+
onSelect?: OnMenuItemSelect | undefined;
|
|
55
|
+
onDismiss?: ((event: React.UIEvent<Element, UIEvent> | React.FocusEvent<Element, Element>, documentClick: boolean) => void) | undefined;
|
|
56
|
+
onFocus?: ((event: React.FocusEvent<Element, Element>) => void) | undefined;
|
|
57
|
+
onMouseOver?: ((event: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
58
|
+
onKeyDown?: ((event: React.KeyboardEvent<HTMLUListElement>) => void) | undefined;
|
|
59
|
+
onKeyUp?: ((event: React.KeyboardEvent<HTMLUListElement>) => void) | undefined;
|
|
60
|
+
menuRef?: ((el: HTMLUListElement | null) => void) | undefined;
|
|
61
|
+
popoverRef?: ((el: Popover | null) => void) | undefined;
|
|
62
62
|
mountNode?: import("@instructure/ui-position").PositionMountNode | undefined;
|
|
63
63
|
constrain?: import("@instructure/ui-position").PositionConstraint | undefined;
|
|
64
|
-
liveRegion?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | ((...args: any[]) => any) | undefined;
|
|
65
64
|
shouldHideOnSelect?: boolean | undefined;
|
|
66
65
|
shouldFocusTriggerOnClose?: boolean | undefined;
|
|
67
66
|
type?: "flyout" | undefined;
|
|
@@ -71,25 +70,13 @@ declare class Menu extends Component<MenuProps> {
|
|
|
71
70
|
offsetY?: string | number | undefined;
|
|
72
71
|
})[];
|
|
73
72
|
static defaultProps: {
|
|
74
|
-
children: null;
|
|
75
73
|
label: null;
|
|
76
74
|
disabled: boolean;
|
|
77
75
|
trigger: null;
|
|
78
76
|
placement: string;
|
|
79
77
|
defaultShow: boolean;
|
|
80
|
-
onToggle: (shown: any, menu: any) => void;
|
|
81
|
-
onSelect: (event: any, value: any, selected: any, item: any) => void;
|
|
82
|
-
onDismiss: (event: any, documentClick: any) => void;
|
|
83
|
-
onBlur: (event: any) => void;
|
|
84
|
-
onFocus: (event: any) => void;
|
|
85
|
-
onMouseOver: (event: any) => void;
|
|
86
|
-
onKeyDown: (event: any) => void;
|
|
87
|
-
onKeyUp: (event: any) => void;
|
|
88
|
-
menuRef: (el: any) => void;
|
|
89
|
-
popoverRef: (el: any) => void;
|
|
90
78
|
mountNode: null;
|
|
91
79
|
constrain: string;
|
|
92
|
-
liveRegion: null;
|
|
93
80
|
shouldHideOnSelect: boolean;
|
|
94
81
|
shouldFocusTriggerOnClose: boolean;
|
|
95
82
|
withArrow: boolean;
|
|
@@ -103,43 +90,46 @@ declare class Menu extends Component<MenuProps> {
|
|
|
103
90
|
hasFocus: boolean;
|
|
104
91
|
};
|
|
105
92
|
_rootNode: null;
|
|
106
|
-
_menuItems:
|
|
107
|
-
_popover: null;
|
|
108
|
-
_trigger:
|
|
93
|
+
_menuItems: MenuItem[];
|
|
94
|
+
_popover: Popover | null;
|
|
95
|
+
_trigger: MenuItem | (React.ReactInstance & {
|
|
96
|
+
focus?: () => void;
|
|
97
|
+
}) | null;
|
|
109
98
|
_menu: HTMLUListElement | null;
|
|
110
99
|
_labelId: string;
|
|
111
|
-
_activeSubMenu
|
|
112
|
-
|
|
100
|
+
_activeSubMenu?: Menu | null;
|
|
101
|
+
_id: string;
|
|
102
|
+
ref: Element | null;
|
|
113
103
|
handleRef: (el: HTMLUListElement | null) => void;
|
|
114
|
-
constructor(props:
|
|
104
|
+
constructor(props: MenuProps);
|
|
115
105
|
componentDidMount(): void;
|
|
116
|
-
componentDidUpdate(
|
|
117
|
-
static contextType:
|
|
118
|
-
registerMenuItem: () => void;
|
|
119
|
-
removeMenuItem: () => void;
|
|
106
|
+
componentDidUpdate(): void;
|
|
107
|
+
static contextType: React.Context<{
|
|
108
|
+
registerMenuItem: (_value: MenuItem) => void;
|
|
109
|
+
removeMenuItem: (_value: MenuItem) => void;
|
|
120
110
|
}>;
|
|
121
|
-
registerMenuItem: (item:
|
|
122
|
-
removeMenuItem: (item:
|
|
123
|
-
get menuItems():
|
|
124
|
-
getMenuItemIndex: (item:
|
|
125
|
-
handleTriggerKeyDown: (event:
|
|
126
|
-
handleTriggerMouseOver: () => void;
|
|
127
|
-
handleToggle: (shown:
|
|
128
|
-
handleMenuKeyDown: (event:
|
|
129
|
-
handleMenuItemSelect:
|
|
111
|
+
registerMenuItem: (item: MenuItem) => void;
|
|
112
|
+
removeMenuItem: (item: MenuItem) => void;
|
|
113
|
+
get menuItems(): MenuItem[];
|
|
114
|
+
getMenuItemIndex: (item: MenuItem) => number;
|
|
115
|
+
handleTriggerKeyDown: (event: React.KeyboardEvent) => void;
|
|
116
|
+
handleTriggerMouseOver: (event: React.MouseEvent) => void;
|
|
117
|
+
handleToggle: (shown: boolean) => void;
|
|
118
|
+
handleMenuKeyDown: (event: React.KeyboardEvent<HTMLUListElement>) => void;
|
|
119
|
+
handleMenuItemSelect: OnMenuItemSelect;
|
|
130
120
|
handleMenuItemFocus: () => void;
|
|
131
121
|
handleMenuItemBlur: () => void;
|
|
132
|
-
handleMenuItemMouseOver:
|
|
133
|
-
hideActiveSubMenu: (event:
|
|
134
|
-
handleSubMenuToggle:
|
|
135
|
-
handleSubMenuDismiss: (event:
|
|
136
|
-
hide: (event:
|
|
137
|
-
show: (event:
|
|
122
|
+
handleMenuItemMouseOver: MenuItemProps['onMouseOver'];
|
|
123
|
+
hideActiveSubMenu: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
124
|
+
handleSubMenuToggle: MenuProps['onToggle'];
|
|
125
|
+
handleSubMenuDismiss: (event: React.MouseEvent | React.KeyboardEvent, documentClick: boolean) => void;
|
|
126
|
+
hide: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
127
|
+
show: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
138
128
|
focus(): void;
|
|
139
129
|
focused(): boolean;
|
|
140
130
|
get focusedIndex(): number;
|
|
141
|
-
moveFocus(step:
|
|
142
|
-
get shown():
|
|
131
|
+
moveFocus(step: number): void;
|
|
132
|
+
get shown(): boolean | undefined;
|
|
143
133
|
renderChildren(): jsx.JSX.Element[] | null | undefined;
|
|
144
134
|
renderMenu(): jsx.JSX.Element;
|
|
145
135
|
render(): jsx.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Menu/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Menu/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,KAAK,EAAE,EAAY,SAAS,EAAgB,MAAM,OAAO,CAAA;AAGhE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAWjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IACrC,MAAM,CAAC,QAAQ,CAAC,WAAW,UAAS;IAEpC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;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,mBAAmB,UAKjE;IAED,mBAAmB,EAAE,SAAS,CAAC,UAAU,CAAC,CAIzC;IAED,oBAAoB,UACX,gBAAgB,GAAG,mBAAmB,iBAC9B,OAAO,UAQvB;IAED,IAAI,UAAW,gBAAgB,GAAG,mBAAmB,UAIpD;IAED,IAAI,UAAW,gBAAgB,GAAG,mBAAmB,UAIpD;IAED,KAAK;IAUL,OAAO;IAQP,IAAI,YAAY,WAIf;IAED,SAAS,CAAC,IAAI,EAAE,MAAM;IAmBtB,IAAI,KAAK,wBAER;IAED,cAAc;IAuGd,UAAU;IA+BV,MAAM;CA+DP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAA"}
|
package/types/Menu/props.d.ts
CHANGED
|
@@ -1,40 +1,118 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Menu } from './index';
|
|
3
|
+
import type { PropValidators, MenuTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
3
4
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
5
|
import type { PlacementPropValues, PositionConstraint, PositionMountNode } from '@instructure/ui-position';
|
|
6
|
+
import type { OnMenuItemSelect } from './MenuItem/props';
|
|
7
|
+
import type { Popover } from '@instructure/ui-popover';
|
|
5
8
|
declare type MenuOwnProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Children of type `Menu.Item`, `Menu.Group`, `Menu.Separator`, or `Menu`
|
|
11
|
+
*/
|
|
6
12
|
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Description of the `<Menu />`
|
|
15
|
+
*/
|
|
7
16
|
label?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Is the `<Menu />` disabled
|
|
19
|
+
*/
|
|
8
20
|
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The trigger element, if the `<Menu />` is to render as a popover
|
|
23
|
+
*/
|
|
9
24
|
trigger?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* If a trigger is supplied, where should the `<Menu />` be placed (relative to the trigger)
|
|
27
|
+
*/
|
|
10
28
|
placement?: PlacementPropValues;
|
|
29
|
+
/**
|
|
30
|
+
* Should the `<Menu />` be open for the initial render
|
|
31
|
+
*/
|
|
11
32
|
defaultShow?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Is the `<Menu />` open (should be accompanied by `onToggle`)
|
|
35
|
+
*/
|
|
36
|
+
show?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Callback fired when the `<Menu />` is toggled open/closed. When used with `show`,
|
|
39
|
+
* the component will not control its own state.
|
|
40
|
+
*/
|
|
41
|
+
onToggle?: (show: boolean, menu: Menu) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired when an item within the `<Menu />` is selected
|
|
44
|
+
*/
|
|
45
|
+
onSelect?: OnMenuItemSelect;
|
|
46
|
+
/**
|
|
47
|
+
* If a trigger is supplied, callback fired when the `<Menu />` is closed
|
|
48
|
+
*/
|
|
49
|
+
onDismiss?: (event: React.UIEvent | React.FocusEvent, documentClick: boolean) => void;
|
|
50
|
+
/**
|
|
51
|
+
* If a trigger is supplied, callback fired when the `<Menu />` trigger is focused
|
|
52
|
+
*/
|
|
53
|
+
onFocus?: (event: React.FocusEvent) => void;
|
|
54
|
+
/**
|
|
55
|
+
* If a trigger is supplied, callback fired onMouseOver for the `<Menu />` trigger
|
|
56
|
+
*/
|
|
57
|
+
onMouseOver?: (event: React.MouseEvent) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Callback fired on the onKeyDown of the `<Menu />`
|
|
60
|
+
*/
|
|
61
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLUListElement>) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Callback fired on the onKeyUp of the `<Menu />`
|
|
64
|
+
*/
|
|
65
|
+
onKeyUp?: (event: React.KeyboardEvent<HTMLUListElement>) => void;
|
|
66
|
+
/**
|
|
67
|
+
* A function that returns a reference to the `<Menu />`
|
|
68
|
+
*/
|
|
69
|
+
menuRef?: (el: HTMLUListElement | null) => void;
|
|
70
|
+
/**
|
|
71
|
+
* A function that returns a reference to the `<Popover />`
|
|
72
|
+
*/
|
|
73
|
+
popoverRef?: (el: Popover | null) => void;
|
|
74
|
+
/**
|
|
75
|
+
* If a trigger is supplied, an element or a function returning an element to use as the mount node
|
|
76
|
+
* for the `<Menu />` (defaults to `document.body`)
|
|
77
|
+
*/
|
|
23
78
|
mountNode?: PositionMountNode;
|
|
79
|
+
/**
|
|
80
|
+
* The parent in which to constrain the menu.
|
|
81
|
+
* One of: 'window', 'scroll-parent', 'parent', 'none', an element,
|
|
82
|
+
* or a function returning an element
|
|
83
|
+
*/
|
|
24
84
|
constrain?: PositionConstraint;
|
|
25
|
-
|
|
26
|
-
|
|
85
|
+
/**
|
|
86
|
+
* If a trigger is supplied, should the `<Menu />` hide when an item is selected
|
|
87
|
+
*/
|
|
27
88
|
shouldHideOnSelect?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* If a trigger is supplied, should the `<Menu />` focus the trigger on after closing
|
|
91
|
+
*/
|
|
28
92
|
shouldFocusTriggerOnClose?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The type of `<Menu />`
|
|
95
|
+
*/
|
|
29
96
|
type?: 'flyout';
|
|
30
97
|
id?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Whether or not an arrow pointing to the trigger should be rendered
|
|
100
|
+
*/
|
|
31
101
|
withArrow?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* The horizontal offset for the positioned content.
|
|
104
|
+
* Works only if `trigger` is provided.
|
|
105
|
+
*/
|
|
32
106
|
offsetX?: string | number;
|
|
107
|
+
/**
|
|
108
|
+
* The vertical offset for the positioned content.
|
|
109
|
+
* Works only if `trigger` is provided.
|
|
110
|
+
*/
|
|
33
111
|
offsetY?: string | number;
|
|
34
112
|
};
|
|
35
113
|
declare type PropKeys = keyof MenuOwnProps;
|
|
36
114
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
37
|
-
declare type MenuProps = MenuOwnProps & WithStyleProps<MenuTheme, MenuStyle>;
|
|
115
|
+
declare type MenuProps = MenuOwnProps & WithStyleProps<MenuTheme, MenuStyle> & OtherHTMLAttributes<MenuOwnProps>;
|
|
38
116
|
declare type MenuStyle = ComponentStyle<'menu'>;
|
|
39
117
|
declare const propTypes: PropValidators<PropKeys>;
|
|
40
118
|
declare const allowedProps: AllowedPropKeys;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Menu/props.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Menu/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,aAAK,YAAY,GAAG;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAC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kB,CAAA;IAC9B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC1B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,YAAY,CAAA;AAElC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,SAAS,GAAG,YAAY,GAC3B,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,GACpC,mBAAmB,CAAC,YAAY,CAAC,CAAA;AAEnC,aAAK,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;AAEvC,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA+BvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eA0BnB,CAAA;AAED,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/MenuContext.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MenuItem } from './Menu/MenuItem';
|
|
2
3
|
/**
|
|
3
4
|
---
|
|
4
5
|
private: true
|
|
@@ -6,8 +7,8 @@ private: true
|
|
|
6
7
|
@module MenuContext
|
|
7
8
|
**/
|
|
8
9
|
declare const MenuContext: import("react").Context<{
|
|
9
|
-
registerMenuItem: () => void;
|
|
10
|
-
removeMenuItem: () => void;
|
|
10
|
+
registerMenuItem: (_value: MenuItem) => void;
|
|
11
|
+
removeMenuItem: (_value: MenuItem) => void;
|
|
11
12
|
}>;
|
|
12
13
|
export default MenuContext;
|
|
13
14
|
export { MenuContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../src/MenuContext.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"MenuContext.d.ts","sourceRoot":"","sources":["../src/MenuContext.ts"],"names":[],"mappings":";AAyBA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C;;;;;GAKG;AACH,QAAA,MAAM,WAAW;+BACY,QAAQ;6BACV,QAAQ;EACjC,CAAA;AAEF,eAAe,WAAW,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|