@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 CHANGED
@@ -1,10 +1,8 @@
1
- # <vaadin-virtual-list>
1
+ # @vaadin/virtual-list
2
2
 
3
- [Live Demo ↗](https://vaadin.com/docs/latest/ds/components/virtual-list)
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
- [<vaadin-virtual-list>](https://vaadin.com/docs/latest/ds/components/virtual-list) is a Web Component providing an accessible and customizable virtual-list, part of the [Vaadin components](https://vaadin.com/docs/latest/ds/components).
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/virtual-list)
8
6
 
9
7
  [![npm version](https://badgen.net/npm/v/@vaadin/virtual-list)](https://www.npmjs.com/package/@vaadin/virtual-list)
10
8
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](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 `vaadin-virtual-list`:
24
+ Install the component:
29
25
 
30
26
  ```sh
31
- npm i @vaadin/virtual-list --save
27
+ npm i @vaadin/virtual-list
32
28
  ```
33
29
 
34
- Once installed, import it in your application:
30
+ Once installed, import the component in your application:
35
31
 
36
32
  ```js
37
- import '@vaadin/virtual-list/vaadin-virtual-list.js';
33
+ import '@vaadin/virtual-list';
38
34
  ```
39
35
 
40
- ## Getting started
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
- ## Entry points
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
- - The component with the Lumo theme:
41
+ To use the Material theme, import the component from the `theme/material` folder:
49
42
 
50
- `theme/lumo/vaadin-virtual-list.js`
43
+ ```js
44
+ import '@vaadin/virtual-list/theme/material/vaadin-virtual-list.js';
45
+ ```
51
46
 
52
- - The component with the Material theme:
47
+ You can also import the Lumo version of the component explicitly:
53
48
 
54
- `theme/material/vaadin-virtual-list.js`
49
+ ```js
50
+ import '@vaadin/virtual-list/theme/lumo/vaadin-virtual-list.js';
51
+ ```
55
52
 
56
- - Alias for `theme/lumo/vaadin-virtual-list.js`:
53
+ Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
57
54
 
58
- `vaadin-virtual-list.js`
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 usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
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-alpha9",
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-alpha9",
37
- "@vaadin/vaadin-lumo-styles": "22.0.0-alpha9",
38
- "@vaadin/vaadin-material-styles": "22.0.0-alpha9",
39
- "@vaadin/vaadin-themable-mixin": "22.0.0-alpha9"
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-alpha9",
44
- "@vaadin/testing-helpers": "^0.3.0",
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": "6e8c899dc65918f97e3c0acb2076122c4b2ef274"
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 { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
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
- if (items.length === virtualizer.size) {
157
- virtualizer.update();
158
- } else {
159
- virtualizer.size = items.length;
160
- }
156
+ virtualizer.size = items.length;
157
+ virtualizer.update();
161
158
  }
162
159
  }
163
160