@vaadin/date-picker 23.3.3 → 24.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/package.json +10 -10
- package/src/vaadin-date-picker-helper.d.ts +7 -0
- package/src/vaadin-date-picker-helper.js +16 -2
- package/src/vaadin-date-picker-light.d.ts +1 -7
- package/src/vaadin-date-picker-light.js +12 -50
- package/src/vaadin-date-picker-mixin.d.ts +4 -18
- package/src/vaadin-date-picker-mixin.js +121 -83
- package/src/vaadin-date-picker-month-scroller.js +74 -0
- package/src/vaadin-date-picker-overlay-content.js +268 -208
- package/src/vaadin-date-picker-overlay.js +19 -8
- package/src/vaadin-date-picker-year-scroller.js +104 -0
- package/src/vaadin-date-picker-year.js +57 -0
- package/src/vaadin-date-picker.d.ts +24 -12
- package/src/vaadin-date-picker.js +43 -39
- package/src/vaadin-infinite-scroller.js +98 -101
- package/src/vaadin-month-calendar.js +37 -14
- package/theme/lumo/vaadin-date-picker-overlay-content-styles.js +13 -50
- package/theme/lumo/vaadin-date-picker-year-styles.js +32 -0
- package/theme/lumo/vaadin-month-calendar-styles.js +16 -16
- package/theme/material/vaadin-date-picker-overlay-content-styles.js +10 -31
- package/theme/material/vaadin-date-picker-year-styles.js +28 -0
- package/theme/material/vaadin-month-calendar-styles.js +14 -14
- package/web-types.json +145 -5
- package/web-types.lit.json +61 -5
- package/src/vaadin-date-picker-styles.js +0 -28
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2023 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
|
7
|
+
import { dateAfterXMonths } from './vaadin-date-picker-helper.js';
|
|
8
|
+
import { InfiniteScroller } from './vaadin-infinite-scroller.js';
|
|
9
|
+
|
|
10
|
+
const stylesTemplate = html`
|
|
11
|
+
<style>
|
|
12
|
+
:host {
|
|
13
|
+
--vaadin-infinite-scroller-item-height: 270px;
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
height: 100%;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
let memoizedTemplate;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* An element used internally by `<vaadin-date-picker>`. Not intended to be used separately.
|
|
28
|
+
*
|
|
29
|
+
* @extends InfiniteScroller
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
class DatePickerMonthScroller extends InfiniteScroller {
|
|
33
|
+
static get is() {
|
|
34
|
+
return 'vaadin-date-picker-month-scroller';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static get template() {
|
|
38
|
+
if (!memoizedTemplate) {
|
|
39
|
+
memoizedTemplate = super.template.cloneNode(true);
|
|
40
|
+
memoizedTemplate.content.appendChild(stylesTemplate.content.cloneNode(true));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return memoizedTemplate;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static get properties() {
|
|
47
|
+
return {
|
|
48
|
+
bufferSize: {
|
|
49
|
+
type: Number,
|
|
50
|
+
value: 3,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @protected
|
|
57
|
+
* @override
|
|
58
|
+
*/
|
|
59
|
+
_createElement() {
|
|
60
|
+
return document.createElement('vaadin-month-calendar');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {HTMLElement} element
|
|
65
|
+
* @param {number} index
|
|
66
|
+
* @protected
|
|
67
|
+
* @override
|
|
68
|
+
*/
|
|
69
|
+
_updateElement(element, index) {
|
|
70
|
+
element.month = dateAfterXMonths(index);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
customElements.define(DatePickerMonthScroller.is, DatePickerMonthScroller);
|