@vaadin/virtual-list 22.0.0-alpha9 → 22.0.0
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/README.md +24 -24
- package/package.json +8 -8
- package/src/vaadin-virtual-list.js +4 -7
- package/src/iron-list.js +0 -951
- package/src/virtualizer-iron-list-adapter.js +0 -487
- package/src/virtualizer.js +0 -83
package/README.md
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaadin/virtual-list
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
|
5
|
-
[API documentation ↗](https://vaadin.com/docs/latest/ds/components/virtual-list/api)
|
|
3
|
+
A web component for rendering a long list of items without sacrificing performance.
|
|
6
4
|
|
|
7
|
-
[
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/virtual-list)
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/@vaadin/virtual-list)
|
|
10
8
|
[](https://discord.gg/PHmkCKC)
|
|
@@ -21,41 +19,42 @@
|
|
|
21
19
|
</script>
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
[<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/virtual-list/screenshot.png" alt="Screenshot of vaadin-virtual-list">](https://vaadin.com/docs/latest/ds/components/virtual-list)
|
|
25
|
-
|
|
26
22
|
## Installation
|
|
27
23
|
|
|
28
|
-
Install
|
|
24
|
+
Install the component:
|
|
29
25
|
|
|
30
26
|
```sh
|
|
31
|
-
npm i @vaadin/virtual-list
|
|
27
|
+
npm i @vaadin/virtual-list
|
|
32
28
|
```
|
|
33
29
|
|
|
34
|
-
Once installed, import
|
|
30
|
+
Once installed, import the component in your application:
|
|
35
31
|
|
|
36
32
|
```js
|
|
37
|
-
import '@vaadin/virtual-list
|
|
33
|
+
import '@vaadin/virtual-list';
|
|
38
34
|
```
|
|
39
35
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
Vaadin components use the Lumo theme by default.
|
|
43
|
-
|
|
44
|
-
To use the Material theme, import the correspondent file from the `theme/material` folder.
|
|
36
|
+
## Themes
|
|
45
37
|
|
|
46
|
-
|
|
38
|
+
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
|
|
39
|
+
The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/virtual-list/vaadin-virtual-list.js) of the package uses the Lumo theme.
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
To use the Material theme, import the component from the `theme/material` folder:
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
```js
|
|
44
|
+
import '@vaadin/virtual-list/theme/material/vaadin-virtual-list.js';
|
|
45
|
+
```
|
|
51
46
|
|
|
52
|
-
|
|
47
|
+
You can also import the Lumo version of the component explicitly:
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
```js
|
|
50
|
+
import '@vaadin/virtual-list/theme/lumo/vaadin-virtual-list.js';
|
|
51
|
+
```
|
|
55
52
|
|
|
56
|
-
-
|
|
53
|
+
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
```js
|
|
56
|
+
import '@vaadin/virtual-list/src/vaadin-virtual-list.js';
|
|
57
|
+
```
|
|
59
58
|
|
|
60
59
|
## Contributing
|
|
61
60
|
|
|
@@ -65,4 +64,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
|
|
|
65
64
|
|
|
66
65
|
Apache License 2.0
|
|
67
66
|
|
|
68
|
-
Vaadin collects development time
|
|
67
|
+
Vaadin collects usage statistics at development time to improve this product.
|
|
68
|
+
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/virtual-list",
|
|
3
|
-
"version": "22.0.0
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/component-base": "22.0.0
|
|
37
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0
|
|
38
|
-
"@vaadin/vaadin-material-styles": "22.0.0
|
|
39
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0
|
|
36
|
+
"@vaadin/component-base": "^22.0.0",
|
|
37
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.0",
|
|
38
|
+
"@vaadin/vaadin-material-styles": "^22.0.0",
|
|
39
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@esm-bundle/chai": "^4.3.4",
|
|
43
|
-
"@vaadin/polymer-legacy-adapter": "22.0.0
|
|
44
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
43
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.0",
|
|
44
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
45
45
|
"lit": "^2.0.0",
|
|
46
46
|
"sinon": "^9.2.4"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
|
|
49
49
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2021 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
8
|
import { processTemplates } from '@vaadin/component-base/src/templates.js';
|
|
9
|
+
import { Virtualizer } from '@vaadin/component-base/src/virtualizer.js';
|
|
9
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
-
import { Virtualizer } from './virtualizer.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* `<vaadin-virtual-list>` is a Web Component for displaying a virtual/infinite list of items.
|
|
@@ -153,11 +153,8 @@ class VirtualList extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
153
153
|
const hasRenderedItems = this.childElementCount > 0;
|
|
154
154
|
|
|
155
155
|
if ((renderer || hasRenderedItems) && virtualizer) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} else {
|
|
159
|
-
virtualizer.size = items.length;
|
|
160
|
-
}
|
|
156
|
+
virtualizer.size = items.length;
|
|
157
|
+
virtualizer.update();
|
|
161
158
|
}
|
|
162
159
|
}
|
|
163
160
|
|