@vaadin/scroller 23.0.0-alpha1 → 23.0.0-alpha5
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 +7 -6
- package/src/vaadin-scroller.d.ts +14 -2
- package/src/vaadin-scroller.js +31 -2
- package/theme/lumo/vaadin-scroller-styles.js +16 -0
- package/theme/lumo/vaadin-scroller.js +1 -0
- package/theme/material/vaadin-scroller-styles.js +16 -0
- package/theme/material/vaadin-scroller.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/scroller",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-alpha5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"main": "vaadin-scroller.js",
|
|
20
20
|
"module": "vaadin-scroller.js",
|
|
21
|
+
"type": "module",
|
|
21
22
|
"files": [
|
|
22
23
|
"src",
|
|
23
24
|
"theme",
|
|
@@ -33,14 +34,14 @@
|
|
|
33
34
|
],
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/component-base": "23.0.0-
|
|
37
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
38
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
39
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
37
|
+
"@vaadin/component-base": "23.0.0-alpha5",
|
|
38
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-alpha5",
|
|
39
|
+
"@vaadin/vaadin-material-styles": "23.0.0-alpha5",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-alpha5"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
42
43
|
"@esm-bundle/chai": "^4.3.4",
|
|
43
44
|
"@vaadin/testing-helpers": "^0.3.2"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "74f9294964eb8552d96578c14af6ad214f5257bc"
|
|
46
47
|
}
|
package/src/vaadin-scroller.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2020 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
|
+
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
7
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -14,13 +15,24 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
14
15
|
* <div>Content</div>
|
|
15
16
|
* </vaadin-scroller>
|
|
16
17
|
* ```
|
|
18
|
+
* The following attributes are exposed for styling:
|
|
19
|
+
*
|
|
20
|
+
* Attribute | Description
|
|
21
|
+
* -------------| -----------
|
|
22
|
+
* `focus-ring` | Set when the element is focused using the keyboard.
|
|
23
|
+
* `focused` | Set when the element is focused.
|
|
17
24
|
*/
|
|
18
|
-
declare class Scroller extends ThemableMixin(ElementMixin(HTMLElement)) {
|
|
25
|
+
declare class Scroller extends FocusMixin(ThemableMixin(ElementMixin(HTMLElement))) {
|
|
19
26
|
/**
|
|
20
27
|
* This property indicates the scroll direction. Supported values are `vertical`, `horizontal`, `none`.
|
|
21
28
|
* When `scrollDirection` is undefined scrollbars will be shown in both directions.
|
|
22
29
|
*/
|
|
23
30
|
scrollDirection: 'horizontal' | 'vertical' | 'none' | undefined;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
|
|
34
|
+
*/
|
|
35
|
+
tabindex: number;
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
declare global {
|
package/src/vaadin-scroller.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2020 - 2022 Vaadin Ltd.
|
|
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
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
|
+
import { FocusMixin } from '@vaadin/component-base/src/focus-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -15,12 +16,19 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
15
16
|
* <div>Content</div>
|
|
16
17
|
* </vaadin-scroller>
|
|
17
18
|
* ```
|
|
19
|
+
* The following attributes are exposed for styling:
|
|
20
|
+
*
|
|
21
|
+
* Attribute | Description
|
|
22
|
+
* -------------| -----------
|
|
23
|
+
* `focus-ring` | Set when the element is focused using the keyboard.
|
|
24
|
+
* `focused` | Set when the element is focused.
|
|
18
25
|
*
|
|
19
26
|
* @extends HTMLElement
|
|
20
27
|
* @mixes ThemableMixin
|
|
21
28
|
* @mixes ElementMixin
|
|
29
|
+
* @mixes FocusMixin
|
|
22
30
|
*/
|
|
23
|
-
class Scroller extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
31
|
+
class Scroller extends FocusMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
24
32
|
static get template() {
|
|
25
33
|
return html`
|
|
26
34
|
<style>
|
|
@@ -63,9 +71,30 @@ class Scroller extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
63
71
|
scrollDirection: {
|
|
64
72
|
type: String,
|
|
65
73
|
reflectToAttribute: true
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
|
|
78
|
+
* @protected
|
|
79
|
+
*/
|
|
80
|
+
tabindex: {
|
|
81
|
+
type: Number,
|
|
82
|
+
value: 0,
|
|
83
|
+
reflectToAttribute: true
|
|
66
84
|
}
|
|
67
85
|
};
|
|
68
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Override method inherited from `FocusMixin` to mark the scroller as focused
|
|
90
|
+
* only when the host is focused.
|
|
91
|
+
* @param {Event} event
|
|
92
|
+
* @return {boolean}
|
|
93
|
+
* @protected
|
|
94
|
+
*/
|
|
95
|
+
_shouldSetFocus(event) {
|
|
96
|
+
return event.target === this;
|
|
97
|
+
}
|
|
69
98
|
}
|
|
70
99
|
|
|
71
100
|
customElements.define(Scroller.is, Scroller);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '@vaadin/vaadin-lumo-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(--lumo-primary-color-50pct);
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
registerStyles('vaadin-scroller', scroller, { moduleId: 'lumo-scroller' });
|
|
15
|
+
|
|
16
|
+
export { scroller };
|
|
@@ -0,0 +1,16 @@
|
|
|
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 };
|