@umbraco-ui/uui-card-content-node 1.4.0-rc.1 → 1.4.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 +27 -1
- package/lib/index.js +49 -11
- package/lib/uui-card-content-node.element.d.ts +1 -0
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -23,6 +23,18 @@
|
|
|
23
23
|
"type": "boolean",
|
|
24
24
|
"default": "\"false\""
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"name": "href",
|
|
28
|
+
"description": "Set an href, this will turns the name of the card into an anchor tag.",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"default": "\"undefined\""
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "target",
|
|
34
|
+
"description": "Set an anchor tag target, only used when using href.",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"default": "\"undefined\""
|
|
37
|
+
},
|
|
26
38
|
{
|
|
27
39
|
"name": "select-only",
|
|
28
40
|
"description": "Enforce selection interaction and prevent all other interactions, set this when the UI is turned into Selection-Mode.",
|
|
@@ -67,6 +79,20 @@
|
|
|
67
79
|
"type": "boolean",
|
|
68
80
|
"default": "\"false\""
|
|
69
81
|
},
|
|
82
|
+
{
|
|
83
|
+
"name": "href",
|
|
84
|
+
"attribute": "href",
|
|
85
|
+
"description": "Set an href, this will turns the name of the card into an anchor tag.",
|
|
86
|
+
"type": "string",
|
|
87
|
+
"default": "\"undefined\""
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "target",
|
|
91
|
+
"attribute": "target",
|
|
92
|
+
"description": "Set an anchor tag target, only used when using href.",
|
|
93
|
+
"type": "string",
|
|
94
|
+
"default": "\"undefined\""
|
|
95
|
+
},
|
|
70
96
|
{
|
|
71
97
|
"name": "selectOnly",
|
|
72
98
|
"attribute": "select-only",
|
|
@@ -90,7 +116,7 @@
|
|
|
90
116
|
"events": [
|
|
91
117
|
{
|
|
92
118
|
"name": "open",
|
|
93
|
-
"description": "fires when the card title is clicked"
|
|
119
|
+
"description": "fires when the card title is clicked."
|
|
94
120
|
},
|
|
95
121
|
{
|
|
96
122
|
"name": "selected",
|
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
|
|
|
3
3
|
import { UUICardElement } from '@umbraco-ui/uui-card/lib';
|
|
4
4
|
import { css, html, nothing } from 'lit';
|
|
5
5
|
import { property, state } from 'lit/decorators.js';
|
|
6
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
7
|
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
8
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -15,9 +16,25 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
16
|
__defProp(target, key, result);
|
|
16
17
|
return result;
|
|
17
18
|
};
|
|
19
|
+
var __accessCheck = (obj, member, msg) => {
|
|
20
|
+
if (!member.has(obj))
|
|
21
|
+
throw TypeError("Cannot " + msg);
|
|
22
|
+
};
|
|
23
|
+
var __privateAdd = (obj, member, value) => {
|
|
24
|
+
if (member.has(obj))
|
|
25
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
26
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
27
|
+
};
|
|
28
|
+
var __privateMethod = (obj, member, method) => {
|
|
29
|
+
__accessCheck(obj, member, "access private method");
|
|
30
|
+
return method;
|
|
31
|
+
};
|
|
32
|
+
var _renderButton, renderButton_fn, _renderLink, renderLink_fn;
|
|
18
33
|
let UUICardContentNodeElement = class extends UUICardElement {
|
|
19
34
|
constructor() {
|
|
20
35
|
super(...arguments);
|
|
36
|
+
__privateAdd(this, _renderButton);
|
|
37
|
+
__privateAdd(this, _renderLink);
|
|
21
38
|
this.name = "";
|
|
22
39
|
this._iconSlotHasContent = false;
|
|
23
40
|
this.fallbackIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M396.441 138.878l-83.997-83.993-7.331-7.333H105.702v416.701h298.071V146.214l-7.332-7.336zM130.74 439.217V72.591h141.613c37.201 0 19.274 88.18 19.274 88.18s86-20.901 87.104 18.534v259.912H130.74z"></path></svg>';
|
|
@@ -31,17 +48,7 @@ let UUICardContentNodeElement = class extends UUICardElement {
|
|
|
31
48
|
}
|
|
32
49
|
render() {
|
|
33
50
|
return html`
|
|
34
|
-
|
|
35
|
-
id="open-part"
|
|
36
|
-
tabindex=${this.disabled ? nothing : 0}
|
|
37
|
-
@click=${this.handleOpenClick}
|
|
38
|
-
@keydown=${this.handleOpenKeydown}>
|
|
39
|
-
<span id="icon">
|
|
40
|
-
<slot name="icon" @slotchange=${this._onSlotIconChange}></slot>
|
|
41
|
-
${this._iconSlotHasContent === false ? this._renderFallbackIcon() : ""}
|
|
42
|
-
</span>
|
|
43
|
-
<span id="name"> ${this.name} </span>
|
|
44
|
-
</div>
|
|
51
|
+
${this.href ? __privateMethod(this, _renderLink, renderLink_fn).call(this) : __privateMethod(this, _renderButton, renderButton_fn).call(this)}
|
|
45
52
|
<!-- Select border must be right after #open-part -->
|
|
46
53
|
<div id="select-border"></div>
|
|
47
54
|
|
|
@@ -51,6 +58,37 @@ let UUICardContentNodeElement = class extends UUICardElement {
|
|
|
51
58
|
`;
|
|
52
59
|
}
|
|
53
60
|
};
|
|
61
|
+
_renderButton = new WeakSet();
|
|
62
|
+
renderButton_fn = function() {
|
|
63
|
+
return html`<div
|
|
64
|
+
id="open-part"
|
|
65
|
+
tabindex=${this.disabled ? nothing : 0}
|
|
66
|
+
@click=${this.handleOpenClick}
|
|
67
|
+
@keydown=${this.handleOpenKeydown}>
|
|
68
|
+
<span id="icon">
|
|
69
|
+
<slot name="icon" @slotchange=${this._onSlotIconChange}></slot>
|
|
70
|
+
${this._iconSlotHasContent === false ? this._renderFallbackIcon() : ""}
|
|
71
|
+
</span>
|
|
72
|
+
<span id="name"> ${this.name} </span>
|
|
73
|
+
</div>`;
|
|
74
|
+
};
|
|
75
|
+
_renderLink = new WeakSet();
|
|
76
|
+
renderLink_fn = function() {
|
|
77
|
+
return html`<a
|
|
78
|
+
id="open-part"
|
|
79
|
+
tabindex=${this.disabled ? nothing : 0}
|
|
80
|
+
href=${ifDefined(!this.disabled ? this.href : void 0)}
|
|
81
|
+
target=${ifDefined(this.target || void 0)}
|
|
82
|
+
rel=${ifDefined(
|
|
83
|
+
this.target === "_blank" ? "noopener noreferrer" : void 0
|
|
84
|
+
)}>
|
|
85
|
+
<span id="icon">
|
|
86
|
+
<slot name="icon" @slotchange=${this._onSlotIconChange}></slot>
|
|
87
|
+
${this._iconSlotHasContent === false ? this._renderFallbackIcon() : ""}
|
|
88
|
+
</span>
|
|
89
|
+
<span id="name"> ${this.name} </span>
|
|
90
|
+
</a>`;
|
|
91
|
+
};
|
|
54
92
|
UUICardContentNodeElement.styles = [
|
|
55
93
|
...UUICardElement.styles,
|
|
56
94
|
css`
|
|
@@ -8,6 +8,7 @@ import { UUICardElement } from '@umbraco-ui/uui-card/lib';
|
|
|
8
8
|
* @slot actions - slot for the actions with support for the `<uui-action-bar>` element
|
|
9
9
|
*/
|
|
10
10
|
export declare class UUICardContentNodeElement extends UUICardElement {
|
|
11
|
+
#private;
|
|
11
12
|
static styles: import("lit").CSSResult[];
|
|
12
13
|
/**
|
|
13
14
|
* Node name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-card-content-node",
|
|
3
|
-
"version": "1.4.0
|
|
3
|
+
"version": "1.4.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.4.0
|
|
34
|
-
"@umbraco-ui/uui-card": "1.4.0
|
|
35
|
-
"@umbraco-ui/uui-icon": "1.4.0
|
|
33
|
+
"@umbraco-ui/uui-base": "1.4.0",
|
|
34
|
+
"@umbraco-ui/uui-card": "1.4.0",
|
|
35
|
+
"@umbraco-ui/uui-icon": "1.4.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "npm run analyze && tsc --build --force && 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-card-content-node",
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "09437426b75b875ea93d7ab61b489d3817d81d96"
|
|
47
47
|
}
|