myio-js-library 0.1.189 → 0.1.192

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.
@@ -23952,6 +23952,9 @@
23952
23952
  transition: all 0.2s ease;
23953
23953
  font-weight: 600;
23954
23954
  font-size: 13px;
23955
+ position: relative;
23956
+ z-index: 10;
23957
+ pointer-events: auto;
23955
23958
  }
23956
23959
 
23957
23960
  .annotations-create-btn:hover {
@@ -23959,15 +23962,22 @@
23959
23962
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
23960
23963
  }
23961
23964
 
23965
+ .annotations-create-btn:active {
23966
+ transform: translateY(0);
23967
+ box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
23968
+ }
23969
+
23962
23970
  .annotations-create-btn__icon {
23963
23971
  font-size: 28px;
23964
23972
  line-height: 1;
23973
+ pointer-events: none;
23965
23974
  }
23966
23975
 
23967
23976
  .annotations-create-btn__text {
23968
23977
  font-size: 11px;
23969
23978
  text-transform: uppercase;
23970
23979
  letter-spacing: 0.5px;
23980
+ pointer-events: none;
23971
23981
  }
23972
23982
 
23973
23983
  /* New Annotation Modal Overlay */
@@ -25296,18 +25306,29 @@
25296
25306
  }
25297
25307
  isOverdue(annotation) {
25298
25308
  if (!annotation.dueDate || annotation.status === "archived") return false;
25299
- return new Date(annotation.dueDate) < /* @__PURE__ */ new Date();
25309
+ try {
25310
+ const dueDate = new Date(annotation.dueDate);
25311
+ if (isNaN(dueDate.getTime())) return false;
25312
+ return dueDate < /* @__PURE__ */ new Date();
25313
+ } catch (e) {
25314
+ return false;
25315
+ }
25300
25316
  }
25301
25317
  formatDate(isoString) {
25302
25318
  if (!isoString) return "-";
25303
- const date = new Date(isoString);
25304
- return date.toLocaleDateString("pt-BR", {
25305
- day: "2-digit",
25306
- month: "2-digit",
25307
- year: "numeric",
25308
- hour: "2-digit",
25309
- minute: "2-digit"
25310
- });
25319
+ try {
25320
+ const date = new Date(isoString);
25321
+ if (isNaN(date.getTime())) return "-";
25322
+ return date.toLocaleDateString("pt-BR", {
25323
+ day: "2-digit",
25324
+ month: "2-digit",
25325
+ year: "numeric",
25326
+ hour: "2-digit",
25327
+ minute: "2-digit"
25328
+ });
25329
+ } catch (e) {
25330
+ return "-";
25331
+ }
25311
25332
  }
