@umbraco-ui/uui-ref-node 1.11.0 → 1.12.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/lib/index.js +28 -8
- 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 {
|
|
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,
|
|
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 =
|
|
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,
|
|
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
|
-
|
|
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:
|
|
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.
|
|
3
|
+
"version": "1.12.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.
|
|
34
|
-
"@umbraco-ui/uui-icon": "1.
|
|
35
|
-
"@umbraco-ui/uui-ref": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.12.0",
|
|
34
|
+
"@umbraco-ui/uui-icon": "1.12.0",
|
|
35
|
+
"@umbraco-ui/uui-ref": "1.12.0"
|
|
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": "
|
|
46
|
+
"gitHead": "0ac5219b2765bf6c90fe4943a6620b46a7fced4e"
|
|
47
47
|
}
|