@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-alpha8",
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-alpha8",
37
- "@vaadin/component-base": "25.0.0-alpha8",
38
- "@vaadin/overlay": "25.0.0-alpha8",
39
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha8",
40
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha8",
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-alpha8",
45
- "@vaadin/checkbox": "25.0.0-alpha8",
46
- "@vaadin/checkbox-group": "25.0.0-alpha8",
47
- "@vaadin/date-picker": "25.0.0-alpha8",
48
- "@vaadin/date-time-picker": "25.0.0-alpha8",
49
- "@vaadin/item": "25.0.0-alpha8",
50
- "@vaadin/list-box": "25.0.0-alpha8",
51
- "@vaadin/radio-group": "25.0.0-alpha8",
52
- "@vaadin/select": "25.0.0-alpha8",
53
- "@vaadin/test-runner-commands": "25.0.0-alpha8",
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-alpha8",
56
- "@vaadin/text-field": "25.0.0-alpha8",
57
- "@vaadin/time-picker": "25.0.0-alpha8",
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": "ebf53673d5f639d2b1b6f2b31f640f530643ee2f"
60
+ "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
61
61
  }
@@ -15,7 +15,7 @@ const userTagsOverlay = css`
15
15
  overflow: visible;
16
16
  }
17
17
 
18
- ::slotted([part='tags']) {
18
+ [part='content'] {
19
19
  display: flex;
20
20
  flex-direction: column;
21
21
  align-items: flex-start;
@@ -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
- ></vaadin-user-tags-overlay>
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
- return this.$.overlay.querySelector('[part="tags"]');
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
- this.$.overlay.renderer = (root) => {
166
- if (!root.firstChild) {
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.wrapper.children).find((tag) => tag.uid === user.id);
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) => wrapper.insertBefore(tag, wrapper.firstChild));
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 === wrapper) {
256
- wrapper.removeChild(tag);
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.wrapper.children).forEach((tag) => {
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(wrapper.children);
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
- wrapper.insertBefore(tag, wrapper.firstChild);
346
+ this.insertBefore(tag, this.firstChild);
352
347
  });
353
348
 
354
349
  this.flashPromise = new Promise((resolve) => {