@vaadin/scroller 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/README.md +0 -23
- package/package.json +12 -13
- package/src/styles/vaadin-scroller-base-styles.d.ts +8 -0
- package/src/styles/vaadin-scroller-base-styles.js +57 -0
- package/src/styles/vaadin-scroller-core-styles.d.ts +8 -0
- package/src/styles/vaadin-scroller-core-styles.js +29 -0
- package/src/vaadin-scroller.d.ts +2 -3
- package/src/vaadin-scroller.js +19 -32
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-lit-scroller.js +0 -69
- package/theme/lumo/vaadin-lit-scroller.d.ts +0 -2
- package/theme/lumo/vaadin-lit-scroller.js +0 -2
- package/theme/material/vaadin-lit-scroller.d.ts +0 -2
- package/theme/material/vaadin-lit-scroller.js +0 -2
- package/theme/material/vaadin-scroller-styles.d.ts +0 -3
- package/theme/material/vaadin-scroller-styles.js +0 -16
- package/theme/material/vaadin-scroller.d.ts +0 -2
- package/theme/material/vaadin-scroller.js +0 -2
- package/vaadin-lit-scroller.d.ts +0 -1
- package/vaadin-lit-scroller.js +0 -2
package/README.md
CHANGED
|
@@ -34,29 +34,6 @@ Once installed, import the component in your application:
|
|
|
34
34
|
import '@vaadin/scroller';
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
## Themes
|
|
38
|
-
|
|
39
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
40
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/scroller/vaadin-scroller.js) of the package uses the Lumo theme.
|
|
41
|
-
|
|
42
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
import '@vaadin/scroller/theme/material/vaadin-scroller.js';
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
You can also import the Lumo version of the component explicitly:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
import '@vaadin/scroller/theme/lumo/vaadin-scroller.js';
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
55
|
-
|
|
56
|
-
```js
|
|
57
|
-
import '@vaadin/scroller/src/vaadin-scroller.js';
|
|
58
|
-
```
|
|
59
|
-
|
|
60
37
|
## Contributing
|
|
61
38
|
|
|
62
39
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/scroller",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -31,27 +33,24 @@
|
|
|
31
33
|
"Vaadin",
|
|
32
34
|
"vaadin-scroller",
|
|
33
35
|
"web-components",
|
|
34
|
-
"web-component"
|
|
35
|
-
"polymer"
|
|
36
|
+
"web-component"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/vaadin-
|
|
43
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
45
44
|
"lit": "^3.0.0"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@vaadin/chai-plugins": "
|
|
49
|
-
"@vaadin/test-runner-commands": "
|
|
50
|
-
"@vaadin/testing-helpers": "^
|
|
47
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
49
|
+
"@vaadin/testing-helpers": "^2.0.0"
|
|
51
50
|
},
|
|
52
51
|
"web-types": [
|
|
53
52
|
"web-types.json",
|
|
54
53
|
"web-types.lit.json"
|
|
55
54
|
],
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
57
56
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const scrollerStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([focus-ring]) {
|
|
17
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host([hidden]) {
|
|
21
|
+
display: none !important;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([scroll-direction='vertical']) {
|
|
25
|
+
overflow-x: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
:host([scroll-direction='horizontal']) {
|
|
29
|
+
overflow-y: hidden;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
:host([scroll-direction='none']) {
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([theme~='overflow-indicators'])::before,
|
|
37
|
+
:host([theme~='overflow-indicators'])::after {
|
|
38
|
+
content: '';
|
|
39
|
+
display: none;
|
|
40
|
+
position: sticky;
|
|
41
|
+
inset: 0;
|
|
42
|
+
z-index: 9999;
|
|
43
|
+
height: 1px;
|
|
44
|
+
margin-bottom: -1px;
|
|
45
|
+
background: var(--vaadin-scroller-border-color, var(--vaadin-border-color));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:host([theme~='overflow-indicators'])::after {
|
|
49
|
+
margin-bottom: 0;
|
|
50
|
+
margin-top: -1px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([theme~='overflow-indicators'][overflow~='top'])::before,
|
|
54
|
+
:host([theme~='overflow-indicators'][overflow~='bottom'])::after {
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const scrollerStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
overflow: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([scroll-direction='vertical']) {
|
|
19
|
+
overflow-x: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([scroll-direction='horizontal']) {
|
|
23
|
+
overflow-y: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([scroll-direction='none']) {
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
`;
|
package/src/vaadin-scroller.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2020 - 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 { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
8
|
import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
@@ -11,7 +10,7 @@ import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
|
11
10
|
/**
|
|
12
11
|
* `<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.
|
|
13
12
|
*
|
|
14
|
-
* ```
|
|
13
|
+
* ```html
|
|
15
14
|
* <vaadin-scroller>
|
|
16
15
|
* <div>Content</div>
|
|
17
16
|
* </vaadin-scroller>
|
|
@@ -24,7 +23,7 @@ import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
|
24
23
|
* `focused` | Set when the element is focused.
|
|
25
24
|
* `overflow` | Set to `top`, `bottom`, `start`, `end`, all of them, or none.
|
|
26
25
|
*/
|
|
27
|
-
declare class Scroller extends ScrollerMixin(ThemableMixin(ElementMixin(
|
|
26
|
+
declare class Scroller extends ScrollerMixin(ThemableMixin(ElementMixin(HTMLElement))) {}
|
|
28
27
|
|
|
29
28
|
declare global {
|
|
30
29
|
interface HTMLElementTagNameMap {
|
package/src/vaadin-scroller.js
CHANGED
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
* Copyright (c) 2020 - 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 { html,
|
|
7
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
8
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
9
|
import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { scrollerStyles } from './styles/vaadin-scroller-core-styles.js';
|
|
12
14
|
import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* `<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.
|
|
16
18
|
*
|
|
17
|
-
* ```
|
|
19
|
+
* ```html
|
|
18
20
|
* <vaadin-scroller>
|
|
19
21
|
* <div>Content</div>
|
|
20
22
|
* </vaadin-scroller>
|
|
@@ -30,42 +32,27 @@ import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
|
30
32
|
* @customElement
|
|
31
33
|
* @extends HTMLElement
|
|
32
34
|
* @mixes ThemableMixin
|
|
33
|
-
* @mixes ControllerMixin
|
|
34
35
|
* @mixes ElementMixin
|
|
35
36
|
* @mixes ScrollerMixin
|
|
36
37
|
*/
|
|
37
|
-
class Scroller extends ScrollerMixin(ElementMixin(
|
|
38
|
-
static get
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
:host([hidden]) {
|
|
42
|
-
display: none !important;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host {
|
|
46
|
-
display: block;
|
|
47
|
-
overflow: auto;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
:host([scroll-direction='vertical']) {
|
|
51
|
-
overflow-x: hidden;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:host([scroll-direction='horizontal']) {
|
|
55
|
-
overflow-y: hidden;
|
|
56
|
-
}
|
|
38
|
+
class Scroller extends ScrollerMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
39
|
+
static get is() {
|
|
40
|
+
return 'vaadin-scroller';
|
|
41
|
+
}
|
|
57
42
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</style>
|
|
43
|
+
static get styles() {
|
|
44
|
+
return scrollerStyles;
|
|
45
|
+
}
|
|
62
46
|
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
static get lumoInjector() {
|
|
48
|
+
return {
|
|
49
|
+
includeBaseStyles: true,
|
|
50
|
+
};
|
|
65
51
|
}
|
|
66
52
|
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
/** @protected */
|
|
54
|
+
render() {
|
|
55
|
+
return html`<slot></slot>`;
|
|
69
56
|
}
|
|
70
57
|
|
|
71
58
|
/** @protected */
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/scroller",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-scroller",
|
|
11
|
-
"description": "`<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.\n\n
|
|
11
|
+
"description": "`<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.\n\n```html\n<vaadin-scroller>\n <div>Content</div>\n</vaadin-scroller>\n```\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n`overflow` | Set to `top`, `bottom`, `start`, `end`, all of them, or none.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "scroll-direction",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/scroller",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-scroller",
|
|
19
|
-
"description": "`<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.\n\n
|
|
19
|
+
"description": "`<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.\n\n```html\n<vaadin-scroller>\n <div>Content</div>\n</vaadin-scroller>\n```\nThe following attributes are exposed for styling:\n\nAttribute | Description\n-------------| -----------\n`focus-ring` | Set when the element is focused using the keyboard.\n`focused` | Set when the element is focused.\n`overflow` | Set to `top`, `bottom`, `start`, `end`, all of them, or none.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2020 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
-
import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* LitElement based version of `<vaadin-scroller>` web component.
|
|
16
|
-
*
|
|
17
|
-
* ## Disclaimer
|
|
18
|
-
*
|
|
19
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
20
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
21
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
22
|
-
*/
|
|
23
|
-
class Scroller extends ScrollerMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
24
|
-
static get is() {
|
|
25
|
-
return 'vaadin-scroller';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static get styles() {
|
|
29
|
-
return css`
|
|
30
|
-
:host {
|
|
31
|
-
display: block;
|
|
32
|
-
overflow: auto;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host([hidden]) {
|
|
36
|
-
display: none !important;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([scroll-direction='vertical']) {
|
|
40
|
-
overflow-x: hidden;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
:host([scroll-direction='horizontal']) {
|
|
44
|
-
overflow-y: hidden;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
:host([scroll-direction='none']) {
|
|
48
|
-
overflow: hidden;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** @protected */
|
|
54
|
-
render() {
|
|
55
|
-
return html`<slot></slot>`;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** @protected */
|
|
59
|
-
ready() {
|
|
60
|
-
super.ready();
|
|
61
|
-
|
|
62
|
-
this.__overflowController = new OverflowController(this);
|
|
63
|
-
this.addController(this.__overflowController);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
defineCustomElement(Scroller);
|
|
68
|
-
|
|
69
|
-
export { Scroller };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
3
|
-
|
|
4
|
-
const scroller = css`
|
|
5
|
-
:host {
|
|
6
|
-
outline: none;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
:host([focus-ring]) {
|
|
10
|
-
box-shadow: 0 0 0 2px var(--material-primary-color);
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
|
|
14
|
-
registerStyles('vaadin-scroller', scroller, { moduleId: 'material-scroller' });
|
|
15
|
-
|
|
16
|
-
export { scroller };
|
package/vaadin-lit-scroller.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-scroller.js';
|
package/vaadin-lit-scroller.js
DELETED