@vaadin/date-picker 22.0.2 → 22.0.3
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 +12 -12
- package/src/vaadin-date-picker-helper.js +1 -1
- package/src/vaadin-date-picker-light.d.ts +1 -1
- package/src/vaadin-date-picker-light.js +1 -1
- package/src/vaadin-date-picker-mixin.d.ts +1 -1
- package/src/vaadin-date-picker-mixin.js +1 -1
- package/src/vaadin-date-picker-overlay-content.js +12 -8
- package/src/vaadin-date-picker-overlay.js +1 -1
- package/src/vaadin-date-picker-styles.js +1 -1
- package/src/vaadin-date-picker.d.ts +1 -1
- package/src/vaadin-date-picker.js +2 -2
- package/src/vaadin-infinite-scroller.js +20 -10
- package/src/vaadin-month-calendar.js +1 -1
- package/theme/material/vaadin-date-picker-overlay-content-styles.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/date-picker",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"@polymer/iron-a11y-announcer": "^3.0.0",
|
|
36
36
|
"@polymer/iron-media-query": "^3.0.0",
|
|
37
37
|
"@polymer/polymer": "^3.2.0",
|
|
38
|
-
"@vaadin/button": "^22.0.
|
|
39
|
-
"@vaadin/component-base": "^22.0.
|
|
40
|
-
"@vaadin/field-base": "^22.0.
|
|
41
|
-
"@vaadin/input-container": "^22.0.
|
|
42
|
-
"@vaadin/vaadin-lumo-styles": "^22.0.
|
|
43
|
-
"@vaadin/vaadin-material-styles": "^22.0.
|
|
44
|
-
"@vaadin/vaadin-overlay": "^22.0.
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "^22.0.
|
|
38
|
+
"@vaadin/button": "^22.0.3",
|
|
39
|
+
"@vaadin/component-base": "^22.0.3",
|
|
40
|
+
"@vaadin/field-base": "^22.0.3",
|
|
41
|
+
"@vaadin/input-container": "^22.0.3",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.3",
|
|
43
|
+
"@vaadin/vaadin-material-styles": "^22.0.3",
|
|
44
|
+
"@vaadin/vaadin-overlay": "^22.0.3",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@esm-bundle/chai": "^4.3.4",
|
|
49
|
-
"@vaadin/dialog": "^22.0.
|
|
50
|
-
"@vaadin/polymer-legacy-adapter": "^22.0.
|
|
49
|
+
"@vaadin/dialog": "^22.0.3",
|
|
50
|
+
"@vaadin/polymer-legacy-adapter": "^22.0.3",
|
|
51
51
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
52
52
|
"sinon": "^9.2.0"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "935ad1ea65a79b0f9ecb10d767689479b36c4e07"
|
|
55
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 { isIOS } from '@vaadin/component-base/src/browser-utils.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 '@polymer/iron-media-query/iron-media-query.js';
|
|
@@ -406,18 +406,22 @@ class DatePickerOverlayContent extends ThemableMixin(DirMixin(GestureEventListen
|
|
|
406
406
|
/**
|
|
407
407
|
* Scrolls the month and year scrollers enough to reveal the given date.
|
|
408
408
|
*/
|
|
409
|
-
revealDate(date) {
|
|
409
|
+
revealDate(date, animate = true) {
|
|
410
410
|
if (date) {
|
|
411
|
-
|
|
412
|
-
|
|
411
|
+
const diff = this._differenceInMonths(date, this._originDate);
|
|
412
|
+
const scrolledAboveViewport = this.$.monthScroller.position > diff;
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
const visibleArea = Math.max(
|
|
415
|
+
this.$.monthScroller.itemHeight,
|
|
416
|
+
this.$.monthScroller.clientHeight - this.$.monthScroller.bufferOffset * 2
|
|
417
|
+
);
|
|
418
|
+
const visibleItems = visibleArea / this.$.monthScroller.itemHeight;
|
|
419
|
+
const scrolledBelowViewport = this.$.monthScroller.position + visibleItems - 1 < diff;
|
|
416
420
|
|
|
417
421
|
if (scrolledAboveViewport) {
|
|
418
|
-
this._scrollToPosition(diff,
|
|
422
|
+
this._scrollToPosition(diff, animate);
|
|
419
423
|
} else if (scrolledBelowViewport) {
|
|
420
|
-
this._scrollToPosition(diff - visibleItems + 1,
|
|
424
|
+
this._scrollToPosition(diff - visibleItems + 1, animate);
|
|
421
425
|
}
|
|
422
426
|
}
|
|
423
427
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 { DisableUpgradeMixin } from '@polymer/polymer/lib/mixins/disable-upgrade-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 '@polymer/iron-media-query/iron-media-query.js';
|
|
@@ -213,7 +213,7 @@ class DatePicker extends DatePickerMixin(
|
|
|
213
213
|
this.ariaTarget = input;
|
|
214
214
|
})
|
|
215
215
|
);
|
|
216
|
-
this.addController(new LabelledInputController(this.inputElement, this.
|
|
216
|
+
this.addController(new LabelledInputController(this.inputElement, this._labelController));
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
/** @private */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2016 - 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 { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
@@ -186,9 +186,9 @@ class InfiniteScroller extends PolymerElement {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
// Check if we scrolled enough to translate the buffer positions.
|
|
189
|
-
const
|
|
190
|
-
const upperThresholdReached = scrollTop > this._buffers[1].translateY +
|
|
191
|
-
const lowerThresholdReached = scrollTop < this._buffers[0].translateY +
|
|
189
|
+
const offset = this.itemHeight + this.bufferOffset;
|
|
190
|
+
const upperThresholdReached = scrollTop > this._buffers[1].translateY + offset;
|
|
191
|
+
const lowerThresholdReached = scrollTop < this._buffers[0].translateY + offset;
|
|
192
192
|
|
|
193
193
|
if (upperThresholdReached || lowerThresholdReached) {
|
|
194
194
|
this._translateBuffer(lowerThresholdReached);
|
|
@@ -209,10 +209,24 @@ class InfiniteScroller extends PolymerElement {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
/**
|
|
213
|
+
* @return {number}
|
|
214
|
+
*/
|
|
215
|
+
get bufferOffset() {
|
|
216
|
+
return this._buffers[0].offsetTop;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* @return {number}
|
|
221
|
+
*/
|
|
222
|
+
get position() {
|
|
223
|
+
return (this.$.scroller.scrollTop - this._buffers[0].translateY) / this.itemHeight + this._firstIndex;
|
|
224
|
+
}
|
|
225
|
+
|
|
212
226
|
/**
|
|
213
227
|
* Current scroller position as index. Can be a fractional number.
|
|
214
228
|
*
|
|
215
|
-
* @type {
|
|
229
|
+
* @type {number}
|
|
216
230
|
*/
|
|
217
231
|
set position(index) {
|
|
218
232
|
this._preventScrollEvent = true;
|
|
@@ -239,12 +253,8 @@ class InfiniteScroller extends PolymerElement {
|
|
|
239
253
|
}
|
|
240
254
|
|
|
241
255
|
/**
|
|
242
|
-
* @
|
|
256
|
+
* @return {number}
|
|
243
257
|
*/
|
|
244
|
-
get position() {
|
|
245
|
-
return (this.$.scroller.scrollTop - this._buffers[0].translateY) / this.itemHeight + this._firstIndex;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
258
|
get itemHeight() {
|
|
249
259
|
if (!this._itemHeightVal) {
|
|
250
260
|
const itemHeight = getComputedStyle(this).getPropertyValue('--vaadin-infinite-scroller-item-height');
|