myio-js-library 0.1.160 → 0.1.161

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.
@@ -2059,8 +2059,9 @@
2059
2059
  lastValue: Number(entity.lastValue) || 0,
2060
2060
  unit: entity.unit || "",
2061
2061
  status: entity.status || "unknown",
2062
- ingestionId: entity.ingestionId || entity.id
2062
+ ingestionId: entity.ingestionId || entity.id,
2063
2063
  // ⭐ ADD: Store ingestionId for API calls
2064
+ customerName: entity.customerName || ""
2064
2065
  };
2065
2066
  this.entities.set(entity.id, normalizedEntity);
2066
2067
  }
@@ -4674,6 +4675,13 @@
4674
4675
  viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false">
4675
4676
  <rect x="5" y="4" width="14" height="16" rx="2"/>
4676
4677
  <path d="M7 12c1.5 1 3 .9 5-.3s3.5-1.3 5 .3v4H7v-4Z" fill="#fff" fill-opacity=".25"/>
4678
+ </svg>`,
4679
+ waterDrop: `
4680
+ <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
4681
+ <g id="water" transform="translate(-4 -2)">
4682
+ <path id="secondary" fill="#2ca9bc" d="M19,14A7,7,0,1,1,5,14C5,8,12,3,12,3S19,8,19,14Z"/>
4683
+ <path id="primary" d="M19,14A7,7,0,1,1,5,14C5,8,12,3,12,3S19,8,19,14Z" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
4684
+ </g>
4677
4685
  </svg>`,
4678
4686
  // ⋮ Kebab (for actions menu)
4679
4687
  kebab: `
@@ -4702,6 +4710,7 @@
4702
4710
  var DEFAULT_I18N = {
4703
4711
  // Status labels with icons
4704
4712
  in_operation: "\u26A1 Normal",
4713
+ in_operation_water: "\u{1F4A7} Normal",
4705
4714
  standby: "\u{1F4A4} Em standby",
4706
4715
  alert: "\u26A0\uFE0F Alerta",
4707
4716
  failure: "\u{1F6A8} Falha",
@@ -4758,7 +4767,13 @@
4758
4767
  }
4759
4768
  };
4760
4769
  }
