@vaadin/component-base 24.8.0-alpha9 → 25.0.0-alpha1

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/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export { ControllerMixin } from './src/controller-mixin.js';
2
1
  export { DelegateStateMixin } from './src/delegate-state-mixin.js';
3
2
  export { DirMixin } from './src/dir-mixin.js';
4
3
  export { ElementMixin } from './src/element-mixin.js';
package/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export { ControllerMixin } from './src/controller-mixin.js';
2
1
  export { DelegateStateMixin } from './src/delegate-state-mixin.js';
3
2
  export { DirMixin } from './src/dir-mixin.js';
4
3
  export { ElementMixin } from './src/element-mixin.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/component-base",
3
- "version": "24.8.0-alpha9",
3
+ "version": "25.0.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,7 +23,8 @@
23
23
  "custom_typings",
24
24
  "index.d.ts",
25
25
  "index.js",
26
- "src"
26
+ "src",
27
+ "!src/style-props.js"
27
28
  ],
28
29
  "keywords": [
29
30
  "Vaadin",
@@ -32,16 +33,15 @@
32
33
  ],
33
34
  "dependencies": {
34
35
  "@open-wc/dedupe-mixin": "^1.3.0",
35
- "@polymer/polymer": "^3.0.0",
36
36
  "@vaadin/vaadin-development-mode-detector": "^2.0.0",
37
37
  "@vaadin/vaadin-usage-statistics": "^2.1.0",
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "24.8.0-alpha9",
42
- "@vaadin/test-runner-commands": "24.8.0-alpha9",
41
+ "@vaadin/chai-plugins": "25.0.0-alpha1",
42
+ "@vaadin/test-runner-commands": "25.0.0-alpha1",
43
43
  "@vaadin/testing-helpers": "^1.1.0",
44
44
  "sinon": "^18.0.0"
45
45
  },
46
- "gitHead": "4de3809275ddfd733b0d13fd02af8faf73eb6770"
46
+ "gitHead": "b8c22a4a0c64156210d0daac96b43ae4e5526d49"
47
47
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '24.8.0-alpha9') {
16
+ export function defineCustomElement(CustomElement, version = '24.8.0-alpha18') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -3,14 +3,14 @@
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 { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
6
+ import { dedupeMixin } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  /**
9
9
  * A mixin to delegate properties and attributes to a target element.
10
10
  *
11
11
  * @polymerMixin
12
12
  */
13
- export const DelegateStateMixin = dedupingMixin(
13
+ export const DelegateStateMixin = dedupeMixin(
14
14
  (superclass) =>
15
15
  class DelegateStateMixinClass extends superclass {
16
16
  static get properties() {
@@ -3,18 +3,11 @@
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 { setCancelSyntheticClickEvents } from '@polymer/polymer/lib/utils/settings.js';
7
6
  import { usageStatistics } from '@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js';
8
7
  import { idlePeriod } from './async.js';
9
8
  import { Debouncer, enqueueDebouncer } from './debounce.js';
10
9
  import { DirMixin } from './dir-mixin.js';
11
10
 
12
- // This setting affects the legacy Polymer gestures which get activated
13
- // once you import any iron component e.g iron-icon.
14
- // It has to be explicitly disabled to prevent click issues in iOS + VoiceOver
15
- // for buttons that are based on `[role=button]` e.g vaadin-button.
16
- setCancelSyntheticClickEvents(false);
17
-
18
11
  if (!window.Vaadin) {
19
12
  window.Vaadin = {};
20
13
  }
@@ -45,6 +45,13 @@ function getOrCreateMap(obj, name) {
45
45
 
46
46
  const PolylitMixinImplementation = (superclass) => {
47
47
  class PolylitMixinClass extends superclass {
48
+ // PolylitMixin, and components using it, force synchronous updates
49
+ // in connectedCallback and for properties that are configured to
50
+ // be sync. This causes Lit's `change-in-update` warning to be
51
+ // logged for almost every component when Lit runs in development
52
+ // mode. Since we intentionally force updates, disable the warning.
53
+ static enabledWarnings = [];
54
+
48
55
  static createProperty(name, options) {
49
56
  if ([String, Boolean, Number, Array].includes(options)) {
50
57
  options = {
@@ -68,6 +75,13 @@ const PolylitMixinImplementation = (superclass) => {
68
75
  * @override
69
76
  */
70
77
  static finalize() {
78
+ // Suppress warnings about deprecated overriding ReactiveElement methods
79
+ // as the mixin requires those. See https://github.com/lit/lit/pull/4901
80
+ if (window.litIssuedWarnings) {
81
+ window.litIssuedWarnings.add('no-override-create-property');
82
+ window.litIssuedWarnings.add('no-override-get-property-descriptor');
83
+ }
84
+
71
85
  super.finalize();
72
86
 
73
87
  if (Array.isArray(this.observers)) {
@@ -3,7 +3,7 @@
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 { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
6
+ import { dedupeMixin } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  const observer = new ResizeObserver((entries) => {
9
9
  setTimeout(() => {
@@ -29,7 +29,7 @@ const observer = new ResizeObserver((entries) => {
29
29
  *
30
30
  * @polymerMixin
31
31
  */
32
- export const ResizeMixin = dedupingMixin(
32
+ export const ResizeMixin = dedupeMixin(
33
33
  (superclass) =>
34
34
  class ResizeMixinClass extends superclass {
35
35
  /**
@@ -3,7 +3,7 @@
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 { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
6
+ import { dedupeMixin } from '@open-wc/dedupe-mixin';
7
7
 
8
8
  const stylesMap = new WeakMap();
9
9
 
@@ -42,7 +42,7 @@ function insertStyles(styles, root) {
42
42
  *
43
43
  * @polymerMixin
44
44
  */
45
- export const SlotStylesMixin = dedupingMixin(
45
+ export const SlotStylesMixin = dedupeMixin(
46
46
  (superclass) =>
47
47
  class SlotStylesMixinClass extends superclass {
48
48
  /**
@@ -1,26 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { Constructor } from '@open-wc/dedupe-mixin';
7
- import type { ReactiveController } from 'lit';
8
-
9
- /**
10
- * A mixin for connecting controllers to the element.
11
- */
12
- export declare function ControllerMixin<T extends Constructor<HTMLElement>>(
13
- superclass: T,
14
- ): Constructor<ControllerMixinClass> & T;
15
-
16
- export declare class ControllerMixinClass {
17
- /**
18
- * Registers a controller to participate in the element update cycle.
19
- */
20
- protected addController(controller: ReactiveController): void;
21
-
22
- /**
23
- * Removes a controller from the element.
24
- */
25
- protected removeController(controller: ReactiveController): void;
26
- }
@@ -1,81 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { dedupingMixin } from '@polymer/polymer/lib/utils/mixin.js';
7
-
8
- /**
9
- * @typedef ReactiveController
10
- * @type {import('lit').ReactiveController}
11
- */
12
-
13
- /**
14
- * A mixin for connecting controllers to the element.
15
- *
16
- * @polymerMixin
17
- */
18
- export const ControllerMixin = dedupingMixin((superClass) => {
19
- // If the superclass extends from LitElement,
20
- // use its own controllers implementation.
21
- if (typeof superClass.prototype.addController === 'function') {
22
- return superClass;
23
- }
24
-
25
- return class ControllerMixinClass extends superClass {
26
- constructor() {
27
- super();
28
-
29
- /**
30
- * @type {Set<ReactiveController>}
31
- */
32
- this.__controllers = new Set();
33
- }
34
-
35
- /** @protected */
36
- connectedCallback() {
37
- super.connectedCallback();
38
-
39
- this.__controllers.forEach((c) => {
40
- if (c.hostConnected) {
41
- c.hostConnected();
42
- }
43
- });
44
- }
45
-
46
- /** @protected */
47
- disconnectedCallback() {
48
- super.disconnectedCallback();
49
-
50
- this.__controllers.forEach((c) => {
51
- if (c.hostDisconnected) {
52
- c.hostDisconnected();
53
- }
54
- });
55
- }
56
-
57
- /**
58
- * Registers a controller to participate in the element update cycle.
59
- *
60
- * @param {ReactiveController} controller
61
- * @protected
62
- */
63
- addController(controller) {
64
- this.__controllers.add(controller);
65
- // Call hostConnected if a controller is added after the element is attached.
66
- if (this.$ !== undefined && this.isConnected && controller.hostConnected) {
67
- controller.hostConnected();
68
- }
69
- }
70
-
71
- /**
72
- * Removes a controller from the element.
73
- *
74
- * @param {ReactiveController} controller
75
- * @protected
76
- */
77
- removeController(controller) {
78
- this.__controllers.delete(controller);
79
- }
80
- };
81
- });
package/src/templates.js DELETED
@@ -1,24 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
-
7
- /**
8
- * Passes the component to the template renderer callback if the template renderer is imported.
9
- * Otherwise, if there is a template, it warns that the template renderer needs to be imported.
10
- *
11
- * @param {HTMLElement} component
12
- */
13
- export function processTemplates(component) {
14
- if (window.Vaadin && window.Vaadin.templateRendererCallback) {
15
- window.Vaadin.templateRendererCallback(component);
16
- return;
17
- }
18
-
19
- if (component.querySelector('template')) {
20
- console.warn(
21
- `WARNING: <template> inside <${component.localName}> is no longer supported. Import @vaadin/polymer-legacy-adapter/template-renderer.js to enable compatibility.`,
22
- );
23
- }
24
- }