@vaadin/component-base 23.2.0-alpha2 → 23.2.0-alpha3

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.
@@ -1,7 +1,6 @@
1
1
  interface Vaadin {
2
2
  developmentModeCallback?: {
3
3
  'usage-statistics'?(): void;
4
- 'vaadin-license-checker'?(): void;
5
4
  };
6
5
  registrations?: Array<{ is: string; version: string }>;
7
6
  usageStatsChecker?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/component-base",
3
- "version": "23.2.0-alpha2",
3
+ "version": "23.2.0-alpha3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,5 +42,5 @@
42
42
  "@vaadin/testing-helpers": "^0.3.2",
43
43
  "sinon": "^13.0.2"
44
44
  },
45
- "gitHead": "c9b8113d0fa9a602f8b9cb915c1826355af2e8df"
45
+ "gitHead": "06e5875be93ca50da2846dafc65a8531010c0576"
46
46
  }
@@ -3,9 +3,9 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
7
- import { DisabledMixinClass } from './disabled-mixin.js';
8
- import { KeyboardMixinClass } from './keyboard-mixin.js';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { DisabledMixinClass } from './disabled-mixin.js';
8
+ import type { KeyboardMixinClass } from './keyboard-mixin.js';
9
9
 
10
10
  /**
11
11
  * A mixin to toggle the `active` attribute.
@@ -3,8 +3,8 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
7
- import { ReactiveController, ReactiveControllerHost } from 'lit';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
8
8
 
9
9
  /**
10
10
  * A mixin for connecting controllers to the element.
package/src/debounce.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * Code distributed by Google as part of the polymer project is also
8
8
  * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
9
  */
10
- import { AsyncInterface } from './async.js';
10
+ import type { AsyncInterface } from './async.js';
11
11
 
12
12
  export declare class Debouncer {
13
13
  /**
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin to handle `dir` attribute based on the one set on the `<html>` element.
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin to provide disabled property for field components.
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import '../custom_typings/vaadin-usage-statistics.js';
7
7
  import '../custom_typings/vaadin.js';
8
- import { Constructor } from '@open-wc/dedupe-mixin';
9
- import { DirMixinClass } from './dir-mixin.js';
8
+ import type { Constructor } from '@open-wc/dedupe-mixin';
9
+ import type { DirMixinClass } from './dir-mixin.js';
10
10
 
11
11
  /**
12
12
  * A mixin providing common logic for Vaadin components.
@@ -39,7 +39,7 @@ const registered = new Set();
39
39
  export const ElementMixin = (superClass) =>
40
40
  class VaadinElementMixin extends DirMixin(superClass) {
41
41
  static get version() {
42
- return '23.2.0-alpha2';
42
+ return '23.2.0-alpha3';
43
43
  }
44
44
 
45
45
  /** @protected */
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin to handle `focused` and `focus-ring` attributes based on focus.
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ReactiveController } from 'lit';
6
+ import type { ReactiveController } from 'lit';
7
7
 
8
8
  /**
9
9
  * A controller for trapping focus within a DOM node.
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin that manages keyboard handling.
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ReactiveController } from 'lit';
6
+ import type { ReactiveController } from 'lit';
7
7
 
8
8
  /**
9
9
  * A controller for listening on media query changes.
@@ -3,8 +3,8 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
7
- import { LitElement } from 'lit';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { LitElement } from 'lit';
8
8
 
9
9
  export declare function PolylitMixin<T extends Constructor<LitElement>>(base: T): T & Constructor<PolylitMixinClass>;
10
10
 
@@ -10,7 +10,8 @@ const caseMap = {};
10
10
  const CAMEL_TO_DASH = /([A-Z])/g;
11
11
 
12
12
  function camelToDash(camel) {
13
- return caseMap[camel] || (caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase());
13
+ caseMap[camel] = caseMap[camel] || camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase();
14
+ return caseMap[camel];
14
15
  }
15
16
 
16
17
  function upper(name) {
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin that uses a ResizeObserver to listen to host size changes.
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { ReactiveController } from 'lit';
6
+ import type { ReactiveController } from 'lit';
7
7
 
8
8
  export class SlotController extends EventTarget implements ReactiveController {
9
9
  /**
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin to provide content for named slots defined by component.
@@ -3,8 +3,8 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Constructor } from '@open-wc/dedupe-mixin';
7
- import { DisabledMixinClass } from './disabled-mixin.js';
6
+ import type { Constructor } from '@open-wc/dedupe-mixin';
7
+ import type { DisabledMixinClass } from './disabled-mixin.js';
8
8
 
9
9
  /**
10
10
  * A mixin to toggle the `tabindex` attribute.
@@ -55,7 +55,9 @@ export class IronListAdapter {
55
55
  if (this.reorderElements) {
56
56
  // Reordering the physical elements cancels the user's grab of the scroll bar handle on Safari.
57
57
  // Need to defer reordering until the user lets go of the scroll bar handle.
58
- this.scrollTarget.addEventListener('mousedown', () => (this.__mouseDown = true));
58
+ this.scrollTarget.addEventListener('mousedown', () => {
59
+ this.__mouseDown = true;
60
+ });
59
61
  this.scrollTarget.addEventListener('mouseup', () => {
60
62
  this.__mouseDown = false;
61
63
  if (this.__pendingReorder) {
@@ -298,7 +300,9 @@ export class IronListAdapter {
298
300
  /** @private */
299
301
  _isClientFull() {
300
302
  // Workaround an issue in iron-list that can cause it to freeze on fast scroll
301
- setTimeout(() => (this.__clientFull = true));
303
+ setTimeout(() => {
304
+ this.__clientFull = true;
305
+ });
302
306
  return this.__clientFull || super._isClientFull();
303
307
  }
304
308
 
@@ -378,7 +382,9 @@ export class IronListAdapter {
378
382
  this.__debouncerWheelAnimationFrame = Debouncer.debounce(
379
383
  this.__debouncerWheelAnimationFrame,
380
384
  animationFrame,
381
- () => (this._wheelAnimationFrame = false),
385
+ () => {
386
+ this._wheelAnimationFrame = false;
387
+ },
382
388
  );
383
389
 
384
390
  const momentum = Math.abs(e.deltaX) + Math.abs(deltaY);
@@ -394,7 +400,9 @@ export class IronListAdapter {
394
400
  this._debouncerIgnoreNewWheel = Debouncer.debounce(
395
401
  this._debouncerIgnoreNewWheel,
396
402
  timeOut.after(this.timeouts.IGNORE_WHEEL),
397
- () => (this._ignoreNewWheel = false),
403
+ () => {
404
+ this._ignoreNewWheel = false;
405
+ },
398
406
  );
399
407
  } else if ((this._hasResidualMomentum && momentum <= this._previousMomentum) || this._ignoreNewWheel) {
400
408
  e.preventDefault();
@@ -494,7 +502,9 @@ export class IronListAdapter {
494
502
  if (isSafari) {
495
503
  const { transform } = this.scrollTarget.style;
496
504
  this.scrollTarget.style.transform = 'translateZ(0)';
497
- setTimeout(() => (this.scrollTarget.style.transform = transform));
505
+ setTimeout(() => {
506
+ this.scrollTarget.style.transform = transform;
507
+ });
498
508
  }
499
509
  }
500
510