@vaadin/scroller 24.5.0-rc2 → 24.6.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/package.json +9 -8
- package/src/vaadin-scroller-mixin.d.ts +25 -0
- package/src/vaadin-scroller-mixin.js +48 -0
- package/src/vaadin-scroller.d.ts +2 -14
- package/src/vaadin-scroller.js +3 -38
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/scroller",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.6.0-alpha1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,20 +35,21 @@
|
|
|
35
35
|
"polymer"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
+
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
39
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.
|
|
40
|
-
"@vaadin/component-base": "24.
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "24.
|
|
42
|
-
"@vaadin/vaadin-material-styles": "24.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "24.
|
|
40
|
+
"@vaadin/a11y-base": "24.6.0-alpha1",
|
|
41
|
+
"@vaadin/component-base": "24.6.0-alpha1",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha1",
|
|
43
|
+
"@vaadin/vaadin-material-styles": "24.6.0-alpha1",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha1"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "24.
|
|
47
|
+
"@vaadin/chai-plugins": "24.6.0-alpha1",
|
|
47
48
|
"@vaadin/testing-helpers": "^1.0.0"
|
|
48
49
|
},
|
|
49
50
|
"web-types": [
|
|
50
51
|
"web-types.json",
|
|
51
52
|
"web-types.lit.json"
|
|
52
53
|
],
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ae1fb0e6e7ce925999051c6cc62ba8476264c63f"
|
|
54
55
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
|
+
import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
8
|
+
|
|
9
|
+
export declare function ScrollerMixin<T extends Constructor<HTMLElement>>(
|
|
10
|
+
base: T,
|
|
11
|
+
): Constructor<FocusMixinClass> & Constructor<ScrollerMixinClass> & T;
|
|
12
|
+
|
|
13
|
+
export declare class ScrollerMixinClass {
|
|
14
|
+
/**
|
|
15
|
+
* This property indicates the scroll direction. Supported values are `vertical`, `horizontal`, `none`.
|
|
16
|
+
* When `scrollDirection` is undefined scrollbars will be shown in both directions.
|
|
17
|
+
* @attr {string} scroll-direction
|
|
18
|
+
*/
|
|
19
|
+
scrollDirection: 'horizontal' | 'none' | 'vertical' | undefined;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
|
|
23
|
+
*/
|
|
24
|
+
tabindex: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2020 - 2024 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @polymerMixin
|
|
10
|
+
* @mixes FocusMixin
|
|
11
|
+
*/
|
|
12
|
+
export const ScrollerMixin = (superClass) =>
|
|
13
|
+
class ScrollerMixinClass extends FocusMixin(superClass) {
|
|
14
|
+
static get properties() {
|
|
15
|
+
return {
|
|
16
|
+
/**
|
|
17
|
+
* This property indicates the scroll direction. Supported values are `vertical`, `horizontal`, `none`.
|
|
18
|
+
* When `scrollDirection` is undefined scrollbars will be shown in both directions.
|
|
19
|
+
* @attr {string} scroll-direction
|
|
20
|
+
*/
|
|
21
|
+
scrollDirection: {
|
|
22
|
+
type: String,
|
|
23
|
+
reflectToAttribute: true,
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
|
|
28
|
+
* @protected
|
|
29
|
+
*/
|
|
30
|
+
tabindex: {
|
|
31
|
+
type: Number,
|
|
32
|
+
value: 0,
|
|
33
|
+
reflectToAttribute: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Override method inherited from `FocusMixin` to mark the scroller as focused
|
|
40
|
+
* only when the host is focused.
|
|
41
|
+
* @param {Event} event
|
|
42
|
+
* @return {boolean}
|
|
43
|
+
* @protected
|
|
44
|
+
*/
|
|
45
|
+
_shouldSetFocus(event) {
|
|
46
|
+
return event.target === this;
|
|
47
|
+
}
|
|
48
|
+
};
|
package/src/vaadin-scroller.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Copyright (c) 2020 - 2024 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
7
6
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
8
7
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
+
import { ScrollerMixin } from './vaadin-scroller-mixin.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* `<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.
|
|
@@ -24,19 +24,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
24
24
|
* `focused` | Set when the element is focused.
|
|
25
25
|
* `overflow` | Set to `top`, `bottom`, `start`, `end`, all of them, or none.
|
|
26
26
|
*/
|
|
27
|
-
declare class Scroller extends
|
|
28
|
-
/**
|
|
29
|
-
* This property indicates the scroll direction. Supported values are `vertical`, `horizontal`, `none`.
|
|
30
|
-
* When `scrollDirection` is undefined scrollbars will be shown in both directions.
|
|
31
|
-
* @attr {string} scroll-direction
|
|
32
|
-
*/
|
|
33
|
-
scrollDirection: 'horizontal' | 'none' | 'vertical' | undefined;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
|
|
37
|
-
*/
|
|
38
|
-
tabindex: number;
|
|
39
|
-
}
|
|
27
|
+
declare class Scroller extends ScrollerMixin(ThemableMixin(ElementMixin(ControllerMixin(HTMLElement)))) {}
|
|
40
28
|
|
|
41
29
|
declare global {
|
|
42
30
|
interface HTMLElementTagNameMap {
|
package/src/vaadin-scroller.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
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 { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
8
7
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
9
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
10
|
import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
|
|
12
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
+
import { ScrollerMixin } from './vaadin-scroller-mixin';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* `<vaadin-scroller>` provides a simple way to enable scrolling when its content is overflowing.
|
|
@@ -32,9 +32,9 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
32
32
|
* @mixes ThemableMixin
|
|
33
33
|
* @mixes ControllerMixin
|
|
34
34
|
* @mixes ElementMixin
|
|
35
|
-
* @mixes
|
|
35
|
+
* @mixes ScrollerMixin
|
|
36
36
|
*/
|
|
37
|
-
class Scroller extends
|
|
37
|
+
class Scroller extends ScrollerMixin(ElementMixin(ControllerMixin(ThemableMixin(PolymerElement)))) {
|
|
38
38
|
static get template() {
|
|
39
39
|
return html`
|
|
40
40
|
<style>
|
|
@@ -68,30 +68,6 @@ class Scroller extends FocusMixin(ElementMixin(ControllerMixin(ThemableMixin(Pol
|
|
|
68
68
|
return 'vaadin-scroller';
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
static get properties() {
|
|
72
|
-
return {
|
|
73
|
-
/**
|
|
74
|
-
* This property indicates the scroll direction. Supported values are `vertical`, `horizontal`, `none`.
|
|
75
|
-
* When `scrollDirection` is undefined scrollbars will be shown in both directions.
|
|
76
|
-
* @attr {string} scroll-direction
|
|
77
|
-
*/
|
|
78
|
-
scrollDirection: {
|
|
79
|
-
type: String,
|
|
80
|
-
reflectToAttribute: true,
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Indicates whether the element can be focused and where it participates in sequential keyboard navigation.
|
|
85
|
-
* @protected
|
|
86
|
-
*/
|
|
87
|
-
tabindex: {
|
|
88
|
-
type: Number,
|
|
89
|
-
value: 0,
|
|
90
|
-
reflectToAttribute: true,
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
|
|
95
71
|
/** @protected */
|
|
96
72
|
ready() {
|
|
97
73
|
super.ready();
|
|
@@ -99,17 +75,6 @@ class Scroller extends FocusMixin(ElementMixin(ControllerMixin(ThemableMixin(Pol
|
|
|
99
75
|
this.__overflowController = new OverflowController(this);
|
|
100
76
|
this.addController(this.__overflowController);
|
|
101
77
|
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Override method inherited from `FocusMixin` to mark the scroller as focused
|
|
105
|
-
* only when the host is focused.
|
|
106
|
-
* @param {Event} event
|
|
107
|
-
* @return {boolean}
|
|
108
|
-
* @protected
|
|
109
|
-
*/
|
|
110
|
-
_shouldSetFocus(event) {
|
|
111
|
-
return event.target === this;
|
|
112
|
-
}
|
|
113
78
|
}
|
|
114
79
|
|
|
115
80
|
defineCustomElement(Scroller);
|
package/web-types.json
CHANGED