@vaadin/vaadin-overlay 23.1.0-alpha3 → 23.1.0-beta2

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/vaadin-overlay",
3
- "version": "23.1.0-alpha3",
3
+ "version": "23.1.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,20 +35,20 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/component-base": "23.1.0-alpha3",
39
- "@vaadin/vaadin-lumo-styles": "23.1.0-alpha3",
40
- "@vaadin/vaadin-material-styles": "23.1.0-alpha3",
41
- "@vaadin/vaadin-themable-mixin": "23.1.0-alpha3"
38
+ "@vaadin/component-base": "23.1.0-beta2",
39
+ "@vaadin/vaadin-lumo-styles": "23.1.0-beta2",
40
+ "@vaadin/vaadin-material-styles": "23.1.0-beta2",
41
+ "@vaadin/vaadin-themable-mixin": "23.1.0-beta2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@esm-bundle/chai": "^4.3.4",
45
45
  "@polymer/iron-overlay-behavior": "^3.0.0",
46
- "@vaadin/button": "23.1.0-alpha3",
47
- "@vaadin/radio-group": "23.1.0-alpha3",
46
+ "@vaadin/button": "23.1.0-beta2",
47
+ "@vaadin/radio-group": "23.1.0-beta2",
48
48
  "@vaadin/testing-helpers": "^0.3.2",
49
- "@vaadin/text-field": "23.1.0-alpha3",
49
+ "@vaadin/text-field": "23.1.0-beta2",
50
50
  "lit": "^2.0.0",
51
51
  "sinon": "^13.0.2"
52
52
  },
53
- "gitHead": "8c9e64e8dfa158dd52a9bf6da351ff038c88ca85"
53
+ "gitHead": "f11f9245a0b5e6bf912725a501c27c24b74e7c8d"
54
54
  }
@@ -6,12 +6,12 @@
6
6
 
7
7
  const PROP_NAMES_VERTICAL = {
8
8
  start: 'top',
9
- end: 'bottom'
9
+ end: 'bottom',
10
10
  };
11
11
 
12
12
  const PROP_NAMES_HORIZONTAL = {
13
13
  start: 'left',
14
- end: 'right'
14
+ end: 'right',
15
15
  };
16
16
 
17
17
  /**
@@ -29,7 +29,7 @@ export const PositionMixin = (superClass) =>
29
29
  */
30
30
  positionTarget: {
31
31
  type: Object,
32
- value: null
32
+ value: null,
33
33
  },
34
34
 
35
35
  /**
@@ -42,7 +42,7 @@ export const PositionMixin = (superClass) =>
42
42
  */
43
43
  horizontalAlign: {
44
44
  type: String,
45
- value: 'start'
45
+ value: 'start',
46
46
  },
47
47
 
48
48
  /**
@@ -54,7 +54,7 @@ export const PositionMixin = (superClass) =>
54
54
  */
55
55
  verticalAlign: {
56
56
  type: String,
57
- value: 'top'
57
+ value: 'top',
58
58
  },
59
59
 
60
60
  /**
@@ -63,7 +63,7 @@ export const PositionMixin = (superClass) =>
63
63
  */
64
64
  noHorizontalOverlap: {
65
65
  type: Boolean,
66
- value: false
66
+ value: false,
67
67
  },
68
68
 
69
69
  /**
@@ -72,15 +72,15 @@ export const PositionMixin = (superClass) =>
72
72
  */
73
73
  noVerticalOverlap: {
74
74
  type: Boolean,
75
- value: false
76
- }
75
+ value: false,
76
+ },
77
77
  };
78
78
  }
79
79
 
80
80
  static get observers() {
81
81
  return [
82
82
  '__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap)',
83
- '__overlayOpenedChanged(opened)'
83
+ '__overlayOpenedChanged(opened)',
84
84
  ];
85
85
  }
86
86
 
@@ -150,7 +150,7 @@ export const PositionMixin = (superClass) =>
150
150
  this.noVerticalOverlap,
151
151
  PROP_NAMES_VERTICAL,
152
152
  this,
153
- shouldAlignStartVertically
153
+ shouldAlignStartVertically,
154
154
  );
155
155
 
156
156
  // Obtain horizontal positioning properties
@@ -160,7 +160,7 @@ export const PositionMixin = (superClass) =>
160
160
  this.noHorizontalOverlap,
161
161
  PROP_NAMES_HORIZONTAL,
162
162
  this,
163
- shouldAlignStartHorizontally
163
+ shouldAlignStartHorizontally,
164
164
  );
165
165
 
166
166
  // Apply the positioning properties to the overlay
@@ -189,7 +189,7 @@ export const PositionMixin = (superClass) =>
189
189
  this.__margins,
