@neovici/cosmoz-bottom-bar 5.1.1 → 5.2.0
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/cosmoz-bottom-bar.js +17 -4
- package/package.json +1 -1
package/cosmoz-bottom-bar.js
CHANGED
|
@@ -11,7 +11,8 @@ import { defaultPlacement } from '@neovici/cosmoz-dropdown';
|
|
|
11
11
|
|
|
12
12
|
const
|
|
13
13
|
BOTTOM_BAR_TOOLBAR_SLOT = 'bottom-bar-toolbar',
|
|
14
|
-
BOTTOM_BAR_MENU_SLOT = 'bottom-bar-menu'
|
|
14
|
+
BOTTOM_BAR_MENU_SLOT = 'bottom-bar-menu',
|
|
15
|
+
rendered = Symbol('rendered');
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* `<cosmoz-bottom-bar>` is a horizontal responsive bottom toolbar containing items that
|
|
@@ -130,6 +131,11 @@ class CosmozBottomBar extends PolymerElement {
|
|
|
130
131
|
type: Number
|
|
131
132
|
},
|
|
132
133
|
|
|
134
|
+
renderOpen: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
value: false
|
|
137
|
+
},
|
|
138
|
+
|
|
133
139
|
forceOpen: {
|
|
134
140
|
type: Boolean,
|
|
135
141
|
value: false
|
|
@@ -171,7 +177,7 @@ class CosmozBottomBar extends PolymerElement {
|
|
|
171
177
|
|
|
172
178
|
static get observers() {
|
|
173
179
|
return [
|
|
174
|
-
'_showHideBottomBar(visible)'
|
|
180
|
+
'_showHideBottomBar(visible, renderOpen)'
|
|
175
181
|
];
|
|
176
182
|
}
|
|
177
183
|
|
|
@@ -203,6 +209,7 @@ class CosmozBottomBar extends PolymerElement {
|
|
|
203
209
|
|
|
204
210
|
disconnectedCallback() {
|
|
205
211
|
super.disconnectedCallback();
|
|
212
|
+
this[rendered] = false;
|
|
206
213
|
|
|
207
214
|
[...this._nodeObservers, this._hiddenMutationObserver].forEach(e => e.disconnect(e));
|
|
208
215
|
this._layoutDebouncer?.cancel(); /* eslint-disable-line no-unused-expressions */
|
|
@@ -330,15 +337,21 @@ class CosmozBottomBar extends PolymerElement {
|
|
|
330
337
|
this._computedBarHeightKicker += 1;
|
|
331
338
|
}
|
|
332
339
|
|
|
333
|
-
_showHideBottomBar(visible) {
|
|
340
|
+
_showHideBottomBar(visible, renderOpen) {
|
|
334
341
|
this.style.transitionDuration = 0;
|
|
335
342
|
this.style.display = '';
|
|
336
343
|
this.style.maxHeight = '';
|
|
337
344
|
|
|
338
345
|
const height = this.computedBarHeight,
|
|
339
|
-
from = visible ? '0px' : height + 'px',
|
|
340
346
|
to = !visible ? '0px' : height + 'px';
|
|
341
347
|
|
|
348
|
+
let from = visible ? '0px' : height + 'px';
|
|
349
|
+
|
|
350
|
+
if(visible && renderOpen && !this[rendered]) {
|
|
351
|
+
from = to;
|
|
352
|
+
this[rendered] = true;
|
|
353
|
+
}
|
|
354
|
+
|
|
342
355
|
this.style.maxHeight = from;
|
|
343
356
|
|
|
344
357
|
const onEnd = () => {
|
package/package.json
CHANGED