@brightspace-ui/core 2.37.1 → 2.38.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/components/dropdown/dropdown-opener-mixin.js +9 -0
- package/components/empty-state/empty-state-action-button.js +1 -0
- package/components/empty-state/empty-state-styles.js +1 -1
- package/components/menu/menu-item-mixin.js +1 -3
- package/components/menu/menu-item-styles.js +23 -4
- package/components/menu/menu.js +1 -2
- package/components/tooltip/tooltip-help.js +1 -0
- package/custom-elements.json +36 -1
- package/package.json +1 -1
|
@@ -174,6 +174,13 @@ export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
|
174
174
|
this.dropdownOpened = !this.dropdownOpened;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
__dispatchOpenerClickEvent() {
|
|
178
|
+
/** Dispatched when the opener is clicked, useful for when no-auto-open is enabled */
|
|
179
|
+
this.dispatchEvent(new CustomEvent(
|
|
180
|
+
'd2l-dropdown-opener-click', { bubbles: false, composed: false }
|
|
181
|
+
));
|
|
182
|
+
}
|
|
183
|
+
|
|
177
184
|
__getContentElement() {
|
|
178
185
|
if (!this.shadowRoot) return undefined;
|
|
179
186
|
return this.shadowRoot.querySelector('slot:not([name])').assignedNodes()
|
|
@@ -202,6 +209,7 @@ export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
|
202
209
|
__onKeypress(e) {
|
|
203
210
|
if (e.srcElement === this || isComposedAncestor(this.getOpenerElement(), e.srcElement)) {
|
|
204
211
|
if (e.keyCode !== 13 && e.keyCode !== 32) return;
|
|
212
|
+
this.__dispatchOpenerClickEvent();
|
|
205
213
|
if (this.noAutoOpen) return;
|
|
206
214
|
if (!this.openOnHover) {
|
|
207
215
|
this.toggleOpen(true);
|
|
@@ -256,6 +264,7 @@ export const DropdownOpenerMixin = superclass => class extends superclass {
|
|
|
256
264
|
}
|
|
257
265
|
|
|
258
266
|
__onOpenerMouseUp(e) {
|
|
267
|
+
this.__dispatchOpenerClickEvent();
|
|
259
268
|
if (this.noAutoOpen) return;
|
|
260
269
|
if (this.openOnHover) {
|
|
261
270
|
// prevent propogation to window and triggering _onOutsideClick
|
|
@@ -5,6 +5,7 @@ import { css, html, LitElement, nothing } from 'lit';
|
|
|
5
5
|
/**
|
|
6
6
|
* `d2l-empty-state-action-button` is an empty state action component that can be placed inside of the default slot of `empty-state-simple` or `empty-state-illustrated` to add a button action to the component.
|
|
7
7
|
* @fires d2l-empty-state-action - Dispatched when the action button is clicked
|
|
8
|
+
* @fires d2l-empty-state-illustrated-check - Internal event
|
|
8
9
|
*/
|
|
9
10
|
class EmptyStateActionButton extends LitElement {
|
|
10
11
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const MenuItemMixin = superclass => class extends FocusVisiblePolyfillMixin(superclass) {
|
|
1
|
+
export const MenuItemMixin = superclass => class extends superclass {
|
|
4
2
|
|
|
5
3
|
static get properties() {
|
|
6
4
|
return {
|
|
@@ -16,8 +16,6 @@ export const menuItemStyles = css`
|
|
|
16
16
|
width: 100%;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
:host(.focus-visible),
|
|
20
|
-
:host([first].focus-visible),
|
|
21
19
|
:host(:hover),
|
|
22
20
|
:host([first]:hover) {
|
|
23
21
|
background-color: var(--d2l-menu-background-color-hover);
|
|
@@ -27,7 +25,23 @@ export const menuItemStyles = css`
|
|
|
27
25
|
z-index: 2;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
/** separated because Safari <15.4 is having trouble parsing these */
|
|
29
|
+
:host(:focus-visible),
|
|
30
|
+
:host([first]:focus-visible) {
|
|
31
|
+
background-color: var(--d2l-menu-background-color-hover);
|
|
32
|
+
border-bottom: 1px solid var(--d2l-menu-border-color-hover);
|
|
33
|
+
border-top: 1px solid var(--d2l-menu-border-color-hover);
|
|
34
|
+
color: var(--d2l-menu-foreground-color-hover);
|
|
35
|
+
z-index: 2;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host([disabled]), :host([disabled]:hover) {
|
|
39
|
+
cursor: default;
|
|
40
|
+
opacity: 0.75;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** separated because Safari <15.4 is having trouble parsing these */
|
|
44
|
+
:host([disabled]:focus-visible) {
|
|
31
45
|
cursor: default;
|
|
32
46
|
opacity: 0.75;
|
|
33
47
|
}
|
|
@@ -40,7 +54,12 @@ export const menuItemStyles = css`
|
|
|
40
54
|
border-top-color: transparent;
|
|
41
55
|
}
|
|
42
56
|
|
|
43
|
-
:host([last]:hover)
|
|
57
|
+
:host([last]:hover) {
|
|
58
|
+
border-bottom-color: var(--d2l-menu-border-color-hover);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** separated because Safari <15.4 is having trouble parsing these */
|
|
62
|
+
:host([last]:focus-visible) {
|
|
44
63
|
border-bottom-color: var(--d2l-menu-border-color-hover);
|
|
45
64
|
}
|
|
46
65
|
|
package/components/menu/menu.js
CHANGED
|
@@ -2,7 +2,6 @@ import '../colors/colors.js';
|
|
|
2
2
|
import '../icons/icon.js';
|
|
3
3
|
import './menu-item-return.js';
|
|
4
4
|
import { css, html, LitElement } from 'lit';
|
|
5
|
-
import { FocusVisiblePolyfillMixin } from '../../mixins/focus-visible-polyfill-mixin.js';
|
|
6
5
|
import { HierarchicalViewMixin } from '../hierarchical-view/hierarchical-view-mixin.js';
|
|
7
6
|
import { ThemeMixin } from '../../mixins/theme-mixin.js';
|
|
8
7
|
|
|
@@ -21,7 +20,7 @@ const keyCodes = {
|
|
|
21
20
|
* @slot - Menu items
|
|
22
21
|
* @fires d2l-menu-resize - Dispatched when size of menu changes (e.g., when nested menu of a different size is opened)
|
|
23
22
|
*/
|
|
24
|
-
class Menu extends
|
|
23
|
+
class Menu extends ThemeMixin(HierarchicalViewMixin(LitElement)) {
|
|
25
24
|
|
|
26
25
|
static get properties() {
|
|
27
26
|
return {
|
package/custom-elements.json
CHANGED
|
@@ -1815,6 +1815,12 @@
|
|
|
1815
1815
|
"default": "false"
|
|
1816
1816
|
}
|
|
1817
1817
|
],
|
|
1818
|
+
"events": [
|
|
1819
|
+
{
|
|
1820
|
+
"name": "d2l-dropdown-opener-click",
|
|
1821
|
+
"description": "Dispatched when the opener is clicked, useful for when no-auto-open is enabled"
|
|
1822
|
+
}
|
|
1823
|
+
],
|
|
1818
1824
|
"slots": [
|
|
1819
1825
|
{
|
|
1820
1826
|
"name": "",
|
|
@@ -1903,6 +1909,12 @@
|
|
|
1903
1909
|
"default": "false"
|
|
1904
1910
|
}
|
|
1905
1911
|
],
|
|
1912
|
+
"events": [
|
|
1913
|
+
{
|
|
1914
|
+
"name": "d2l-dropdown-opener-click",
|
|
1915
|
+
"description": "Dispatched when the opener is clicked, useful for when no-auto-open is enabled"
|
|
1916
|
+
}
|
|
1917
|
+
],
|
|
1906
1918
|
"slots": [
|
|
1907
1919
|
{
|
|
1908
1920
|
"name": "",
|
|
@@ -2266,6 +2278,12 @@
|
|
|
2266
2278
|
"default": "false"
|
|
2267
2279
|
}
|
|
2268
2280
|
],
|
|
2281
|
+
"events": [
|
|
2282
|
+
{
|
|
2283
|
+
"name": "d2l-dropdown-opener-click",
|
|
2284
|
+
"description": "Dispatched when the opener is clicked, useful for when no-auto-open is enabled"
|
|
2285
|
+
}
|
|
2286
|
+
],
|
|
2269
2287
|
"slots": [
|
|
2270
2288
|
{
|
|
2271
2289
|
"name": "",
|
|
@@ -2629,6 +2647,12 @@
|
|
|
2629
2647
|
"default": "false"
|
|
2630
2648
|
}
|
|
2631
2649
|
],
|
|
2650
|
+
"events": [
|
|
2651
|
+
{
|
|
2652
|
+
"name": "d2l-dropdown-opener-click",
|
|
2653
|
+
"description": "Dispatched when the opener is clicked, useful for when no-auto-open is enabled"
|
|
2654
|
+
}
|
|
2655
|
+
],
|
|
2632
2656
|
"slots": [
|
|
2633
2657
|
{
|
|
2634
2658
|
"name": "",
|
|
@@ -2963,6 +2987,12 @@
|
|
|
2963
2987
|
"default": "false"
|
|
2964
2988
|
}
|
|
2965
2989
|
],
|
|
2990
|
+
"events": [
|
|
2991
|
+
{
|
|
2992
|
+
"name": "d2l-dropdown-opener-click",
|
|
2993
|
+
"description": "Dispatched when the opener is clicked, useful for when no-auto-open is enabled"
|
|
2994
|
+
}
|
|
2995
|
+
],
|
|
2966
2996
|
"slots": [
|
|
2967
2997
|
{
|
|
2968
2998
|
"name": "",
|
|
@@ -3010,7 +3040,8 @@
|
|
|
3010
3040
|
"description": "Dispatched when the action button is clicked"
|
|
3011
3041
|
},
|
|
3012
3042
|
{
|
|
3013
|
-
"name": "d2l-empty-state-illustrated-check"
|
|
3043
|
+
"name": "d2l-empty-state-illustrated-check",
|
|
3044
|
+
"description": "Internal event"
|
|
3014
3045
|
}
|
|
3015
3046
|
]
|
|
3016
3047
|
},
|
|
@@ -9071,6 +9102,10 @@
|
|
|
9071
9102
|
{
|
|
9072
9103
|
"name": "d2l-selection-observer-subscribe",
|
|
9073
9104
|
"description": "Internal event"
|
|
9105
|
+
},
|
|
9106
|
+
{
|
|
9107
|
+
"name": "d2l-dropdown-opener-click",
|
|
9108
|
+
"description": "Dispatched when the opener is clicked, useful for when no-auto-open is enabled"
|
|
9074
9109
|
}
|
|
9075
9110
|
],
|
|
9076
9111
|
"slots": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.38.0",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|