@umbraco-ui/uui-menu-item 1.9.0-rc.1 → 1.9.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/custom-elements.json +13 -0
- package/lib/index.js +11 -2
- package/lib/uui-menu-item.element.d.ts +7 -0
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -53,6 +53,12 @@
|
|
|
53
53
|
"type": "string",
|
|
54
54
|
"default": "\"undefined\""
|
|
55
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"name": "caret-label",
|
|
58
|
+
"description": "Sets the aria-label for the caret button.",
|
|
59
|
+
"type": "string",
|
|
60
|
+
"default": "\"'Reveal the underlying items'\""
|
|
61
|
+
},
|
|
56
62
|
{
|
|
57
63
|
"name": "select-only",
|
|
58
64
|
"description": "Enforce selection interaction and prevent all other interactions, set this when the UI is turned into Selection-Mode.",
|
|
@@ -138,6 +144,13 @@
|
|
|
138
144
|
"type": "string",
|
|
139
145
|
"default": "\"undefined\""
|
|
140
146
|
},
|
|
147
|
+
{
|
|
148
|
+
"name": "caretLabel",
|
|
149
|
+
"attribute": "caret-label",
|
|
150
|
+
"description": "Sets the aria-label for the caret button.",
|
|
151
|
+
"type": "string",
|
|
152
|
+
"default": "\"'Reveal the underlying items'\""
|
|
153
|
+
},
|
|
141
154
|
{
|
|
142
155
|
"name": "styles",
|
|
143
156
|
"type": "CSSResult[]",
|
package/lib/index.js
CHANGED
|
@@ -32,6 +32,7 @@ let UUIMenuItemElement = class extends SelectOnlyMixin(
|
|
|
32
32
|
this.showChildren = false;
|
|
33
33
|
this.hasChildren = false;
|
|
34
34
|
this.loading = false;
|
|
35
|
+
this.caretLabel = "Reveal the underlying items";
|
|
35
36
|
this.iconSlotHasContent = false;
|
|
36
37
|
this._labelButtonChanged = (label) => {
|
|
37
38
|
this.selectableTarget = label || this;
|
|
@@ -105,8 +106,13 @@ let UUIMenuItemElement = class extends SelectOnlyMixin(
|
|
|
105
106
|
render() {
|
|
106
107
|
return html`
|
|
107
108
|
<div id="menu-item" aria-label="menuitem" role="menuitem">
|
|
108
|
-
${this.hasChildren ? html`<button
|
|
109
|
-
|
|
109
|
+
${this.hasChildren ? html`<button
|
|
110
|
+
id="caret-button"
|
|
111
|
+
aria-label=${this.caretLabel}
|
|
112
|
+
@click=${this._onCaretClicked}>
|
|
113
|
+
<uui-symbol-expand
|
|
114
|
+
aria-hidden="true"
|
|
115
|
+
?open=${this.showChildren}></uui-symbol-expand>
|
|
110
116
|
</button>` : ""}
|
|
111
117
|
${this.href ? this._renderLabelAsAnchor() : this._renderLabelAsButton()}
|
|
112
118
|
|
|
@@ -514,6 +520,9 @@ __decorateClass([
|
|
|
514
520
|
__decorateClass([
|
|
515
521
|
property({ type: String, attribute: "select-mode", reflect: true })
|
|
516
522
|
], UUIMenuItemElement.prototype, "selectMode", 2);
|
|
523
|
+
__decorateClass([
|
|
524
|
+
property({ type: String, attribute: "caret-label" })
|
|
525
|
+
], UUIMenuItemElement.prototype, "caretLabel", 2);
|
|
517
526
|
__decorateClass([
|
|
518
527
|
state()
|
|
519
528
|
], UUIMenuItemElement.prototype, "iconSlotHasContent", 2);
|
|
@@ -78,6 +78,13 @@ export declare class UUIMenuItemElement extends UUIMenuItemElement_base {
|
|
|
78
78
|
* @default undefined
|
|
79
79
|
*/
|
|
80
80
|
selectMode?: 'highlight' | 'persisting';
|
|
81
|
+
/**
|
|
82
|
+
* Sets the aria-label for the caret button.
|
|
83
|
+
* @remark Only used when the menu item has children.
|
|
84
|
+
* @attr
|
|
85
|
+
* @default 'Reveal the underlying items'
|
|
86
|
+
*/
|
|
87
|
+
caretLabel: string;
|
|
81
88
|
private iconSlotHasContent;
|
|
82
89
|
connectedCallback(): void;
|
|
83
90
|
focus(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-menu-item",
|
|
3
|
-
"version": "1.9.0
|
|
3
|
+
"version": "1.9.0",
|
|
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.9.0
|
|
34
|
-
"@umbraco-ui/uui-loader-bar": "1.9.0
|
|
35
|
-
"@umbraco-ui/uui-symbol-expand": "1.9.0
|
|
33
|
+
"@umbraco-ui/uui-base": "1.9.0",
|
|
34
|
+
"@umbraco-ui/uui-loader-bar": "1.9.0",
|
|
35
|
+
"@umbraco-ui/uui-symbol-expand": "1.9.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": "37111ea2cebb5883dcef0e682916f1e101013123"
|
|
47
47
|
}
|