@umbraco-ui/uui-menu-item 1.8.0 → 1.9.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 +10 -7
- package/lib/uui-menu-item.element.d.ts +7 -0
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
"type": "string",
|
|
42
42
|
"default": "\"undefined\""
|
|
43
43
|
},
|
|
44
|
+
{
|
|
45
|
+
"name": "rel",
|
|
46
|
+
"description": "Set the rel attribute for an anchor tag, only used when using href.",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"default": "\"undefined\""
|
|
49
|
+
},
|
|
44
50
|
{
|
|
45
51
|
"name": "select-mode",
|
|
46
52
|
"description": "Sets the selection mode.",
|
|
@@ -118,6 +124,13 @@
|
|
|
118
124
|
"type": "string",
|
|
119
125
|
"default": "\"undefined\""
|
|
120
126
|
},
|
|
127
|
+
{
|
|
128
|
+
"name": "rel",
|
|
129
|
+
"attribute": "rel",
|
|
130
|
+
"description": "Set the rel attribute for an anchor tag, only used when using href.",
|
|
131
|
+
"type": "string",
|
|
132
|
+
"default": "\"undefined\""
|
|
133
|
+
},
|
|
121
134
|
{
|
|
122
135
|
"name": "selectMode",
|
|
123
136
|
"attribute": "select-mode",
|
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,8 +53,7 @@ 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
|
}
|
|
@@ -85,7 +82,9 @@ let UUIMenuItemElement = class extends SelectOnlyMixin(
|
|
|
85
82
|
href=${ifDefined(this.href)}
|
|
86
83
|
target=${ifDefined(this.target || void 0)}
|
|
87
84
|
rel=${ifDefined(
|
|
88
|
-
this.
|
|
85
|
+
this.rel || ifDefined(
|
|
86
|
+
this.target === "_blank" ? "noopener noreferrer" : void 0
|
|
87
|
+
)
|
|
89
88
|
)}
|
|
90
89
|
@click=${this._onLabelClicked}
|
|
91
90
|
?disabled=${this.disabled}
|
|
@@ -415,6 +414,7 @@ UUIMenuItemElement.styles = [
|
|
|
415
414
|
opacity: 0;
|
|
416
415
|
width: 0;
|
|
417
416
|
grid-column-start: 3;
|
|
417
|
+
overflow: hidden;
|
|
418
418
|
}
|
|
419
419
|
:host(:not([disabled])) #menu-item:hover #actions-container,
|
|
420
420
|
:host(:not([disabled])) #menu-item:focus #actions-container,
|
|
@@ -508,6 +508,9 @@ __decorateClass([
|
|
|
508
508
|
__decorateClass([
|
|
509
509
|
property({ type: String })
|
|
510
510
|
], UUIMenuItemElement.prototype, "target", 2);
|
|
511
|
+
__decorateClass([
|
|
512
|
+
property({ type: String })
|
|
513
|
+
], UUIMenuItemElement.prototype, "rel", 2);
|
|
511
514
|
__decorateClass([
|
|
512
515
|
property({ type: String, attribute: "select-mode", reflect: true })
|
|
513
516
|
], UUIMenuItemElement.prototype, "selectMode", 2);
|
|
@@ -64,6 +64,13 @@ export declare class UUIMenuItemElement extends UUIMenuItemElement_base {
|
|
|
64
64
|
* @default undefined
|
|
65
65
|
*/
|
|
66
66
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
67
|
+
/**
|
|
68
|
+
* Set the rel attribute for an anchor tag, only used when using href.
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @attr
|
|
71
|
+
* @default undefined
|
|
72
|
+
*/
|
|
73
|
+
rel?: string;
|
|
67
74
|
/**
|
|
68
75
|
* Sets the selection mode.
|
|
69
76
|
* @type {string}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-menu-item",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.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.9.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-loader-bar": "1.9.0-rc.0",
|
|
35
|
+
"@umbraco-ui/uui-symbol-expand": "1.9.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": "e3e398e07b6ff9874aa0656cb7767df42f58a4ce"
|
|
47
47
|
}
|