@umbraco-ui/uui-card-user 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 +41 -7
- package/lib/uui-card-user.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 } 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 UUICardUserElement = class extends UUICardElement {
|
|
19
34
|
constructor() {
|
|
20
35
|
super(...arguments);
|
|
36
|
+
__privateAdd(this, _renderButton);
|
|
37
|
+
__privateAdd(this, _renderLink);
|
|
21
38
|
this.name = "";
|
|
22
39
|
}
|
|
23
40
|
connectedCallback() {
|
|
@@ -27,19 +44,36 @@ let UUICardUserElement = class extends UUICardElement {
|
|
|
27
44
|
render() {
|
|
28
45
|
return html`
|
|
29
46
|
<uui-avatar id="avatar" name=${this.name} size="m"></uui-avatar>
|
|
30
|
-
|
|
31
|
-
id="open-part"
|
|
32
|
-
tabindex=${this.disabled ? nothing : "0"}
|
|
33
|
-
@click=${this.handleOpenClick}
|
|
34
|
-
@keydown=${this.handleOpenKeydown}>
|
|
35
|
-
<span> ${this.name} </span>
|
|
36
|
-
</div>
|
|
47
|
+
${this.href ? __privateMethod(this, _renderLink, renderLink_fn).call(this) : __privateMethod(this, _renderButton, renderButton_fn).call(this)}
|
|
37
48
|
<slot></slot>
|
|
38
49
|
<slot name="tag"></slot>
|
|
39
50
|
<slot name="actions"></slot>
|
|
40
51
|
`;
|
|
41
52
|
}
|
|
42
53
|
};
|
|
54
|
+
_renderButton = new WeakSet();
|
|
55
|
+
renderButton_fn = function() {
|
|
56
|
+
return html`<div
|
|
57
|
+
id="open-part"
|
|
58
|
+
tabindex=${this.disabled ? nothing : "0"}
|
|
59
|
+
@click=${this.handleOpenClick}
|
|
60
|
+
@keydown=${this.handleOpenKeydown}>
|
|
61
|
+
<span> ${this.name} </span>
|
|
62
|
+
</div>`;
|
|
63
|
+
};
|
|
64
|
+
_renderLink = new WeakSet();
|
|
65
|
+
renderLink_fn = function() {
|
|
66
|
+
return html`<a
|
|
67
|
+
id="open-part"
|
|
68
|
+
tabindex=${this.disabled ? nothing : "0"}
|
|
69
|
+
href=${ifDefined(!this.disabled ? this.href : void 0)}
|
|
70
|
+
target=${ifDefined(this.target || void 0)}
|
|
71
|
+
rel=${ifDefined(
|
|
72
|
+
this.target === "_blank" ? "noopener noreferrer" : void 0
|
|
73
|
+
)}>
|
|
74
|
+
<span>${this.name}</span>
|
|
75
|
+
</a>`;
|
|
76
|
+
};
|
|
43
77
|
UUICardUserElement.styles = [
|
|
44
78
|
...UUICardElement.styles,
|
|
45
79
|
css`
|
|
@@ -7,6 +7,7 @@ import { UUICardElement } from '@umbraco-ui/uui-card/lib';
|
|
|
7
7
|
* @slot actions - slot for the actions with support for the `<uui-action-bar>` element
|
|
8
8
|
*/
|
|
9
9
|
export declare class UUICardUserElement extends UUICardElement {
|
|
10
|
+
#private;
|
|
10
11
|
static styles: import("lit").CSSResult[];
|
|
11
12
|
/**
|
|
12
13
|
* User name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-card-user",
|
|
3
|
-
"version": "1.4.0
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"custom-elements.json"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@umbraco-ui/uui-avatar": "1.4.0
|
|
35
|
-
"@umbraco-ui/uui-base": "1.4.0
|
|
36
|
-
"@umbraco-ui/uui-card": "1.4.0
|
|
34
|
+
"@umbraco-ui/uui-avatar": "1.4.0",
|
|
35
|
+
"@umbraco-ui/uui-base": "1.4.0",
|
|
36
|
+
"@umbraco-ui/uui-card": "1.4.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-card-user",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "09437426b75b875ea93d7ab61b489d3817d81d96"
|
|
48
48
|
}
|