@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.1 → 2.2.0-next.2

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,4 +1,4 @@
1
- import {LitElement, html, unsafeCSS} from 'lit';
1
+ import {LitElement, PropertyValues, html, unsafeCSS} from 'lit';
2
2
  import {property} from 'lit/decorators.js';
3
3
  import {classMap} from 'lit/directives/class-map.js';
4
4
  import {msg} from '@lit/localize';
@@ -81,7 +81,8 @@ export enum ObcTopBarMenuButtonIcon {
81
81
  * - `menu-button-clicked` – Fired when the menu button is clicked.
82
82
  * - `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.
83
83
  * - `apps-button-clicked` – Fired when the apps button is clicked.
84
- * - `left-more-button-clicked` – Fired when the left more button is clicked.
84
+ * - `more-button-clicked` – Fired when the more button is clicked.
85
+ * - `left-more-button-clicked` – Deprecated alias of `more-button-clicked`, fired with it; removed in 4.0.0.
85
86
  * - `user-button-clicked` – Fired when the user/profile button is clicked.
86
87
  * - `close` – Fired in settings mode when the close button is clicked.
87
88
  * - `back` – Fired in settings mode when the back button is clicked.
@@ -132,8 +133,8 @@ export enum ObcTopBarMenuButtonIcon {
132
133
  * @availableWhen dimmingButtonActivated showDimmingButton==true && inactive==false
133
134
  * @property appsButtonActivated - Highlights the apps button as active.
134
135
  * @availableWhen appsButtonActivated showAppsButton==true && inactive==false
135
- * @property leftMoreButtonActivated - Highlights the left more button as active.
136
- * @availableWhen leftMoreButtonActivated inactive==false
136
+ * @property moreButtonActivated - Highlights the more button as active.
137
+ * @availableWhen moreButtonActivated inactive==false
137
138
  * @property userButtonActivated - Highlights the user/profile button as active.
138
139
  * @availableWhen userButtonActivated showUserButton==true && inactive==false
139
140
  * @property userButtonDisabled - Disables the user/profile button.
@@ -163,13 +164,16 @@ export enum ObcTopBarMenuButtonIcon {
163
164
  * @fires menu-button-clicked - Fired when the menu button is clicked
164
165
  * @fires dimming-button-clicked - Fired when the dimming (day/night) button is clicked
165
166
  * @fires apps-button-clicked - Fired when the apps button is clicked
166
- * @fires left-more-button-clicked - Fired when the left more button is clicked
167
+ * @fires more-button-clicked - Fired when the more button is clicked
168
+ * @fires left-more-button-clicked - Deprecated: listen to `more-button-clicked` instead. Fired together with it; removed in 4.0.0.
167
169
  * @fires user-button-clicked - Fired when the user/profile button is clicked
168
170
  * @fires close - Fired in settings mode when the close button is clicked
169
171
  * @fires back - Fired in settings mode when the back button is clicked
170
172
  * @fires emergency-brightness-start - Fired when the menu button is held for 500ms. This should increase the brightness of the screen slowly. Used when the screen is too dark.
171
173
  * @fires emergency-brightness-stop - Fired when the menu button is released.
172
174
  * @fires {BreadcrumbClickEvent} breadcrumb-click - Fired when a breadcrumb item is clicked.
175
+ * @csspart more-button - The more button shown below the breakpoints.
176
+ * @csspart left-more-button - Deprecated alias of the `more-button` part; removed in 4.0.0.
173
177
  * @stable
174
178
  */
175
179
  @customElement('obc-top-bar')
@@ -190,7 +194,13 @@ export class ObcTopBar extends LitElement {
190
194
  appsButtonActivated = false;
191
195
 
192
196
  @property({type: Boolean})
193
- leftMoreButtonActivated = false;
197
+ moreButtonActivated = false;
198
+
199
+ /**
200
+ * @deprecated Use `moreButtonActivated`. Removed in 4.0.0.
201
+ */
202
+ @property({type: Boolean})
203
+ leftMoreButtonActivated?: boolean;
194
204
 
195
205
  @property({type: Boolean})
196
206
  userButtonActivated = false;
@@ -253,9 +263,30 @@ export class ObcTopBar extends LitElement {
253
263
  this.dispatchEvent(new CustomEvent('apps-button-clicked'));
254
264
  }
255
265
 
256
- private leftMoreButtonClicked() {
266
+ /**
267
+ * Copies the deprecated `leftMoreButtonActivated` into
268
+ * `moreButtonActivated`. A plain field rather than a getter/setter alias:
269
+ * the Vue wrapper writes every prop back on its second render, and a getter
270
+ * would then write `false` over the new property.
271
+ */
272
+ override willUpdate(changed: PropertyValues<this>): void {
273
+ super.willUpdate(changed);
274
+ if (
275
+ changed.has('leftMoreButtonActivated') &&
276
+ this.leftMoreButtonActivated !== undefined
277
+ ) {
278
+ this.moreButtonActivated = this.leftMoreButtonActivated;
279
+ }
280
+ }
281
+
282
+ private moreButtonClicked() {
283
+ /**
284
+ * Fired when the more button is clicked.
285
+ * @event more-button-clicked
286
+ */
287
+ this.dispatchEvent(new CustomEvent('more-button-clicked'));
257
288
  /**
258
- * Fired when the left more button is clicked.
289
+ * Deprecated alias of `more-button-clicked`; removed in 4.0.0.
259
290
  * @event left-more-button-clicked
260
291
  */
261
292
  this.dispatchEvent(new CustomEvent('left-more-button-clicked'));
@@ -413,13 +444,15 @@ export class ObcTopBar extends LitElement {
413
444
 
414
445
  const breakpointMoreButton = Math.max(
415
446
  this.appButtonBreakpointPx,
416
- this.dimmingButtonBreakpointPx
447
+ this.dimmingButtonBreakpointPx,
448
+ this.userButtonBreakpointPx,
449
+ this.appIconBreakpointPx
417
450
  );
418
451
 
419
452
  return html`
420
453
  <style>
421
454
  @media (max-width: ${breakpointMoreButton}px) {
422
- .left-more-button {
455
+ .more-button {
423
456
  display: revert !important;
424
457
  }
425
458
 
@@ -519,12 +552,12 @@ export class ObcTopBar extends LitElement {
519
552
  ${
520
553
  !this.inactive
521
554
  ? html`<obc-icon-button
522
- class="left-more-button"
523
- part="left-more-button"
555
+ class="more-button"
556
+ part="more-button left-more-button"
524
557
  variant="flat"
525
558
  aria-label=${msg('More')}
526
- @click=${this.leftMoreButtonClicked}
527
- ?activated=${this.leftMoreButtonActivated}
559
+ @click=${this.moreButtonClicked}
560
+ ?activated=${this.moreButtonActivated}
528
561
  >
529
562
  <obi-more-vertical-google></obi-more-vertical-google>
530
563
  </obc-icon-button>`