@umbraco-ui/uui-card-user 1.6.0-rc.0 → 1.6.0-rc.2
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/lib/index.js +17 -3
- package/lib/uui-card-user.element.d.ts +2 -0
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
2
|
-
import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
|
|
2
|
+
import { slotHasContent, 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
|
-
import { property } from 'lit/decorators.js';
|
|
5
|
+
import { property, state } from 'lit/decorators.js';
|
|
6
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
7
7
|
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
@@ -36,6 +36,10 @@ let UUICardUserElement = class extends UUICardElement {
|
|
|
36
36
|
__privateAdd(this, _renderButton);
|
|
37
37
|
__privateAdd(this, _renderLink);
|
|
38
38
|
this.name = "";
|
|
39
|
+
this._avatarSlotHasContent = false;
|
|
40
|
+
this._avatarSlotChanged = (e) => {
|
|
41
|
+
this._avatarSlotHasContent = slotHasContent(e.target);
|
|
42
|
+
};
|
|
39
43
|
}
|
|
40
44
|
connectedCallback() {
|
|
41
45
|
super.connectedCallback();
|
|
@@ -43,7 +47,14 @@ let UUICardUserElement = class extends UUICardElement {
|
|
|
43
47
|
}
|
|
44
48
|
render() {
|
|
45
49
|
return html`
|
|
46
|
-
|
|
50
|
+
${this._avatarSlotHasContent ? nothing : html`<uui-avatar
|
|
51
|
+
id="avatar"
|
|
52
|
+
name=${this.name}
|
|
53
|
+
size="m"></uui-avatar>`}
|
|
54
|
+
<slot
|
|
55
|
+
name="avatar"
|
|
56
|
+
id="avatar"
|
|
57
|
+
@slotchange=${this._avatarSlotChanged}></slot>
|
|
47
58
|
${this.href ? __privateMethod(this, _renderLink, renderLink_fn).call(this) : __privateMethod(this, _renderButton, renderButton_fn).call(this)}
|
|
48
59
|
<slot></slot>
|
|
49
60
|
<slot name="tag"></slot>
|
|
@@ -153,6 +164,9 @@ UUICardUserElement.styles = [
|
|
|
153
164
|
__decorateClass([
|
|
154
165
|
property({ type: String })
|
|
155
166
|
], UUICardUserElement.prototype, "name", 2);
|
|
167
|
+
__decorateClass([
|
|
168
|
+
state()
|
|
169
|
+
], UUICardUserElement.prototype, "_avatarSlotHasContent", 2);
|
|
156
170
|
UUICardUserElement = __decorateClass([
|
|
157
171
|
defineElement("uui-card-user")
|
|
158
172
|
], UUICardUserElement);
|
|
@@ -15,6 +15,8 @@ export declare class UUICardUserElement extends UUICardElement {
|
|
|
15
15
|
* @default ''
|
|
16
16
|
*/
|
|
17
17
|
name: string;
|
|
18
|
+
private _avatarSlotHasContent;
|
|
19
|
+
private _avatarSlotChanged;
|
|
18
20
|
connectedCallback(): void;
|
|
19
21
|
render(): import("lit-html").TemplateResult<1>;
|
|
20
22
|
static styles: import("lit").CSSResult[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-card-user",
|
|
3
|
-
"version": "1.6.0-rc.
|
|
3
|
+
"version": "1.6.0-rc.2",
|
|
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.6.0-rc.
|
|
35
|
-
"@umbraco-ui/uui-base": "1.6.0-rc.
|
|
36
|
-
"@umbraco-ui/uui-card": "1.6.0-rc.
|
|
34
|
+
"@umbraco-ui/uui-avatar": "1.6.0-rc.2",
|
|
35
|
+
"@umbraco-ui/uui-base": "1.6.0-rc.2",
|
|
36
|
+
"@umbraco-ui/uui-card": "1.6.0-rc.2"
|
|
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": "5d4eefce4744802ab5bc40055b1a3136f0afc520"
|
|
48
48
|
}
|