@umbraco-ui/uui-ref-node 1.11.0 → 1.12.1

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 +28 -8
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@ import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
2
2
  import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
3
3
  import { ifDefined } from 'lit/directives/if-defined.js';
4
4
  import { UUIRefElement } from '@umbraco-ui/uui-ref/lib';
5
- import { css, html, nothing } from 'lit';
5
+ import { html, css, nothing } from 'lit';
6
6
  import { property, state } from 'lit/decorators.js';
7
7
 
8
8
  var __defProp = Object.defineProperty;
@@ -21,7 +21,7 @@ var __decorateClass = (decorators, target, key, kind) => {
21
21
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
22
22
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
23
23
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
24
- var _UUIRefNodeElement_instances, onSlotIconChange_fn, renderFallbackIcon_fn, renderContent_fn, renderLink_fn, renderButton_fn, renderSomething_fn;
24
+ var _UUIRefNodeElement_instances, onSlotIconChange_fn, renderFallbackIcon_fn, renderContent_fn, renderLink_fn, renderButton_fn, renderOpenPart_fn;
25
25
  let UUIRefNodeElement = class extends UUIRefElement {
26
26
  constructor() {
27
27
  super(...arguments);
@@ -29,7 +29,18 @@ let UUIRefNodeElement = class extends UUIRefElement {
29
29
  this.name = "";
30
30
  this.detail = "";
31
31
  this._iconSlotHasContent = false;
32
- 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>';
32
+ this.fallbackIcon = `<svg
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ viewBox="0 0 24 24"
35
+ fill="none"
36
+ stroke="currentColor"
37
+ stroke-width="1.75"
38
+ stroke-linecap="round"
39
+ stroke-linejoin="round"
40
+ id="icon">
41
+ <path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" />
42
+ <path d="M14 2v4a2 2 0 0 0 2 2h4" />
43
+ </svg>`;
33
44
  }
34
45
  connectedCallback() {
35
46
  super.connectedCallback();
@@ -42,12 +53,12 @@ let UUIRefNodeElement = class extends UUIRefElement {
42
53
  }
43
54
  render() {
44
55
  return html`
45
- ${__privateMethod(this, _UUIRefNodeElement_instances, renderSomething_fn).call(this)}
56
+ ${__privateMethod(this, _UUIRefNodeElement_instances, renderOpenPart_fn).call(this)}
46
57
  <!-- Select border must be right after #open-part -->
47
58
  <div id="select-border"></div>
48
59
 
49
60
  <slot></slot>
50
- <slot name="tag"></slot>
61
+ <slot name="tag" id="tag-container"></slot>
51
62
  <slot name="actions" id="actions-container"></slot>
52
63
  `;
53
64
  }
@@ -100,7 +111,7 @@ renderButton_fn = function() {
100
111
  </button>
101
112
  `;
102
113
  };
103
- renderSomething_fn = function() {
114
+ renderOpenPart_fn = function() {
104
115
  if (this.readonly) {
105
116
  return html`${__privateMethod(this, _UUIRefNodeElement_instances, renderContent_fn).call(this)}`;
106
117
  } else {
@@ -112,7 +123,7 @@ UUIRefNodeElement.styles = [
112
123
  css`
113
124
  :host {
114
125
  min-width: 250px;
115
- padding: calc(var(--uui-size-2,6px) + 1px);
126
+ padding: 1px;
116
127
  }
117
128
 
118
129
  #content {
@@ -127,6 +138,10 @@ UUIRefNodeElement.styles = [
127
138
  color: inherit;
128
139
  text-decoration: none;
129
140
  cursor: pointer;
141
+ align-self: stretch;
142
+ display: flex;
143
+ flex-grow: 1;
144
+ padding: calc(var(--uui-size-2,6px));
130
145
  }
131
146
 
132
147
  #icon {
@@ -152,11 +167,16 @@ UUIRefNodeElement.styles = [
152
167
  font-size: var(--uui-type-small-size,12px);
153
168
  }
154
169
 
170
+ :host([selectable]) #open-part {
171
+ flex-grow: 0;
172
+ padding: 0;
173
+ margin: calc(var(--uui-size-2,6px));
174
+ }
175
+
155
176
  :host(:not([disabled])) #open-part:hover #icon {
156
177
  color: var(--uui-color-interactive-emphasis,#3544b1);
157
178
  }
158
179
  :host(:not([disabled])) #open-part:hover #name {
159
- font-weight: 700;
160
180
  text-decoration: underline;
161
181
  color: var(--uui-color-interactive-emphasis,#3544b1);
162
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-ref-node",
3
- "version": "1.11.0",
3
+ "version": "1.12.1",
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.11.0",
34
- "@umbraco-ui/uui-icon": "1.11.0",
35
- "@umbraco-ui/uui-ref": "1.11.0"
33
+ "@umbraco-ui/uui-base": "1.12.1",
34
+ "@umbraco-ui/uui-icon": "1.12.1",
35
+ "@umbraco-ui/uui-ref": "1.12.1"
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-ref-node",
46
- "gitHead": "414ce88901f82c5fc7d6be942779047bb34a1407"
46
+ "gitHead": "a7d67a9f6b60b8c0b351b21d5dac49cdfc764f44"
47
47
  }