@instructure/ui-menu 8.22.1-snapshot.4 → 8.23.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/index.js +8 -1
- package/lib/Menu/index.js +8 -1
- package/package.json +20 -21
- package/src/Menu/index.tsx +7 -1
- package/src/Menu/props.ts +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Menu/index.d.ts.map +1 -1
- package/types/Menu/props.d.ts +2 -1
- package/types/Menu/props.d.ts.map +1 -1
- package/LICENSE.md +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.23.0](https://github.com/instructure/instructure-ui/compare/v8.22.0...v8.23.0) (2022-04-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-menu
|
|
9
|
+
|
|
6
10
|
# [8.22.0](https://github.com/instructure/instructure-ui/compare/v8.21.0...v8.22.0) (2022-03-31)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @instructure/ui-menu
|
package/es/Menu/index.js
CHANGED
|
@@ -69,6 +69,11 @@ let Menu = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gener
|
|
|
69
69
|
|
|
70
70
|
if (typeof menuRef === 'function') {
|
|
71
71
|
menuRef(el);
|
|
72
|
+
} // If there is no trigger `<ul>` is the ref, otherwise the trigger
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if (!this.props.trigger) {
|
|
76
|
+
this.ref = el;
|
|
72
77
|
}
|
|
73
78
|
};
|
|
74
79
|
|
|
@@ -414,6 +419,9 @@ let Menu = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gener
|
|
|
414
419
|
onMouseOver: onMouseOver,
|
|
415
420
|
offsetX: offsetX,
|
|
416
421
|
offsetY: offsetY,
|
|
422
|
+
elementRef: element => {
|
|
423
|
+
this.ref = element;
|
|
424
|
+
},
|
|
417
425
|
ref: el => {
|
|
418
426
|
this._popover = el;
|
|
419
427
|
|
|
@@ -424,7 +432,6 @@ let Menu = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, gener
|
|
|
424
432
|
renderTrigger: safeCloneElement(trigger, {
|
|
425
433
|
ref: el => {
|
|
426
434
|
this._trigger = el;
|
|
427
|
-
this.ref = (el === null || el === void 0 ? void 0 : el.ref) || el;
|
|
428
435
|
},
|
|
429
436
|
'aria-haspopup': true,
|
|
430
437
|
id: this._labelId,
|
package/lib/Menu/index.js
CHANGED
|
@@ -92,6 +92,11 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
92
92
|
|
|
93
93
|
if (typeof menuRef === 'function') {
|
|
94
94
|
menuRef(el);
|
|
95
|
+
} // If there is no trigger `<ul>` is the ref, otherwise the trigger
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if (!this.props.trigger) {
|
|
99
|
+
this.ref = el;
|
|
95
100
|
}
|
|
96
101
|
};
|
|
97
102
|
|
|
@@ -437,6 +442,9 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
437
442
|
onMouseOver: onMouseOver,
|
|
438
443
|
offsetX: offsetX,
|
|
439
444
|
offsetY: offsetY,
|
|
445
|
+
elementRef: element => {
|
|
446
|
+
this.ref = element;
|
|
447
|
+
},
|
|
440
448
|
ref: el => {
|
|
441
449
|
this._popover = el;
|
|
442
450
|
|
|
@@ -447,7 +455,6 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
447
455
|
renderTrigger: (0, _safeCloneElement.safeCloneElement)(trigger, {
|
|
448
456
|
ref: el => {
|
|
449
457
|
this._trigger = el;
|
|
450
|
-
this.ref = (el === null || el === void 0 ? void 0 : el.ref) || el;
|
|
451
458
|
},
|
|
452
459
|
'aria-haspopup': true,
|
|
453
460
|
id: this._labelId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-menu",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.23.0",
|
|
4
4
|
"description": "A dropdown menu component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.
|
|
27
|
-
"@instructure/ui-color-utils": "8.
|
|
28
|
-
"@instructure/ui-test-locator": "8.
|
|
29
|
-
"@instructure/ui-test-queries": "8.
|
|
30
|
-
"@instructure/ui-test-utils": "8.
|
|
31
|
-
"@instructure/ui-themes": "8.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.23.0",
|
|
27
|
+
"@instructure/ui-color-utils": "8.23.0",
|
|
28
|
+
"@instructure/ui-test-locator": "8.23.0",
|
|
29
|
+
"@instructure/ui-test-queries": "8.23.0",
|
|
30
|
+
"@instructure/ui-test-utils": "8.23.0",
|
|
31
|
+
"@instructure/ui-themes": "8.23.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.
|
|
36
|
-
"@instructure/emotion": "8.
|
|
37
|
-
"@instructure/shared-types": "8.
|
|
38
|
-
"@instructure/ui-a11y-utils": "8.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.
|
|
40
|
-
"@instructure/ui-icons": "8.
|
|
41
|
-
"@instructure/ui-popover": "8.
|
|
42
|
-
"@instructure/ui-position": "8.
|
|
43
|
-
"@instructure/ui-prop-types": "8.
|
|
44
|
-
"@instructure/ui-react-utils": "8.
|
|
45
|
-
"@instructure/ui-testable": "8.
|
|
46
|
-
"@instructure/ui-utils": "8.
|
|
35
|
+
"@instructure/console": "8.23.0",
|
|
36
|
+
"@instructure/emotion": "8.23.0",
|
|
37
|
+
"@instructure/shared-types": "8.23.0",
|
|
38
|
+
"@instructure/ui-a11y-utils": "8.23.0",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.23.0",
|
|
40
|
+
"@instructure/ui-icons": "8.23.0",
|
|
41
|
+
"@instructure/ui-popover": "8.23.0",
|
|
42
|
+
"@instructure/ui-position": "8.23.0",
|
|
43
|
+
"@instructure/ui-prop-types": "8.23.0",
|
|
44
|
+
"@instructure/ui-react-utils": "8.23.0",
|
|
45
|
+
"@instructure/ui-testable": "8.23.0",
|
|
46
|
+
"@instructure/ui-utils": "8.23.0",
|
|
47
47
|
"keycode": "^2",
|
|
48
48
|
"prop-types": "^15"
|
|
49
49
|
},
|
|
@@ -53,6 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"sideEffects": false
|
|
57
|
-
"gitHead": "5809c01bc3fc6e7b468d18d44c22f364304561ed"
|
|
56
|
+
"sideEffects": false
|
|
58
57
|
}
|
package/src/Menu/index.tsx
CHANGED
|
@@ -110,6 +110,10 @@ class Menu extends Component<MenuProps> {
|
|
|
110
110
|
if (typeof menuRef === 'function') {
|
|
111
111
|
menuRef(el)
|
|
112
112
|
}
|
|
113
|
+
// If there is no trigger `<ul>` is the ref, otherwise the trigger
|
|
114
|
+
if (!this.props.trigger) {
|
|
115
|
+
this.ref = el
|
|
116
|
+
}
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
constructor(props: MenuProps) {
|
|
@@ -487,6 +491,9 @@ class Menu extends Component<MenuProps> {
|
|
|
487
491
|
onMouseOver={onMouseOver}
|
|
488
492
|
offsetX={offsetX}
|
|
489
493
|
offsetY={offsetY}
|
|
494
|
+
elementRef={(element) => {
|
|
495
|
+
this.ref = element
|
|
496
|
+
}}
|
|
490
497
|
ref={(el) => {
|
|
491
498
|
this._popover = el
|
|
492
499
|
if (typeof popoverRef === 'function') {
|
|
@@ -496,7 +503,6 @@ class Menu extends Component<MenuProps> {
|
|
|
496
503
|
renderTrigger={safeCloneElement(trigger as ReactElement, {
|
|
497
504
|
ref: (el: (React.ReactInstance & { ref?: Element }) | null) => {
|
|
498
505
|
this._trigger = el
|
|
499
|
-
this.ref = el?.ref || (el as Element)
|
|
500
506
|
},
|
|
501
507
|
'aria-haspopup': true,
|
|
502
508
|
id: this._labelId,
|
package/src/Menu/props.ts
CHANGED
|
@@ -55,7 +55,8 @@ type MenuOwnProps = {
|
|
|
55
55
|
*/
|
|
56
56
|
children?: React.ReactNode // TODO: oneOf(['MenuItem', 'MenuItemGroup', 'MenuItemSeparator', 'Menu'])
|
|
57
57
|
/**
|
|
58
|
-
* Description of the `<Menu
|
|
58
|
+
* Description of the `<Menu />`. The component uses it to add its value to
|
|
59
|
+
* the `aria-label` attribute.
|
|
59
60
|
*/
|
|
60
61
|
label?: string
|
|
61
62
|
/**
|