@vaadin/date-picker 25.3.0-alpha11 → 25.3.0-alpha13

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": "25.3.0-alpha11",
3
+ "version": "25.3.0-alpha13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,21 +35,21 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.3.0-alpha11",
39
- "@vaadin/button": "25.3.0-alpha11",
40
- "@vaadin/component-base": "25.3.0-alpha11",
41
- "@vaadin/field-base": "25.3.0-alpha11",
42
- "@vaadin/input-container": "25.3.0-alpha11",
43
- "@vaadin/overlay": "25.3.0-alpha11",
44
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha11",
38
+ "@vaadin/a11y-base": "25.3.0-alpha13",
39
+ "@vaadin/button": "25.3.0-alpha13",
40
+ "@vaadin/component-base": "25.3.0-alpha13",
41
+ "@vaadin/field-base": "25.3.0-alpha13",
42
+ "@vaadin/input-container": "25.3.0-alpha13",
43
+ "@vaadin/overlay": "25.3.0-alpha13",
44
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha13",
45
45
  "lit": "^3.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vaadin/aura": "25.3.0-alpha11",
49
- "@vaadin/chai-plugins": "25.3.0-alpha11",
50
- "@vaadin/test-runner-commands": "25.3.0-alpha11",
48
+ "@vaadin/aura": "25.3.0-alpha13",
49
+ "@vaadin/chai-plugins": "25.3.0-alpha13",
50
+ "@vaadin/test-runner-commands": "25.3.0-alpha13",
51
51
  "@vaadin/testing-helpers": "^2.0.0",
52
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha11",
52
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha13",
53
53
  "sinon": "^22.0.0"
54
54
  },
55
55
  "customElements": "custom-elements.json",
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "7e0c61a37e68d8971def9cdf28ad0548a0f530a9"
60
+ "gitHead": "e23e44d29e6bc1e47245d5e2cc0e4b022ec61818"
61
61
  }
@@ -459,7 +459,10 @@ export const DatePickerMixin = (subclass) =>
459
459
  super._onFocus(event);
460
460
 
461
461
  if (this._noInput && !isKeyboardActive()) {
462
+ // Blur to hide the virtual keyboard, but do not validate.
463
+ this.__ignoreInternalBlur = true;
462
464
  event.target.blur();
465
+ this.__ignoreInternalBlur = false;
463
466
  }
464
467
  }
465
468
 
@@ -470,6 +473,10 @@ export const DatePickerMixin = (subclass) =>
470
473
  _onBlur(event) {
471
474
  super._onBlur(event);
472
475
 
476
+ if (this.__ignoreInternalBlur) {
477
+ return;
478
+ }
479
+
473
480
  if (!this.opened) {
474
481
  this.__commitParsedOrFocusedDate();
475
482
 
@@ -268,6 +268,8 @@ export const DatePickerOverlayContentMixin = (superClass) =>
268
268
 
269
269
  reset() {
270
270
  this._closeYearScroller();
271
+ this._monthScroller?.reset();
272
+ this._yearScroller?.reset();
271
273
  }
272
274
 
273
275
  /**
@@ -37,6 +37,10 @@ template.innerHTML = `
37
37
  box-sizing: border-box;
38
38
  top: var(--vaadin-infinite-scroller-buffer-offset, 0);
39
39
  }
40
+
41
+ ::slotted(div) {
42
+ height: var(--vaadin-infinite-scroller-item-height);
43
+ }
40
44
  </style>
41
45
 
42
46
  <div id="scroller" tabindex="-1">
@@ -149,7 +153,7 @@ export class InfiniteScroller extends HTMLElement {
149
153
  this.$.scroller.scrollTop = this.itemHeight * (index - this._firstIndex) + this._buffers[0].translateY;
150
154
  } else {
151
155
  this._initialIndex = ~~index;
152
- this._reset();
156
+ this.reset();
153
157
  this._scrollDisabled = true;
154
158
  this.$.scroller.scrollTop += (index % 1) * this.itemHeight;
155
159
  this._scrollDisabled = false;
@@ -235,7 +239,7 @@ export class InfiniteScroller extends HTMLElement {
235
239
  });
236
240
 
237
241
  if (!this._buffers[0].translateY) {
238
- this._reset();
242
+ this.reset();
239
243
  }
240
244
 
241
245
  this._initDone = true;
@@ -262,7 +266,7 @@ export class InfiniteScroller extends HTMLElement {
262
266
  if (scrollTop < this._bufferHeight || scrollTop > this._initialScroll * 2 - this._bufferHeight) {
263
267
  // Scrolled near the end/beginning of the scrollable area -> reset.
264
268
  this._initialIndex = ~~this.position;
265
- this._reset();
269
+ this.reset();
266
270
  }
267
271
 
268
272
  // Check if we scrolled enough to translate the buffer positions.
@@ -288,8 +292,18 @@ export class InfiniteScroller extends HTMLElement {
288
292
  });
289
293
  }
290
294
 
291
- /** @private */
292
- _reset() {
295
+ /**
296
+ * Resets the scroller to the last starting index, and re-measures the
297
+ * item height in case the computed value of the CSS custom property
298
+ * has changed.
299
+ */
300
+ reset() {
301
+ if (!this._activated || !this.isConnected) {
302
+ return;
303
+ }
304
+
305
+ this._itemHeightVal = null;
306
+
293
307
  this._scrollDisabled = true;
294
308
  this.$.scroller.scrollTop = this._initialScroll;
295
309
  this._buffers[0].translateY = this._initialScroll - this._bufferHeight;
@@ -314,7 +328,6 @@ export class InfiniteScroller extends HTMLElement {
314
328
  this._buffers.forEach((buffer) => {
315
329
  for (let i = 0; i < this.bufferSize; i++) {
316
330
  const itemWrapper = document.createElement('div');
317
- itemWrapper.style.height = `${this.itemHeight}px`;
318
331
  itemWrapper.instance = {};
319
332
 
320
333
  const slotName = `vaadin-infinite-scroller-item-content-${generateUniqueId()}`;
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": "25.3.0-alpha11",
4
+ "version": "25.3.0-alpha13",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/date-picker",
4
- "version": "25.3.0-alpha11",
4
+ "version": "25.3.0-alpha13",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {