@vaadin/component-base 24.8.4 → 25.0.0-alpha10

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.4",
3
+ "version": "25.0.0-alpha10",
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.4",
42
- "@vaadin/test-runner-commands": "~24.8.4",
43
- "@vaadin/testing-helpers": "^1.1.0",
41
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
42
+ "@vaadin/test-runner-commands": "25.0.0-alpha10",
43
+ "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^18.0.0"
45
45
  },
46
- "gitHead": "849e54e967563080a685965e2dced02060b3ab23"
46
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
47
47
  }
@@ -33,6 +33,3 @@ export const isTouch = (() => {
33
33
  return false;
34
34
  }
35
35
  })();
36
-
37
- export const supportsAdoptingStyleSheets =
38
- window.ShadowRoot && 'adoptedStyleSheets' in Document.prototype && 'replace' in CSSStyleSheet.prototype;
@@ -58,14 +58,6 @@ export class Cache<TItem> {
58
58
  */
59
59
  get flatSize(): number;
60
60
 
61
- /**
62
- * The total number of items, including items from expanded sub-caches.
63
- *
64
- * @protected
65
- * @deprecated since 24.3 and will be removed in Vaadin 25.
66
- */
67
- get effectiveSize(): number;
68
-
69
61
  constructor(
70
62
  context: CacheContext<TItem>,
71
63
  pageSize: number,
@@ -113,34 +105,4 @@ export class Cache<TItem> {
113
105
  * of an item in the `items` array.
114
106
  */
115
107
  getFlatIndex(index: number): number;
116
-
117
- /**
118
- * @deprecated since 24.3 and will be removed in Vaadin 25.
119
- */
120
- getItemForIndex(index: number): TItem | undefined;
121
-
122
- /**
123
- * @deprecated since 24.3 and will be removed in Vaadin 25.
124
- */
125
- getCacheAndIndex(index: number): { cache: Cache<TItem>; scaledIndex: number };
126
-
127
- /**
128
- * @deprecated since 24.3 and will be removed in Vaadin 25.
129
- */
130
- updateSize(): void;
131
-
132
- /**
133
- * @deprecated since 24.3 and will be removed in Vaadin 25.
134
- */
135
- ensureSubCacheForScaledIndex(scaledIndex: number): void;
136
-
137
- /**
138
- * @deprecated since 24.3 and will be removed in Vaadin 25.
139
- */
140
- get grid(): HTMLElement;
141
-
142
- /**
143
- * @deprecated since 24.3 and will be removed in Vaadin 25.
144
- */
145
- get itemCaches(): object;
146
108
  }
@@ -3,7 +3,6 @@
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 { getFlatIndexContext } from './helpers.js';
7
6
 
8
7
  /**
9
8
  * A class that stores items with their associated sub-caches.
@@ -124,19 +123,6 @@ export class Cache {
124
123
  return this.__flatSize;
125
124
  }
126
125
 
127
- /**
128
- * The total number of items, including items from expanded sub-caches.
129
- *
130
- * @protected
131
- * @deprecated since 24.3 and will be removed in Vaadin 25.
132
- */
133
- get effectiveSize() {
134
- console.warn(
135
- '<vaadin-grid> The `effectiveSize` property of ItemCache is deprecated and will be removed in Vaadin 25.',
136
- );
137
- return this.flatSize;
138
- }
139
-
140
126
  /**
141
127
  * The number of items.
142
128
  *
@@ -261,66 +247,4 @@ export class Cache {
261
247
  return clampedIndex > index ? prev + subCache.flatSize : prev;
262
248
  }, clampedIndex);
263
249
  }
264
-
265
- /**
266
- * @deprecated since 24.3 and will be removed in Vaadin 25.
267
- */
268
- getItemForIndex(index) {
269
- console.warn(
270
- '<vaadin-grid> The `getItemForIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.',
271
- );
272
- const { item } = getFlatIndexContext(this, index);
273
- return item;
274
- }
275
-
276
- /**
277
- * @deprecated since 24.3 and will be removed in Vaadin 25.
278
- */
279
- getCacheAndIndex(index) {
280
- console.warn(
281
- '<vaadin-grid> The `getCacheAndIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.',
282
- );
283
- const { cache, index: scaledIndex } = getFlatIndexContext(this, index);
284
- return { cache, scaledIndex };
285
- }
286
-
287
- /**
288
- * @deprecated since 24.3 and will be removed in Vaadin 25.
289
- */
290
- updateSize() {
291
- console.warn('<vaadin-grid> The `updateSize` method of ItemCache is deprecated and will be removed in Vaadin 25.');
292
- this.recalculateFlatSize();
293
- }
294
-
295
- /**
296
- * @deprecated since 24.3 and will be removed in Vaadin 25.
297
- */
298
- ensureSubCacheForScaledIndex(scaledIndex) {
299
- console.warn(
300
- '<vaadin-grid> The `ensureSubCacheForScaledIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.',
301
- );
302
-
303
- if (!this.getSubCache(scaledIndex)) {
304
- const subCache = this.createSubCache(scaledIndex);
305
- this.context.__controller.__loadCachePage(subCache, 0);
306
- }
307
- }
308
-
309
- /**
310
- * @deprecated since 24.3 and will be removed in Vaadin 25.
311
- */
312
- get grid() {
313
- console.warn('<vaadin-grid> The `grid` property of ItemCache is deprecated and will be removed in Vaadin 25.');
314
- return this.context.__controller.host;
315
- }
316
-
317
- /**
318
- * @deprecated since 24.3 and will be removed in Vaadin 25.
319
- */
320
- get itemCaches() {
321
- console.warn(
322
- '<vaadin-grid> The `itemCaches` property of ItemCache is deprecated and will be removed in Vaadin 25.',
323
- );
324
- return this.__subCacheByIndex;
325
- }
326
250
  }
@@ -100,8 +100,6 @@ export class DataProviderController extends EventTarget {
100
100
  return {
101
101
  isExpanded: this.isExpanded,
102
102
  placeholder: this.placeholder,
103
- // The controller instance is needed to ensure deprecated cache methods work.
104
- __controller: this,
105
103
  };
106
104
  }
107
105
 
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.4') {
16
+ export function defineCustomElement(CustomElement, version = '25.0.0-alpha10') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -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
  }
