@flexem/fc-gui 3.0.0-alpha.164 → 3.0.0-alpha.166

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.
@@ -40542,7 +40542,9 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
40542
40542
  const validNames = (_d = (_c = (_b = (_a = this.guiContext) === null || _a === void 0 ? void 0 : _a.configStore) === null || _b === void 0 ? void 0 : _b.variableStore) === null || _c === void 0 ? void 0 : _c.getAllVariableNames) === null || _d === void 0 ? void 0 : _d.call(_c);
40543
40543
  if (validNames && !validNames.includes(convertedName)) {
40544
40544
  this.updateElementStates([new communication["c" /* VariableState */](convertedName, communication["d" /* VariableStateEnum */].InvalidMonitor)]);
40545
- return;
40545
+ // 无效变量时先显示第一个状态样式,避免空白;
40546
+ // 但仍继续初始化订阅,以便后续收到 Offline/Unbind 时能正确覆盖
40547
+ this.switchToState(0);
40546
40548
  }
40547
40549
  }
40548
40550
  switch (settings.type) {
@@ -40573,6 +40575,10 @@ class switch_indicator_light_element_SwitchIndicatorLightElement extends conditi
40573
40575
  else if (!Object(lodash["isUndefined"])(statusIdValue.value)) {
40574
40576
  this.switchToState(statusIdValue.value);
40575
40577
  }
40578
+ else {
40579
+ // 变量值为 null/undefined(含无效变量)时,显示第一个状态样式
40580
+ this.switchToState(0);
40581
+ }
40576
40582
  }
40577
40583
  switchToState(stateId) {
40578
40584
  this.textStateElement.switchToState(stateId);