@neovici/cosmoz-bottom-bar 7.5.1 → 8.0.1

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.
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-len */
1
2
  import '@neovici/cosmoz-dropdown';
2
3
  import { html } from '@polymer/polymer/lib/utils/html-tag';
3
4
 
@@ -8,7 +8,6 @@ import { timeOut } from '@polymer/polymer/lib/utils/async';
8
8
  import { html } from 'lit-html';
9
9
  import { hauntedPolymer } from '@neovici/cosmoz-utils';
10
10
  import { useActivity } from '@neovici/cosmoz-utils/keybindings/use-activity';
11
- import { defaultPlacement } from '@neovici/cosmoz-dropdown';
12
11
  import template from './cosmoz-bottom-bar.html.js';
13
12
 
14
13
  const BOTTOM_BAR_TOOLBAR_SLOT = 'bottom-bar-toolbar',
@@ -188,7 +187,8 @@ class CosmozBottomBar extends hauntedPolymer(useBottomBar)(PolymerElement) {
188
187
  },
189
188
 
190
189
  topPlacement: {
191
- value: ['top-right', ...defaultPlacement],
190
+ value: 'top-end',
191
+ type: String,
192
192
  },
193
193
  };
194
194
  }
@@ -238,7 +238,6 @@ class CosmozBottomBar extends hauntedPolymer(useBottomBar)(PolymerElement) {
238
238
  [...this._nodeObservers, this._hiddenMutationObserver].forEach((e) =>
239
239
  e.disconnect(e),
240
240
  );
241
- this._layoutDebouncer?.cancel();
242
241
  this._resizeObserver.unobserve(this);
243
242
  }
244
243
 
@@ -334,17 +333,6 @@ class CosmozBottomBar extends hauntedPolymer(useBottomBar)(PolymerElement) {
334
333
  ];
335
334
  }
336
335
 
337
- _distribute(hostWidth) {
338
- const elements = this._getElements();
339
-
340
- const tooNarrow = hostWidth <= 480,
341
- toolbarElements = elements.slice(0, tooNarrow ? 0 : this.maxToolbarItems),
342
- menuElements = elements.slice(toolbarElements.length);
343
- toolbarElements.forEach((el) => this._moveElement(el, true));
344
- menuElements.forEach((el) => this._moveElement(el));
345
- this._setHasMenuItems(menuElements.length > 0);
346
- }
347
-
348
336
  /**
349
337
  * Layout the actions available as buttons or menu items
350
338
  *
@@ -375,7 +363,11 @@ class CosmozBottomBar extends hauntedPolymer(useBottomBar)(PolymerElement) {
375
363
  return this._setHasMenuItems(false);
376
364
  }
377
365
 
378
- this._distribute(this.getBoundingClientRect().width);
366
+ const toolbarElements = elements.slice(0, this.maxToolbarItems),
367
+ menuElements = elements.slice(toolbarElements.length);
368
+ toolbarElements.forEach((el) => this._moveElement(el, true));
369
+ menuElements.forEach((el) => this._moveElement(el));
370
+ this._setHasMenuItems(menuElements.length > 0);
379
371
  }
380
372
 
381
373
  _moveElement(element, toToolbar) {
@@ -399,7 +391,6 @@ class CosmozBottomBar extends hauntedPolymer(useBottomBar)(PolymerElement) {
399
391
  this._matchHeightElement,
400
392
  this.barHeight,
401
393
  );
402
- this._distribute(entry.contentRect?.width);
403
394
  }
404
395
 
405
396
  _showHideBottomBar(visible) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-bottom-bar",
3
- "version": "7.5.1",
3
+ "version": "8.0.1",
4
4
  "description": "A responsive bottom-bar that can house buttons/actions and a menu for the buttons that won't fit the available width.",
5
5
  "keywords": [
6
6
  "polymer",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@neovici/cosmoz-collapse": "^1.5.0",
63
- "@neovici/cosmoz-dropdown": "^4.0.0",
63
+ "@neovici/cosmoz-dropdown": "^4.0.0 || ^5.0.0",
64
64
  "@neovici/cosmoz-utils": "^6.13.1",
65
65
  "@pionjs/pion": "^2.5.2",
66
66
  "@polymer/polymer": "^3.3.0",
@@ -86,12 +86,13 @@
86
86
  "@web/storybook-builder": "^0.1.9",
87
87
  "@web/storybook-framework-web-components": "^0.1.1",
88
88
  "@webcomponents/webcomponentsjs": "^2.5.0",
89
- "esbuild": "^0.23.0",
89
+ "esbuild": "^0.24.0",
90
+ "eslint": "^8.57.1",
90
91
  "http-server": "^14.1.1",
91
92
  "husky": "^9.1.1",
92
93
  "rollup-plugin-esbuild": "^6.1.1",
93
94
  "semantic-release": "^24.0.0",
94
- "sinon": "^18.0.0",
95
+ "sinon": "^19.0.0",
95
96
  "storybook": "^7.6.17",
96
97
  "typescript": "^5.0.0"
97
98
  }