package/src/gestures.js CHANGED
@@ -58,7 +58,6 @@ function isMouseEvent(name) {
58
58
  return MOUSE_EVENTS.indexOf(name) > -1;
59
59
  }
60
60
 
61
- /* eslint no-empty: ["error", { "allowEmptyCatch": true }] */
62
61
  // check for passive event listeners
63
62
  let supportsPassive = false;
64
63
  (function () {
@@ -347,7 +347,6 @@ export const ironList = {
347
347
  ith = this._physicalEnd;
348
348
  offsetContent = bottom - scrollBottom;
349
349
  }
350
- // eslint-disable-next-line no-constant-condition
351
350
  while (true) {
352
351
  physicalItemHeight = this._getPhysicalSizeIncrement(ith);
353
352
  offsetContent -= physicalItemHeight;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const loaderStyles = css`
10
+ @keyframes fade-in {
11
+ 0% {
12
+ opacity: 0;
13
+ }
14
+ }
15
+
16
+ @keyframes spin {
17
+ to {
18
+ rotate: 1turn;
19
+ }
20
+ }
21
+
22
+ [part='loader'] {
23
+ animation:
24
+ spin var(--vaadin-spinner-animation-duration, 1s) linear infinite,
25
+ fade-in 0.3s 0.3s both;
26
+ border: var(--vaadin-spinner-width, 2px) solid;
27
+ --_spinner-color: var(--vaadin-spinner-color, var(--vaadin-color));
28
+ --_spinner-color2: color-mix(in srgb, var(--_spinner-color) 20%, transparent);
29
+ border-color: var(--_spinner-color) var(--_spinner-color) var(--_spinner-color2) var(--_spinner-color2);
30
+ border-radius: 50%;
31
+ box-sizing: border-box;
32
+ height: var(--vaadin-spinner-size, 1lh);
33
+ pointer-events: none;
34
+ width: var(--vaadin-spinner-size, 1lh);
35
+ }
36
+
37
+ :host(:not([loading])) [part~='loader'] {
38
+ display: none;
39
+ }
40
+ `;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
1
6
  import { IronListAdapter } from './virtualizer-iron-list-adapter.js';
2
7
 
3
8
  export class Virtualizer {
@@ -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 { dedupeMixin } from '@open-wc/dedupe-mixin';
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 = dedupeMixin((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
- }