@umbraco-ui/uui-menu-item 1.9.0-rc.1 → 1.10.0-rc.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 +13 -4
- 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);
|
|
@@ -10,12 +10,14 @@ declare const UUIMenuItemElement_base: (new (...args: any[]) => import("@umbraco
|
|
|
10
10
|
* @cssprop --uui-menu-item-color-active - text color when active
|
|
11
11
|
* @cssprop --uui-menu-item-background-color-disabled - background color when disabled
|
|
12
12
|
* @cssprop --uui-menu-item-color-disabled - text color when disabled
|
|
13
|
-
*
|
|
13
|
+
* @cssprop --uui-menu-item-background-color-selected - background color when selected
|
|
14
14
|
* @cssprop --uui-menu-item-color-selected - text color when selected
|
|
15
15
|
* @cssprop --uui-menu-item-color-background-selected-hover - text color when selected
|
|
16
16
|
* @fires {UUIMenuItemEvent} show-children - fires when the expand icon is clicked to show nested menu items
|
|
17
17
|
* @fires {UUIMenuItemEvent} hide-children - fires when the expend icon is clicked to hide nested menu items
|
|
18
18
|
* @fires {UUIMenuItemEvent} click-label - fires when the label is clicked
|
|
19
|
+
* @fires {UUISelectableEvent} selected - fires when the media card is selected
|
|
20
|
+
* @fires {UUISelectableEvent} deselected - fires when the media card is deselected
|
|
19
21
|
* @slot - nested menu items go here
|
|
20
22
|
* @slot icon - icon area
|
|
21
23
|
* @slot actions - actions area
|
|
@@ -32,14 +34,14 @@ export declare class UUIMenuItemElement extends UUIMenuItemElement_base {
|
|
|
32
34
|
/**
|
|
33
35
|
* Controls if nested items should be shown.
|
|
34
36
|
* @type {boolean}
|
|
35
|
-
* @attr
|
|
37
|
+
* @attr show-children
|
|
36
38
|
* @default false
|
|
37
39
|
*/
|
|
38
40
|
showChildren: boolean;
|
|
39
41
|
/**
|
|
40
42
|
* Shows/hides the caret.
|
|
41
43
|
* @type {boolean}
|
|
42
|
-
* @attr
|
|
44
|
+
* @attr has-children
|
|
43
45
|
* @default false
|
|
44
46
|
*/
|
|
45
47
|
hasChildren: boolean;
|
|
@@ -74,10 +76,17 @@ export declare class UUIMenuItemElement extends UUIMenuItemElement_base {
|
|
|
74
76
|
/**
|
|
75
77
|
* Sets the selection mode.
|
|
76
78
|
* @type {string}
|
|
77
|
-
* @attr
|
|
79
|
+
* @attr select-mode
|
|
78
80
|
* @default undefined
|
|
79
81
|
*/
|
|
80
82
|
selectMode?: 'highlight' | 'persisting';
|
|
83
|
+
/**
|
|
84
|
+
* Sets the aria-label for the caret button.
|
|
85
|
+
* @remark Only used when the menu item has children.
|
|
86
|
+
* @attr caret-label
|
|
87
|
+
* @default 'Reveal the underlying items'
|
|
88
|
+
*/
|
|
89
|
+
caretLabel: string;
|
|
81
90
|
private iconSlotHasContent;
|
|
82
91
|
connectedCallback(): void;
|
|
83
92
|
focus(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-menu-item",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0-rc.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.
|
|
34
|
-
"@umbraco-ui/uui-loader-bar": "1.
|
|
35
|
-
"@umbraco-ui/uui-symbol-expand": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.10.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-loader-bar": "1.10.0-rc.0",
|
|
35
|
+
"@umbraco-ui/uui-symbol-expand": "1.10.0-rc.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": "f7982264bca0f2db4109c638e458f10719b1c22f"
|
|
47
47
|
}
|