@vaadin/field-highlighter 24.7.0-alpha7 → 24.7.0-alpha8

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": "24.7.0-alpha7",
3
+ "version": "24.7.0-alpha8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,30 +34,31 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/a11y-base": "24.7.0-alpha7",
38
- "@vaadin/component-base": "24.7.0-alpha7",
39
- "@vaadin/overlay": "24.7.0-alpha7",
40
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha7",
41
- "@vaadin/vaadin-material-styles": "24.7.0-alpha7",
42
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha7",
37
+ "@vaadin/a11y-base": "24.7.0-alpha8",
38
+ "@vaadin/component-base": "24.7.0-alpha8",
39
+ "@vaadin/overlay": "24.7.0-alpha8",
40
+ "@vaadin/vaadin-lumo-styles": "24.7.0-alpha8",
41
+ "@vaadin/vaadin-material-styles": "24.7.0-alpha8",
42
+ "@vaadin/vaadin-themable-mixin": "24.7.0-alpha8",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/chai-plugins": "24.7.0-alpha7",
47
- "@vaadin/checkbox": "24.7.0-alpha7",
48
- "@vaadin/checkbox-group": "24.7.0-alpha7",
49
- "@vaadin/combo-box": "24.7.0-alpha7",
50
- "@vaadin/date-picker": "24.7.0-alpha7",
51
- "@vaadin/date-time-picker": "24.7.0-alpha7",
52
- "@vaadin/item": "24.7.0-alpha7",
53
- "@vaadin/list-box": "24.7.0-alpha7",
54
- "@vaadin/radio-group": "24.7.0-alpha7",
55
- "@vaadin/select": "24.7.0-alpha7",
46
+ "@vaadin/chai-plugins": "24.7.0-alpha8",
47
+ "@vaadin/checkbox": "24.7.0-alpha8",
48
+ "@vaadin/checkbox-group": "24.7.0-alpha8",
49
+ "@vaadin/combo-box": "24.7.0-alpha8",
50
+ "@vaadin/date-picker": "24.7.0-alpha8",
51
+ "@vaadin/date-time-picker": "24.7.0-alpha8",
52
+ "@vaadin/item": "24.7.0-alpha8",
53
+ "@vaadin/list-box": "24.7.0-alpha8",
54
+ "@vaadin/radio-group": "24.7.0-alpha8",
55
+ "@vaadin/select": "24.7.0-alpha8",
56
+ "@vaadin/test-runner-commands": "24.7.0-alpha8",
56
57
  "@vaadin/testing-helpers": "^1.1.0",
57
- "@vaadin/text-area": "24.7.0-alpha7",
58
- "@vaadin/text-field": "24.7.0-alpha7",
59
- "@vaadin/time-picker": "24.7.0-alpha7",
58
+ "@vaadin/text-area": "24.7.0-alpha8",
59
+ "@vaadin/text-field": "24.7.0-alpha8",
60
+ "@vaadin/time-picker": "24.7.0-alpha8",
60
61
  "sinon": "^18.0.0"
61
62
  },
62
- "gitHead": "5f48d7024caa02773aff3aa53091326a42d1eeb1"
63
+ "gitHead": "d015035192480fcc8cc9df5d00a950f177b83c32"
63
64
  }
@@ -65,7 +65,7 @@ export const userTagsOverlayStyles = css`
65
65
  box-shadow: none;
66
66
  }
67
67
 
68
- [part='overlay'] {
68
+ :scope [part='overlay'] {
69
69
  box-shadow: none;
70
70
  background: transparent;
71
71
  position: relative;
@@ -86,7 +86,7 @@ export const userTagsOverlayStyles = css`
86
86
  right: -4px;
87
87
  }
88
88
 
