@oicl/openbridge-webcomponents 2.0.0-next.119 → 2.0.0-next.120

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.
@@ -14597,6 +14597,7 @@ const compentStyle$1e = i$7`* {
14597
14597
 
14598
14598
  .wrapper.level-critical {
14599
14599
  --bg-color: var(--critical-enabled-background-color);
14600
+ --blink-on: var(--critical-blink-on);
14600
14601
  color: var(--on-critical-active-color);
14601
14602
  }
14602
14603
 
@@ -15220,6 +15221,42 @@ function usesAlarmNoAckIcon(type) {
15220
15221
  AlertType.LevelHigh
15221
15222
  ].includes(type);
15222
15223
  }
15224
+ const CRITICAL_PERIOD = 1e3;
15225
+ const ALARM_PERIOD = 2e3;
15226
+ const WARNING_PERIOD = 4e3;
15227
+ const LOW_PERIOD = 8e3;
15228
+ function blinkingInstall(el, period, label) {
15229
+ const anim = el.animate(
15230
+ [
15231
+ { [label + "-on"]: 1, [label + "-off"]: 0 },
15232
+ { [label + "-on"]: 0, [label + "-off"]: 1 }
15233
+ ],
15234
+ { duration: period, iterations: Infinity, easing: "steps(2, jump-none)" }
15235
+ );
15236
+ anim.startTime = 0;
15237
+ return () => anim.cancel();
15238
+ }
15239
+ function blinkingCritical(el) {
15240
+ return blinkingInstall(el, CRITICAL_PERIOD, "--critical-blink");
15241
+ }
15242
+ function blinkingAlarm(el) {
15243
+ return blinkingInstall(el, ALARM_PERIOD, "--alarm-blink");
15244
+ }
15245
+ function blinkingWarning(el) {
15246
+ return blinkingInstall(el, WARNING_PERIOD, "--warning-blink");
15247
+ }
15248
+ function blinkingLow(el) {
15249
+ return blinkingInstall(el, LOW_PERIOD, "--low-blink");
15250
+ }
15251
+ function blinkingAll(el) {
15252
+ const animes = [
15253
+ blinkingCritical(el),
15254
+ blinkingAlarm(el),
15255
+ blinkingWarning(el),
15256
+ blinkingLow(el)
15257
+ ];
15258
+ return () => animes.forEach((anim) => anim());
15259
+ }
15223
15260
  var __defProp$zL = Object.defineProperty;
15224
15261
  var __getOwnPropDesc$zN = Object.getOwnPropertyDescriptor;
15225
15262
  var __decorateClass$zT = (decorators, target, key, kind) => {
@@ -15289,6 +15326,29 @@ let ObcAlertFrame = class extends i$4 {
15289
15326
  </div>
15290
15327
  `;
15291
15328
  }
15329
+ syncBlinking() {
15330
+ if (this.mode !== "unacked-active" && this._blinkAnimationCancel) {
15331
+ this._blinkAnimationCancel();
15332
+ this._blinkAnimationCancel = void 0;
15333
+ }
15334
+ if (this.mode === "unacked-active" && !this._blinkAnimationCancel) {
15335
+ this._blinkAnimationCancel = blinkingAll(this);
15336
+ }
15337
+ }
15338
+ connectedCallback() {
15339
+ super.connectedCallback();
15340
+ if (this.hasUpdated) {
15341
+ this.syncBlinking();
15342
+ }
15343
+ }
15344
+ updated() {
15345
+ this.syncBlinking();
15346
+ }
15347
+ disconnectedCallback() {
15348
+ super.disconnectedCallback();
15349
+ this._blinkAnimationCancel?.();
15350
+ this._blinkAnimationCancel = void 0;
15351
+ }
15292
15352
  flap() {
15293
15353
  if (this.type === "regular") {
15294
15354
  return A;
@@ -70698,9 +70758,13 @@ let ObcAlertButton = class extends i$4 {
70698
70758
  connectedCallback() {
70699
70759
  super.connectedCallback();
70700
70760
  window.addEventListener("resize", this.resizeListener);
70761
+ if (this.hasUpdated) {
70762
+ this.installBlinking();
70763
+ }
70701
70764
  }
70702
70765
  disconnectedCallback() {
70703
70766
  window.removeEventListener("resize", this.resizeListener);
70767
+ this._blinkAnimationCancel?.();
70704
70768
  super.disconnectedCallback();
70705
70769
  }
70706
70770
  renderAlertTwotoneIcon() {
@@ -70762,6 +70826,13 @@ let ObcAlertButton = class extends i$4 {
70762
70826
  get showSilenceButtonDynamic() {
70763
70827
  return this.showSilenceButton && this.width >= this.silenceButtonMinBreakpointPx && this.activeType !== "flat";
70764
70828
  }
70829
+ installBlinking() {
70830
+ this._blinkAnimationCancel?.();
70831
+ this._blinkAnimationCancel = blinkingAll(this);
70832
+ }
70833
+ updated() {
70834
+ this.installBlinking();
70835
+ }
70765
70836
  render() {
70766
70837
  const hasAlerts = this.nAlerts > 0;
70767
70838
  const showCounter = this.counter && hasAlerts && this.activeType !== "flat";
@@ -72272,6 +72343,31 @@ let ObcAlertIcon = class extends i$4 {
72272
72343
  }
72273
72344
  return b`<div class="wrapper">${this.renderStaticIcon()}</div>`;
72274
72345
  }
72346
+ syncBlinking() {
72347
+ if (this._blinkAnimationCancel && !supportsBlinking(this._effectiveType, this.acknowledged ?? false)) {
72348
+ this._blinkAnimationCancel();
72349
+ this._blinkAnimationCancel = void 0;
72350
+ }
72351
+ if (!this._blinkAnimationCancel && supportsBlinking(this._effectiveType, this.acknowledged ?? false)) {
72352
+ this._blinkAnimationCancel = blinkingAll(this);
72353
+ }
72354
+ }
72355
+ connectedCallback() {
72356
+ super.connectedCallback();
72357
+ if (this.hasUpdated) {
72358
+ this.syncBlinking();
72359
+ }
72360
+ }
72361
+ updated() {
72362
+ this.syncBlinking();
72363
+ }
72364
+ disconnectedCallback() {
72365
+ super.disconnectedCallback();
72366
+ if (this._blinkAnimationCancel) {
72367
+ this._blinkAnimationCancel();
72368
+ this._blinkAnimationCancel = void 0;
72369
+ }
72370
+ }
72275
72371
  };
72276
72372
  ObcAlertIcon.styles = i$7`
72277
72373
  .wrapper {