190
190
  defaultAlignLeft,
191
191
  this.noHorizontalOverlap,
192
- PROP_NAMES_HORIZONTAL
192
+ PROP_NAMES_HORIZONTAL,
193
193
  );
194
194
  }
195
195
 
@@ -209,7 +209,7 @@ export const PositionMixin = (superClass) =>
209
209
  this.__margins,
210
210
  defaultAlignTop,
211
211
  this.noVerticalOverlap,
212
- PROP_NAMES_VERTICAL
212
+ PROP_NAMES_VERTICAL,
213
213
  );
214
214
  }
215
215
 
@@ -244,8 +244,8 @@ export const PositionMixin = (superClass) =>
244
244
  targetRect[noOverlap === shouldAlignStart ? propNames.end : propNames.start];
245
245
 
246
246
  return {
247
- [cssPropNameToSet]: currentValue + diff * (shouldAlignStart ? -1 : 1) + 'px',
248
- [cssPropNameToClear]: ''
247
+ [cssPropNameToSet]: `${currentValue + diff * (shouldAlignStart ? -1 : 1)}px`,
248
+ [cssPropNameToClear]: '',
249
249
  };
250
250
  }
251
251
  };
@@ -232,13 +232,13 @@ declare class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(HTML
232
232
  addEventListener<K extends keyof OverlayEventMap>(
233
233
  type: K,
234
234
  listener: (this: OverlayElement, ev: OverlayEventMap[K]) => void,
235
- options?: boolean | AddEventListenerOptions
235
+ options?: boolean | AddEventListenerOptions,
236
236
  ): void;
237
237
 
238
238
  removeEventListener<K extends keyof OverlayEventMap>(
239
239
  type: K,
240
240
  listener: (this: OverlayElement, ev: OverlayEventMap[K]) => void,
241
- options?: boolean | EventListenerOptions
241
+ options?: boolean | EventListenerOptions,
242
242
  ): void;
243
243
  }
244
244
 
@@ -194,7 +194,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
194
194
  type: Boolean,
195
195
  notify: true,
196
196
  observer: '_openedChanged',
197
- reflectToAttribute: true
197
+ reflectToAttribute: true,
198
198
  },
199
199
 
200
200
  /**
@@ -220,7 +220,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
220
220
  */
221
221
  template: {
222
222
  type: Object,
223
- notify: true
223
+ notify: true,
224
224
  },
225
225
 
226
226
  /**
@@ -229,7 +229,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
229
229
  */
230
230
  content: {
231
231
  type: Object,
232
- notify: true
232
+ notify: true,
233
233
  },
234
234
 
235
235
  /**
@@ -239,7 +239,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
239
239
  withBackdrop: {
240
240
  type: Boolean,
241
241
  value: false,
242
- reflectToAttribute: true
242
+ reflectToAttribute: true,
243
243
  },
244
244
 
245
245
  /**
@@ -256,7 +256,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
256
256
  type: Boolean,
257
257
  value: false,
258
258
  reflectToAttribute: true,
259
- observer: '_modelessChanged'
259
+ observer: '_modelessChanged',
260
260
  },
261
261
 
262
262
  /**
@@ -267,7 +267,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
267
267
  hidden: {
268
268
  type: Boolean,
269
269
  reflectToAttribute: true,
270
- observer: '_hiddenChanged'
270
+ observer: '_hiddenChanged',
271
271
  },
272
272
 
273
273
  /**
@@ -277,7 +277,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
277
277
  */
278
278
  focusTrap: {
279
279
  type: Boolean,
280
- value: false
280
+ value: false,
281
281
  },
282
282
 
283
283
  /**
@@ -286,7 +286,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
286
286
  */
287
287
  restoreFocusOnClose: {
288
288
  type: Boolean,
289
- value: false
289
+ value: false,
290
290
  },
291
291
 
292
292
  /**
@@ -295,22 +295,22 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
295
295
  * @type {HTMLElement}
296
296
  */
297
297
  restoreFocusNode: {
298
- type: HTMLElement
298
+ type: HTMLElement,
299
299
  },
300
300
 
301
301
  /** @private */
302
302
  _mouseDownInside: {
303
- type: Boolean
303
+ type: Boolean,
304
304
  },
305
305
 
306
306
  /** @private */
307
307
  _mouseUpInside: {
308
- type: Boolean
308
+ type: Boolean,
309
309
  },
310
310
 
311
311
  /** @private */
312
312
  _instance: {
313
- type: Object
313
+ type: Object,
314
314
  },
315
315
 
316
316
  /** @private */
@@ -332,7 +332,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
332
332
  _oldRenderer: Object,
333
333
 
334
334
  /** @private */
