ednl-liftstatus-web-components 1.62.3 → 1.62.4

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.
@@ -55960,13 +55960,19 @@ const Ls3dScene = class {
55960
55960
  };
55961
55961
  }
55962
55962
  componentDidLoad() {
55963
+ var _a;
55963
55964
  this.initializeScene();
55964
55965
  this.startAnimation();
55965
55966
  this.observeResize();
55966
55967
  if (this.store !== null) {
55967
55968
  this.hasBackDoor(this.store.state.hasBackDoor);
55968
55969
  }
55969
- this.updateErrorMessageElement();
55970
+ // An error already in the store found no canvas to cover before the first
55971
+ // render. Applied after initializeScene, which keeps the renderer at a
55972
+ // fixed child index of the canvas.
55973
+ if (this.errorState.hasError && !isNil.isNil(this.canvas)) {
55974
+ errorMessage.applyErrorMessage(this.canvas, errorMessage.getErrorMessageForDisplay(this.errorState.messageKey, (_a = this.store) === null || _a === void 0 ? void 0 : _a.state.locale));
55975
+ }
55970
55976
  if (this.store !== null) {
55971
55977
  this.processSensorUpdate(this.store.state.currentSensorData, true);
55972
55978
  }
@@ -55980,9 +55986,9 @@ const Ls3dScene = class {
55980
55986
  render() {
55981
55987
  var _a, _b, _c;
55982
55988
  const effectiveLastUpdate = this.lastUpdate === undefined || this.lastUpdate === 0 ? ((_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state.currentSensorData.lastUpdate) !== null && _b !== void 0 ? _b : 0) : this.lastUpdate;
55983
- return (index.h(index.Host, { key: '8495bbfde19d949a1837cc4b466787f33dd0fa1b' }, index.h("div", { key: '1d830fc5aa05bf2b4918f50001386d41c977d215', class: "canvas", ref: el => {
55989
+ return (index.h(index.Host, { key: '386954d30c092e2157fddcb3bb0ad0107956d040' }, index.h("div", { key: 'b828028056490e6a8fb11d182f4afc62a680ff1d', class: "canvas", ref: el => {
55984
55990
  this.canvas = el;
55985
- } }, index.h("ls-indicator", { key: 'd4506e32a03175e463ea1248d4b109be090039fd', class: "current-floor", "sensor-id": sensors.SENSOR.CurrentStop, "id-key": this.idKey }), index.h("ls-indicator", { key: '0283d236f4cc97287f21960212d5d1c0b52b4e0f', class: "last-passed-floor", "sensor-id": sensors.SENSOR.LastPassedStop, "id-key": this.idKey }), index.h("div", { key: 'f4fff768a93fcf86dad40f022ee9428ae169247c', class: "last-update" }, safeRelativeTime.getSafeRelativeTime(effectiveLastUpdate, (_c = this.store) === null || _c === void 0 ? void 0 : _c.state.locale))), index.h("slot", { key: 'df62171ae1407dc9252899a6e0b6e6d249f4e654' })));
55991
+ } }, index.h("ls-indicator", { key: 'cd8a73176772b176b41c667a1d6943f023100386', class: "current-floor", "sensor-id": sensors.SENSOR.CurrentStop, "id-key": this.idKey }), index.h("ls-indicator", { key: '10bd56f6b2df0dc6178aaf0a7b1064535bb90618', class: "last-passed-floor", "sensor-id": sensors.SENSOR.LastPassedStop, "id-key": this.idKey }), index.h("div", { key: '0a985a3d6b874b75ac9b08048b264832a41ee5d7', class: "last-update" }, safeRelativeTime.getSafeRelativeTime(effectiveLastUpdate, (_c = this.store) === null || _c === void 0 ? void 0 : _c.state.locale))), index.h("slot", { key: '0444dd4682bd15ce5ba74d72fd8eb432137486be' })));
55986
55992
  }
55987
55993
  static get assetsDirs() { return ["assets"]; }
55988
55994
  };
@@ -498,9 +498,12 @@ const LsSwimlane = class {
498
498
  },
499
499
  getStore: () => this.store,
500
500
  overlayContainer: () => this.canvas,
501
- // Canvas DOM is kept during errors, so the chart can resume without a
502
- // redraw — just restart the animation loop if it isn't already running.
501
+ // Resizes and locale changes are skipped during an error, so the chart can
502
+ // be stale by now: redraw it, as a resize does, before restarting the loop.
503
503
  onRecovered: () => {
504
+ this.drawChart();
505
+ this.rebuildChartData();
506
+ this.updateTimeline();
504
507
  if (this.interval === null)
505
508
  this.timelineTimer();
506
509
  },
@@ -783,16 +786,18 @@ const LsSwimlane = class {
783
786
  if (this.store === null) {
784
787
  return;
785
788
  }
786
- if (this.errorState.hasError) {
787
- return;
788
- }
789
+ // Drawn even during an error, so the overlay has a chart to cover and a
790
+ // recovery only needs to restart the timer.
789
791
  this.drawChart();
790
792
  // Fill chart with historical data
791
793
  this.processHistoricalData(this.store.state.historicalSensorData);
792
794
  // Initial chart data build
793
795
  this.rebuildChartData();
796
+ // An error set before the first render found no container to cover.
797
+ swimlaneConstants.applyErrorOverlay(this.errorStateHost);
794
798
  // Start the timer to update the swim lane at regular intervals
795
- this.timelineTimer();
799
+ if (!this.errorState.hasError)
800
+ this.timelineTimer();
796
801
  // Subscribe to future sensor value updates
797
802
  this.storeUnsubscribes.push(this.store.onChange('currentSensorData', sensorData => {
798
803
  this.processLiveData(sensorData);
@@ -800,9 +805,9 @@ const LsSwimlane = class {
800
805
  }
801
806
  render() {
802
807
  var _a;
803
- return (index.h(index.Host, { key: 'c4828ba5ed8384b6f2b80473f7dbc1f90482063a' }, index.h("div", { key: 'd75276b51d51dfe534253ae72e72530fafb0e024', ref: el => {
808
+ return (index.h(index.Host, { key: '0ce059db23e715bad8e4cc6105318f0888e73f92' }, index.h("div", { key: '553f19d3c5897380f0072ddf8012f40094da0e18', ref: el => {
804
809
  this.canvas = el !== null && el !== void 0 ? el : null;
805
- } }, index.h("div", { key: '2ea05c0737573e45f953fff072e7b639b5f5ff60', class: "chart" })), this.isLoading && index.h("div", { key: '250b3a9642d7f358535d2842bc68086e3339a7e6', class: "loading" }, (_a = this.store) === null || _a === void 0 ? void 0 : _a.t('ui:general.loading')), index.h("slot", { key: '652175e11e63c2f35535c7c7ad47c1e48ff491bc' })));
810
+ } }, index.h("div", { key: '7598ba42e750b632aa3eb72eefb77e2c9ae05d05', class: "chart" })), this.isLoading && index.h("div", { key: 'da3665b56f361568a460b7453801cd706814d142', class: "loading" }, (_a = this.store) === null || _a === void 0 ? void 0 : _a.t('ui:general.loading')), index.h("slot", { key: '3028c84a6ec7a9a6ea7a8bc079ea81803613157c' })));
806
811
  }
807
812
  disconnectedCallback() {
808
813
  this.clearTimer();
@@ -1134,13 +1134,19 @@ export class Ls3dScene {
1134
1134
  };
1135
1135
  }
1136
1136
  componentDidLoad() {
1137
+ var _a;
1137
1138
  this.initializeScene();
1138
1139
  this.startAnimation();
1139
1140
  this.observeResize();
1140
1141
  if (this.store !== null) {
1141
1142
  this.hasBackDoor(this.store.state.hasBackDoor);
1142
1143
  }
1143
- this.updateErrorMessageElement();
1144
+ // An error already in the store found no canvas to cover before the first
1145
+ // render. Applied after initializeScene, which keeps the renderer at a
1146
+ // fixed child index of the canvas.
1147
+ if (this.errorState.hasError && !isNil(this.canvas)) {
1148
+ applyErrorMessage(this.canvas, getErrorMessageForDisplay(this.errorState.messageKey, (_a = this.store) === null || _a === void 0 ? void 0 : _a.state.locale));
1149
+ }
1144
1150
  if (this.store !== null) {
1145
1151
  this.processSensorUpdate(this.store.state.currentSensorData, true);
1146
1152
  }
@@ -1154,9 +1160,9 @@ export class Ls3dScene {
1154
1160
  render() {
1155
1161
  var _a, _b, _c;
1156
1162
  const effectiveLastUpdate = this.lastUpdate === undefined || this.lastUpdate === 0 ? ((_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state.currentSensorData.lastUpdate) !== null && _b !== void 0 ? _b : 0) : this.lastUpdate;
1157
- return (h(Host, { key: '8495bbfde19d949a1837cc4b466787f33dd0fa1b' }, h("div", { key: '1d830fc5aa05bf2b4918f50001386d41c977d215', class: "canvas", ref: el => {
1163
+ return (h(Host, { key: '386954d30c092e2157fddcb3bb0ad0107956d040' }, h("div", { key: 'b828028056490e6a8fb11d182f4afc62a680ff1d', class: "canvas", ref: el => {
1158
1164
  this.canvas = el;
1159
- } }, h("ls-indicator", { key: 'd4506e32a03175e463ea1248d4b109be090039fd', class: "current-floor", "sensor-id": SENSOR.CurrentStop, "id-key": this.idKey }), h("ls-indicator", { key: '0283d236f4cc97287f21960212d5d1c0b52b4e0f', class: "last-passed-floor", "sensor-id": SENSOR.LastPassedStop, "id-key": this.idKey }), h("div", { key: 'f4fff768a93fcf86dad40f022ee9428ae169247c', class: "last-update" }, getSafeRelativeTime(effectiveLastUpdate, (_c = this.store) === null || _c === void 0 ? void 0 : _c.state.locale))), h("slot", { key: 'df62171ae1407dc9252899a6e0b6e6d249f4e654' })));
1165
+ } }, h("ls-indicator", { key: 'cd8a73176772b176b41c667a1d6943f023100386', class: "current-floor", "sensor-id": SENSOR.CurrentStop, "id-key": this.idKey }), h("ls-indicator", { key: '10bd56f6b2df0dc6178aaf0a7b1064535bb90618', class: "last-passed-floor", "sensor-id": SENSOR.LastPassedStop, "id-key": this.idKey }), h("div", { key: '0a985a3d6b874b75ac9b08048b264832a41ee5d7', class: "last-update" }, getSafeRelativeTime(effectiveLastUpdate, (_c = this.store) === null || _c === void 0 ? void 0 : _c.state.locale))), h("slot", { key: '0444dd4682bd15ce5ba74d72fd8eb432137486be' })));
1160
1166
  }
1161
1167
  static get is() { return "ls-3d-scene"; }
1162
1168
  static get encapsulation() { return "shadow"; }
@@ -5,7 +5,7 @@ import { debounce, each, filter, get, indexOf, isEmpty, isNil, isObject, keys, l
5
5
  import { getStore } from "../../store";
6
6
  import { SWIMLANE_ICON_SIZE, SWIMLANE_ITEM_HEIGHT, SWIMLANE_LABEL_WIDTH, SWIMLANE_ROW_HEIGHT } from "../swimlane-shared/swimlane-constants";
7
7
  import { truncateSvgText } from "../swimlane-shared/swimlane-text";
8
- import { updateErrorState } from "../../utils/component-error-state";
8
+ import { applyErrorOverlay, updateErrorState } from "../../utils/component-error-state";
9
9
  import { watchStoreLocale } from "../../utils/locale-state";
10
10
  import { sensorInfo } from "../../utils/sensorInfo";
11
11
  import { isZeroBasedStopSensor, SENSOR, SWIMLANE_SENSOR_IDS, sensorIdsToString } from "../../utils/sensors";
@@ -343,9 +343,12 @@ export class LsSwimlane {
343
343
  },
344
344
  getStore: () => this.store,
345
345
  overlayContainer: () => this.canvas,
346
- // Canvas DOM is kept during errors, so the chart can resume without a
347
- // redraw — just restart the animation loop if it isn't already running.
346
+ // Resizes and locale changes are skipped during an error, so the chart can
347
+ // be stale by now: redraw it, as a resize does, before restarting the loop.
348
348
  onRecovered: () => {
349
+ this.drawChart();
350
+ this.rebuildChartData();
351
+ this.updateTimeline();
349
352
  if (this.interval === null)
350
353
  this.timelineTimer();
351
354
  },
@@ -628,16 +631,18 @@ export class LsSwimlane {
628
631
  if (this.store === null) {
629
632
  return;
630
633
  }
631
- if (this.errorState.hasError) {
632
- return;
633
- }
634
+ // Drawn even during an error, so the overlay has a chart to cover and a
635
+ // recovery only needs to restart the timer.
634
636
  this.drawChart();
635
637
  // Fill chart with historical data
636
638
  this.processHistoricalData(this.store.state.historicalSensorData);
637
639
  // Initial chart data build
638
640
  this.rebuildChartData();
641
+ // An error set before the first render found no container to cover.
642
+ applyErrorOverlay(this.errorStateHost);
639
643
  // Start the timer to update the swim lane at regular intervals
640
- this.timelineTimer();
644
+ if (!this.errorState.hasError)
645
+ this.timelineTimer();
641
646
  // Subscribe to future sensor value updates
642
647
  this.storeUnsubscribes.push(this.store.onChange('currentSensorData', sensorData => {
643
648
  this.processLiveData(sensorData);
@@ -645,9 +650,9 @@ export class LsSwimlane {
645
650
  }
646
651
  render() {
647
652
  var _a;
648
- return (h(Host, { key: 'c4828ba5ed8384b6f2b80473f7dbc1f90482063a' }, h("div", { key: 'd75276b51d51dfe534253ae72e72530fafb0e024', ref: el => {
653
+ return (h(Host, { key: '0ce059db23e715bad8e4cc6105318f0888e73f92' }, h("div", { key: '553f19d3c5897380f0072ddf8012f40094da0e18', ref: el => {
649
654
  this.canvas = el !== null && el !== void 0 ? el : null;
650
- } }, h("div", { key: '2ea05c0737573e45f953fff072e7b639b5f5ff60', class: "chart" })), this.isLoading && h("div", { key: '250b3a9642d7f358535d2842bc68086e3339a7e6', class: "loading" }, (_a = this.store) === null || _a === void 0 ? void 0 : _a.t('ui:general.loading')), h("slot", { key: '652175e11e63c2f35535c7c7ad47c1e48ff491bc' })));
655
+ } }, h("div", { key: '7598ba42e750b632aa3eb72eefb77e2c9ae05d05', class: "chart" })), this.isLoading && h("div", { key: 'da3665b56f361568a460b7453801cd706814d142', class: "loading" }, (_a = this.store) === null || _a === void 0 ? void 0 : _a.t('ui:general.loading')), h("slot", { key: '3028c84a6ec7a9a6ea7a8bc079ea81803613157c' })));
651
656
  }
652
657
  disconnectedCallback() {
653
658
  this.clearTimer();