@vaadin/scroller 25.0.0-alpha2 → 25.0.0-alpha20

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/scroller",
3
- "version": "25.0.0-alpha2",
3
+ "version": "25.0.0-alpha20",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,7 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "theme",
25
24
  "vaadin-*.d.ts",
26
25
  "vaadin-*.js",
27
26
  "web-types.json",
@@ -35,20 +34,20 @@
35
34
  ],
36
35
  "dependencies": {
37
36
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.0.0-alpha2",
39
- "@vaadin/component-base": "25.0.0-alpha2",
40
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
41
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
37
+ "@vaadin/a11y-base": "25.0.0-alpha20",
38
+ "@vaadin/component-base": "25.0.0-alpha20",
39
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha20",
42
40
  "lit": "^3.0.0"
43
41
  },
44
42
  "devDependencies": {
45
- "@vaadin/chai-plugins": "25.0.0-alpha2",
46
- "@vaadin/test-runner-commands": "25.0.0-alpha2",
47
- "@vaadin/testing-helpers": "^2.0.0"
43
+ "@vaadin/chai-plugins": "25.0.0-alpha20",
44
+ "@vaadin/test-runner-commands": "25.0.0-alpha20",
45
+ "@vaadin/testing-helpers": "^2.0.0",
46
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha20"
48
47
  },
49
48
  "web-types": [
50
49
  "web-types.json",
51
50
  "web-types.lit.json"
52
51
  ],
53
- "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
52
+ "gitHead": "c948aae591a30b432f3784000d4677674cae56e0"
54
53
  }
@@ -0,0 +1,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const scrollerStyles: CSSResult;
@@ -0,0 +1,59 @@
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/styles/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-indicator'])::before,
37
+ :host([theme*='overflow-indicator'])::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-secondary));
46
+ }
47
+
48
+ :host([theme*='overflow-indicator'])::after {
49
+ margin-bottom: 0;
50
+ margin-top: -1px;
51
+ }
52
+
53
+ :host([theme~='overflow-indicator-top'][overflow~='top'])::before,
54
+ :host([theme~='overflow-indicators'][overflow~='top'])::before,
55
+ :host([theme~='overflow-indicators'][overflow~='bottom'])::after,
56
+ :host([theme~='overflow-indicator-bottom'][overflow~='bottom'])::after {
57
+ display: block;
58
+ }
59
+ `;
@@ -10,11 +10,12 @@ import { ScrollerMixin } from './vaadin-scroller-mixin.js';
10
10
  /**
11
11
  * `<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.
12
12
  *
13
- * ```
13
+ * ```html
14
14
  * <vaadin-scroller>
15
15
  * <div>Content</div>
16
16
  * </vaadin-scroller>
17
17
  * ```
18
+ *
18
19
  * The following attributes are exposed for styling:
19
20
  *
20
21
  * Attribute | Description
@@ -3,22 +3,25 @@
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 { css, html, LitElement } from 'lit';
6
+ import { html, LitElement } from 'lit';
7
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
9
  import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
10
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-base-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>
21
23
  * ```
24
+ *
22
25
  * The following attributes are exposed for styling:
23
26
  *
24
27
  * Attribute | Description
@@ -33,34 +36,19 @@ import { ScrollerMixin } from './vaadin-scroller-mixin.js';
33
36
  * @mixes ElementMixin
34
37
  * @mixes ScrollerMixin
35
38
  */
36
- class Scroller extends ScrollerMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
39
+ class Scroller extends ScrollerMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
37
40
  static get is() {
38
41
  return 'vaadin-scroller';
39
42
  }
40
43
 
41
44
  static get styles() {
42
- return css`
43
- :host {
44
- display: block;
45
- overflow: auto;
46
- }
47
-
48
- :host([hidden]) {
49
- display: none !important;
50
- }
51
-
52
- :host([scroll-direction='vertical']) {
53
- overflow-x: hidden;
54
- }
55
-
56
- :host([scroll-direction='horizontal']) {
57
- overflow-y: hidden;
58
- }
45
+ return scrollerStyles;
46
+ }
59
47
 
60
- :host([scroll-direction='none']) {
61
- overflow: hidden;
62
- }
63
- `;
48
+ static get lumoInjector() {
49
+ return {
50
+ includeBaseStyles: true,
51
+ };
64
52
  }
65
53
 
66
54
  /** @protected */
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-scroller.js';
1
+ import './src/vaadin-scroller.js';
2
2
  export * from './src/vaadin-scroller.js';
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": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
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```\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.",
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```\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",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/scroller",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
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```\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.",
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```\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,4 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/style.js';
3
- declare const scroller: import("lit").CSSResult;
4
- export { scroller };
@@ -1,43 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/style.js';
3
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
-
5
- const scroller = css`
6
- :host {
7
- outline: none;
8
- --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
9
- --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
10
- }
11
-
12
- :host([focus-ring]) {
13
- box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
14
- }
15
-
16
- /* Show dividers when content overflows */
17
-
18
- :host([theme~='overflow-indicators'])::before,
19
- :host([theme~='overflow-indicators'])::after {
20
- content: '';
21
- display: none;
22
- position: sticky;
23
- inset: 0;
24
- z-index: 9999;
25
- height: 1px;
26
- margin-bottom: -1px;
27
- background: var(--lumo-contrast-10pct);
28
- }
29
-
30
- :host([theme~='overflow-indicators'])::after {
31
- margin-bottom: 0;
32
- margin-top: -1px;
33
- }
34
-
35
- :host([theme~='overflow-indicators'][overflow~='top'])::before,
36
- :host([theme~='overflow-indicators'][overflow~='bottom'])::after {
37
- display: block;
38
- }
39
- `;
40
-
41
- registerStyles('vaadin-scroller', scroller, { moduleId: 'lumo-scroller' });
42
-
43
- export { scroller };
@@ -1,2 +0,0 @@
1
- import './vaadin-scroller-styles.js';
2
- import '../../src/vaadin-scroller.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-scroller-styles.js';
2
- import '../../src/vaadin-scroller.js';