@vaadin/field-highlighter 24.0.0-alpha8 → 24.0.0-beta1

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.0.0-alpha8",
3
+ "version": "24.0.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,29 +34,29 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/component-base": "24.0.0-alpha8",
38
- "@vaadin/overlay": "24.0.0-alpha8",
39
- "@vaadin/vaadin-lumo-styles": "24.0.0-alpha8",
40
- "@vaadin/vaadin-material-styles": "24.0.0-alpha8",
41
- "@vaadin/vaadin-themable-mixin": "24.0.0-alpha8",
37
+ "@vaadin/component-base": "24.0.0-beta1",
38
+ "@vaadin/overlay": "24.0.0-beta1",
39
+ "@vaadin/vaadin-lumo-styles": "24.0.0-beta1",
40
+ "@vaadin/vaadin-material-styles": "24.0.0-beta1",
41
+ "@vaadin/vaadin-themable-mixin": "24.0.0-beta1",
42
42
  "lit": "^2.0.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
- "@vaadin/checkbox": "24.0.0-alpha8",
47
- "@vaadin/checkbox-group": "24.0.0-alpha8",
48
- "@vaadin/combo-box": "24.0.0-alpha8",
49
- "@vaadin/date-picker": "24.0.0-alpha8",
50
- "@vaadin/date-time-picker": "24.0.0-alpha8",
51
- "@vaadin/item": "24.0.0-alpha8",
52
- "@vaadin/list-box": "24.0.0-alpha8",
53
- "@vaadin/radio-group": "24.0.0-alpha8",
54
- "@vaadin/select": "24.0.0-alpha8",
55
- "@vaadin/testing-helpers": "^0.3.2",
56
- "@vaadin/text-area": "24.0.0-alpha8",
57
- "@vaadin/text-field": "24.0.0-alpha8",
58
- "@vaadin/time-picker": "24.0.0-alpha8",
46
+ "@vaadin/checkbox": "24.0.0-beta1",
47
+ "@vaadin/checkbox-group": "24.0.0-beta1",
48
+ "@vaadin/combo-box": "24.0.0-beta1",
49
+ "@vaadin/date-picker": "24.0.0-beta1",
50
+ "@vaadin/date-time-picker": "24.0.0-beta1",
51
+ "@vaadin/item": "24.0.0-beta1",
52
+ "@vaadin/list-box": "24.0.0-beta1",
53
+ "@vaadin/radio-group": "24.0.0-beta1",
54
+ "@vaadin/select": "24.0.0-beta1",
55
+ "@vaadin/testing-helpers": "^0.4.0",
56
+ "@vaadin/text-area": "24.0.0-beta1",
57
+ "@vaadin/text-field": "24.0.0-beta1",
58
+ "@vaadin/time-picker": "24.0.0-beta1",
59
59
  "sinon": "^13.0.2"
60
60
  },
61
- "gitHead": "476752249bb12295c500980d98a3256ad3b22b73"
61
+ "gitHead": "c5b48921a62482746df8e46994b37e1490fec27e"
62
62
  }
@@ -10,8 +10,6 @@ const getOutlineTarget = (element, tagName) => {
10
10
  case 'vaadin-big-decimal-field':
11
11
  case 'vaadin-combo-box':
12
12
  case 'vaadin-date-picker':
13
- case 'vaadin-date-time-picker-date-picker':
14
- case 'vaadin-date-time-picker-time-picker':
15
13
  case 'vaadin-email-field':
16
14
  case 'vaadin-integer-field':
17
15
  case 'vaadin-number-field':
@@ -53,20 +53,6 @@ const initFieldObserver = (field) => {
53
53
  * See https://vaadin.com/collaboration for Collaboration Engine documentation.
54
54
  */
55
55
  export class FieldHighlighterController {
56
- get user() {
57
- return this._user;
58
- }
59
-
60
- set user(user) {
61
- this._user = user;
62
-
63
- if (user) {
64
- const msg = `${user.name} started editing`;
65
- const { label } = this.host;
66
- announce(label ? `${msg} ${label}` : msg);
67
- }
68
- }
69
-
70
56
  constructor(host) {
71
57
  this.host = host;
72
58
 
@@ -94,6 +80,20 @@ export class FieldHighlighterController {
94
80
  this.users = [];
95
81
  }
96
82
 
83
+ get user() {
84
+ return this._user;
85
+ }
86
+
87
+ set user(user) {
88
+ this._user = user;
89
+
90
+ if (user) {
91
+ const msg = `${user.name} started editing`;
92
+ const { label } = this.host;
93
+ announce(label ? `${msg} ${label}` : msg);
94
+ }
95
+ }
96
+
97
97
  hostConnected() {
98
98
  this.redraw();
99
99
  }
@@ -128,6 +128,11 @@ export class UserTags extends PolymerElement {
128
128
  );
129
129
  }
130
130
 
131
+ /** @protected */
132
+ get wrapper() {
133
+ return this.$.overlay.querySelector('[part="tags"]');
134
+ }
135
+
131
136
  /** @protected */
132
137
  connectedCallback() {
133
138
  super.connectedCallback();
@@ -208,10 +213,6 @@ export class UserTags extends PolymerElement {
208
213
  }
209
214
  }
210
215
 
211
- get wrapper() {
212
- return this.$.overlay.querySelector('[part="tags"]');
213
- }
214
-
215
216
  createUserTag(user) {
216
217
  const tag = document.createElement('vaadin-user-tag');
217
218
  tag.name = user.name;
@@ -235,9 +236,9 @@ export class UserTags extends PolymerElement {
235
236
  const usersToRemove = [];
236
237
 
237
238
  splices.forEach((splice) => {
238
- for (let i = 0; i < splice.removed.length; i++) {
239
- usersToRemove.push(splice.removed[i]);
240
- }
239
+ splice.removed.forEach((user) => {
240
+ usersToRemove.push(user);
241
+ });
241
242
 
242
243
  for (let i = splice.addedCount - 1; i >= 0; i--) {
243
244
  usersToAdd.push(users[splice.index + i]);
@@ -290,15 +291,17 @@ export class UserTags extends PolymerElement {
290
291
 
291
292
  // Check if flash queue contains pending tags for removed users
292
293
  if (this.__flashQueue.length > 0) {
293
- for (let i = 0; i < removedUsers.length; i++) {
294
+ removedUsers.forEach((user, i) => {
294
295
  if (changedTags.removed[i] === null) {
295
- for (let j = 0; j < this.__flashQueue.length; j++) {
296
- if (this.__flashQueue[j].some((tag) => tag.uid === removedUsers[i].id)) {
297
- this.splice('__flashQueue', i, 1);
298
- }
299
- }
296
+ return;
300
297
  }
301
- }
298
+
299
+ this.__flashQueue.forEach((tags) => {
300
+ if (tags.some((tag) => tag.uid === user.id)) {
301
+ this.splice('__flashQueue', i, 1);
302
+ }
303
+ });
304
+ });
302
305
  }
303
306
 
304
307
  if (this.opened && this.hasFocus) {