@vaadin/component-base 25.0.0-alpha4 → 25.0.0-alpha6
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 +4 -4
- package/src/define.js +1 -1
- package/src/loader-styles.js +42 -0
- package/src/virtualizer-iron-list-adapter.js +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/component-base",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha6",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"lit": "^3.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
42
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
41
|
+
"@vaadin/chai-plugins": "25.0.0-alpha6",
|
|
42
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha6",
|
|
43
43
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
44
44
|
"sinon": "^18.0.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "cd1d084198d2b326c58d44bb39fa4845b71ce551"
|
|
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 = '25.0.0-
|
|
16
|
+
export function defineCustomElement(CustomElement, version = '25.0.0-alpha6') {
|
|
17
17
|
Object.defineProperty(CustomElement, 'version', {
|
|
18
18
|
get() {
|
|
19
19
|
return version;
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
@layer base {
|
|
11
|
+
@keyframes fade-in {
|
|
12
|
+
0% {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@keyframes spin {
|
|
18
|
+
to {
|
|
19
|
+
rotate: 1turn;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[part='loader'] {
|
|
24
|
+
animation:
|
|
25
|
+
spin var(--vaadin-spinner-animation-duration, 1s) linear infinite,
|
|
26
|
+
fade-in 0.3s 0.3s both;
|
|
27
|
+
border: var(--vaadin-spinner-width, 2px) solid;
|
|
28
|
+
--_spinner-color: var(--vaadin-spinner-color, var(--vaadin-color));
|
|
29
|
+
border-color: var(--_spinner-color) var(--_spinner-color) hsl(from var(--_spinner-color) h s l / 0.2)
|
|
30
|
+
hsl(from var(--_spinner-color) h s l / 0.2);
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
height: var(--vaadin-spinner-size, 1lh);
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
width: var(--vaadin-spinner-size, 1lh);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:host(:not([loading])) [part~='loader'] {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
@@ -599,6 +599,24 @@ export class IronListAdapter {
|
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
+
/** @override */
|
|
603
|
+
_resizeHandler() {
|
|
604
|
+
super._resizeHandler();
|
|
605
|
+
|
|
606
|
+
// Fixes an issue where the new items are not created on scroll target resize when the scroll position is around the end.
|
|
607
|
+
// See https://github.com/vaadin/flow-components/issues/7307
|
|
608
|
+
const lastIndexVisible = this.adjustedLastVisibleIndex === this.size - 1;
|
|
609
|
+
const emptySpace = this._physicalTop - this._scrollPosition;
|
|
610
|
+
if (lastIndexVisible && emptySpace > 0) {
|
|
611
|
+
const idxAdjustment = Math.ceil(emptySpace / this._physicalAverage);
|
|
612
|
+
this._virtualStart = Math.max(0, this._virtualStart - idxAdjustment);
|
|
613
|
+
this._physicalStart = Math.max(0, this._physicalStart - idxAdjustment);
|
|
614
|
+
// Scroll to end for smoother resize
|
|
615
|
+
super.scrollToIndex(this._virtualCount - 1);
|
|
616
|
+
this.scrollTarget.scrollTop = this.scrollTarget.scrollHeight - this.scrollTarget.clientHeight;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
602
620
|
/**
|
|
603
621
|
* Work around an iron-list issue with invalid item positioning.
|
|
604
622
|
* See https://github.com/vaadin/flow-components/issues/4306
|