25312
25333
  renderCard(annotation) {
25313
25334
  const canModify = canModifyAnnotation(annotation, this.permissions);
@@ -25368,7 +25389,7 @@
25368
25389
  const typeColor = ANNOTATION_TYPE_COLORS[annotation.type];
25369
25390
  const importanceColor = IMPORTANCE_COLORS[annotation.importance];
25370
25391
  const statusColor = STATUS_COLORS[annotation.status];
25371
- const date = new Date(annotation.createdAt).toLocaleString("pt-BR");
25392
+ const date = this.formatDate(annotation.createdAt);
25372
25393
  const truncatedText = annotation.text.length > 50 ? annotation.text.substring(0, 50) + "..." : annotation.text;
25373
25394
  return `
25374
25395
  <div class="annotation-row ${annotation.status === "archived" ? "annotation-row--archived" : ""}" data-id="${annotation.id}">
@@ -25430,9 +25451,13 @@
25430
25451
  // ============================================
25431
25452
  attachEventListeners() {
25432
25453
  const openModalBtn = this.container.querySelector("#open-new-annotation-modal");
25433
- openModalBtn?.addEventListener("click", () => {
25434
- this.showNewAnnotationModal();
25435
- });
25454
+ if (openModalBtn) {
25455
+ openModalBtn.onclick = () => {
25456
+ this.showNewAnnotationModal();
25457
+ };
25458
+ } else {
25459
+ console.warn("[AnnotationsTab] Create button not found");
25460
+ }
25436
25461
  this.setupMultiselectDropdown("filter-status", (values) => {
25437
25462
  if (values.includes("all") || values.length === 0) {
25438
25463
  this.filters.statusList = void 0;
@@ -25670,16 +25695,14 @@
25670
25695
  </div>
25671
25696
  </div>
25672
25697
 
25673
- <!-- Due Date Range -->
25698
+ <!-- Due Date -->
25674
25699
  <div class="annotations-form__field" style="margin-bottom: 16px;">
25675
25700
  <label class="annotations-form__label">Data Limite (opcional)</label>
25676
25701
  <input
25677
- type="text"
25702
+ type="datetime-local"
25678
25703
  class="annotations-form__input"
25679
25704
  id="new-annotation-due-date"
25680
- placeholder="Selecione a data limite..."
25681
- readonly
25682
- style="cursor: pointer;"
25705
+ style="cursor: text;"
25683
25706
  >
25684
25707
  </div>
25685
25708
  </div>
@@ -25728,24 +25751,6 @@
25728
25751
  });
25729
25752
  }
25730
25753
  const dueDateInput = overlay.querySelector("#new-annotation-due-date");
25731
- if (dueDateInput) {
25732
- try {
25733
- this.modalDateRangePicker = await createDateRangePicker2(dueDateInput, {
25734
- includeTime: true,
25735
- timePrecision: "minute",
25736
- locale: "pt-BR",
25737
- parentEl: overlay.querySelector(".annotations-modal"),
25738
- onApply: (result) => {
25739
- dueDateInput.setAttribute("data-due-date", result.startISO);
25740
- }
25741
- });
25742
- } catch (error) {
25743
- console.warn("[AnnotationsTab] Modal DateRangePicker initialization failed:", error);
25744
- dueDateInput.type = "datetime-local";
25745
- dueDateInput.removeAttribute("readonly");
25746
- dueDateInput.style.cursor = "text";
25747
- }
25748
- }
25749
25754
  const closeModal = () => {
25750
25755
  this.modalDateRangePicker?.destroy?.();
25751
25756
  this.modalDateRangePicker = null;
@@ -25763,11 +25768,15 @@
25763
25768
  const selectedImportance = overlay.querySelector(".importance-option.selected");
25764
25769
  const importance = parseInt(selectedImportance?.dataset.importance || "3");
25765
25770
  let dueDate;
25766
- const storedDueDate = dueDateInput?.getAttribute("data-due-date");
25767
- if (storedDueDate) {
25768
- dueDate = storedDueDate;
25769
- } else if (dueDateInput?.value) {
25770
- dueDate = new Date(dueDateInput.value).toISOString();
25771
+ if (dueDateInput?.value) {
25772
+ try {
25773
+ const dateValue = new Date(dueDateInput.value);
25774
+ if (!isNaN(dateValue.getTime())) {
25775
+ dueDate = dateValue.toISOString();
25776
+ }
25777
+ } catch (e) {
25778
+ console.warn("[AnnotationsTab] Invalid due date value:", dueDateInput.value);
25779
+ }
25771
25780
  }
25772
25781
  const text = textArea.value.trim();
25773
25782
  if (text) {
@@ -26014,12 +26023,12 @@
26014
26023
  </div>
26015
26024
  <div class="annotation-detail__field">
26016
26025
  <div class="annotation-detail__label">Data de Cria\xE7\xE3o</div>
26017
- <div class="annotation-detail__value">${new Date(annotation.createdAt).toLocaleString("pt-BR")}</div>
26026
+ <div class="annotation-detail__value">${this.formatDate(annotation.createdAt)}</div>
26018
26027
  </div>
26019
26028
  ${annotation.dueDate ? `
26020
26029
  <div class="annotation-detail__field">
26021
26030
  <div class="annotation-detail__label">Data Limite</div>
26022
- <div class="annotation-detail__value">${new Date(annotation.dueDate).toLocaleDateString("pt-BR")}</div>
26031
+ <div class="annotation-detail__value">${this.formatDate(annotation.dueDate)}</div>
26023
26032
  </div>
26024
26033
  ` : ""}
26025
26034
  <div class="annotation-detail__field">
@@ -26030,7 +26039,7 @@
26030
26039
  <div class="annotation-detail__field">
26031
26040
  <div class="annotation-detail__label">Reconhecido por</div>
26032
26041
  <div class="annotation-detail__value">
26033
- ${annotation.acknowledgedBy?.name} em ${new Date(annotation.acknowledgedAt || "").toLocaleString("pt-BR")}
26042
+ ${annotation.acknowledgedBy?.name} em ${this.formatDate(annotation.acknowledgedAt || "")}
26034
26043
  </div>
26035
26044
  </div>
26036
26045
  ` : ""}