335
- _oldOpened: Boolean
335
+ _oldOpened: Boolean,
336
336
  };
337
337
  }
338
338
 
@@ -393,7 +393,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
393
393
  const clientHeight = document.documentElement.clientHeight;
394
394
 
395
395
  if (landscape && clientHeight > innerHeight) {
396
- this.style.setProperty('--vaadin-overlay-viewport-bottom', clientHeight - innerHeight + 'px');
396
+ this.style.setProperty('--vaadin-overlay-viewport-bottom', `${clientHeight - innerHeight}px`);
397
397
  } else {
398
398
  this.style.setProperty('--vaadin-overlay-viewport-bottom', '0');
399
399
  }
@@ -413,10 +413,10 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
413
413
  * fired before the `vaadin-overlay` will be closed. If canceled the closing of the overlay is canceled as well.
414
414
  */
415
415
  close(sourceEvent) {
416
- var evt = new CustomEvent('vaadin-overlay-close', {
416
+ const evt = new CustomEvent('vaadin-overlay-close', {
417
417
  bubbles: true,
418
418
  cancelable: true,
419
- detail: { sourceEvent: sourceEvent }
419
+ detail: { sourceEvent },
420
420
  });
421
421
  this.dispatchEvent(evt);
422
422
  if (!evt.defaultPrevented) {
@@ -483,7 +483,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
483
483
  * @private
484
484
  */
485
485
  _outsideClickListener(event) {
486
- if (event.composedPath().indexOf(this.$.overlay) !== -1 || this._mouseDownInside || this._mouseUpInside) {
486
+ if (event.composedPath().includes(this.$.overlay) || this._mouseDownInside || this._mouseUpInside) {
487
487
  this._mouseDownInside = false;
488
488
  this._mouseUpInside = false;
489
489
  return;
@@ -495,7 +495,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
495
495
  const evt = new CustomEvent('vaadin-overlay-outside-click', {
496
496
  bubbles: true,
497
497
  cancelable: true,
498
- detail: { sourceEvent: event }
498
+ detail: { sourceEvent: event },
499
499
  });
500
500
  this.dispatchEvent(evt);
501
501
 
@@ -519,7 +519,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
519
519
  const evt = new CustomEvent('vaadin-overlay-escape-press', {
520
520
  bubbles: true,
521
521
  cancelable: true,
522
- detail: { sourceEvent: event }
522
+ detail: { sourceEvent: event },
523
523
  });
524
524
  this.dispatchEvent(evt);
525
525
 
@@ -587,7 +587,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
587
587
  _shouldAnimate() {
588
588
  const name = getComputedStyle(this).getPropertyValue('animation-name');
589
589
  const hidden = getComputedStyle(this).getPropertyValue('display') === 'none';
590
- return !hidden && name && name != 'none';
590
+ return !hidden && name && name !== 'none';
591
591
  }
592
592
 
593
593
  /**
@@ -725,7 +725,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
725
725
  }
726
726
 
727
727
  /**
728
- * returns true if this is the last one in the opened overlays stack
728
+ * Returns true if this is the last one in the opened overlays stack
729
729
  * @return {boolean}
730
730
  * @protected
731
731
  */
@@ -842,11 +842,11 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
842
842
 
843
843
  if (!template._Templatizer) {
844
844
  template._Templatizer = templatize(template, this, {
845
- forwardHostProp: function (prop, value) {
845
+ forwardHostProp(prop, value) {
846
846
  if (this._instance) {
847
847
  this._instance.forwardHostProp(prop, value);
848
848
  }
849
- }
849
+ },
850
850
  });
851
851
  }
852
852
 
@@ -862,7 +862,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
862
862
 
863
863
  let scopeCssText = Array.from(templateRoot.querySelectorAll('style')).reduce(
864
864
  (result, style) => result + style.textContent,
865
- ''
865
+ '',
866
866
  );
867
867
 
868
868
  // The overlay root’s :host styles should not apply inside the overlay
@@ -937,7 +937,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
937
937
  * @protected
938
938
  */
939
939
  _getActiveElement() {
940
- // document.activeElement can be null
940
+ // Document.activeElement can be null
941
941
  // https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement
942
942
  let active = document.activeElement || document.body;
943
943
  while (active.shadowRoot && active.shadowRoot.activeElement) {
@@ -957,7 +957,7 @@ class OverlayElement extends ThemableMixin(DirMixin(ControllerMixin(PolymerEleme
957
957
  }
958
958
  let n = node;
959
959
  const doc = node.ownerDocument;
960
- // walk from node to `this` or `document`
960
+ // Walk from node to `this` or `document`
961
961
  while (n && n !== doc && n !== this) {
962
962
  n = n.parentNode || n.host;
963
963
  }