89
- [part='content'] {
89
+ :scope [part='content'] {
90
90
  padding: 0;
91
91
  }
92
92
 
@@ -3,9 +3,10 @@
3
3
  * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
10
  import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
11
  import { fieldOutlineStyles } from './vaadin-field-highlighter-styles.js';
11
12
 
@@ -19,15 +20,11 @@ registerStyles('vaadin-field-outline', fieldOutlineStyles, { moduleId: 'vaadin-f
19
20
  * @mixes ThemableMixin
20
21
  * @private
21
22
  */
22
- export class FieldOutline extends ThemableMixin(DirMixin(PolymerElement)) {
23
+ export class FieldOutline extends ThemableMixin(DirMixin(PolylitMixin(LitElement))) {
23
24
  static get is() {
24
25
  return 'vaadin-field-outline';
25
26
  }
26
27
 
27
- static get template() {
28
- return html``;
29
- }
30
-
31
28
  static get properties() {
32
29
  return {
33
30
  /**
@@ -37,10 +34,16 @@ export class FieldOutline extends ThemableMixin(DirMixin(PolymerElement)) {
37
34
  type: Object,
38
35
  value: null,
39
36
  observer: '_userChanged',
37
+ sync: true,
40
38
  },
41
39
  };
42
40
  }
43
41
 
42
+ /** @protected */
43
+ render() {
44
+ return html``;
45
+ }
46
+
44
47
  /** @protected */
45
48
  ready() {
46
49
  super.ready();
@@ -3,14 +3,13 @@
3
3
  * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
11
  import { userTagStyles } from './vaadin-field-highlighter-styles.js';
11
12
 
12
- registerStyles('vaadin-user-tag', userTagStyles, { moduleId: 'vaadin-user-tag-styles' });
13
-
14
13
  /**
15
14
  * An element used internally by `<vaadin-field-highlighter>`. Not intended to be used separately.
16
15
  *
@@ -20,13 +19,18 @@ registerStyles('vaadin-user-tag', userTagStyles, { moduleId: 'vaadin-user-tag-st
20
19
  * @mixes ThemableMixin
21
20
  * @private
22
21
  */
23
- export class UserTag extends ThemableMixin(DirMixin(PolymerElement)) {
22
+ export class UserTag extends ThemableMixin(DirMixin(PolylitMixin(LitElement))) {
24
23
  static get is() {
25
24
  return 'vaadin-user-tag';
26
25
  }
27
26
 
28
- static get template() {
29
- return html`<div part="name">[[name]]</div>`;
27
+ static get styles() {
28
+ return userTagStyles;
29
+ }
30
+
31
+ /** @protected */
32
+ render() {
33
+ return html`<div part="name">${this.name}</div>`;
30
34
  }
31
35
 
32
36
  static get properties() {
@@ -3,17 +3,16 @@
3
3
  * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
10
  import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
10
11
  import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
11
12
  import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
12
- import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
14
  import { userTagsOverlayStyles } from './vaadin-field-highlighter-styles.js';
14
15
 
15
- registerStyles('vaadin-user-tags-overlay', [overlayStyles, userTagsOverlayStyles]);
16
-
17
16
  /**
18
17
  * An element used internally by `<vaadin-field-highlighter>`. Not intended to be used separately.
19
18
  *
@@ -25,14 +24,19 @@ registerStyles('vaadin-user-tags-overlay', [overlayStyles, userTagsOverlayStyles
25
24
  * @mixes ThemableMixin
26
25
  * @private
27
26
  */
28
- class UserTagsOverlay extends PositionMixin(OverlayMixin(DirMixin(ThemableMixin(PolymerElement)))) {
27
+ class UserTagsOverlay extends PositionMixin(OverlayMixin(DirMixin(ThemableMixin(PolylitMixin(LitElement))))) {
29
28
  static get is() {
30
29
  return 'vaadin-user-tags-overlay';
31
30
  }
32
31
 
33
- static get template() {
32
+ static get styles() {
33
+ return [overlayStyles, userTagsOverlayStyles];
34
+ }
35
+
36
+ /** @protected */
37
+ render() {
34
38
  return html`
35
- <div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
39
+ <div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
36
40
  <div part="overlay" id="overlay">
37
41
  <div part="content" id="content">
38
42
  <slot></slot>
@@ -5,10 +5,11 @@
5
5
  */
6
6
  import './vaadin-user-tag.js';
7
7
  import './vaadin-user-tags-overlay.js';
8
- import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
+ import { css, html, LitElement } from 'lit';
9
9
  import { timeOut } from '@vaadin/component-base/src/async.js';
10
10
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
11
11
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
12
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
13
 
13
14
  const listenOnce = (elem, type) => {
14
15
  return new Promise((resolve) => {
@@ -27,24 +28,28 @@ const listenOnce = (elem, type) => {
27
28
  * @extends HTMLElement
28
29
  * @private
29
30
  */
30
- export class UserTags extends PolymerElement {
31
+ export class UserTags extends PolylitMixin(LitElement) {
31
32
  static get is() {
32
33
  return 'vaadin-user-tags';
33
34
  }
34
35
 
35
- static get template() {
36
+ static get styles() {
37
+ return css`
38
+ :host {
39
+ position: absolute;
40
+ }
41
+ `;
42
+ }
43
+
44
+ /** @protected */
45
+ render() {
36
46
  return html`
37
- <style>
38
- :host {
39
- position: absolute;
40
- }
41
- </style>
42
47
  <vaadin-user-tags-overlay
43
48
  id="overlay"
44
49
  modeless
45
- opened="[[opened]]"
50
+ .opened="${this.opened}"
46
51
  no-vertical-overlap
47
- on-vaadin-overlay-open="_onOverlayOpen"
52
+ @vaadin-overlay-open="${this._onOverlayOpen}"
48
53
  ></vaadin-user-tags-overlay>
49
54
  `;
50
55
  }
@@ -67,6 +72,7 @@ export class UserTags extends PolymerElement {
67
72
  opened: {
68
73
  type: Boolean,
69
74
  value: false,
75
+ sync: true,
70
76
  },
71
77
 
72
78
  /**
@@ -288,7 +294,7 @@ export class UserTags extends PolymerElement {
288
294
 
289
295
  this.__flashQueue.forEach((tags) => {
290
296
  if (tags.some((tag) => tag.uid === user.id)) {
291
- this.splice('__flashQueue', i, 1);
297
+ this.__flashQueue = this.__flashQueue.filter((_, index) => index !== i);
292
298
  }
293
299
  });
294
300
  });
@@ -311,7 +317,7 @@ export class UserTags extends PolymerElement {
311
317
 
312
318
  if (this.flashing || !this.__isTargetVisible) {
313
319
  // Schedule next flash later
314
- this.push('__flashQueue', addedTags);
320
+ this.__flashQueue = [...this.__flashQueue, addedTags];
315
321
  } else {
316
322
  this.flashTags(addedTags);
317
323
  }
@@ -382,7 +388,7 @@ export class UserTags extends PolymerElement {
382
388
  }).then(() => {
383
389
  if (this.__flashQueue.length > 0) {
384
390
  const tags = this.__flashQueue[0];
385
- this.splice('__flashQueue', 0, 1);
391
+ this.__flashQueue = [...this.__flashQueue].slice(1);
386
392
  this.flashTags(tags);
387
393
  }
388
394
  });
@@ -404,7 +410,7 @@ export class UserTags extends PolymerElement {
404
410
  this.applyTagsStart(changed);
405
411
 
406
412
  this._debounceRender = Debouncer.debounce(this._debounceRender, timeOut.after(this.duration), () => {
407
- this.set('users', users);
413
+ this.users = users;
408
414
 
409
415
  this.applyTagsEnd(changed);
410
416
 
@@ -416,7 +422,7 @@ export class UserTags extends PolymerElement {
416
422
 
417
423
  updateTagsSync(users, changed) {
418
424
  this.applyTagsStart(changed);
419
- this.set('users', users);
425
+ this.users = users;
420
426
  this.applyTagsEnd(changed);
421
427
  }
422
428