@vaadin/date-picker 24.5.3 → 24.5.5
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/date-picker",
|
|
3
|
-
"version": "24.5.
|
|
3
|
+
"version": "24.5.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.2.0",
|
|
39
|
-
"@vaadin/a11y-base": "~24.5.
|
|
40
|
-
"@vaadin/button": "~24.5.
|
|
41
|
-
"@vaadin/component-base": "~24.5.
|
|
42
|
-
"@vaadin/field-base": "~24.5.
|
|
43
|
-
"@vaadin/input-container": "~24.5.
|
|
44
|
-
"@vaadin/overlay": "~24.5.
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "~24.5.
|
|
46
|
-
"@vaadin/vaadin-material-styles": "~24.5.
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "~24.5.
|
|
39
|
+
"@vaadin/a11y-base": "~24.5.5",
|
|
40
|
+
"@vaadin/button": "~24.5.5",
|
|
41
|
+
"@vaadin/component-base": "~24.5.5",
|
|
42
|
+
"@vaadin/field-base": "~24.5.5",
|
|
43
|
+
"@vaadin/input-container": "~24.5.5",
|
|
44
|
+
"@vaadin/overlay": "~24.5.5",
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "~24.5.5",
|
|
46
|
+
"@vaadin/vaadin-material-styles": "~24.5.5",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "~24.5.5",
|
|
48
48
|
"lit": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@vaadin/chai-plugins": "~24.5.
|
|
51
|
+
"@vaadin/chai-plugins": "~24.5.5",
|
|
52
52
|
"@vaadin/testing-helpers": "^1.0.0",
|
|
53
53
|
"sinon": "^18.0.0"
|
|
54
54
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "864c93992c6466634ad47975dc6aceca3bbf8506"
|
|
60
60
|
}
|
|
@@ -571,6 +571,7 @@ export const DatePickerOverlayContentMixin = (superClass) =>
|
|
|
571
571
|
|
|
572
572
|
if (!animate) {
|
|
573
573
|
this._monthScroller.position = targetPosition;
|
|
574
|
+
this._monthScroller.forceUpdate();
|
|
574
575
|
this._targetPosition = undefined;
|
|
575
576
|
this._repositionYearScroller();
|
|
576
577
|
this.__tryFocusDate();
|
|
@@ -626,6 +627,7 @@ export const DatePickerOverlayContentMixin = (superClass) =>
|
|
|
626
627
|
);
|
|
627
628
|
|
|
628
629
|
this._monthScroller.position = this._targetPosition;
|
|
630
|
+
this._monthScroller.forceUpdate();
|
|
629
631
|
this._targetPosition = undefined;
|
|
630
632
|
|
|
631
633
|
revealResolve();
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 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 { flush } from '@polymer/polymer/lib/utils/flush.js';
|
|
6
7
|
import { timeOut } from '@vaadin/component-base/src/async.js';
|
|
7
|
-
import { isFirefox } from '@vaadin/component-base/src/browser-utils.js';
|
|
8
8
|
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
9
9
|
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
10
10
|
|
|
@@ -54,7 +54,7 @@ template.innerHTML = `
|
|
|
54
54
|
}
|
|
55
55
|
</style>
|
|
56
56
|
|
|
57
|
-
<div id="scroller">
|
|
57
|
+
<div id="scroller" tabindex="-1">
|
|
58
58
|
<div class="buffer"></div>
|
|
59
59
|
<div class="buffer"></div>
|
|
60
60
|
<div id="fullHeight"></div>
|
|
@@ -198,12 +198,6 @@ export class InfiniteScroller extends HTMLElement {
|
|
|
198
198
|
this._buffers = [...this.shadowRoot.querySelectorAll('.buffer')];
|
|
199
199
|
|
|
200
200
|
this.$.fullHeight.style.height = `${this._initialScroll * 2}px`;
|
|
201
|
-
|
|
202
|
-
// Firefox interprets elements with overflow:auto as focusable
|
|
203
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=1069739
|
|
204
|
-
if (isFirefox) {
|
|
205
|
-
this.$.scroller.tabIndex = -1;
|
|
206
|
-
}
|
|
207
201
|
}
|
|
208
202
|
}
|
|
209
203
|
|
|
@@ -212,11 +206,17 @@ export class InfiniteScroller extends HTMLElement {
|
|
|
212
206
|
* waiting for the debouncer to resolve.
|
|
213
207
|
*/
|
|
214
208
|
forceUpdate() {
|
|
209
|
+
if (this._debouncerScrollFinish) {
|
|
210
|
+
this._debouncerScrollFinish.flush();
|
|
211
|
+
}
|
|
212
|
+
|
|
215
213
|
if (this._debouncerUpdateClones) {
|
|
216
214
|
this._buffers[0].updated = this._buffers[1].updated = false;
|
|
217
215
|
this._updateClones();
|
|
218
216
|
this._debouncerUpdateClones.cancel();
|
|
219
217
|
}
|
|
218
|
+
|
|
219
|
+
flush();
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
@@ -371,7 +371,8 @@ export class InfiniteScroller extends HTMLElement {
|
|
|
371
371
|
|
|
372
372
|
/** @private */
|
|
373
373
|
_updateClones(viewPortOnly) {
|
|
374
|
-
this._firstIndex =
|
|
374
|
+
this._firstIndex =
|
|
375
|
+
Math.round((this._buffers[0].translateY - this._initialScroll) / this.itemHeight) + this._initialIndex;
|
|
375
376
|
|
|
376
377
|
const scrollerRect = viewPortOnly ? this.$.scroller.getBoundingClientRect() : undefined;
|
|
377
378
|
this._buffers.forEach((buffer, bufferIndex) => {
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-picker",
|
|
4
|
-
"version": "24.5.
|
|
4
|
+
"version": "24.5.5",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
346
|
"name": "vaadin-date-picker",
|
|
347
|
-
"description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.5.
|
|
347
|
+
"description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------------|--------------------\n`toggle-button` | Toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n-----------|--------------------------------------------------|-----------\n`opened` | Set when the date selector overlay is opened | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
|
|
348
348
|
"attributes": [
|
|
349
349
|
{
|
|
350
350
|
"name": "disabled",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/date-picker",
|
|
4
|
-
"version": "24.5.
|
|
4
|
+
"version": "24.5.5",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
165
|
"name": "vaadin-date-picker",
|
|
166
|
-
"description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.5.
|
|
166
|
+
"description": "`<vaadin-date-picker>` is an input field that allows to enter a date by typing or by selecting from a calendar overlay.\n\n```html\n<vaadin-date-picker label=\"Birthday\"></vaadin-date-picker>\n```\n```js\ndatePicker.value = '2016-03-02';\n```\n\nWhen the selected `value` is changed, a `value-changed` event is triggered.\n\n### Styling\n\nThe following custom properties are available for styling:\n\nCustom property | Description | Default\n-------------------------------|----------------------------|---------\n`--vaadin-field-default-width` | Default width of the field | `12em`\n\n`<vaadin-date-picker>` provides the same set of shadow DOM parts and state attributes as `<vaadin-text-field>`.\nSee [`<vaadin-text-field>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-text-field) for the styling documentation.\n\nIn addition to `<vaadin-text-field>` parts, the following parts are available for theming:\n\nPart name | Description\n----------------------|--------------------\n`toggle-button` | Toggle button\n\nIn addition to `<vaadin-text-field>` state attributes, the following state attributes are available for theming:\n\nAttribute | Description | Part name\n-----------|--------------------------------------------------|-----------\n`opened` | Set when the date selector overlay is opened | :host\n\nIf you want to replace the default `<input>` and its container with a custom implementation to get full control\nover the input field, consider using the [`<vaadin-date-picker-light>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-date-picker-light) element.\n\n### Internal components\n\nIn addition to `<vaadin-date-picker>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-date-picker-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-overlay).\n- `<vaadin-date-picker-overlay-content>`\n- `<vaadin-date-picker-month-scroller>`\n- `<vaadin-date-picker-year-scroller>`\n- `<vaadin-date-picker-year>`\n- `<vaadin-month-calendar>`\n- [`<vaadin-input-container>`](https://cdn.vaadin.com/vaadin-web-components/24.5.5/#/elements/vaadin-input-container) - an internal element wrapping the input.\n\nIn order to style the overlay content, use `<vaadin-date-picker-overlay-content>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`overlay-header` | Fullscreen mode header\n`label` | Fullscreen mode value/label\n`clear-button` | Fullscreen mode clear button\n`toggle-button` | Fullscreen mode toggle button\n`years-toggle-button` | Fullscreen mode years scroller toggle\n`toolbar` | Footer bar with slotted buttons\n\nThe following state attributes are available on the `<vaadin-date-picker-overlay-content>` element:\n\nAttribute | Description\n----------------|-------------------------------------------------\n`desktop` | Set when the overlay content is in desktop mode\n`fullscreen` | Set when the overlay content is in fullscreen mode\n`years-visible` | Set when the year scroller is visible in fullscreen mode\n\nIn order to style the month calendar, use `<vaadin-month-calendar>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`month-header` | Month title\n`weekdays` | Weekday container\n`weekday` | Weekday element\n`week-numbers` | Week numbers container\n`week-number` | Week number element\n`date` | Date element\n`disabled` | Disabled date element\n`focused` | Focused date element\n`selected` | Selected date element\n`today` | Date element corresponding to the current day\n`past` | Date element corresponding to the date in the past\n`future` | Date element corresponding to the date in the future\n\nIn order to style year scroller elements, use `<vaadin-date-picker-year>` shadow DOM parts:\n\nPart name | Description\n----------------------|--------------------\n`year-number` | Year number\n`year-separator` | Year separator\n\nNote: the `theme` attribute value set on `<vaadin-date-picker>` is\npropagated to the internal components listed above.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Change events\n\nDepending on the nature of the value change that the user attempts to commit e.g. by pressing Enter,\nthe component can fire either a `change` event or an `unparsable-change` event:\n\nValue change | Event\n:------------------------|:------------------\nempty => parsable | change\nempty => unparsable | unparsable-change\nparsable => empty | change\nparsable => parsable | change\nparsable => unparsable | change\nunparsable => empty | unparsable-change\nunparsable => parsable | change\nunparsable => unparsable | unparsable-change",
|
|
167
167
|
"extension": true,
|
|
168
168
|
"attributes": [
|
|
169
169
|
{
|