myio-js-library 0.1.62 → 0.1.63
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 +175 -145
- package/dist/index.js +175 -145
- package/dist/myio-js-library.umd.js +175 -145
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6408,12 +6408,15 @@ var EnergyModalView = class {
|
|
|
6408
6408
|
this.setupEventListeners();
|
|
6409
6409
|
}
|
|
6410
6410
|
/**
|
|
6411
|
-
* Creates the main modal content structure -
|
|
6411
|
+
* Creates the main modal content structure - CLEAN LAYOUT, NO BLUR ON MODAL
|
|
6412
6412
|
*/
|
|
6413
6413
|
createModalContent() {
|
|
6414
6414
|
const container = document.createElement("div");
|
|
6415
|
-
container.className = "myio-modal-overlay";
|
|
6416
6415
|
container.id = "dashboard-popup";
|
|
6416
|
+
container.className = "myio-modal-overlay";
|
|
6417
|
+
container.setAttribute("role", "dialog");
|
|
6418
|
+
container.setAttribute("aria-modal", "true");
|
|
6419
|
+
container.setAttribute("aria-labelledby", "modal-title");
|
|
6417
6420
|
const { device } = this.config.context;
|
|
6418
6421
|
const identifier = device.attributes.identifier || "SEM IDENTIFICADOR";
|
|
6419
6422
|
const label = device.label || "SEM ETIQUETA";
|
|
@@ -6422,34 +6425,39 @@ var EnergyModalView = class {
|
|
|
6422
6425
|
${this.getModalStyles()}
|
|
6423
6426
|
</style>
|
|
6424
6427
|
|
|
6425
|
-
<div class="myio-modal energy-report-modal"
|
|
6426
|
-
<!--
|
|
6428
|
+
<div class="myio-modal energy-report-modal">
|
|
6429
|
+
<!-- SINGLE HEADER ONLY -->
|
|
6427
6430
|
<header class="myio-modal__header">
|
|
6428
6431
|
<h2 id="modal-title">Relat\xF3rio de Energia \u2013 ${identifier} \u2013 ${label}</h2>
|
|
6429
6432
|
<button id="close-btn" class="myio-modal__close" aria-label="Fechar">\xD7</button>
|
|
6430
6433
|
</header>
|
|
6431
6434
|
|
|
6432
|
-
<!--
|
|
6435
|
+
<!-- TOOLBAR -->
|
|
6433
6436
|
<div class="myio-modal__toolbar">
|
|
6434
|
-
<
|
|
6435
|
-
|
|
6436
|
-
<button id="load
|
|
6437
|
+
<div class="tb-start">
|
|
6438
|
+
<input type="text" id="energy-date-range" readonly placeholder="Selecione o per\xEDodo">
|
|
6439
|
+
<button id="btn-load" class="btn btn-ghost">
|
|
6437
6440
|
<span class="myio-spinner" id="load-spinner" style="display: none;"></span>
|
|
6438
6441
|
Carregar
|
|
6439
6442
|
</button>
|
|
6440
|
-
|
|
6441
|
-
|
|
6443
|
+
</div>
|
|
6444
|
+
<div class="tb-end">
|
|
6445
|
+
<button id="btn-csv" class="btn btn-ghost" disabled>Exportar CSV</button>
|
|
6446
|
+
<button id="btn-pdf" class="btn btn-premium">Exportar PDF</button>
|
|
6447
|
+
<button id="btn-close" class="btn btn-ghost">Fechar</button>
|
|
6442
6448
|
</div>
|
|
6443
6449
|
</div>
|
|
6444
6450
|
|
|
6445
|
-
<!--
|
|
6451
|
+
<!-- ERROR CONTAINER -->
|
|
6446
6452
|
<div id="energy-error" class="myio-energy-error" style="display: none;">
|
|
6447
6453
|
<!-- Error messages will be displayed here -->
|
|
6448
6454
|
</div>
|
|
6449
6455
|
|
|
6450
|
-
<!--
|
|
6456
|
+
<!-- MAIN CHART CONTAINER - FULL HEIGHT -->
|
|
6451
6457
|
<main class="myio-modal__body">
|
|
6452
6458
|
<div class="chart-iframe-wrap">
|
|
6459
|
+
<iframe id="energy-report-iframe" src="" loading="lazy" title="Energy Chart" style="display: none;">
|
|
6460
|
+
</iframe>
|
|
6453
6461
|
<div id="energy-chart-container" class="myio-energy-chart-container">
|
|
6454
6462
|
<div class="myio-loading-state">
|
|
6455
6463
|
<div class="myio-spinner"></div>
|
|
@@ -6475,6 +6483,11 @@ var EnergyModalView = class {
|
|
|
6475
6483
|
<p>${this.getI18nText("loading")}</p>
|
|
6476
6484
|
</div>
|
|
6477
6485
|
`;
|
|
6486
|
+
this.chartContainer.style.display = "flex";
|
|
6487
|
+
}
|
|
6488
|
+
const iframe = document.getElementById("energy-report-iframe");
|
|
6489
|
+
if (iframe) {
|
|
6490
|
+
iframe.style.display = "none";
|
|
6478
6491
|
}
|
|
6479
6492
|
this.hideError();
|
|
6480
6493
|
}
|
|
@@ -6502,8 +6515,8 @@ var EnergyModalView = class {
|
|
|
6502
6515
|
this.hideLoadingState();
|
|
6503
6516
|
this.hideError();
|
|
6504
6517
|
this.renderChart(energyData);
|
|
6505
|
-
const exportCsvBtn = document.getElementById("
|
|
6506
|
-
const exportPdfBtn = document.getElementById("
|
|
6518
|
+
const exportCsvBtn = document.getElementById("btn-csv");
|
|
6519
|
+
const exportPdfBtn = document.getElementById("btn-pdf");
|
|
6507
6520
|
if (exportCsvBtn) exportCsvBtn.disabled = false;
|
|
6508
6521
|
if (exportPdfBtn) exportPdfBtn.disabled = false;
|
|
6509
6522
|
}
|
|
@@ -6552,19 +6565,12 @@ var EnergyModalView = class {
|
|
|
6552
6565
|
endDate: chartConfig.endDate,
|
|
6553
6566
|
granularity: chartConfig.granularity
|
|
6554
6567
|
});
|
|
6555
|
-
this.chartContainer.
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
iframe.style.width = "100%";
|
|
6562
|
-
iframe.style.height = "100%";
|
|
6563
|
-
iframe.style.border = "0";
|
|
6564
|
-
iframe.style.borderRadius = "12px";
|
|
6565
|
-
iframe.style.background = "#f8f8fb";
|
|
6566
|
-
}
|
|
6567
|
-
}, 100);
|
|
6568
|
+
this.chartContainer.style.display = "none";
|
|
6569
|
+
const iframe = document.getElementById("energy-report-iframe");
|
|
6570
|
+
if (iframe) {
|
|
6571
|
+
iframe.style.display = "block";
|
|
6572
|
+
window.EnergyChartSDK.renderTelemetryChart(iframe.parentElement, chartConfig);
|
|
6573
|
+
}
|
|
6568
6574
|
return true;
|
|
6569
6575
|
}
|
|
6570
6576
|
} catch (error) {
|
|
@@ -6598,18 +6604,21 @@ var EnergyModalView = class {
|
|
|
6598
6604
|
*/
|
|
6599
6605
|
renderFallbackChart(energyData) {
|
|
6600
6606
|
if (!this.chartContainer) return;
|
|
6607
|
+
this.chartContainer.style.display = "flex";
|
|
6608
|
+
const iframe = document.getElementById("energy-report-iframe");
|
|
6609
|
+
if (iframe) {
|
|
6610
|
+
iframe.style.display = "none";
|
|
6611
|
+
}
|
|
6601
6612
|
const chartHTML = `
|
|
6602
|
-
<div class="myio-fallback-chart" style="height: 100%; display: flex; flex-direction: column;">
|
|
6603
|
-
<div style="
|
|
6604
|
-
<div style="
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
</p>
|
|
6612
|
-
</div>
|
|
6613
|
+
<div class="myio-fallback-chart" style="height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;">
|
|
6614
|
+
<div style="text-align: center; color: #666;">
|
|
6615
|
+
<div style="font-size: 48px; margin-bottom: 16px;">\u{1F4CA}</div>
|
|
6616
|
+
<h3 style="margin: 0 0 8px 0; color: #2D1458;">Full-Height Energy Chart</h3>
|
|
6617
|
+
<p style="margin: 0; color: #6b7280; line-height: 1.5;">
|
|
6618
|
+
EnergyChartSDK iframe renders here at 100% height<br>
|
|
6619
|
+
Data points: ${energyData.consumption.length}<br>
|
|
6620
|
+
<strong style="color: #2D1458;">Chart takes all available space</strong>
|
|
6621
|
+
</p>
|
|
6613
6622
|
</div>
|
|
6614
6623
|
</div>
|
|
6615
6624
|
`;
|
|
@@ -6644,65 +6653,72 @@ var EnergyModalView = class {
|
|
|
6644
6653
|
this.downloadCSV(csvContent, `energy-report-${device.id}-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.csv`);
|
|
6645
6654
|
}
|
|
6646
6655
|
/**
|
|
6647
|
-
* Robust PDF export using
|
|
6656
|
+
* Robust PDF export using UMD libraries and iframe handshake
|
|
6648
6657
|
*/
|
|
6649
6658
|
async exportToPdf() {
|
|
6650
|
-
if (!this.currentEnergyData || !this.container) {
|
|
6651
|
-
throw new Error("No data available for export");
|
|
6652
|
-
}
|
|
6653
6659
|
try {
|
|
6654
6660
|
await this.ensurePdfLibs();
|
|
6655
|
-
const { device } = this.config.context;
|
|
6656
|
-
const identifier = device.attributes.identifier || "SEM_IDENTIFICADOR";
|
|
6657
|
-
const startDate = this.config.params.startDate instanceof Date ? this.config.params.startDate.toISOString().split("T")[0] : this.config.params.startDate;
|
|
6658
|
-
const endDate = this.config.params.endDate instanceof Date ? this.config.params.endDate.toISOString().split("T")[0] : this.config.params.endDate;
|
|
6659
|
-
const filename = `EnergyReport_${identifier}_${startDate}_to_${endDate}.pdf`;
|
|
6660
6661
|
const iframe = document.getElementById("energy-report-iframe");
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
try {
|
|
6664
|
-
const requestId = "energy-report:" + Date.now();
|
|
6665
|
-
pngDataUrl = await this.requestIframePng(iframe, requestId, 1200);
|
|
6666
|
-
} catch (error) {
|
|
6667
|
-
console.warn("[EnergyModalView] Iframe handshake failed, using modal capture:", error);
|
|
6668
|
-
pngDataUrl = await this.captureModalAsPng();
|
|
6669
|
-
}
|
|
6670
|
-
} else {
|
|
6671
|
-
pngDataUrl = await this.captureModalAsPng();
|
|
6672
|
-
}
|
|
6662
|
+
const requestId = "energy-pdf:" + Date.now();
|
|
6663
|
+
const png = await this.requestIframePng(iframe, requestId, 1400).catch(() => null);
|
|
6673
6664
|
const { jsPDF } = window.jspdf;
|
|
6674
6665
|
const pdf = new jsPDF({ orientation: "landscape", unit: "px", format: "a4" });
|
|
6675
6666
|
const W = pdf.internal.pageSize.getWidth();
|
|
6676
6667
|
pdf.setFillColor(45, 20, 88);
|
|
6677
|
-
pdf.rect(0, 0, W,
|
|
6668
|
+
pdf.rect(0, 0, W, 56, "F");
|
|
6678
6669
|
pdf.setTextColor(255, 255, 255);
|
|
6679
|
-
pdf.setFontSize(
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6670
|
+
pdf.setFontSize(18);
|
|
6671
|
+
const title = document.getElementById("modal-title")?.textContent || "Relat\xF3rio de Energia";
|
|
6672
|
+
pdf.text(title, 20, 34);
|
|
6673
|
+
if (png) {
|
|
6674
|
+
const img = new Image();
|
|
6675
|
+
img.src = png;
|
|
6676
|
+
await img.decode();
|
|
6677
|
+
const maxW = W - 40;
|
|
6678
|
+
const ratio = img.height / img.width;
|
|
6679
|
+
const drawW = maxW;
|
|
6680
|
+
const drawH = drawW * ratio;
|
|
6681
|
+
pdf.addImage(png, "PNG", 20, 76, drawW, drawH, void 0, "FAST");
|
|
6682
|
+
} else {
|
|
6683
|
+
const toolbar = document.querySelector(".myio-modal__toolbar");
|
|
6684
|
+
if (toolbar) {
|
|
6685
|
+
const cap = await window.html2canvas(toolbar, {
|
|
6686
|
+
backgroundColor: "#ffffff",
|
|
6687
|
+
scale: Math.min(window.devicePixelRatio || 1, 2)
|
|
6688
|
+
});
|
|
6689
|
+
const dataUrl = cap.toDataURL("image/png", 0.92);
|
|
6690
|
+
pdf.addImage(dataUrl, "PNG", 20, 76, W - 40, (W - 40) * (cap.height / cap.width));
|
|
6691
|
+
}
|
|
6692
|
+
pdf.setTextColor(85, 85, 85);
|
|
6693
|
+
pdf.setFontSize(12);
|
|
6694
|
+
pdf.text("Nota: o gr\xE1fico est\xE1 hospedado em iframe cross-origin; use a vers\xE3o integrada/same-origin para exportar o gr\xE1fico completo.", 20, 70);
|
|
6695
|
+
}
|
|
6696
|
+
const fname = this.buildEnergyFileName();
|
|
6697
|
+
pdf.save(fname);
|
|
6690
6698
|
} catch (error) {
|
|
6691
6699
|
console.error("[EnergyModalView] PDF export error:", error);
|
|
6692
6700
|
throw new Error("Failed to export PDF. Please try again.");
|
|
6693
6701
|
}
|
|
6694
6702
|
}
|
|
6695
6703
|
/**
|
|
6696
|
-
*
|
|
6704
|
+
* Build energy filename
|
|
6705
|
+
*/
|
|
6706
|
+
buildEnergyFileName() {
|
|
6707
|
+
const { device } = this.config.context;
|
|
6708
|
+
const identifier = device.attributes.identifier || "SEM_IDENTIFICADOR";
|
|
6709
|
+
const startDate = this.config.params.startDate instanceof Date ? this.config.params.startDate.toISOString().split("T")[0] : this.config.params.startDate;
|
|
6710
|
+
const endDate = this.config.params.endDate instanceof Date ? this.config.params.endDate.toISOString().split("T")[0] : this.config.params.endDate;
|
|
6711
|
+
return `EnergyReport_${identifier}_${startDate}_to_${endDate}.pdf`;
|
|
6712
|
+
}
|
|
6713
|
+
/**
|
|
6714
|
+
* Ensure PDF libraries are loaded from CDN (UMD)
|
|
6697
6715
|
*/
|
|
6698
6716
|
async ensurePdfLibs() {
|
|
6699
|
-
const needH2C = !("html2canvas" in window);
|
|
6700
|
-
const needPDF = !window.jspdf;
|
|
6701
6717
|
const tasks = [];
|
|
6702
|
-
if (
|
|
6718
|
+
if (!window.html2canvas) {
|
|
6703
6719
|
tasks.push(this.loadScript("https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"));
|
|
6704
6720
|
}
|
|
6705
|
-
if (
|
|
6721
|
+
if (!(window.jspdf && window.jspdf.jsPDF)) {
|
|
6706
6722
|
tasks.push(this.loadScript("https://cdn.jsdelivr.net/npm/jspdf@2.5.1/dist/jspdf.umd.min.js"));
|
|
6707
6723
|
}
|
|
6708
6724
|
await Promise.all(tasks);
|
|
@@ -6721,41 +6737,31 @@ var EnergyModalView = class {
|
|
|
6721
6737
|
});
|
|
6722
6738
|
}
|
|
6723
6739
|
/**
|
|
6724
|
-
* Request PNG from iframe via postMessage
|
|
6740
|
+
* Request PNG from iframe via postMessage (same-origin)
|
|
6725
6741
|
*/
|
|
6726
|
-
requestIframePng(iframe, requestId, targetWidth =
|
|
6742
|
+
requestIframePng(iframe, requestId, targetWidth = 1400) {
|
|
6727
6743
|
return new Promise((resolve, reject) => {
|
|
6728
|
-
const timeout = setTimeout(() =>
|
|
6744
|
+
const timeout = setTimeout(() => {
|
|
6745
|
+
cleanup();
|
|
6746
|
+
reject(new Error("iframe timeout"));
|
|
6747
|
+
}, 6e3);
|
|
6748
|
+
function cleanup() {
|
|
6749
|
+
clearTimeout(timeout);
|
|
6750
|
+
window.removeEventListener("message", onMessage);
|
|
6751
|
+
}
|
|
6729
6752
|
function onMessage(ev) {
|
|
6730
6753
|
if (!ev.data || ev.data.type !== "energy-report:png" || ev.data.requestId !== requestId) return;
|
|
6731
|
-
|
|
6732
|
-
clearTimeout(timeout);
|
|
6754
|
+
cleanup();
|
|
6733
6755
|
resolve(ev.data.dataUrl);
|
|
6734
6756
|
}
|
|
6735
6757
|
window.addEventListener("message", onMessage);
|
|
6736
|
-
iframe
|
|
6758
|
+
iframe?.contentWindow?.postMessage({
|
|
6737
6759
|
type: "energy-report:render-png",
|
|
6738
6760
|
requestId,
|
|
6739
6761
|
targetWidth
|
|
6740
6762
|
}, "*");
|
|
6741
6763
|
});
|
|
6742
6764
|
}
|
|
6743
|
-
/**
|
|
6744
|
-
* Capture modal as PNG fallback
|
|
6745
|
-
*/
|
|
6746
|
-
async captureModalAsPng() {
|
|
6747
|
-
const modalElement = this.container?.querySelector(".energy-report-modal");
|
|
6748
|
-
if (!modalElement) {
|
|
6749
|
-
throw new Error("Modal element not found");
|
|
6750
|
-
}
|
|
6751
|
-
const canvas = await window.html2canvas(modalElement, {
|
|
6752
|
-
scale: Math.min(window.devicePixelRatio || 1, 2),
|
|
6753
|
-
backgroundColor: "#ffffff",
|
|
6754
|
-
useCORS: true,
|
|
6755
|
-
allowTaint: true
|
|
6756
|
-
});
|
|
6757
|
-
return canvas.toDataURL("image/png", 0.92);
|
|
6758
|
-
}
|
|
6759
6765
|
/**
|
|
6760
6766
|
* Downloads CSV file
|
|
6761
6767
|
*/
|
|
@@ -6778,9 +6784,9 @@ var EnergyModalView = class {
|
|
|
6778
6784
|
*/
|
|
6779
6785
|
async loadData() {
|
|
6780
6786
|
if (this.isLoading) return;
|
|
6781
|
-
const loadBtn = document.getElementById("load
|
|
6782
|
-
const exportCsvBtn = document.getElementById("
|
|
6783
|
-
const exportPdfBtn = document.getElementById("
|
|
6787
|
+
const loadBtn = document.getElementById("btn-load");
|
|
6788
|
+
const exportCsvBtn = document.getElementById("btn-csv");
|
|
6789
|
+
const exportPdfBtn = document.getElementById("btn-pdf");
|
|
6784
6790
|
const spinner = document.getElementById("load-spinner");
|
|
6785
6791
|
if (!this.dateRangePicker) {
|
|
6786
6792
|
this.showError("Seletor de data n\xE3o inicializado");
|
|
@@ -6814,11 +6820,12 @@ var EnergyModalView = class {
|
|
|
6814
6820
|
* Sets up event listeners
|
|
6815
6821
|
*/
|
|
6816
6822
|
async setupEventListeners() {
|
|
6817
|
-
const exportCsvBtn = document.getElementById("
|
|
6818
|
-
const exportPdfBtn = document.getElementById("
|
|
6823
|
+
const exportCsvBtn = document.getElementById("btn-csv");
|
|
6824
|
+
const exportPdfBtn = document.getElementById("btn-pdf");
|
|
6819
6825
|
const closeBtn = document.getElementById("close-btn");
|
|
6820
|
-
const
|
|
6821
|
-
const
|
|
6826
|
+
const closeBtnToolbar = document.getElementById("btn-close");
|
|
6827
|
+
const loadBtn = document.getElementById("btn-load");
|
|
6828
|
+
const dateRangeInput = document.getElementById("energy-date-range");
|
|
6822
6829
|
if (exportCsvBtn) {
|
|
6823
6830
|
exportCsvBtn.addEventListener("click", () => {
|
|
6824
6831
|
try {
|
|
@@ -6852,6 +6859,11 @@ var EnergyModalView = class {
|
|
|
6852
6859
|
this.modal.close();
|
|
6853
6860
|
});
|
|
6854
6861
|
}
|
|
6862
|
+
if (closeBtnToolbar) {
|
|
6863
|
+
closeBtnToolbar.addEventListener("click", () => {
|
|
6864
|
+
this.modal.close();
|
|
6865
|
+
});
|
|
6866
|
+
}
|
|
6855
6867
|
if (loadBtn) {
|
|
6856
6868
|
loadBtn.addEventListener("click", () => this.loadData());
|
|
6857
6869
|
}
|
|
@@ -6869,20 +6881,23 @@ var EnergyModalView = class {
|
|
|
6869
6881
|
} catch (error) {
|
|
6870
6882
|
console.warn("DateRangePicker initialization failed, using fallback:", error);
|
|
6871
6883
|
}
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6884
|
+
this.applyDynamicHeights();
|
|
6885
|
+
}
|
|
6886
|
+
/**
|
|
6887
|
+
* Apply dynamic heights to prevent iframe squashing
|
|
6888
|
+
*/
|
|
6889
|
+
applyDynamicHeights() {
|
|
6890
|
+
const modal = document.querySelector(".energy-report-modal");
|
|
6891
|
+
const body = document.querySelector(".myio-modal__body");
|
|
6892
|
+
if (!modal || !body) return;
|
|
6893
|
+
body.style.minHeight = "0px";
|
|
6878
6894
|
}
|
|
6879
6895
|
/**
|
|
6880
6896
|
* Helper methods for hiding/showing sections
|
|
6881
6897
|
*/
|
|
6882
6898
|
hideLoadingState() {
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
loadingState.remove();
|
|
6899
|
+
if (this.chartContainer) {
|
|
6900
|
+
this.chartContainer.style.display = "none";
|
|
6886
6901
|
}
|
|
6887
6902
|
}
|
|
6888
6903
|
hideError() {
|
|
@@ -6899,39 +6914,47 @@ var EnergyModalView = class {
|
|
|
6899
6914
|
return i18n[key] || DEFAULT_I18N2[key];
|
|
6900
6915
|
}
|
|
6901
6916
|
/**
|
|
6902
|
-
* Gets modal styles
|
|
6917
|
+
* Gets modal styles - FIXED BLUR ISSUE + PROPER LAYOUT
|
|
6903
6918
|
*/
|
|
6904
6919
|
getModalStyles() {
|
|
6905
6920
|
return `
|
|
6906
|
-
/* Overlay
|
|
6921
|
+
/* === Overlay: blur ONLY the background, NOT the modal === */
|
|
6907
6922
|
.myio-modal-overlay {
|
|
6908
6923
|
position: fixed;
|
|
6909
6924
|
inset: 0;
|
|
6910
|
-
z-index:
|
|
6911
|
-
|
|
6912
|
-
|
|
6925
|
+
z-index: 9998;
|
|
6926
|
+
/* Use the requested brand tint but semi-transparent */
|
|
6927
|
+
background: rgba(150,132,181,0.35); /* #9684B5 @ 35% */
|
|
6928
|
+
backdrop-filter: blur(6px); /* blur the page behind */
|
|
6913
6929
|
display: grid;
|
|
6914
6930
|
place-items: center;
|
|
6915
6931
|
}
|
|
6916
6932
|
|
|
6917
|
-
/*
|
|
6918
|
-
.
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
max-height: 90vh;
|
|
6933
|
+
/* Modal sits ABOVE overlay */
|
|
6934
|
+
.myio-modal {
|
|
6935
|
+
position: relative;
|
|
6936
|
+
z-index: 9999; /* ensure not blurred */
|
|
6922
6937
|
background: #fff;
|
|
6938
|
+
color: #111;
|
|
6923
6939
|
border-radius: 16px;
|
|
6924
6940
|
overflow: hidden;
|
|
6941
|
+
box-shadow: 0 24px 64px rgba(0,0,0,.25);
|
|
6942
|
+
}
|
|
6943
|
+
|
|
6944
|
+
/* Fullscreen-ish layout */
|
|
6945
|
+
.energy-report-modal {
|
|
6946
|
+
width: 96vw;
|
|
6947
|
+
max-width: 96vw;
|
|
6948
|
+
max-height: calc(100vh - 48px);
|
|
6925
6949
|
display: flex;
|
|
6926
|
-
flex-direction: column;
|
|
6927
|
-
box-shadow: 0 24px 64px rgba(0,0,0,0.25);
|
|
6950
|
+
flex-direction: column;
|
|
6928
6951
|
}
|
|
6929
6952
|
|
|
6930
|
-
/*
|
|
6953
|
+
/* Header */
|
|
6931
6954
|
.myio-modal__header {
|
|
6932
6955
|
background: #2D1458;
|
|
6933
6956
|
color: #fff;
|
|
6934
|
-
padding: 16px 20px;
|
|
6957
|
+
padding: 16px 20px;
|
|
6935
6958
|
display: flex;
|
|
6936
6959
|
align-items: center;
|
|
6937
6960
|
justify-content: space-between;
|
|
@@ -6962,29 +6985,29 @@ var EnergyModalView = class {
|
|
|
6962
6985
|
/* Toolbar */
|
|
6963
6986
|
.myio-modal__toolbar {
|
|
6964
6987
|
display: flex;
|
|
6965
|
-
gap: 12px;
|
|
6966
6988
|
align-items: center;
|
|
6967
6989
|
justify-content: space-between;
|
|
6968
|
-
|
|
6969
|
-
|
|
6990
|
+
gap: 12px;
|
|
6991
|
+
padding: 12px 16px;
|
|
6992
|
+
border-bottom: 1px solid rgba(45,20,88,.12);
|
|
6970
6993
|
flex-shrink: 0;
|
|
6971
6994
|
}
|
|
6972
6995
|
|
|
6973
|
-
.
|
|
6996
|
+
.tb-start, .tb-end {
|
|
6974
6997
|
display: flex;
|
|
6975
6998
|
align-items: center;
|
|
6976
6999
|
gap: 12px;
|
|
6977
7000
|
}
|
|
6978
7001
|
|
|
6979
|
-
/* Body
|
|
7002
|
+
/* Body must grow; enable internal scroll only */
|
|
6980
7003
|
.myio-modal__body {
|
|
6981
7004
|
flex: 1 1 auto;
|
|
6982
|
-
min-height: 0;
|
|
6983
|
-
overflow: auto;
|
|
7005
|
+
min-height: 0; /* critical to avoid squashing */
|
|
6984
7006
|
padding: 12px 16px 16px;
|
|
7007
|
+
overflow: auto;
|
|
6985
7008
|
}
|
|
6986
7009
|
|
|
6987
|
-
/*
|
|
7010
|
+
/* Chart area fills the remaining height */
|
|
6988
7011
|
.chart-iframe-wrap {
|
|
6989
7012
|
flex: 1 1 auto;
|
|
6990
7013
|
min-height: 0;
|
|
@@ -6995,14 +7018,20 @@ var EnergyModalView = class {
|
|
|
6995
7018
|
.chart-iframe-wrap iframe,
|
|
6996
7019
|
.myio-energy-chart-container {
|
|
6997
7020
|
flex: 1 1 auto;
|
|
6998
|
-
min-height: 0;
|
|
7021
|
+
min-height: 0;
|
|
6999
7022
|
width: 100%;
|
|
7000
7023
|
height: 100%;
|
|
7001
7024
|
border: 0;
|
|
7002
|
-
border-radius: 12px;
|
|
7025
|
+
border-radius: 12px;
|
|
7003
7026
|
background: #f8f8fb;
|
|
7004
7027
|
}
|
|
7005
7028
|
|
|
7029
|
+
.myio-energy-chart-container {
|
|
7030
|
+
display: flex;
|
|
7031
|
+
align-items: center;
|
|
7032
|
+
justify-content: center;
|
|
7033
|
+
}
|
|
7034
|
+
|
|
7006
7035
|
/* Premium buttons */
|
|
7007
7036
|
.btn {
|
|
7008
7037
|
padding: 8px 12px;
|
|
@@ -7015,6 +7044,7 @@ var EnergyModalView = class {
|
|
|
7015
7044
|
display: flex;
|
|
7016
7045
|
align-items: center;
|
|
7017
7046
|
gap: 4px;
|
|
7047
|
+
background: transparent;
|
|
7018
7048
|
}
|
|
7019
7049
|
|
|
7020
7050
|
.btn:disabled {
|
|
@@ -7024,8 +7054,8 @@ var EnergyModalView = class {
|
|
|
7024
7054
|
|
|
7025
7055
|
.btn-premium {
|
|
7026
7056
|
background: #2D1458;
|
|
7027
|
-
color: #fff;
|
|
7028
|
-
border: 1px solid rgba(255,255,255
|
|
7057
|
+
color: #fff;
|
|
7058
|
+
border: 1px solid rgba(255,255,255,.08);
|
|
7029
7059
|
}
|
|
7030
7060
|
|
|
7031
7061
|
.btn-premium:hover:not(:disabled) {
|
|
@@ -7033,7 +7063,7 @@ var EnergyModalView = class {
|
|
|
7033
7063
|
}
|
|
7034
7064
|
|
|
7035
7065
|
.btn-premium:focus {
|
|
7036
|
-
outline: 3px solid rgba(45,20,88
|
|
7066
|
+
outline: 3px solid rgba(45,20,88,.35);
|
|
7037
7067
|
outline-offset: 2px;
|
|
7038
7068
|
}
|
|
7039
7069
|
|
|
@@ -7048,7 +7078,7 @@ var EnergyModalView = class {
|
|
|
7048
7078
|
}
|
|
7049
7079
|
|
|
7050
7080
|
/* Input styling */
|
|
7051
|
-
|
|
7081
|
+
#energy-date-range {
|
|
7052
7082
|
padding: 8px 12px;
|
|
7053
7083
|
border: 1px solid rgba(45,20,88,0.12);
|
|
7054
7084
|
border-radius: 8px;
|
|
@@ -7058,7 +7088,7 @@ var EnergyModalView = class {
|
|
|
7058
7088
|
width: 300px;
|
|
7059
7089
|
}
|
|
7060
7090
|
|
|
7061
|
-
|
|
7091
|
+
#energy-date-range:focus {
|
|
7062
7092
|
outline: none;
|
|
7063
7093
|
border-color: #2D1458;
|
|
7064
7094
|
box-shadow: 0 0 0 3px rgba(45,20,88,0.1);
|
|
@@ -7121,11 +7151,11 @@ var EnergyModalView = class {
|
|
|
7121
7151
|
gap: 8px;
|
|
7122
7152
|
}
|
|
7123
7153
|
|
|
7124
|
-
.
|
|
7154
|
+
.tb-start, .tb-end {
|
|
7125
7155
|
justify-content: center;
|
|
7126
7156
|
}
|
|
7127
7157
|
|
|
7128
|
-
|
|
7158
|
+
#energy-date-range {
|
|
7129
7159
|
width: 100%;
|
|
7130
7160
|
}
|
|
7131
7161
|
}
|