@umbraco-ui/uui-card-user 1.14.1 → 1.15.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.
Files changed (2) hide show
  1. package/lib/index.js +38 -32
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
2
2
  import { slotHasContent, demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
3
3
  import { UUICardElement } from '@umbraco-ui/uui-card/lib';
4
- import { css, html, nothing } from 'lit';
4
+ import { css, nothing, html } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
6
6
  import { ifDefined } from 'lit/directives/if-defined.js';
7
7
 
@@ -41,6 +41,7 @@ let UUICardUserElement = class extends UUICardElement {
41
41
  ${this.href ? __privateMethod(this, _UUICardUserElement_instances, renderLink_fn).call(this) : __privateMethod(this, _UUICardUserElement_instances, renderButton_fn).call(this)}
42
42
  <!-- Select border must be right after #open-part -->
43
43
  <div id="select-border"></div>
44
+ ${this.selectable ? this.renderCheckbox() : nothing}
44
45
  <slot name="tag"></slot>
45
46
  <slot name="actions"></slot>
46
47
  `;
@@ -48,41 +49,46 @@ let UUICardUserElement = class extends UUICardElement {
48
49
  };
49
50
  _UUICardUserElement_instances = new WeakSet();
50
51
  renderButton_fn = function() {
51
- return html`<div
52
- id="open-part"
53
- tabindex=${this.disabled ? nothing : "0"}
54
- @click=${this.handleOpenClick}
55
- @keydown=${this.handleOpenKeydown}>
56
- ${__privateMethod(this, _UUICardUserElement_instances, renderContent_fn).call(this)}
57
- </div>`;
52
+ const tabIndex = !this.disabled ? this.selectOnly ? -1 : 0 : void 0;
53
+ return html`
54
+ <div
55
+ id="open-part"
56
+ tabindex=${ifDefined(tabIndex)}
57
+ @click=${this.handleOpenClick}
58
+ @keydown=${this.handleOpenKeydown}>
59
+ ${__privateMethod(this, _UUICardUserElement_instances, renderContent_fn).call(this)}
60
+ </div>
61
+ `;
58
62
  };
59
63
  renderLink_fn = function() {
60
- return html`<a
61
- id="open-part"
62
- tabindex=${this.disabled ? nothing : "0"}
63
- href=${ifDefined(!this.disabled ? this.href : void 0)}
64
- target=${ifDefined(this.target || void 0)}
65
- rel=${ifDefined(
66
- this.rel || ifDefined(
67
- this.target === "_blank" ? "noopener noreferrer" : void 0
68
- )
69
- )}>
70
- ${__privateMethod(this, _UUICardUserElement_instances, renderContent_fn).call(this)}
71
- </a>`;
64
+ const tabIndex = !this.disabled ? this.selectOnly ? -1 : 0 : void 0;
65
+ const rel = this.target === "_blank" ? "noopener noreferrer" : void 0;
66
+ return html`
67
+ <a
68
+ id="open-part"
69
+ tabindex=${ifDefined(tabIndex)}
70
+ href=${ifDefined(!this.disabled ? this.href : void 0)}
71
+ target=${ifDefined(this.target || void 0)}
72
+ rel=${ifDefined(this.rel || rel)}>
73
+ ${__privateMethod(this, _UUICardUserElement_instances, renderContent_fn).call(this)}
74
+ </a>
75
+ `;
72
76
  };
73
77
  renderContent_fn = function() {
74
- return html`<div id="content">
75
- ${this._avatarSlotHasContent ? nothing : html`<uui-avatar
76
- class="avatar"
77
- name=${this.name}
78
- size="m"></uui-avatar>`}
79
- <slot
80
- name="avatar"
81
- class="avatar"
82
- @slotchange=${this._avatarSlotChanged}></slot>
83
- <span title="${this.name}">${this.name}</span>
84
- <slot></slot>
85
- </div>`;
78
+ return html`
79
+ <div id="content">
80
+ ${this._avatarSlotHasContent ? nothing : html`<uui-avatar
81
+ class="avatar"
82
+ name=${this.name}
83
+ size="m"></uui-avatar>`}
84
+ <slot
85
+ name="avatar"
86
+ class="avatar"
87
+ @slotchange=${this._avatarSlotChanged}></slot>
88
+ <span title="${this.name}">${this.name}</span>
89
+ <slot></slot>
90
+ </div>
91
+ `;
86
92
  };
87
93
  UUICardUserElement.styles = [
88
94
  ...UUICardElement.styles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-card-user",
3
- "version": "1.14.1",
3
+ "version": "1.15.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.14.1",
35
- "@umbraco-ui/uui-base": "1.14.1",
36
- "@umbraco-ui/uui-card": "1.14.1"
34
+ "@umbraco-ui/uui-avatar": "1.15.0",
35
+ "@umbraco-ui/uui-base": "1.15.0",
36
+ "@umbraco-ui/uui-card": "1.15.0"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "npm run analyze && tsc --build && 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": "1dc16cf95e7f45ee85c8000c4932e827466e5229"
47
+ "gitHead": "b84216deaff3a3be8f7bd8cdbf2758e7955c70e9"
48
48
  }