@vaadin/field-highlighter 25.0.0-alpha8 → 25.0.0-alpha9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/field-highlighter",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha9",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,29 +33,29 @@
|
|
|
33
33
|
"field"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
37
|
-
"@vaadin/component-base": "25.0.0-
|
|
38
|
-
"@vaadin/overlay": "25.0.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
40
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
36
|
+
"@vaadin/a11y-base": "25.0.0-alpha9",
|
|
37
|
+
"@vaadin/component-base": "25.0.0-alpha9",
|
|
38
|
+
"@vaadin/overlay": "25.0.0-alpha9",
|
|
39
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
|
|
41
41
|
"lit": "^3.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
45
|
-
"@vaadin/checkbox": "25.0.0-
|
|
46
|
-
"@vaadin/checkbox-group": "25.0.0-
|
|
47
|
-
"@vaadin/date-picker": "25.0.0-
|
|
48
|
-
"@vaadin/date-time-picker": "25.0.0-
|
|
49
|
-
"@vaadin/item": "25.0.0-
|
|
50
|
-
"@vaadin/list-box": "25.0.0-
|
|
51
|
-
"@vaadin/radio-group": "25.0.0-
|
|
52
|
-
"@vaadin/select": "25.0.0-
|
|
53
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
44
|
+
"@vaadin/chai-plugins": "25.0.0-alpha9",
|
|
45
|
+
"@vaadin/checkbox": "25.0.0-alpha9",
|
|
46
|
+
"@vaadin/checkbox-group": "25.0.0-alpha9",
|
|
47
|
+
"@vaadin/date-picker": "25.0.0-alpha9",
|
|
48
|
+
"@vaadin/date-time-picker": "25.0.0-alpha9",
|
|
49
|
+
"@vaadin/item": "25.0.0-alpha9",
|
|
50
|
+
"@vaadin/list-box": "25.0.0-alpha9",
|
|
51
|
+
"@vaadin/radio-group": "25.0.0-alpha9",
|
|
52
|
+
"@vaadin/select": "25.0.0-alpha9",
|
|
53
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha9",
|
|
54
54
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
55
|
-
"@vaadin/text-area": "25.0.0-
|
|
56
|
-
"@vaadin/text-field": "25.0.0-
|
|
57
|
-
"@vaadin/time-picker": "25.0.0-
|
|
55
|
+
"@vaadin/text-area": "25.0.0-alpha9",
|
|
56
|
+
"@vaadin/text-field": "25.0.0-alpha9",
|
|
57
|
+
"@vaadin/time-picker": "25.0.0-alpha9",
|
|
58
58
|
"sinon": "^18.0.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
|
|
61
61
|
}
|
package/src/vaadin-user-tags.js
CHANGED
|
@@ -46,11 +46,14 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
46
46
|
return html`
|
|
47
47
|
<vaadin-user-tags-overlay
|
|
48
48
|
id="overlay"
|
|
49
|
+
exportparts="overlay:user-tags-overlay, content:user-tags-content"
|
|
49
50
|
modeless
|
|
50
51
|
.opened="${this.opened}"
|
|
51
52
|
no-vertical-overlap
|
|
52
53
|
@vaadin-overlay-open="${this._onOverlayOpen}"
|
|
53
|
-
|
|
54
|
+
>
|
|
55
|
+
<slot></slot>
|
|
56
|
+
</vaadin-user-tags-overlay>
|
|
54
57
|
`;
|
|
55
58
|
}
|
|
56
59
|
|
|
@@ -137,7 +140,8 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
137
140
|
|
|
138
141
|
/** @protected */
|
|
139
142
|
get wrapper() {
|
|
140
|
-
|
|
143
|
+
// Used by Collaboration Kit util
|
|
144
|
+
return this;
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
/** @protected */
|
|
@@ -162,15 +166,8 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
162
166
|
ready() {
|
|
163
167
|
super.ready();
|
|
164
168
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const tags = document.createElement('div');
|
|
168
|
-
tags.setAttribute('part', 'tags');
|
|
169
|
-
root.appendChild(tags);
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
this.$.overlay.requestContentUpdate();
|
|
169
|
+
// Export user tags overlay parts for styling
|
|
170
|
+
this.setAttribute('exportparts', 'user-tags-overlay, user-tags-content');
|
|
174
171
|
}
|
|
175
172
|
|
|
176
173
|
/** @private */
|
|
@@ -222,6 +219,7 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
222
219
|
|
|
223
220
|
createUserTag(user) {
|
|
224
221
|
const tag = document.createElement('vaadin-user-tag');
|
|
222
|
+
tag.setAttribute('part', 'user-tag');
|
|
225
223
|
tag.name = user.name;
|
|
226
224
|
tag.uid = user.id;
|
|
227
225
|
tag.colorIndex = user.colorIndex;
|
|
@@ -229,7 +227,7 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
229
227
|
}
|
|
230
228
|
|
|
231
229
|
getTagForUser(user) {
|
|
232
|
-
return Array.from(this.
|
|
230
|
+
return Array.from(this.children).find((tag) => tag.uid === user.id);
|
|
233
231
|
}
|
|
234
232
|
|
|
235
233
|
getChangedTags(addedUsers, removedUsers) {
|
|
@@ -239,21 +237,19 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
239
237
|
}
|
|
240
238
|
|
|
241
239
|
applyTagsStart({ added, removed }) {
|
|
242
|
-
const wrapper = this.wrapper;
|
|
243
240
|
removed.forEach((tag) => {
|
|
244
241
|
if (tag) {
|
|
245
242
|
tag.classList.add('removing');
|
|
246
243
|
tag.classList.remove('show');
|
|
247
244
|
}
|
|
248
245
|
});
|
|
249
|
-
added.forEach((tag) =>
|
|
246
|
+
added.forEach((tag) => this.insertBefore(tag, this.firstChild));
|
|
250
247
|
}
|
|
251
248
|
|
|
252
249
|
applyTagsEnd({ added, removed }) {
|
|
253
|
-
const wrapper = this.wrapper;
|
|
254
250
|
removed.forEach((tag) => {
|
|
255
|
-
if (tag && tag.parentNode ===
|
|
256
|
-
|
|
251
|
+
if (tag && tag.parentNode === this) {
|
|
252
|
+
this.removeChild(tag);
|
|
257
253
|
}
|
|
258
254
|
});
|
|
259
255
|
added.forEach((tag) => tag && tag.classList.add('show'));
|
|
@@ -329,7 +325,7 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
329
325
|
/** @private */
|
|
330
326
|
_onOverlayOpen() {
|
|
331
327
|
// Animate all tags except removing ones
|
|
332
|
-
Array.from(this.
|
|
328
|
+
Array.from(this.children).forEach((tag) => {
|
|
333
329
|
if (!tag.classList.contains('removing')) {
|
|
334
330
|
tag.classList.add('show');
|
|
335
331
|
}
|
|
@@ -338,17 +334,16 @@ export class UserTags extends PolylitMixin(LitElement) {
|
|
|
338
334
|
|
|
339
335
|
flashTags(added) {
|
|
340
336
|
this.flashing = true;
|
|
341
|
-
const wrapper = this.wrapper;
|
|
342
337
|
|
|
343
338
|
// Hide existing tags
|
|
344
|
-
const hidden = Array.from(
|
|
339
|
+
const hidden = Array.from(this.children);
|
|
345
340
|
hidden.forEach((tag) => {
|
|
346
341
|
tag.style.display = 'none';
|
|
347
342
|
});
|
|
348
343
|
|
|
349
344
|
// Render new tags
|
|
350
345
|
added.forEach((tag) => {
|
|
351
|
-
|
|
346
|
+
this.insertBefore(tag, this.firstChild);
|
|
352
347
|
});
|
|
353
348
|
|
|
354
349
|
this.flashPromise = new Promise((resolve) => {
|