@@ -26038,7 +26047,7 @@
26038
26047
  <div class="annotation-detail__history-title">Hist\xF3rico (${annotation.history.length} eventos)</div>
26039
26048
  ${annotation.history.map((h) => `
26040
26049
  <div class="annotation-detail__history-item">
26041
- <strong>${h.action}</strong> por ${h.userName} em ${new Date(h.timestamp).toLocaleString("pt-BR")}
26050
+ <strong>${h.action}</strong> por ${h.userName} em ${this.formatDate(h.timestamp)}
26042
26051
  </div>
26043
26052
  `).join("")}
26044
26053
  </div>
@@ -34065,10 +34074,18 @@
34065
34074
  offlineDevices: widgetAggregation.offlineDevices || [],
34066
34075
  noConsumptionDevices: widgetAggregation.noConsumptionDevices || []
34067
34076
  };
34077
+ const orchestratorTotal = (widgetAggregation.normal || 0) + (widgetAggregation.alert || 0) + (widgetAggregation.failure || 0) + (widgetAggregation.standby || 0) + (widgetAggregation.offline || 0) + (widgetAggregation.noConsumption || 0);
34078
+ if (orchestratorTotal > 0) {
34079
+ summary.totalDevices = orchestratorTotal;
34080
+ }
34068
34081
  } else {
34069
34082
  const statusAggregation = this._aggregateDeviceStatusFromOrchestrator(domain);
34070
34083
  if (statusAggregation.hasData) {
34071
34084
  summary.byStatus = statusAggregation.byStatus;
34085
+ const orchestratorTotal = statusAggregation.byStatus.normal + statusAggregation.byStatus.alert + statusAggregation.byStatus.failure + statusAggregation.byStatus.standby + statusAggregation.byStatus.offline + statusAggregation.byStatus.noConsumption;
34086
+ if (orchestratorTotal > 0) {
34087
+ summary.totalDevices = orchestratorTotal;
34088
+ }
34072
34089
  } else {
34073
34090
  const totalDevices = summary.totalDevices;
34074
34091
  const statusData = receivedData?.statusCounts || receivedData?.deviceStatus || null;
@@ -35419,10 +35436,18 @@
35419
35436
  offlineDevices: widgetAggregation.offlineDevices || [],
35420
35437
  noConsumptionDevices: widgetAggregation.noConsumptionDevices || []
35421
35438
  };
35439
+ const orchestratorTotal = (widgetAggregation.normal || 0) + (widgetAggregation.alert || 0) + (widgetAggregation.failure || 0) + (widgetAggregation.standby || 0) + (widgetAggregation.offline || 0) + (widgetAggregation.noConsumption || 0);
35440
+ if (orchestratorTotal > 0) {
35441
+ summary.totalDevices = orchestratorTotal;
35442
+ }
35422
35443
  } else {
35423
35444
  const statusAggregation = this._aggregateDeviceStatusFromOrchestrator(domain);
35424
35445
  if (statusAggregation.hasData) {
35425
35446
  summary.byStatus = statusAggregation.byStatus;
35447
+ const orchestratorTotal = statusAggregation.byStatus.normal + statusAggregation.byStatus.alert + statusAggregation.byStatus.failure + statusAggregation.byStatus.standby + statusAggregation.byStatus.offline + statusAggregation.byStatus.noConsumption;
35448
+ if (orchestratorTotal > 0) {
35449
+ summary.totalDevices = orchestratorTotal;
35450
+ }
35426
35451
  } else {
35427
35452
  const totalDevices = summary.totalDevices;
35428
35453
  const statusData = receivedData?.statusCounts || receivedData?.deviceStatus || null;