4761
- function getIconSvg(deviceType) {
4770
+ function getIconSvg(deviceType, domain) {
4771
+ if (domain === "water") {
4772
+ return Icons.waterDrop;
4773
+ }
4774
+ if (domain === "temperature") {
4775
+ return Icons.thermometer;
4776
+ }
4762
4777
  return ICON_MAP[deviceType] || ICON_MAP.DEFAULT;
4763
4778
  }
4764
4779
  function formatPower(valueInWatts) {
@@ -4798,9 +4813,23 @@
4798
4813
  const percentage = numericConsumption / numericTarget * 100;
4799
4814
  return percentage;
4800
4815
  }
4801
- function getStatusInfo(deviceStatus, i18n) {
4816
+ function getStatusInfo(deviceStatus, i18n, domain) {
4802
4817
  switch (deviceStatus) {
4818
+ // --- Novos Status de Temperatura ---
4819
+ case "normal":
4820
+ return { chipClass: "chip--ok", label: "Normal" };
4821
+ // Verde/Azul
4822
+ case "cold":
4823
+ return { chipClass: "chip--standby", label: "Frio" };
4824
+ // Azul claro/Ciano
4825
+ case "hot":
4826
+ return { chipClass: "chip--alert", label: "Quente" };
4827
+ // Laranja/Amarelo
4828
+ // --- Status Existentes ---
4803
4829
  case DeviceStatusType.POWER_ON:
4830
+ if (domain === "water") {
4831
+ return { chipClass: "chip--ok", label: i18n.in_operation_water };
4832
+ }
4804
4833
  return { chipClass: "chip--ok", label: i18n.in_operation };
4805
4834
  case DeviceStatusType.STANDBY:
4806
4835
  return { chipClass: "chip--standby", label: i18n.standby };
@@ -4813,6 +4842,7 @@
4813
4842
  return { chipClass: "chip--alert", label: i18n.maintenance };
4814
4843
  case DeviceStatusType.NOT_INSTALLED:
4815
4844
  return { chipClass: "chip--offline", label: i18n.not_installed };
4845
+ // Default (Cai aqui se não achar 'normal', 'hot' etc)
4816
4846
  case DeviceStatusType.NO_INFO:
4817
4847
  default:
4818
4848
  return { chipClass: "chip--offline", label: i18n.offline };
@@ -4844,6 +4874,14 @@
4844
4874
  }
4845
4875
  function getStatusDotClass(deviceStatus) {
4846
4876
  switch (deviceStatus) {
4877
+ // --- Novos Status de Temperatura ---
4878
+ case "normal":
4879
+ return "dot--ok";
4880
+ case "cold":
4881
+ return "dot--standby";
4882
+ case "hot":
4883
+ return "dot--alert";
4884
+ // --- Status Existentes ---
4847
4885
  case DeviceStatusType.POWER_ON:
4848
4886
  return "dot--ok";
4849
4887
  case DeviceStatusType.STANDBY:
@@ -4871,7 +4909,7 @@
4871
4909
  header.className = "myio-ho-card__header";
4872
4910
  const iconContainer = document.createElement("div");
4873
4911
  iconContainer.className = "myio-ho-card__icon";
4874
- iconContainer.innerHTML = getIconSvg(entityObject.deviceType);
4912
+ iconContainer.innerHTML = getIconSvg(entityObject.deviceType, entityObject.domain);
4875
4913
  header.appendChild(iconContainer);
4876
4914
  const titleSection = document.createElement("div");
4877
4915
  titleSection.className = "myio-ho-card__title";
@@ -4993,7 +5031,11 @@
4993
5031
  powerMetric.appendChild(statusDot);
4994
5032
  const powerLabel = document.createElement("div");
4995
5033
  powerLabel.className = "label";
4996
- powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
5034
+ if (entityObject.domain === "water") {
5035
+ powerLabel.textContent = "Leitura";
5036
+ } else {
5037
+ powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
5038
+ }
4997
5039
  powerMetric.appendChild(powerLabel);
4998
5040
  const powerVal = document.createElement("div");
4999
5041
  powerVal.className = "val";
@@ -5017,7 +5059,7 @@
5017
5059
  return true;
5018
5060
  }
5019
5061
  function paint(root, state) {
5020
- const { entityObject, i18n, delayTimeConnectionInMins } = state;
5062
+ const { entityObject, i18n, delayTimeConnectionInMins, isSelected } = state;
5021
5063
  if (entityObject.connectionStatus) {
5022
5064
  if (entityObject.connectionStatus === "offline") {
5023
5065
  entityObject.deviceStatus = DeviceStatusType.NO_INFO;
@@ -5029,16 +5071,23 @@
5029
5071
  }
5030
5072
  const stateClass = getCardStateClass(entityObject.deviceStatus);
5031
5073
  root.className = `myio-ho-card ${stateClass}`;
5032
- const statusInfo = getStatusInfo(entityObject.deviceStatus, i18n);
5074
+ const statusInfo = getStatusInfo(entityObject.deviceStatus, i18n, entityObject.domain);
5033
5075
  const chip = root.querySelector(".chip");
5034
5076
  chip.className = `chip ${statusInfo.chipClass}`;
5035
- chip.textContent = statusInfo.label;
5077
+ chip.innerHTML = statusInfo.label;
5036
5078
  const primaryValue = formatValueByDomain(entityObject.val, entityObject.domain);
5037
5079
  const numSpan = root.querySelector(".myio-ho-card__value .num");
5038
5080
  root.querySelector(".myio-ho-card__value .unit");
5039
5081
  numSpan.textContent = primaryValue;
5040
5082
  const barContainer = root.querySelector(".bar");
5041
5083
  const effContainer = root.querySelector(".myio-ho-card__eff");
5084
+ if (state.enableSelection) {
5085
+ const checkbox = root.querySelector('.myio-ho-card__select input[type="checkbox"]');
5086
+ if (checkbox) {
5087
+ checkbox.checked = !!isSelected;
5088
+ }
5089
+ root.classList.toggle("is-selected", !!isSelected);
5090
+ }
5042
5091
  const targetValue = entityObject.consumptionTargetValue;
5043
5092
  if (targetValue) {
5044
5093
  barContainer.style.display = "";
@@ -5060,9 +5109,14 @@
5060
5109
  }
5061
5110
  const powerVal = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .val");
5062
5111
  if (powerVal) {
5063
- const instantPower = entityObject.instantaneousPower ?? entityObject.consumption_power ?? null;
5064
- const powerFormatted = formatPower(instantPower);
5065
- powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
5112
+ if (entityObject.domain === "water") {
5113
+ const pulses = entityObject.pulses ?? 0;
5114
+ powerVal.textContent = `${pulses} L`;
5115
+ } else {
5116
+ const instantPower = entityObject.instantaneousPower ?? entityObject.consumption_power ?? null;
5117
+ const powerFormatted = formatPower(instantPower);
5118
+ powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
5119
+ }
5066
5120
  }
5067
5121
  const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
5068
5122
  if (statusDot) {
@@ -5122,6 +5176,26 @@
5122
5176
  callbacks.handleActionSettings(e, entityObject);
5123
5177
  });
5124
5178
  }
5179
+ const MyIOSelectionStore2 = window.MyIOLibrary?.MyIOSelectionStore || window.MyIOSelectionStore;
5180
+ if (MyIOSelectionStore2) {
5181
+ const onSelectionChange = () => {
5182
+ const selectedIds = MyIOSelectionStore2.getSelectedIds();
5183
+ const isSelected = selectedIds.includes(entityObject.entityId);
5184
+ if (state.isSelected !== isSelected) {
5185
+ state.isSelected = isSelected;
5186
+ paint(root, state);
5187
+ }
5188
+ };
5189
+ MyIOSelectionStore2.on("selection:change", onSelectionChange);
5190
+ root._selectionListener = onSelectionChange;
5191
+ }
5192
+ root._cleanup = () => {
5193
+ document.removeEventListener("click", closeMenu);
5194
+ document.removeEventListener("keydown", closeMenu);
5195
+ if (MyIOSelectionStore2 && root._selectionListener) {
5196
+ MyIOSelectionStore2.off("selection:change", root._selectionListener);
5197
+ }
5198
+ };
5125
5199
  const checkbox = root.querySelector('.myio-ho-card__select input[type="checkbox"]');
5126
5200
  if (checkbox && callbacks.handleSelect) {
5127
5201
  checkbox.addEventListener("change", (e) => {
@@ -5189,6 +5263,7 @@
5189
5263
  ensureCss();
5190
5264
  const state = normalizeParams(params);
5191
5265
  const root = buildDOM(state);
5266
+ state.isSelected = params.isSelected || false;
5192
5267
  containerEl.appendChild(root);
5193
5268
  bindEvents(root, state, state.callbacks);
5194
5269
  paint(root, state);
@@ -10799,11 +10874,13 @@ ${rangeText}`;
10799
10874
  console.log("[EnergyModalView] Bar mode toggled to:", this.currentBarMode);
10800
10875
  }
10801
10876
  /**
10802
- * Applies the current theme to the modal and charts
10803
- */
10877
+ * Applies the current theme to the modal and charts (Updated with #root override)
10878
+ */
10804
10879
  applyTheme() {
10805
10880
  const themeToggleBtn = document.getElementById("theme-toggle-btn");
10806
- const modalContent = document.querySelector(".myio-energy-modal-scope");
10881
+ const modalContent = this.container;
10882
+ const externalBody = this.container?.closest(".myio-modal-body") || document.querySelector(".myio-modal-body");
10883
+ const rootDiv = document.querySelector("#root > div");
10807
10884
  if (themeToggleBtn) {
10808
10885
  const sunIcon = themeToggleBtn.querySelector(".myio-theme-icon-sun");
10809
10886
  const moonIcon = themeToggleBtn.querySelector(".myio-theme-icon-moon");
@@ -10816,6 +10893,14 @@ ${rangeText}`;
10816
10893
  moonIcon.style.opacity = "0";
10817
10894
  moonIcon.style.transform = "translate(-50%, -50%) rotate(90deg) scale(0)";
10818
10895
  }
10896
+ if (externalBody) {
10897
+ externalBody.style.backgroundColor = "#ffffff";
10898
+ externalBody.style.color = "#1f2937";
10899
+ }
10900
+ if (rootDiv) {
10901
+ rootDiv.style.backgroundColor = "#ffffff";
10902
+ rootDiv.style.color = "#1f2937";
10903
+ }
10819
10904
  } else {
10820
10905
  if (sunIcon) {
10821
10906
  sunIcon.style.opacity = "0";
@@ -10825,6 +10910,14 @@ ${rangeText}`;
10825
10910
  moonIcon.style.opacity = "1";
10826
10911
  moonIcon.style.transform = "translate(-50%, -50%) rotate(0deg) scale(1)";
10827
10912
  }
10913
+ if (externalBody) {
10914
+ externalBody.style.backgroundColor = "#1f1f1f";
10915
+ externalBody.style.color = "#f3f4f6";
10916
+ }
10917
+ if (rootDiv) {
10918
+ rootDiv.style.backgroundColor = "#1f1f1f";
10919
+ rootDiv.style.color = "#f3f4f6";
10920
+ }
10828
10921
  }
10829
10922
  }
10830
10923
  if (modalContent) {
@@ -11053,7 +11146,7 @@ ${rangeText}`;
11053
11146
  ${this.config.params.mode === "comparison" ? `
11054
11147
  <!-- RFC-0097: Granularity Selector (only 1h and 1d supported) -->
11055
11148
  <div class="myio-granularity-selector" style="display: flex; align-items: center; gap: 4px; margin-left: 8px; padding: 4px 8px; background: rgba(0,0,0,0.05); border-radius: 8px;">
11056
- <span style="font-size: 11px; color: #666; margin-right: 4px; white-space: nowrap;">Granularidade:</span>
11149
+ <span class="myio-label-secondary" style="font-size: 11px; margin-right: 4px; white-space: nowrap;">Granularidade:</span>
11057
11150
  <button class="myio-btn myio-btn-granularity ${this.currentGranularity === "1h" ? "active" : ""}" data-granularity="1h" title="Hora">1h</button>
11058
11151
  <button class="myio-btn myio-btn-granularity ${this.currentGranularity === "1d" ? "active" : ""}" data-granularity="1d" title="Dia">1d</button>
11059
11152
  </div>
@@ -11735,93 +11828,159 @@ ${rangeText}`;
11735
11828
  return i18n[key] || DEFAULT_I18N2[key];
11736
11829
  }
11737
11830
  /**
11738
- * Gets modal styles with header color matching openDashboardPopupEnergy
11739
- */
11831
+ * Gets modal styles with fixed Dark/Light contrast
11832
+ */
11833
+ /**
11834
+ * Gets modal styles with fixed Chart Border for Light Mode
11835
+ */
11740
11836
  getModalStyles() {
11741
11837
  const styles = this.config.params.styles || {};
11838
+ const defaultPrimary = styles.primaryColor || "#4A148C";
11839
+ const defaultFont = styles.fontFamily || '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
11742
11840
  return `
11841
+ /* --- VARI\xC1VEIS DE TEMA (LIGHT MODE - PADR\xC3O) --- */
11743
11842
  .myio-energy-modal-scope {
11744
- --myio-energy-primary: ${styles.primaryColor || "#4A148C"};
11745
- --myio-energy-bg: ${styles.backgroundColor || "#ffffff"};
11746
- --myio-energy-text: ${styles.textColor || "#1f2937"};
11747
- --myio-energy-border: ${styles.borderColor || "#e5e7eb"};
11748
- --myio-energy-radius: ${styles.borderRadius || "8px"};
11749
- --myio-energy-font: ${styles.fontFamily || '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};
11843
+ --myio-energy-primary: ${defaultPrimary};
11844
+ --myio-energy-font: ${defaultFont};
11845
+ --myio-energy-radius: 8px;
11846
+
11847
+ /* Cores Gerais (Light Mode) */
11848
+ --myio-energy-bg: #ffffff;
11849
+ --myio-energy-text: #1f2937;
11850
+ --myio-energy-text-secondary: #6b7280;
11851
+
11852
+ /* Borda GERAL (para bot\xF5es e inputs) - Cinza suave */
11853
+ --myio-energy-border: #e5e7eb;
11854
+
11855
+ /* Borda ESPEC\xCDFICA DO GR\xC1FICO (Aqui est\xE1 a corre\xE7\xE3o) */
11856
+ /* No Light Mode, definimos como transparente ou branco para "sumir" */
11857
+ --myio-chart-border: transparent;
11858
+
11859
+ --myio-energy-btn-bg: #f3f4f6;
11860
+ --myio-energy-btn-hover: #e5e7eb;
11861
+ --myio-energy-input-bg: #ffffff;
11862
+ --myio-granularity-bg: #f9fafb;
11750
11863
 
11751
11864
  font-family: var(--myio-energy-font);
11865
+ background-color: var(--myio-energy-bg);
11752
11866
  color: var(--myio-energy-text);
11753
11867
  height: -webkit-fill-available;
11868
+ transition: background-color 0.3s ease, color 0.3s ease;
11754
11869
  }
11755
11870
 
11756
- .myio-btn {
11757
- padding: 8px 16px;
11758
- border-radius: var(--myio-energy-radius);
11759
- border: 1px solid var(--myio-energy-border);
11760
- background: var(--myio-energy-bg);
11761
- color: var(--myio-energy-text);
11762
- cursor: pointer;
11763
- font-size: 14px;
11764
- transition: all 0.2s;
11765
- }
11871
+ /* --- DARK MODE OVERRIDES --- */
11872
+ .myio-energy-modal-scope[data-theme="dark"] {
11873
+ --myio-energy-bg: #1f1f1f;
11874
+ --myio-energy-text: #f3f4f6;
11875
+ --myio-energy-text-secondary: #9ca3af;
11876
+
11877
+ /* No Dark Mode, as bordas precisam aparecer */
11878
+ --myio-energy-border: #374151;
11879
+ --myio-chart-border: #374151; /* Borda vis\xEDvel no escuro */
11766
11880
 
11767
- .myio-btn:hover:not(:disabled) {
11768
- background: #f3f4f6;
11881
+ --myio-energy-btn-bg: #374151;
11882
+ --myio-energy-btn-hover: #4b5563;
11883
+ --myio-energy-input-bg: #111827;
11884
+ --myio-granularity-bg: #111827;
11769
11885
  }
11770
11886
 
11771
- .myio-btn:disabled {
11772
- opacity: 0.5;
11773
- cursor: not-allowed;
11774
- }
11887
+ /* --- COMPONENTES --- */
11775
11888
 
11776
- .myio-btn-primary {
11777
- background: var(--myio-energy-primary);
11778
- color: white;
11779
- border-color: var(--myio-energy-primary);
11889
+ .myio-energy-chart-container {
11890
+ flex: 1 !important;
11891
+ min-height: 353px !important;
11892
+ height: 353px !important;
11893
+ background: var(--myio-energy-bg);
11894
+ border-radius: var(--myio-energy-radius);
11895
+
11896
+ /* USO DA VARI\xC1VEL ESPEC\xCDFICA AQUI */
11897
+ border: 1px solid var(--myio-chart-border);
11898
+
11899
+ padding: 10px !important;
11900
+ display: block !important;
11901
+ overflow: hidden !important;
11780
11902
  }
11781
11903
 
11782
- .myio-btn-primary:hover:not(:disabled) {
11783
- background: #6A1B9A;
11904
+ .myio-chart-container {
11905
+ /* Aplica a mesma l\xF3gica para o gr\xE1fico de fallback */
11906
+ border: 1px solid var(--myio-chart-border);
11907
+ border-radius: var(--myio-energy-radius);
11908
+ overflow: hidden;
11784
11909
  }
11785
11910
 
11786
- .myio-btn-secondary {
11787
- background: #f3f4f6;
11788
- color: var(--myio-energy-text);
11789
- border-color: var(--myio-energy-border);
11911
+ /* --- Resto dos estilos (Bot\xF5es, Labels, etc.) --- */
11912
+
11913
+ .myio-label-secondary {
11914
+ color: var(--myio-energy-text-secondary);
11915
+ font-weight: 500;
11790
11916
  }
11791
11917
 
11792
- .myio-btn-secondary:hover:not(:disabled) {
11793
- background: #e5e7eb;
11918
+ .myio-granularity-selector {
11919
+ display: flex;
11920
+ align-items: center;
11921
+ gap: 4px;
11922
+ margin-left: 8px;
11923
+ padding: 4px 8px;
11924
+ border-radius: 8px;
11925
+ background: var(--myio-granularity-bg);
11926
+ border: 1px solid var(--myio-energy-border); /* Granularidade mant\xE9m borda suave */
11794
11927
  }
11795
11928
 
11796
- /* RFC-0097: Granularity selector buttons */
11797
11929
  .myio-btn-granularity {
11798
11930
  padding: 4px 10px;
11799
11931
  font-size: 12px;
11800
11932
  font-weight: 600;
11801
11933
  border-radius: 6px;
11802
- border: 1px solid var(--myio-energy-border);
11803
- background: var(--myio-energy-bg);
11804
- color: var(--myio-energy-text);
11805
11934
  cursor: pointer;
11806
11935
  transition: all 0.2s ease;
11807
11936
  min-width: 36px;
11937
+ background: transparent;
11938
+ border: 1px solid transparent;
11939
+ color: var(--myio-energy-text-secondary);
11808
11940
  }
11809
11941
 
11810
11942
  .myio-btn-granularity:hover:not(.active) {
11811
- background: #f3f4f6;
11812
- border-color: var(--myio-energy-primary);
11813
- color: var(--myio-energy-primary);
11943
+ background: var(--myio-energy-btn-hover);
11944
+ color: var(--myio-energy-text);
11814
11945
  }
11815
11946
 
11816
11947
  .myio-btn-granularity.active {
11817
11948
  background: var(--myio-energy-primary);
11818
11949
  color: white;
11819
11950
  border-color: var(--myio-energy-primary);
11820
- box-shadow: 0 2px 4px rgba(74, 20, 140, 0.25);
11951
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
11821
11952
  }
11822
11953
 
11823
- .myio-granularity-selector {
11954
+ .myio-btn {
11955
+ padding: 8px 16px;
11956
+ border-radius: var(--myio-energy-radius);
11824
11957
  border: 1px solid var(--myio-energy-border);
11958
+ background: var(--myio-energy-btn-bg);
11959
+ color: var(--myio-energy-text);
11960
+ cursor: pointer;
11961
+ font-size: 14px;
11962
+ transition: all 0.2s;
11963
+ }
11964
+
11965
+ .myio-btn:hover:not(:disabled) {
11966
+ background: var(--myio-energy-btn-hover);
11967
+ border-color: var(--myio-energy-border);
11968
+ }
11969
+
11970
+ .myio-btn-primary {
11971
+ background: var(--myio-energy-primary);
11972
+ color: white;
11973
+ border-color: var(--myio-energy-primary);
11974
+ }
11975
+
11976
+ .myio-btn-primary:hover:not(:disabled) {
11977
+ opacity: 0.9;
11978
+ }
11979
+
11980
+ .myio-btn-secondary {
11981
+ background: var(--myio-energy-btn-bg);
11982
+ color: var(--myio-energy-text);
11983
+ border-color: var(--myio-energy-border);
11825
11984
  }
11826
11985
 
11827
11986
  .myio-modal-scope {
@@ -11830,42 +11989,30 @@ ${rangeText}`;
11830
11989
  flex-direction: column !important;
11831
11990
  }
11832
11991
 
11833
- .myio-energy-chart-container {
11834
- flex: 1 !important;
11835
- min-height: 353px !important;
11836
- height: 353px !important;
11837
- background: var(--myio-energy-bg);
11838
- border-radius: var(--myio-energy-radius);
11839
- border: 1px solid var(--myio-energy-border);
11840
- padding: 10px !important;
11841
- display: block !important;
11842
- overflow: hidden !important;
11843
- }
11844
-
11845
- .myio-energy-chart-container > iframe {
11846
- width: 100% !important;
11847
- height: 100% !important;
11848
- min-height: 408px !important;
11849
- border: none !important;
11992
+ .myio-form-group {
11993
+ display: flex;
11994
+ flex-direction: column;
11850
11995
  }
11851
11996
 
11852
- .myio-energy-chart-container iframe,
11853
- .myio-energy-chart-container iframe body,
11854
- .myio-energy-chart-container iframe html {
11855
- height: 100% !important;
11856
- min-height: 408px !important;
11997
+ .myio-label {
11998
+ font-weight: 500;
11999
+ margin-bottom: 5px;
12000
+ color: var(--myio-energy-text);
11857
12001
  }
11858
12002
 
11859
- .myio-energy-chart-container .chart-wrapper,
11860
- .myio-energy-chart-container .chart-container,
11861
- .myio-energy-chart-container canvas,
11862
- .myio-energy-chart-container svg {
11863
- height: 408px !important;
11864
- min-height: 408px !important;
12003
+ .myio-input {
12004
+ padding: 8px 12px;
12005
+ border: 1px solid var(--myio-energy-border);
12006
+ border-radius: var(--myio-energy-radius);
12007
+ font-size: 14px;
12008
+ background: var(--myio-energy-input-bg);
12009
+ color: var(--myio-energy-text);
11865
12010
  }
11866
12011
 
11867
- .myio-loading-state {
11868
- text-align: center;
12012
+ .myio-input:focus {
12013
+ outline: none;
12014
+ border-color: var(--myio-energy-primary);
12015
+ box-shadow: 0 0 0 1px var(--myio-energy-primary);
11869
12016
  }
11870
12017
 
11871
12018
  .myio-spinner {
@@ -11877,78 +12024,40 @@ ${rangeText}`;
11877
12024
  animation: spin 1s linear infinite;
11878
12025
  margin: 0 auto 16px;
11879
12026
  }
11880
-
12027
+
11881
12028
  @keyframes spin {
11882
12029
  0% { transform: rotate(0deg); }
11883
12030
  100% { transform: rotate(360deg); }
11884
12031
  }
11885
12032
 
12033
+ .myio-loading-state p {
12034
+ color: var(--myio-energy-text);
12035
+ }
12036
+
11886
12037
  .myio-energy-error {
11887
- background: #fef2f2;
11888
- border: 1px solid #fecaca;
12038
+ background: rgba(254, 202, 202, 0.15);
12039
+ border: 1px solid rgba(248, 113, 113, 0.5);
11889
12040
  border-radius: var(--myio-energy-radius);
11890
12041
  padding: 16px;
11891
12042
  }
11892
-
11893
- .myio-error-content {
11894
- display: flex;
11895
- align-items: center;
11896
- gap: 12px;
11897
- }
11898
-
11899
- .myio-error-icon {
11900
- font-size: 24px;
11901
- }
11902
-
12043
+
11903
12044
  .myio-error-message {
11904
- color: #dc2626;
12045
+ color: #ef4444;
11905
12046
  font-weight: 500;
11906
12047
  }
11907
12048
 
11908
-
11909
-
11910
- .myio-fallback-chart h4 {
11911
- margin: 0 0 16px 0;
11912
- text-align: center;
11913
- }
11914
-
11915
- .myio-chart-container {
11916
- border: 1px solid var(--myio-energy-border);
11917
- border-radius: var(--myio-energy-radius);
11918
- overflow: hidden;
11919
- }
11920
-
11921
12049
  .myio-chart-note {
11922
12050
  margin: 12px 0 0 0;
11923
12051
  font-size: 12px;
11924
- color: #666;
11925
- text-align: center;
11926
- }
11927
-
11928
- .myio-form-group {
11929
- display: flex;
11930
- flex-direction: column;
11931
- }
11932
-
11933
- .myio-label {
11934
- font-weight: 500;
11935
- margin-bottom: 5px;
11936
- color: var(--myio-energy-text);
11937
- }
11938
-
11939
- .myio-input {
11940
- padding: 8px 12px;
11941
- border: 1px solid var(--myio-energy-border);
11942
- border-radius: var(--myio-energy-radius);
11943
- font-size: 14px;
11944
- background: var(--myio-energy-bg);
11945
12052
  color: var(--myio-energy-text);
12053
+ opacity: 0.7;
12054
+ text-align: center;
11946
12055
  }
11947
12056
 
11948
- .myio-input:focus {
11949
- outline: none;
11950
- border-color: var(--myio-energy-primary);
11951
- box-shadow: 0 0 0 3px rgba(74, 20, 140, 0.1);
12057
+ .myio-energy-chart-container > iframe {
12058
+ width: 100% !important;
12059
+ height: 100% !important;
12060
+ border: none !important;
11952
12061
  }
11953
12062
 
11954
12063
  @media (max-width: 768px) {
@@ -11956,12 +12065,6 @@ ${rangeText}`;
11956
12065
  grid-template-columns: 1fr;
11957
12066
  grid-template-rows: auto 1fr;
11958
12067
  }
11959
-
11960
- .myio-energy-header {
11961
- flex-direction: column;
11962
- gap: 12px;
11963
- align-items: stretch;
11964
- }
11965
12068
  }
11966
12069
  `;
11967
12070
  }