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

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-alpha5",
3
+ "version": "24.7.0-alpha7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,30 +34,30 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/a11y-base": "24.7.0-alpha5",
38
- "@vaadin/component-base": "24.7.0-alpha5",
39
- "@vaadin/overlay": "24.7.0-alpha5",
40
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha5",
41
- "@vaadin/vaadin-material-styles": "24.7.0-alpha5",
42
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha5",
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",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/chai-plugins": "24.7.0-alpha5",
47
- "@vaadin/checkbox": "24.7.0-alpha5",
48
- "@vaadin/checkbox-group": "24.7.0-alpha5",
49
- "@vaadin/combo-box": "24.7.0-alpha5",
50
- "@vaadin/date-picker": "24.7.0-alpha5",
51
- "@vaadin/date-time-picker": "24.7.0-alpha5",
52
- "@vaadin/item": "24.7.0-alpha5",
53
- "@vaadin/list-box": "24.7.0-alpha5",
54
- "@vaadin/radio-group": "24.7.0-alpha5",
55
- "@vaadin/select": "24.7.0-alpha5",
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",
56
56
  "@vaadin/testing-helpers": "^1.1.0",
57
- "@vaadin/text-area": "24.7.0-alpha5",
58
- "@vaadin/text-field": "24.7.0-alpha5",
59
- "@vaadin/time-picker": "24.7.0-alpha5",
57
+ "@vaadin/text-area": "24.7.0-alpha7",
58
+ "@vaadin/text-field": "24.7.0-alpha7",
59
+ "@vaadin/time-picker": "24.7.0-alpha7",
60
60
  "sinon": "^18.0.0"
61
61
  },
62
- "gitHead": "f9fa2bd652780a344d5e0329b8aafbcbd72ebd14"
62
+ "gitHead": "5f48d7024caa02773aff3aa53091326a42d1eeb1"
63
63
  }
@@ -48,6 +48,10 @@ export const initOutline = (field) => {
48
48
 
49
49
  const style = document.createElement('style');
50
50
  style.textContent = `
51
+ :host([focused]) [part="outline"] {
52
+ opacity: calc(1 - var(--lumo-input-field-pointer-focus-visible, 0));
53
+ }
54
+
51
55
  :host([active]) [part="outline"],
52
56
  :host([focus-ring]) [part="outline"] {
53
57
  display: none;
@@ -5,7 +5,6 @@
5
5
  */
6
6
  import './vaadin-user-tag.js';
7
7
  import './vaadin-user-tags-overlay.js';
8
- import { calculateSplices } from '@polymer/polymer/lib/utils/array-splice.js';
9
8
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
10
9
  import { timeOut } from '@vaadin/component-base/src/async.js';
11
10
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
@@ -233,27 +232,6 @@ export class UserTags extends PolymerElement {
233
232
  return { added, removed };
234
233
  }
235
234
 
236
- getChangedUsers(users, splices) {
237
- const usersToAdd = [];
238
- const usersToRemove = [];
239
-
240
- splices.forEach((splice) => {
241
- splice.removed.forEach((user) => {
242
- usersToRemove.push(user);
243
- });
244
-
245
- for (let i = splice.addedCount - 1; i >= 0; i--) {
246
- usersToAdd.push(users[splice.index + i]);
247
- }
248
- });
249
-
250
- // Filter out users that are only moved
251
- const addedUsers = usersToAdd.filter((u) => !usersToRemove.some((u2) => u.id === u2.id));
252
- const removedUsers = usersToRemove.filter((u) => !usersToAdd.some((u2) => u.id === u2.id));
253
-
254
- return { addedUsers, removedUsers };
255
- }
256
-
257
235
  applyTagsStart({ added, removed }) {
258
236
  const wrapper = this.wrapper;
259
237
  removed.forEach((tag) => {
@@ -279,12 +257,22 @@ export class UserTags extends PolymerElement {
279
257
  // Apply pending change if needed
280
258
  this.requestContentUpdate();
281
259
 
282
- const splices = calculateSplices(users, this.users);
283
- if (splices.length === 0) {
284
- return;
260
+ let addedUsers = [];
261
+ let removedUsers = [];
262
+
263
+ const hasNewUsers = Array.isArray(users);
264
+ const hasOldUsers = Array.isArray(this.users);
265
+
266
+ if (hasOldUsers) {
267
+ const newUserIds = (users || []).map((user) => user.id);
268
+ removedUsers = this.users.filter((item) => !newUserIds.includes(item.id));
269
+ }
270
+
271
+ if (hasNewUsers) {
272
+ const oldUserIds = (this.users || []).map((user) => user.id);
273
+ addedUsers = users.filter((item) => !oldUserIds.includes(item.id)).reverse();
285
274
  }
286
275
 
287
- const { addedUsers, removedUsers } = this.getChangedUsers(users, splices);
288
276
  if (addedUsers.length === 0 && removedUsers.length === 0) {
289
277
  return;
290
278
  }