@vaadin/menu-bar 23.0.0-alpha1 → 23.0.0-alpha2

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/menu-bar",
3
- "version": "23.0.0-alpha1",
3
+ "version": "23.0.0-alpha2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,20 +33,19 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@open-wc/dedupe-mixin": "^1.3.0",
36
- "@polymer/iron-resizable-behavior": "^3.0.0",
37
36
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/button": "23.0.0-alpha1",
39
- "@vaadin/component-base": "23.0.0-alpha1",
40
- "@vaadin/vaadin-context-menu": "23.0.0-alpha1",
41
- "@vaadin/vaadin-lumo-styles": "23.0.0-alpha1",
42
- "@vaadin/vaadin-material-styles": "23.0.0-alpha1",
43
- "@vaadin/vaadin-themable-mixin": "23.0.0-alpha1"
37
+ "@vaadin/button": "23.0.0-alpha2",
38
+ "@vaadin/component-base": "23.0.0-alpha2",
39
+ "@vaadin/vaadin-context-menu": "23.0.0-alpha2",
40
+ "@vaadin/vaadin-lumo-styles": "23.0.0-alpha2",
41
+ "@vaadin/vaadin-material-styles": "23.0.0-alpha2",
42
+ "@vaadin/vaadin-themable-mixin": "23.0.0-alpha2"
44
43
  },
45
44
  "devDependencies": {
46
45
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/icon": "23.0.0-alpha1",
46
+ "@vaadin/icon": "23.0.0-alpha2",
48
47
  "@vaadin/testing-helpers": "^0.3.2",
49
48
  "sinon": "^9.2.1"
50
49
  },
51
- "gitHead": "fbcb07328fdf88260e3b461088d207426b21c710"
50
+ "gitHead": "070f586dead02ca41b66717820c647f48bf1665f"
52
51
  }
@@ -3,8 +3,6 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
7
- import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
8
6
  import { animationFrame } from '@vaadin/component-base/src/async.js';
9
7
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
10
8
 
@@ -12,7 +10,7 @@ import { Debouncer } from '@vaadin/component-base/src/debounce.js';
12
10
  * @polymerMixin
13
11
  */
14
12
  export const ButtonsMixin = (superClass) =>
15
- class extends mixinBehaviors(IronResizableBehavior, superClass) {
13
+ class extends superClass {
16
14
  static get properties() {
17
15
  return {
18
16
  /**
@@ -30,17 +28,14 @@ export const ButtonsMixin = (superClass) =>
30
28
  return ['_menuItemsChanged(items, items.splices)'];
31
29
  }
32
30
 
33
- constructor() {
34
- super();
35
-
36
- this.__boundOnResize = this.__onResize.bind(this);
37
- }
38
-
39
31
  /** @protected */
40
32
  ready() {
41
33
  super.ready();
42
34
 
43
35
  this.setAttribute('role', 'menubar');
36
+
37
+ this.__resizeObserver = new ResizeObserver(() => this.__onResize());
38
+ this.__resizeObserver.observe(this);
44
39
  }
45
40
 
46
41
  /** @protected */
@@ -48,14 +43,6 @@ export const ButtonsMixin = (superClass) =>
48
43
  super.connectedCallback();
49
44
 
50
45
  this._initButtonAttrs(this._overflow);
51
- this.addEventListener('iron-resize', this.__boundOnResize);
52
- }
53
-
54
- /** @protected */
55
- disconnectedCallback() {
56
- super.disconnectedCallback();
57
-
58
- this.removeEventListener('iron-resize', this.__boundOnResize);
59
46
  }
60
47
 
61
48
  /**
@@ -181,7 +168,7 @@ export const ButtonsMixin = (superClass) =>
181
168
  const button = document.createElement('vaadin-menu-bar-button');
182
169
  button.setAttribute('part', 'menu-bar-button');
183
170
 
184
- const itemCopy = Object.assign({}, item);
171
+ const itemCopy = { ...item };
185
172
  button.item = itemCopy;
186
173
 
187
174
  if (item.component) {
@@ -17,8 +17,8 @@ export declare class InteractionsMixinClass {
17
17
  openOnHover: boolean | null | undefined;
18
18
 
19
19
  /**
20
- * Can be called to manually notify a resizable and its descendant
21
- * resizables of a resize change.
20
+ * @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
21
+ * ResizeObserver internally and doesn't need to be explicitly notified of resizes.
22
22
  */
23
23
  notifyResize(): void;
24
24
  }
@@ -408,4 +408,14 @@ export const InteractionsMixin = (superClass) =>
408
408
  this.__deactivateButton(restoreFocus);
409
409
  this._subMenu.opened && this._subMenu.close();
410
410
  }
411
+
412
+ /**
413
+ * @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
414
+ * ResizeObserver internally and doesn't need to be explicitly notified of resizes.
415
+ */
416
+ notifyResize() {
417
+ console.warn(
418
+ `WARNING: Since Vaadin 23, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`
419
+ );
420
+ }
411
421
  };
@@ -20,6 +20,7 @@ export interface SubMenuItem {
20
20
  text?: string;
21
21
  component?: string | HTMLElement;
22
22
  disabled?: boolean;
23
+ theme?: string | string[];
23
24
  checked?: boolean;
24
25
  children?: SubMenuItem[];
25
26
  }