@vaadin/virtual-list 23.2.0-dev.8a7678b70 → 23.3.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A web component for rendering a long list of items without sacrificing performance.
4
4
 
5
- [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/virtual-list)
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/virtual-list)
6
6
 
7
7
  [![npm version](https://badgen.net/npm/v/@vaadin/virtual-list)](https://www.npmjs.com/package/@vaadin/virtual-list)
8
8
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
@@ -35,7 +35,7 @@ import '@vaadin/virtual-list';
35
35
 
36
36
  ## Themes
37
37
 
38
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
38
+ Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
39
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.
40
40
 
41
41
  To use the Material theme, import the component from the `theme/material` folder:
@@ -58,7 +58,7 @@ import '@vaadin/virtual-list/src/vaadin-virtual-list.js';
58
58
 
59
59
  ## Contributing
60
60
 
61
- Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
61
+ Read the [contributing guide](https://vaadin.com/docs/latest/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
62
62
 
63
63
  ## License
64
64
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/virtual-list",
3
- "version": "23.2.0-dev.8a7678b70",
3
+ "version": "23.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,7 +25,9 @@
25
25
  "src",
26
26
  "theme",
27
27
  "vaadin-*.d.ts",
28
- "vaadin-*.js"
28
+ "vaadin-*.js",
29
+ "web-types.json",
30
+ "web-types.lit.json"
29
31
  ],
30
32
  "keywords": [
31
33
  "Vaadin",
@@ -36,18 +38,22 @@
36
38
  ],
37
39
  "dependencies": {
38
40
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "23.2.0-dev.8a7678b70",
40
- "@vaadin/lit-renderer": "23.2.0-dev.8a7678b70",
41
- "@vaadin/vaadin-lumo-styles": "23.2.0-dev.8a7678b70",
42
- "@vaadin/vaadin-material-styles": "23.2.0-dev.8a7678b70",
43
- "@vaadin/vaadin-themable-mixin": "23.2.0-dev.8a7678b70"
41
+ "@vaadin/component-base": "23.3.0-alpha1",
42
+ "@vaadin/lit-renderer": "23.3.0-alpha1",
43
+ "@vaadin/vaadin-lumo-styles": "23.3.0-alpha1",
44
+ "@vaadin/vaadin-material-styles": "23.3.0-alpha1",
45
+ "@vaadin/vaadin-themable-mixin": "23.3.0-alpha1"
44
46
  },
45
47
  "devDependencies": {
46
48
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/polymer-legacy-adapter": "23.2.0-dev.8a7678b70",
49
+ "@vaadin/polymer-legacy-adapter": "23.3.0-alpha1",
48
50
  "@vaadin/testing-helpers": "^0.3.2",
49
51
  "lit": "^2.0.0",
50
52
  "sinon": "^13.0.2"
51
53
  },
52
- "gitHead": "85b403f96d8282f262322b56c0ff4289f843d02a"
54
+ "web-types": [
55
+ "web-types.json",
56
+ "web-types.lit.json"
57
+ ],
58
+ "gitHead": "beabc527d4b1274eb798ff701d406fed45cfe638"
53
59
  }
@@ -3,10 +3,10 @@
3
3
  * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { TemplateResult } from 'lit';
7
- import { DirectiveResult } from 'lit/directive.js';
6
+ import type { TemplateResult } from 'lit';
7
+ import type { DirectiveResult } from 'lit/directive.js';
8
8
  import { LitRendererDirective } from '@vaadin/lit-renderer';
9
- import { VirtualList, VirtualListItemModel } from '../vaadin-virtual-list.js';
9
+ import type { VirtualList, VirtualListItemModel } from '../vaadin-virtual-list.js';
10
10
 
11
11
  export type VirtualListLitRenderer<TItem> = (
12
12
  item: TItem,
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2021 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
6
7
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
7
8
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
9
 
@@ -34,13 +35,21 @@ export type VirtualListRenderer<TItem> = (
34
35
  * }
35
36
  * ```
36
37
  *
37
- * See [Virtual List](https://vaadin.com/docs/latest/ds/components/virtual-list) documentation.
38
+ * The following state attributes are available for styling:
39
+ *
40
+ * Attribute | Description
41
+ * -----------------|--------------------------------------------
42
+ * `overflow` | Set to `top`, `bottom`, both, or none.
43
+ *
44
+ * See [Virtual List](https://vaadin.com/docs/latest/components/virtual-list) documentation.
38
45
  *
39
46
  * @extends HTMLElement
40
47
  * @mixes ElementMixin
41
48
  * @mixes ThemableMixin
42
49
  */
43
- declare class VirtualList<TItem = VirtualListDefaultItem> extends ElementMixin(ThemableMixin(HTMLElement)) {
50
+ declare class VirtualList<TItem = VirtualListDefaultItem> extends ElementMixin(
51
+ ControllerMixin(ThemableMixin(HTMLElement)),
52
+ ) {
44
53
  /**
45
54
  * Gets the index of the first visible item in the viewport.
46
55
  */
@@ -4,7 +4,9 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
7
8
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
+ import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
8
10
  import { processTemplates } from '@vaadin/component-base/src/templates.js';
9
11
  import { Virtualizer } from '@vaadin/component-base/src/virtualizer.js';
10
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -24,13 +26,20 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
24
26
  * }
25
27
  * ```
26
28
  *
27
- * See [Virtual List](https://vaadin.com/docs/latest/ds/components/virtual-list) documentation.
29
+ * The following state attributes are available for styling:
30
+ *
31
+ * Attribute | Description
32
+ * -----------------|--------------------------------------------
33
+ * `overflow` | Set to `top`, `bottom`, both, or none.
34
+ *
35
+ * See [Virtual List](https://vaadin.com/docs/latest/components/virtual-list) documentation.
28
36
  *
29
37
  * @extends HTMLElement
38
+ * @mixes ControllerMixin
30
39
  * @mixes ElementMixin
31
40
  * @mixes ThemableMixin
32
41
  */
33
- class VirtualList extends ElementMixin(ThemableMixin(PolymerElement)) {
42
+ class VirtualList extends ElementMixin(ControllerMixin(ThemableMixin(PolymerElement))) {
34
43
  static get template() {
35
44
  return html`
36
45
  <style>
@@ -104,6 +113,9 @@ class VirtualList extends ElementMixin(ThemableMixin(PolymerElement)) {
104
113
  scrollContainer: this.shadowRoot.querySelector('#items'),
105
114
  });
106
115
 
116
+ this.__overflowController = new OverflowController(this);
117
+ this.addController(this.__overflowController);
118
+
107
119
  processTemplates(this);
108
120
  }
109
121
 
package/web-types.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/virtual-list",
4
+ "version": "23.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-virtual-list",
11
+ "description": "`<vaadin-virtual-list>` is a Web Component for displaying a virtual/infinite list of items.\n\n```html\n<vaadin-virtual-list></vaadin-virtual-list>\n```\n```js\nconst list = document.querySelector('vaadin-virtual-list');\nlist.items = items; // An array of data items\nlist.renderer = (root, list, {item, index}) => {\n root.textContent = `#${index}: ${item.name}`\n}\n```\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`overflow` | Set to `top`, `bottom`, both, or none.\n\nSee [Virtual List](https://vaadin.com/docs/latest/components/virtual-list) documentation.",
12
+ "attributes": [
13
+ {
14
+ "name": "theme",
15
+ "description": "The theme variants to apply to the component.",
16
+ "value": {
17
+ "type": [
18
+ "string",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ }
24
+ ],
25
+ "js": {
26
+ "properties": [
27
+ {
28
+ "name": "items",
29
+ "description": "An array containing items determining how many instances to render.",
30
+ "value": {
31
+ "type": [
32
+ "Array.<VirtualListItem>",
33
+ "undefined"
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "name": "renderer",
39
+ "description": "Custom function for rendering the content of every item.\nReceives three arguments:\n\n- `root` The render target element representing one item at a time.\n- `virtualList` The reference to the `<vaadin-virtual-list>` element.\n- `model` The object with the properties related with the rendered\n item, contains:\n - `model.index` The index of the rendered item.\n - `model.item` The item.",
40
+ "value": {
41
+ "type": [
42
+ "VirtualListRenderer",
43
+ "undefined"
44
+ ]
45
+ }
46
+ }
47
+ ],
48
+ "events": []
49
+ }
50
+ }
51
+ ]
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/virtual-list",
4
+ "version": "23.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
18
+ "name": "vaadin-virtual-list",
19
+ "description": "`<vaadin-virtual-list>` is a Web Component for displaying a virtual/infinite list of items.\n\n```html\n<vaadin-virtual-list></vaadin-virtual-list>\n```\n```js\nconst list = document.querySelector('vaadin-virtual-list');\nlist.items = items; // An array of data items\nlist.renderer = (root, list, {item, index}) => {\n root.textContent = `#${index}: ${item.name}`\n}\n```\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`overflow` | Set to `top`, `bottom`, both, or none.\n\nSee [Virtual List](https://vaadin.com/docs/latest/components/virtual-list) documentation.",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": ".items",
24
+ "description": "An array containing items determining how many instances to render.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": ".renderer",
31
+ "description": "Custom function for rendering the content of every item.\nReceives three arguments:\n\n- `root` The render target element representing one item at a time.\n- `virtualList` The reference to the `<vaadin-virtual-list>` element.\n- `model` The object with the properties related with the rendered\n item, contains:\n - `model.index` The index of the rendered item.\n - `model.item` The item.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ }
36
+ ]
37
+ }
38
+ ]
39
+ }
40
+ }
41
+ }