@umbraco-ui/uui-menu-item 1.8.0-rc.1 → 1.8.2
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/lib/index.js +10 -7
- package/lib/uui-menu-item.element.d.ts +1 -0
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -20,8 +20,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
20
20
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
21
|
if (decorator = decorators[i])
|
|
22
22
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23
|
-
if (kind && result)
|
|
24
|
-
__defProp(target, key, result);
|
|
23
|
+
if (kind && result) __defProp(target, key, result);
|
|
25
24
|
return result;
|
|
26
25
|
};
|
|
27
26
|
let UUIMenuItemElement = class extends SelectOnlyMixin(
|
|
@@ -44,8 +43,7 @@ let UUIMenuItemElement = class extends SelectOnlyMixin(
|
|
|
44
43
|
const eventName = this.showChildren ? UUIMenuItemEvent.HIDE_CHILDREN : UUIMenuItemEvent.SHOW_CHILDREN;
|
|
45
44
|
const event = new UUIMenuItemEvent(eventName, { cancelable: true });
|
|
46
45
|
this.dispatchEvent(event);
|
|
47
|
-
if (event.defaultPrevented)
|
|
48
|
-
return;
|
|
46
|
+
if (event.defaultPrevented) return;
|
|
49
47
|
this.showChildren = !this.showChildren;
|
|
50
48
|
};
|
|
51
49
|
this._onLabelClicked = () => {
|
|
@@ -55,11 +53,14 @@ let UUIMenuItemElement = class extends SelectOnlyMixin(
|
|
|
55
53
|
}
|
|
56
54
|
connectedCallback() {
|
|
57
55
|
super.connectedCallback();
|
|
58
|
-
if (!this.hasAttribute("role"))
|
|
59
|
-
this.setAttribute("role", "menu");
|
|
56
|
+
if (!this.hasAttribute("role")) this.setAttribute("role", "menu");
|
|
60
57
|
demandCustomElement(this, "uui-symbol-expand");
|
|
61
58
|
demandCustomElement(this, "uui-loader-bar");
|
|
62
59
|
}
|
|
60
|
+
async focus() {
|
|
61
|
+
await this.updateComplete;
|
|
62
|
+
this.shadowRoot?.querySelector("#label-button")?.focus?.();
|
|
63
|
+
}
|
|
63
64
|
_renderLabelInside() {
|
|
64
65
|
return html` <slot
|
|
65
66
|
name="icon"
|
|
@@ -409,13 +410,15 @@ UUIMenuItemElement.styles = [
|
|
|
409
410
|
|
|
410
411
|
#actions-container {
|
|
411
412
|
opacity: 0;
|
|
412
|
-
|
|
413
|
+
width: 0;
|
|
413
414
|
grid-column-start: 3;
|
|
415
|
+
overflow: hidden;
|
|
414
416
|
}
|
|
415
417
|
:host(:not([disabled])) #menu-item:hover #actions-container,
|
|
416
418
|
:host(:not([disabled])) #menu-item:focus #actions-container,
|
|
417
419
|
:host(:not([disabled])) #menu-item:focus-within #actions-container {
|
|
418
420
|
opacity: 1;
|
|
421
|
+
width: auto;
|
|
419
422
|
}
|
|
420
423
|
|
|
421
424
|
#loader {
|
|
@@ -73,6 +73,7 @@ export declare class UUIMenuItemElement extends UUIMenuItemElement_base {
|
|
|
73
73
|
selectMode?: 'highlight' | 'persisting';
|
|
74
74
|
private iconSlotHasContent;
|
|
75
75
|
connectedCallback(): void;
|
|
76
|
+
focus(): Promise<void>;
|
|
76
77
|
private _labelButtonChanged;
|
|
77
78
|
private _iconSlotChanged;
|
|
78
79
|
private _onCaretClicked;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-menu-item",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.8.0
|
|
34
|
-
"@umbraco-ui/uui-loader-bar": "1.8.0
|
|
35
|
-
"@umbraco-ui/uui-symbol-expand": "1.8.0
|
|
33
|
+
"@umbraco-ui/uui-base": "1.8.0",
|
|
34
|
+
"@umbraco-ui/uui-loader-bar": "1.8.0",
|
|
35
|
+
"@umbraco-ui/uui-symbol-expand": "1.8.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-menu-item",
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ff7f8bf2e837773d2a73d4ca5eb9b67857b3dd8b"
|
|
47
47
|
}
|