myio-js-library 0.1.159 → 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.
package/dist/index.cjs CHANGED
@@ -2161,8 +2161,9 @@ var MyIOSelectionStoreClass = class _MyIOSelectionStoreClass {
2161
2161
  lastValue: Number(entity.lastValue) || 0,
2162
2162
  unit: entity.unit || "",
2163
2163
  status: entity.status || "unknown",
2164
- ingestionId: entity.ingestionId || entity.id
2164
+ ingestionId: entity.ingestionId || entity.id,
2165
2165
  // ⭐ ADD: Store ingestionId for API calls
2166
+ customerName: entity.customerName || ""
2166
2167
  };
2167
2168
  this.entities.set(entity.id, normalizedEntity);
2168
2169
  }
@@ -4790,6 +4791,13 @@ var Icons = {
4790
4791
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
4791
4792
  viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false">
4792
4793
  <circle cx="12" cy="12" r="5"/>
4794
+ </svg>`,
4795
+ waterDrop: `
4796
+ <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
4797
+ <g id="water" transform="translate(-4 -2)">
4798
+ <path id="secondary" fill="#2ca9bc" d="M19,14A7,7,0,1,1,5,14C5,8,12,3,12,3S19,8,19,14Z"/>
4799
+ <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"/>
4800
+ </g>
4793
4801
  </svg>`,
4794
4802
  // ⋮ Kebab (for actions menu)
4795
4803
  kebab: `
@@ -4818,6 +4826,7 @@ var ICON_MAP = {
4818
4826
  var DEFAULT_I18N = {
4819
4827
  // Status labels with icons
4820
4828
  in_operation: "\u26A1 Normal",
4829
+ in_operation_water: "\u{1F4A7} Normal",
4821
4830
  standby: "\u{1F4A4} Em standby",
4822
4831
  alert: "\u26A0\uFE0F Alerta",
4823
4832
  failure: "\u{1F6A8} Falha",
@@ -4874,7 +4883,13 @@ function normalizeParams(params) {
4874
4883
  }
4875
4884
  };
4876
4885
  }
4877
- function getIconSvg(deviceType) {
4886
+ function getIconSvg(deviceType, domain) {
4887
+ if (domain === "water") {
4888
+ return Icons.waterDrop;
4889
+ }
4890
+ if (domain === "temperature") {
4891
+ return Icons.thermometer;
4892
+ }
4878
4893
  return ICON_MAP[deviceType] || ICON_MAP.DEFAULT;
4879
4894
  }
4880
4895
  function formatPower(valueInWatts) {
@@ -4914,9 +4929,23 @@ function calculateConsumptionPercentage(target, consumption) {
4914
4929
  const percentage = numericConsumption / numericTarget * 100;
4915
4930
  return percentage;
4916
4931
  }
4917
- function getStatusInfo(deviceStatus, i18n) {
4932
+ function getStatusInfo(deviceStatus, i18n, domain) {
4918
4933
  switch (deviceStatus) {
4934
+ // --- Novos Status de Temperatura ---
4935
+ case "normal":
4936
+ return { chipClass: "chip--ok", label: "Normal" };
4937
+ // Verde/Azul
4938
+ case "cold":
4939
+ return { chipClass: "chip--standby", label: "Frio" };
4940
+ // Azul claro/Ciano
4941
+ case "hot":
4942
+ return { chipClass: "chip--alert", label: "Quente" };
4943
+ // Laranja/Amarelo
4944
+ // --- Status Existentes ---
4919
4945
  case DeviceStatusType.POWER_ON:
4946
+ if (domain === "water") {
4947
+ return { chipClass: "chip--ok", label: i18n.in_operation_water };
4948
+ }
4920
4949
  return { chipClass: "chip--ok", label: i18n.in_operation };
4921
4950
  case DeviceStatusType.STANDBY:
4922
4951
  return { chipClass: "chip--standby", label: i18n.standby };
@@ -4929,6 +4958,7 @@ function getStatusInfo(deviceStatus, i18n) {
4929
4958
  return { chipClass: "chip--alert", label: i18n.maintenance };
4930
4959
  case DeviceStatusType.NOT_INSTALLED:
4931
4960
  return { chipClass: "chip--offline", label: i18n.not_installed };
4961
+ // Default (Cai aqui se não achar 'normal', 'hot' etc)
4932
4962
  case DeviceStatusType.NO_INFO:
4933
4963
  default:
4934
4964
  return { chipClass: "chip--offline", label: i18n.offline };
@@ -4960,6 +4990,14 @@ function getCardStateClass(deviceStatus) {
4960
4990
  }
4961
4991
  function getStatusDotClass(deviceStatus) {
4962
4992
  switch (deviceStatus) {
4993
+ // --- Novos Status de Temperatura ---
4994
+ case "normal":
4995
+ return "dot--ok";
4996
+ case "cold":
4997
+ return "dot--standby";
4998
+ case "hot":
4999
+ return "dot--alert";
5000
+ // --- Status Existentes ---
4963
5001
  case DeviceStatusType.POWER_ON:
4964
5002
  return "dot--ok";
4965
5003
  case DeviceStatusType.STANDBY:
@@ -4987,7 +5025,7 @@ function buildDOM(state) {
4987
5025
  header.className = "myio-ho-card__header";
4988
5026
  const iconContainer = document.createElement("div");
4989
5027
  iconContainer.className = "myio-ho-card__icon";
4990
- iconContainer.innerHTML = getIconSvg(entityObject.deviceType);
5028
+ iconContainer.innerHTML = getIconSvg(entityObject.deviceType, entityObject.domain);
4991
5029
  header.appendChild(iconContainer);
4992
5030
  const titleSection = document.createElement("div");
4993
5031
  titleSection.className = "myio-ho-card__title";
@@ -5109,7 +5147,11 @@ function buildDOM(state) {
5109
5147
  powerMetric.appendChild(statusDot);
5110
5148
  const powerLabel = document.createElement("div");
5111
5149
  powerLabel.className = "label";
5112
- powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
5150
+ if (entityObject.domain === "water") {
5151
+ powerLabel.textContent = "Leitura";
5152
+ } else {
5153
+ powerLabel.textContent = i18n.instantaneous_power || "Pot\xEAncia";
5154
+ }
5113
5155
  powerMetric.appendChild(powerLabel);
5114
5156
  const powerVal = document.createElement("div");
5115
5157
  powerVal.className = "val";
@@ -5133,7 +5175,7 @@ function verifyOfflineStatus(entityObject, delayTimeInMins = 15) {
5133
5175
  return true;
5134
5176
  }
5135
5177
  function paint(root, state) {
5136
- const { entityObject, i18n, delayTimeConnectionInMins } = state;
5178
+ const { entityObject, i18n, delayTimeConnectionInMins, isSelected } = state;
5137
5179
  if (entityObject.connectionStatus) {
5138
5180
  if (entityObject.connectionStatus === "offline") {
5139
5181
  entityObject.deviceStatus = DeviceStatusType.NO_INFO;
@@ -5145,16 +5187,23 @@ function paint(root, state) {
5145
5187
  }
5146
5188
  const stateClass = getCardStateClass(entityObject.deviceStatus);
5147
5189
  root.className = `myio-ho-card ${stateClass}`;
5148
- const statusInfo = getStatusInfo(entityObject.deviceStatus, i18n);
5190
+ const statusInfo = getStatusInfo(entityObject.deviceStatus, i18n, entityObject.domain);
5149
5191
  const chip = root.querySelector(".chip");
5150
5192
  chip.className = `chip ${statusInfo.chipClass}`;
5151
- chip.textContent = statusInfo.label;
5193
+ chip.innerHTML = statusInfo.label;
5152
5194
  const primaryValue = formatValueByDomain(entityObject.val, entityObject.domain);
5153
5195
  const numSpan = root.querySelector(".myio-ho-card__value .num");
5154
5196
  const unitSpan = root.querySelector(".myio-ho-card__value .unit");
5155
5197
  numSpan.textContent = primaryValue;
5156
5198
  const barContainer = root.querySelector(".bar");
5157
5199
  const effContainer = root.querySelector(".myio-ho-card__eff");
5200
+ if (state.enableSelection) {
5201
+ const checkbox = root.querySelector('.myio-ho-card__select input[type="checkbox"]');
5202
+ if (checkbox) {
5203
+ checkbox.checked = !!isSelected;
5204
+ }
5205
+ root.classList.toggle("is-selected", !!isSelected);
5206
+ }
5158
5207
  const targetValue = entityObject.consumptionTargetValue;
5159
5208
  if (targetValue) {
5160
5209
  barContainer.style.display = "";
@@ -5176,9 +5225,14 @@ function paint(root, state) {
5176
5225
  }
5177
5226
  const powerVal = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .val");
5178
5227
  if (powerVal) {
5179
- const instantPower = entityObject.instantaneousPower ?? entityObject.consumption_power ?? null;
5180
- const powerFormatted = formatPower(instantPower);
5181
- powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
5228
+ if (entityObject.domain === "water") {
5229
+ const pulses = entityObject.pulses ?? 0;
5230
+ powerVal.textContent = `${pulses} L`;
5231
+ } else {
5232
+ const instantPower = entityObject.instantaneousPower ?? entityObject.consumption_power ?? null;
5233
+ const powerFormatted = formatPower(instantPower);
5234
+ powerVal.textContent = instantPower !== null ? `${powerFormatted.num} ${powerFormatted.unit}` : "-";
5235
+ }
5182
5236
  }
5183
5237
  const statusDot = root.querySelector(".myio-ho-card__footer .metric:nth-child(2) .status-dot");
5184
5238
  if (statusDot) {
@@ -5238,6 +5292,26 @@ function bindEvents(root, state, callbacks) {
5238
5292
  callbacks.handleActionSettings(e, entityObject);
5239
5293
  });
5240
5294
  }
5295
+ const MyIOSelectionStore2 = window.MyIOLibrary?.MyIOSelectionStore || window.MyIOSelectionStore;
5296
+ if (MyIOSelectionStore2) {
5297
+ const onSelectionChange = () => {
5298
+ const selectedIds = MyIOSelectionStore2.getSelectedIds();
5299
+ const isSelected = selectedIds.includes(entityObject.entityId);
5300
+ if (state.isSelected !== isSelected) {
5301
+ state.isSelected = isSelected;
5302
+ paint(root, state);
5303
+ }
5304
+ };
5305
+ MyIOSelectionStore2.on("selection:change", onSelectionChange);
5306
+ root._selectionListener = onSelectionChange;
5307
+ }
5308
+ root._cleanup = () => {
5309
+ document.removeEventListener("click", closeMenu);
5310
+ document.removeEventListener("keydown", closeMenu);
5311
+ if (MyIOSelectionStore2 && root._selectionListener) {
5312
+ MyIOSelectionStore2.off("selection:change", root._selectionListener);
5313
+ }
5314
+ };
5241
5315
  const checkbox = root.querySelector('.myio-ho-card__select input[type="checkbox"]');
5242
5316
  if (checkbox && callbacks.handleSelect) {
5243
5317
  checkbox.addEventListener("change", (e) => {
@@ -5305,6 +5379,7 @@ function renderCardComponentHeadOffice(containerEl, params) {
5305
5379
  ensureCss();
5306
5380
  const state = normalizeParams(params);
5307
5381
  const root = buildDOM(state);
5382
+ state.isSelected = params.isSelected || false;
5308
5383
  containerEl.appendChild(root);
5309
5384
  bindEvents(root, state, state.callbacks);
5310
5385
  paint(root, state);
@@ -11048,11 +11123,13 @@ var EnergyModalView = class {
11048
11123
  console.log("[EnergyModalView] Bar mode toggled to:", this.currentBarMode);
11049
11124
  }
11050
11125
  /**
11051
- * Applies the current theme to the modal and charts
11052
- */
11126
+ * Applies the current theme to the modal and charts (Updated with #root override)
11127
+ */
11053
11128
  applyTheme() {
11054
11129
  const themeToggleBtn = document.getElementById("theme-toggle-btn");
11055
- const modalContent = document.querySelector(".myio-energy-modal-scope");
11130
+ const modalContent = this.container;
11131
+ const externalBody = this.container?.closest(".myio-modal-body") || document.querySelector(".myio-modal-body");
11132
+ const rootDiv = document.querySelector("#root > div");
11056
11133
  if (themeToggleBtn) {
11057
11134
  const sunIcon = themeToggleBtn.querySelector(".myio-theme-icon-sun");
11058
11135
  const moonIcon = themeToggleBtn.querySelector(".myio-theme-icon-moon");
@@ -11065,6 +11142,14 @@ var EnergyModalView = class {
11065
11142
  moonIcon.style.opacity = "0";
11066
11143
  moonIcon.style.transform = "translate(-50%, -50%) rotate(90deg) scale(0)";
11067
11144
  }
11145
+ if (externalBody) {
11146
+ externalBody.style.backgroundColor = "#ffffff";
11147
+ externalBody.style.color = "#1f2937";
11148
+ }
11149
+ if (rootDiv) {
11150
+ rootDiv.style.backgroundColor = "#ffffff";
11151
+ rootDiv.style.color = "#1f2937";
11152
+ }
11068
11153
  } else {
11069
11154
  if (sunIcon) {
11070
11155
  sunIcon.style.opacity = "0";
@@ -11074,6 +11159,14 @@ var EnergyModalView = class {
11074
11159
  moonIcon.style.opacity = "1";
11075
11160
  moonIcon.style.transform = "translate(-50%, -50%) rotate(0deg) scale(1)";
11076
11161
  }
11162
+ if (externalBody) {
11163
+ externalBody.style.backgroundColor = "#1f1f1f";
11164
+ externalBody.style.color = "#f3f4f6";
11165
+ }
11166
+ if (rootDiv) {
11167
+ rootDiv.style.backgroundColor = "#1f1f1f";
11168
+ rootDiv.style.color = "#f3f4f6";
11169
+ }
11077
11170
  }
11078
11171
  }
11079
11172
  if (modalContent) {
@@ -11302,7 +11395,7 @@ var EnergyModalView = class {
11302
11395
  ${this.config.params.mode === "comparison" ? `
11303
11396
  <!-- RFC-0097: Granularity Selector (only 1h and 1d supported) -->
11304
11397
  <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;">
11305
- <span style="font-size: 11px; color: #666; margin-right: 4px; white-space: nowrap;">Granularidade:</span>
11398
+ <span class="myio-label-secondary" style="font-size: 11px; margin-right: 4px; white-space: nowrap;">Granularidade:</span>
11306
11399
  <button class="myio-btn myio-btn-granularity ${this.currentGranularity === "1h" ? "active" : ""}" data-granularity="1h" title="Hora">1h</button>
11307
11400
  <button class="myio-btn myio-btn-granularity ${this.currentGranularity === "1d" ? "active" : ""}" data-granularity="1d" title="Dia">1d</button>
11308
11401
  </div>
@@ -11984,93 +12077,159 @@ var EnergyModalView = class {
11984
12077
  return i18n[key] || DEFAULT_I18N2[key];
11985
12078
  }
11986
12079
  /**
11987
- * Gets modal styles with header color matching openDashboardPopupEnergy
11988
- */
12080
+ * Gets modal styles with fixed Dark/Light contrast
12081
+ */
12082
+ /**
12083
+ * Gets modal styles with fixed Chart Border for Light Mode
12084
+ */
11989
12085
  getModalStyles() {
11990
12086
  const styles = this.config.params.styles || {};
12087
+ const defaultPrimary = styles.primaryColor || "#4A148C";
12088
+ const defaultFont = styles.fontFamily || '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif';
11991
12089
  return `
12090
+ /* --- VARI\xC1VEIS DE TEMA (LIGHT MODE - PADR\xC3O) --- */
11992
12091
  .myio-energy-modal-scope {
11993
- --myio-energy-primary: ${styles.primaryColor || "#4A148C"};
11994
- --myio-energy-bg: ${styles.backgroundColor || "#ffffff"};
11995
- --myio-energy-text: ${styles.textColor || "#1f2937"};
11996
- --myio-energy-border: ${styles.borderColor || "#e5e7eb"};
11997
- --myio-energy-radius: ${styles.borderRadius || "8px"};
11998
- --myio-energy-font: ${styles.fontFamily || '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};
12092
+ --myio-energy-primary: ${defaultPrimary};
12093
+ --myio-energy-font: ${defaultFont};
12094
+ --myio-energy-radius: 8px;
12095
+
12096
+ /* Cores Gerais (Light Mode) */
12097
+ --myio-energy-bg: #ffffff;
12098
+ --myio-energy-text: #1f2937;
12099
+ --myio-energy-text-secondary: #6b7280;
12100
+
12101
+ /* Borda GERAL (para bot\xF5es e inputs) - Cinza suave */
12102
+ --myio-energy-border: #e5e7eb;
12103
+
12104
+ /* Borda ESPEC\xCDFICA DO GR\xC1FICO (Aqui est\xE1 a corre\xE7\xE3o) */
12105
+ /* No Light Mode, definimos como transparente ou branco para "sumir" */
12106
+ --myio-chart-border: transparent;
12107
+
12108
+ --myio-energy-btn-bg: #f3f4f6;
12109
+ --myio-energy-btn-hover: #e5e7eb;
12110
+ --myio-energy-input-bg: #ffffff;
12111
+ --myio-granularity-bg: #f9fafb;
11999
12112
 
12000
12113
  font-family: var(--myio-energy-font);
12114
+ background-color: var(--myio-energy-bg);
12001
12115
  color: var(--myio-energy-text);
12002
12116
  height: -webkit-fill-available;
12117
+ transition: background-color 0.3s ease, color 0.3s ease;
12003
12118
  }
12004
12119
 
12005
- .myio-btn {
12006
- padding: 8px 16px;
12007
- border-radius: var(--myio-energy-radius);
12008
- border: 1px solid var(--myio-energy-border);
12009
- background: var(--myio-energy-bg);
12010
- color: var(--myio-energy-text);
12011
- cursor: pointer;
12012
- font-size: 14px;
12013
- transition: all 0.2s;
12014
- }
12120
+ /* --- DARK MODE OVERRIDES --- */
12121
+ .myio-energy-modal-scope[data-theme="dark"] {
12122
+ --myio-energy-bg: #1f1f1f;
12123
+ --myio-energy-text: #f3f4f6;
12124
+ --myio-energy-text-secondary: #9ca3af;
12125
+
12126
+ /* No Dark Mode, as bordas precisam aparecer */
12127
+ --myio-energy-border: #374151;
12128
+ --myio-chart-border: #374151; /* Borda vis\xEDvel no escuro */
12015
12129
 
12016
- .myio-btn:hover:not(:disabled) {
12017
- background: #f3f4f6;
12130
+ --myio-energy-btn-bg: #374151;
12131
+ --myio-energy-btn-hover: #4b5563;
12132
+ --myio-energy-input-bg: #111827;
12133
+ --myio-granularity-bg: #111827;
12018
12134
  }
12019
12135
 
12020
- .myio-btn:disabled {
12021
- opacity: 0.5;
12022
- cursor: not-allowed;
12023
- }
12136
+ /* --- COMPONENTES --- */
12024
12137
 
12025
- .myio-btn-primary {
12026
- background: var(--myio-energy-primary);
12027
- color: white;
12028
- border-color: var(--myio-energy-primary);
12138
+ .myio-energy-chart-container {
12139
+ flex: 1 !important;
12140
+ min-height: 353px !important;
12141
+ height: 353px !important;
12142
+ background: var(--myio-energy-bg);
12143
+ border-radius: var(--myio-energy-radius);
12144
+
12145
+ /* USO DA VARI\xC1VEL ESPEC\xCDFICA AQUI */
12146
+ border: 1px solid var(--myio-chart-border);
12147
+
12148
+ padding: 10px !important;
12149
+ display: block !important;
12150
+ overflow: hidden !important;
12029
12151
  }
12030
12152
 
12031
- .myio-btn-primary:hover:not(:disabled) {
12032
- background: #6A1B9A;
12153
+ .myio-chart-container {
12154
+ /* Aplica a mesma l\xF3gica para o gr\xE1fico de fallback */
12155
+ border: 1px solid var(--myio-chart-border);
12156
+ border-radius: var(--myio-energy-radius);
12157
+ overflow: hidden;
12033
12158
  }
12034
12159
 
12035
- .myio-btn-secondary {
12036
- background: #f3f4f6;
12037
- color: var(--myio-energy-text);
12038
- border-color: var(--myio-energy-border);
12160
+ /* --- Resto dos estilos (Bot\xF5es, Labels, etc.) --- */
12161
+
12162
+ .myio-label-secondary {
12163
+ color: var(--myio-energy-text-secondary);
12164
+ font-weight: 500;
12039
12165
  }
12040
12166
 
12041
- .myio-btn-secondary:hover:not(:disabled) {
12042
- background: #e5e7eb;
12167
+ .myio-granularity-selector {
12168
+ display: flex;
12169
+ align-items: center;
12170
+ gap: 4px;
12171
+ margin-left: 8px;
12172
+ padding: 4px 8px;
12173
+ border-radius: 8px;
12174
+ background: var(--myio-granularity-bg);
12175
+ border: 1px solid var(--myio-energy-border); /* Granularidade mant\xE9m borda suave */
12043
12176
  }
12044
12177
 
12045
- /* RFC-0097: Granularity selector buttons */
12046
12178
  .myio-btn-granularity {
12047
12179
  padding: 4px 10px;
12048
12180
  font-size: 12px;
12049
12181
  font-weight: 600;
12050
12182
  border-radius: 6px;
12051
- border: 1px solid var(--myio-energy-border);
12052
- background: var(--myio-energy-bg);
12053
- color: var(--myio-energy-text);
12054
12183
  cursor: pointer;
12055
12184
  transition: all 0.2s ease;
12056
12185
  min-width: 36px;
12186
+ background: transparent;
12187
+ border: 1px solid transparent;
12188
+ color: var(--myio-energy-text-secondary);
12057
12189
  }
12058
12190
 
12059
12191
  .myio-btn-granularity:hover:not(.active) {
12060
- background: #f3f4f6;
12061
- border-color: var(--myio-energy-primary);
12062
- color: var(--myio-energy-primary);
12192
+ background: var(--myio-energy-btn-hover);
12193
+ color: var(--myio-energy-text);
12063
12194
  }
12064
12195
 
12065
12196
  .myio-btn-granularity.active {
12066
12197
  background: var(--myio-energy-primary);
12067
12198
  color: white;
12068
12199
  border-color: var(--myio-energy-primary);
12069
- box-shadow: 0 2px 4px rgba(74, 20, 140, 0.25);
12200
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
12070
12201
  }
12071
12202
 
12072
- .myio-granularity-selector {
12203
+ .myio-btn {
12204
+ padding: 8px 16px;
12205
+ border-radius: var(--myio-energy-radius);
12073
12206
  border: 1px solid var(--myio-energy-border);
12207
+ background: var(--myio-energy-btn-bg);
12208
+ color: var(--myio-energy-text);
12209
+ cursor: pointer;
12210
+ font-size: 14px;
12211
+ transition: all 0.2s;
12212
+ }
12213
+
12214
+ .myio-btn:hover:not(:disabled) {
12215
+ background: var(--myio-energy-btn-hover);
12216
+ border-color: var(--myio-energy-border);
12217
+ }
12218
+
12219
+ .myio-btn-primary {
12220
+ background: var(--myio-energy-primary);
12221
+ color: white;
12222
+ border-color: var(--myio-energy-primary);
12223
+ }
12224
+
12225
+ .myio-btn-primary:hover:not(:disabled) {
12226
+ opacity: 0.9;
12227
+ }
12228
+
12229
+ .myio-btn-secondary {
12230
+ background: var(--myio-energy-btn-bg);
12231
+ color: var(--myio-energy-text);
12232
+ border-color: var(--myio-energy-border);
12074
12233
  }
12075
12234
 
12076
12235
  .myio-modal-scope {
@@ -12079,42 +12238,30 @@ var EnergyModalView = class {
12079
12238
  flex-direction: column !important;
12080
12239
  }
12081
12240
 
12082
- .myio-energy-chart-container {
12083
- flex: 1 !important;
12084
- min-height: 353px !important;
12085
- height: 353px !important;
12086
- background: var(--myio-energy-bg);
12087
- border-radius: var(--myio-energy-radius);
12088
- border: 1px solid var(--myio-energy-border);
12089
- padding: 10px !important;
12090
- display: block !important;
12091
- overflow: hidden !important;
12092
- }
12093
-
12094
- .myio-energy-chart-container > iframe {
12095
- width: 100% !important;
12096
- height: 100% !important;
12097
- min-height: 408px !important;
12098
- border: none !important;
12241
+ .myio-form-group {
12242
+ display: flex;
12243
+ flex-direction: column;
12099
12244
  }
12100
12245
 
12101
- .myio-energy-chart-container iframe,
12102
- .myio-energy-chart-container iframe body,
12103
- .myio-energy-chart-container iframe html {
12104
- height: 100% !important;
12105
- min-height: 408px !important;
12246
+ .myio-label {
12247
+ font-weight: 500;
12248
+ margin-bottom: 5px;
12249
+ color: var(--myio-energy-text);
12106
12250
  }
12107
12251
 
12108
- .myio-energy-chart-container .chart-wrapper,
12109
- .myio-energy-chart-container .chart-container,
12110
- .myio-energy-chart-container canvas,
12111
- .myio-energy-chart-container svg {
12112
- height: 408px !important;
12113
- min-height: 408px !important;
12252
+ .myio-input {
12253
+ padding: 8px 12px;
12254
+ border: 1px solid var(--myio-energy-border);
12255
+ border-radius: var(--myio-energy-radius);
12256
+ font-size: 14px;
12257
+ background: var(--myio-energy-input-bg);
12258
+ color: var(--myio-energy-text);
12114
12259
  }
12115
12260
 
12116
- .myio-loading-state {
12117
- text-align: center;
12261
+ .myio-input:focus {
12262
+ outline: none;
12263
+ border-color: var(--myio-energy-primary);
12264
+ box-shadow: 0 0 0 1px var(--myio-energy-primary);
12118
12265
  }
12119
12266
 
12120
12267
  .myio-spinner {
@@ -12126,78 +12273,40 @@ var EnergyModalView = class {
12126
12273
  animation: spin 1s linear infinite;
12127
12274
  margin: 0 auto 16px;
12128
12275
  }
12129
-
12276
+
12130
12277
  @keyframes spin {
12131
12278
  0% { transform: rotate(0deg); }
12132
12279
  100% { transform: rotate(360deg); }
12133
12280
  }
12134
12281
 
12282
+ .myio-loading-state p {
12283
+ color: var(--myio-energy-text);
12284
+ }
12285
+
12135
12286
  .myio-energy-error {
12136
- background: #fef2f2;
12137
- border: 1px solid #fecaca;
12287
+ background: rgba(254, 202, 202, 0.15);
12288
+ border: 1px solid rgba(248, 113, 113, 0.5);
12138
12289
  border-radius: var(--myio-energy-radius);
12139
12290
  padding: 16px;
12140
12291
  }
12141
-
12142
- .myio-error-content {
12143
- display: flex;
12144
- align-items: center;
12145
- gap: 12px;
12146
- }
12147
-
12148
- .myio-error-icon {
12149
- font-size: 24px;
12150
- }
12151
-
12292
+
12152
12293
  .myio-error-message {
12153
- color: #dc2626;
12294
+ color: #ef4444;
12154
12295
  font-weight: 500;
12155
12296
  }
12156
12297
 
12157
-
12158
-
12159
- .myio-fallback-chart h4 {
12160
- margin: 0 0 16px 0;
12161
- text-align: center;
12162
- }
12163
-
12164
- .myio-chart-container {
12165
- border: 1px solid var(--myio-energy-border);
12166
- border-radius: var(--myio-energy-radius);
12167
- overflow: hidden;
12168
- }
12169
-
12170
12298
  .myio-chart-note {
12171
12299
  margin: 12px 0 0 0;
12172
12300
  font-size: 12px;
12173
- color: #666;
12174
- text-align: center;
12175
- }
12176
-
12177
- .myio-form-group {
12178
- display: flex;
12179
- flex-direction: column;
12180
- }
12181
-
12182
- .myio-label {
12183
- font-weight: 500;
12184
- margin-bottom: 5px;
12185
- color: var(--myio-energy-text);
12186
- }
12187
-
12188
- .myio-input {
12189
- padding: 8px 12px;
12190
- border: 1px solid var(--myio-energy-border);
12191
- border-radius: var(--myio-energy-radius);
12192
- font-size: 14px;
12193
- background: var(--myio-energy-bg);
12194
12301
  color: var(--myio-energy-text);
12302
+ opacity: 0.7;
12303
+ text-align: center;
12195
12304
  }
12196
12305
 
12197
- .myio-input:focus {
12198
- outline: none;
12199
- border-color: var(--myio-energy-primary);
12200
- box-shadow: 0 0 0 3px rgba(74, 20, 140, 0.1);
12306
+ .myio-energy-chart-container > iframe {
12307
+ width: 100% !important;
12308
+ height: 100% !important;
12309
+ border: none !important;
12201
12310
  }
12202
12311
 
12203
12312
  @media (max-width: 768px) {
@@ -12205,12 +12314,6 @@ var EnergyModalView = class {
12205
12314
  grid-template-columns: 1fr;
12206
12315
  grid-template-rows: auto 1fr;
12207
12316
  }
12208
-
12209
- .myio-energy-header {
12210
- flex-direction: column;
12211
- gap: 12px;
12212
- align-items: stretch;
12213
- }
12214
12317
  }
12215
12318
  `;
12216
12319
  }