myio-js-library 0.1.511 → 0.1.513
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 +218 -43
- package/dist/index.d.cts +36 -0
- package/dist/index.js +218 -43
- package/dist/myio-js-library.umd.js +218 -43
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1193,7 +1193,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
1193
1193
|
// package.json
|
|
1194
1194
|
var package_default = {
|
|
1195
1195
|
name: "myio-js-library",
|
|
1196
|
-
version: "0.1.
|
|
1196
|
+
version: "0.1.513",
|
|
1197
1197
|
description: "A clean, standalone JS SDK for MYIO projects",
|
|
1198
1198
|
license: "MIT",
|
|
1199
1199
|
repository: "github:gh-myio/myio-js-library",
|
|
@@ -142528,26 +142528,30 @@ var HEADER_ANNOTATIONS_STYLES = `
|
|
|
142528
142528
|
.myio-vlist-container { /* container is .myio-annotations-body in practice */ }
|
|
142529
142529
|
.myio-vlist-viewport { will-change: transform; }
|
|
142530
142530
|
|
|
142531
|
-
/* Header
|
|
142531
|
+
/* Header \u2014 subtle line in the InfoTooltip/EnergySummaryTooltip pattern.
|
|
142532
|
+
Soft amethyst gradient + thin border, compact padding. */
|
|
142532
142533
|
.myio-annotations-panel-header {
|
|
142533
142534
|
display: flex;
|
|
142534
142535
|
align-items: center;
|
|
142535
142536
|
gap: 8px;
|
|
142536
|
-
padding:
|
|
142537
|
-
border-bottom: 1px solid #
|
|
142538
|
-
background: linear-gradient(
|
|
142537
|
+
padding: 10px 14px;
|
|
142538
|
+
border-bottom: 1px solid #c4b5fd;
|
|
142539
|
+
background: linear-gradient(90deg, #faf9ff 0%, #ede9fe 100%);
|
|
142540
|
+
border-radius: 12px 12px 0 0;
|
|
142541
|
+
cursor: move;
|
|
142542
|
+
user-select: none;
|
|
142543
|
+
}
|
|
142544
|
+
.myio-annotations-icon {
|
|
142545
|
+
font-size: 16px;
|
|
142546
|
+
flex-shrink: 0;
|
|
142539
142547
|
}
|
|
142540
142548
|
.myio-annotations-panel-title {
|
|
142541
|
-
flex: 1;
|
|
142542
142549
|
margin: 0;
|
|
142543
|
-
font-size:
|
|
142550
|
+
font-size: 14px;
|
|
142544
142551
|
font-weight: 700;
|
|
142545
142552
|
color: #4c3aac;
|
|
142546
|
-
letter-spacing:
|
|
142547
|
-
|
|
142548
|
-
.myio-annotations-panel-title .myio-annotations-icon {
|
|
142549
|
-
margin-right: 6px;
|
|
142550
|
-
font-size: 16px;
|
|
142553
|
+
letter-spacing: 0.2px;
|
|
142554
|
+
flex-shrink: 0;
|
|
142551
142555
|
}
|
|
142552
142556
|
.myio-annotations-panel-meta {
|
|
142553
142557
|
font-size: 11px;
|
|
@@ -142927,22 +142931,19 @@ var HEADER_ANNOTATIONS_STYLES = `
|
|
|
142927
142931
|
align-items: flex-end;
|
|
142928
142932
|
gap: 4px;
|
|
142929
142933
|
}
|
|
142934
|
+
/* Importance badge \u2014 label + color come from inline style (RFC-0104
|
|
142935
|
+
canonical colors). Padding leaves room for "Muito Baixa"/"Muito Alta". */
|
|
142930
142936
|
.myio-annotations-importance-badge {
|
|
142931
142937
|
display: inline-block;
|
|
142932
|
-
|
|
142933
|
-
padding: 2px 6px;
|
|
142938
|
+
padding: 2px 8px;
|
|
142934
142939
|
border-radius: 10px;
|
|
142935
142940
|
font-size: 10px;
|
|
142936
142941
|
font-weight: 700;
|
|
142937
142942
|
color: #fff;
|
|
142938
142943
|
text-align: center;
|
|
142939
|
-
line-height: 1.
|
|
142944
|
+
line-height: 1.3;
|
|
142945
|
+
white-space: nowrap;
|
|
142940
142946
|
}
|
|
142941
|
-
.myio-annotations-importance-1 { background: #94a3b8; }
|
|
142942
|
-
.myio-annotations-importance-2 { background: #64748b; }
|
|
142943
|
-
.myio-annotations-importance-3 { background: #6c5ce7; }
|
|
142944
|
-
.myio-annotations-importance-4 { background: #f59e0b; }
|
|
142945
|
-
.myio-annotations-importance-5 { background: #dc2626; }
|
|
142946
142947
|
|
|
142947
142948
|
.myio-annotations-overdue {
|
|
142948
142949
|
font-size: 10px;
|
|
@@ -142972,44 +142973,61 @@ var HEADER_ANNOTATIONS_STYLES = `
|
|
|
142972
142973
|
font-size: 13px;
|
|
142973
142974
|
}
|
|
142974
142975
|
|
|
142975
|
-
/* Footer
|
|
142976
|
+
/* Footer \u2014 modeled on the TELEMETRY_INFO climatiza\xE7\xE3o tooltip:
|
|
142977
|
+
icon-style buttons left + right, subtle meta in the middle. */
|
|
142976
142978
|
.myio-annotations-panel-footer {
|
|
142977
142979
|
display: flex;
|
|
142978
142980
|
align-items: center;
|
|
142979
142981
|
justify-content: space-between;
|
|
142980
|
-
|
|
142982
|
+
gap: 8px;
|
|
142983
|
+
padding: 6px 12px;
|
|
142981
142984
|
border-top: 1px solid #e2e8f0;
|
|
142982
142985
|
background: #fafbff;
|
|
142983
142986
|
font-size: 11px;
|
|
142984
142987
|
color: #64748b;
|
|
142985
142988
|
flex-shrink: 0;
|
|
142986
142989
|
}
|
|
142990
|
+
.myio-annotations-panel-footer-tools {
|
|
142991
|
+
display: flex;
|
|
142992
|
+
align-items: center;
|
|
142993
|
+
gap: 4px;
|
|
142994
|
+
}
|
|
142987
142995
|
.myio-annotations-panel-footer-meta {
|
|
142988
142996
|
flex: 1;
|
|
142989
142997
|
text-align: center;
|
|
142990
142998
|
font-size: 11px;
|
|
142991
142999
|
color: #94a3b8;
|
|
143000
|
+
white-space: nowrap;
|
|
143001
|
+
overflow: hidden;
|
|
143002
|
+
text-overflow: ellipsis;
|
|
142992
143003
|
}
|
|
142993
|
-
.myio-annotations-panel-footer-
|
|
143004
|
+
.myio-annotations-panel-footer-iconbtn {
|
|
142994
143005
|
font: inherit;
|
|
142995
|
-
font-size:
|
|
143006
|
+
font-size: 11px;
|
|
142996
143007
|
font-weight: 600;
|
|
142997
143008
|
color: #4c3aac;
|
|
142998
|
-
background:
|
|
142999
|
-
border: 1px solid rgba(108, 92, 231, 0.
|
|
143009
|
+
background: rgba(108, 92, 231, 0.06);
|
|
143010
|
+
border: 1px solid rgba(108, 92, 231, 0.2);
|
|
143000
143011
|
border-radius: 6px;
|
|
143001
|
-
padding: 4px
|
|
143012
|
+
padding: 4px 8px;
|
|
143002
143013
|
cursor: pointer;
|
|
143003
|
-
|
|
143014
|
+
display: inline-flex;
|
|
143015
|
+
align-items: center;
|
|
143016
|
+
gap: 5px;
|
|
143017
|
+
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
143004
143018
|
}
|
|
143005
|
-
.myio-annotations-panel-footer-
|
|
143006
|
-
background: rgba(108, 92, 231, 0.
|
|
143019
|
+
.myio-annotations-panel-footer-iconbtn:hover {
|
|
143020
|
+
background: rgba(108, 92, 231, 0.14);
|
|
143007
143021
|
border-color: rgba(108, 92, 231, 0.5);
|
|
143022
|
+
color: #3b2e8a;
|
|
143008
143023
|
}
|
|
143009
|
-
.myio-annotations-panel-footer-
|
|
143024
|
+
.myio-annotations-panel-footer-iconbtn:focus-visible {
|
|
143010
143025
|
outline: 2px solid #6c5ce7;
|
|
143011
143026
|
outline-offset: 1px;
|
|
143012
143027
|
}
|
|
143028
|
+
.myio-annotations-panel-footer-iconbtn svg {
|
|
143029
|
+
display: block;
|
|
143030
|
+
}
|
|
143013
143031
|
`;
|
|
143014
143032
|
function injectStylesOnce() {
|
|
143015
143033
|
if (typeof document === "undefined") return;
|
|
@@ -143086,7 +143104,7 @@ function _compareIsoDesc(a, b) {
|
|
|
143086
143104
|
function createDefaultFilter() {
|
|
143087
143105
|
return {
|
|
143088
143106
|
types: /* @__PURE__ */ new Set(),
|
|
143089
|
-
statuses: /* @__PURE__ */ new Set(),
|
|
143107
|
+
statuses: /* @__PURE__ */ new Set(["created", "modified"]),
|
|
143090
143108
|
importance: /* @__PURE__ */ new Set(),
|
|
143091
143109
|
actionableOnly: false,
|
|
143092
143110
|
searchTerm: ""
|
|
@@ -143132,6 +143150,25 @@ var TYPE_ICONS = {
|
|
|
143132
143150
|
maintenance: "\u{1F527}",
|
|
143133
143151
|
activity: "\u2713"
|
|
143134
143152
|
};
|
|
143153
|
+
var IMPORTANCE_LABELS3 = {
|
|
143154
|
+
1: "Muito Baixa",
|
|
143155
|
+
2: "Baixa",
|
|
143156
|
+
3: "Normal",
|
|
143157
|
+
4: "Alta",
|
|
143158
|
+
5: "Muito Alta"
|
|
143159
|
+
};
|
|
143160
|
+
var IMPORTANCE_COLORS4 = {
|
|
143161
|
+
1: "#9E9E9E",
|
|
143162
|
+
// gray
|
|
143163
|
+
2: "#64B5F6",
|
|
143164
|
+
// light blue
|
|
143165
|
+
3: "#2196F3",
|
|
143166
|
+
// blue
|
|
143167
|
+
4: "#FF9800",
|
|
143168
|
+
// orange
|
|
143169
|
+
5: "#F44336"
|
|
143170
|
+
// red
|
|
143171
|
+
};
|
|
143135
143172
|
var ITEM_TEXT_MAX = 120;
|
|
143136
143173
|
function escapeHtml6(input) {
|
|
143137
143174
|
if (input == null) return "";
|
|
@@ -143204,7 +143241,11 @@ function renderAnnotationItemCard(device, annotation, searchTerm) {
|
|
|
143204
143241
|
</div>
|
|
143205
143242
|
</div>
|
|
143206
143243
|
<div class="myio-annotations-item-side">
|
|
143207
|
-
<span
|
|
143244
|
+
<span
|
|
143245
|
+
class="myio-annotations-importance-badge"
|
|
143246
|
+
style="background:${IMPORTANCE_COLORS4[importance]}"
|
|
143247
|
+
title="Import\xE2ncia: ${IMPORTANCE_LABELS3[importance]}"
|
|
143248
|
+
>${IMPORTANCE_LABELS3[importance]}</span>
|
|
143208
143249
|
${overdueTag}
|
|
143209
143250
|
</div>
|
|
143210
143251
|
</button>
|
|
@@ -143823,13 +143864,13 @@ function _formatDate(iso) {
|
|
|
143823
143864
|
var TABS = [
|
|
143824
143865
|
{ id: "identifier", label: "Por Identificador" },
|
|
143825
143866
|
{ id: "device", label: "Por Dispositivo" },
|
|
143826
|
-
{ id: "domain", label: "Por
|
|
143867
|
+
{ id: "domain", label: "Por Tipo de Telemetria" }
|
|
143827
143868
|
];
|
|
143828
143869
|
var TAB_STORAGE_KEY = "myio.annotations.activeTab";
|
|
143829
143870
|
var SORT_STORAGE_KEY = "myio.annotations.sortBy";
|
|
143830
143871
|
var SEARCH_DEBOUNCE_MS = 250;
|
|
143831
143872
|
var PANEL_DOM_ID = "myio-annotations-panel";
|
|
143832
|
-
var HeaderAnnotationsPanel = class {
|
|
143873
|
+
var HeaderAnnotationsPanel = class _HeaderAnnotationsPanel {
|
|
143833
143874
|
root = null;
|
|
143834
143875
|
anchorButton = null;
|
|
143835
143876
|
activeTab = "identifier";
|
|
@@ -143854,6 +143895,10 @@ var HeaderAnnotationsPanel = class {
|
|
|
143854
143895
|
_onFocusTrap;
|
|
143855
143896
|
// Debounce timer for search input
|
|
143856
143897
|
_searchDebounceTimer = null;
|
|
143898
|
+
// RFC-0203 follow-up — hover-to-open + delayed-close pattern (alarm parity)
|
|
143899
|
+
_hideTimer = null;
|
|
143900
|
+
_isMouseOver = false;
|
|
143901
|
+
static DELAYED_HIDE_MS = 450;
|
|
143857
143902
|
constructor(options = {}) {
|
|
143858
143903
|
this.opts = {
|
|
143859
143904
|
getOrchestrator: options.getOrchestrator ?? (() => (typeof window !== "undefined" ? window.AnnotationServiceOrchestrator : null) ?? null),
|
|
@@ -143925,8 +143970,23 @@ var HeaderAnnotationsPanel = class {
|
|
|
143925
143970
|
this.root.setAttribute("aria-hidden", "false");
|
|
143926
143971
|
this.isOpen = true;
|
|
143927
143972
|
this._bindWindowListeners();
|
|
143928
|
-
|
|
143929
|
-
|
|
143973
|
+
this.root.onmouseenter = () => {
|
|
143974
|
+
this._isMouseOver = true;
|
|
143975
|
+
if (this._hideTimer) {
|
|
143976
|
+
clearTimeout(this._hideTimer);
|
|
143977
|
+
this._hideTimer = null;
|
|
143978
|
+
}
|
|
143979
|
+
};
|
|
143980
|
+
this.root.onmouseleave = () => {
|
|
143981
|
+
this._isMouseOver = false;
|
|
143982
|
+
this.startDelayedHide();
|
|
143983
|
+
};
|
|
143984
|
+
if (!this._suppressNextFocus) {
|
|
143985
|
+
const firstTab = this.root.querySelector(
|
|
143986
|
+
'.myio-annotations-tab[aria-selected="true"]'
|
|
143987
|
+
);
|
|
143988
|
+
if (firstTab) firstTab.focus();
|
|
143989
|
+
}
|
|
143930
143990
|
}
|
|
143931
143991
|
/** Hide the panel without destroying it. */
|
|
143932
143992
|
hide() {
|
|
@@ -143947,9 +144007,42 @@ var HeaderAnnotationsPanel = class {
|
|
|
143947
144007
|
if (this.isOpen) this.hide();
|
|
143948
144008
|
else this.show(anchorButton);
|
|
143949
144009
|
}
|
|
144010
|
+
/**
|
|
144011
|
+
* RFC-0203 follow-up — hover-to-open helper for the HEADER button.
|
|
144012
|
+
* Cancels any pending delayed-hide so quickly re-entering keeps the panel.
|
|
144013
|
+
* Does NOT steal keyboard focus (mouse-driven UX).
|
|
144014
|
+
*/
|
|
144015
|
+
showFromHover(anchorButton) {
|
|
144016
|
+
if (this._hideTimer) {
|
|
144017
|
+
clearTimeout(this._hideTimer);
|
|
144018
|
+
this._hideTimer = null;
|
|
144019
|
+
}
|
|
144020
|
+
if (this.isOpen) return;
|
|
144021
|
+
this._suppressNextFocus = true;
|
|
144022
|
+
this.show(anchorButton);
|
|
144023
|
+
this._suppressNextFocus = false;
|
|
144024
|
+
}
|
|
144025
|
+
_suppressNextFocus = false;
|
|
144026
|
+
/**
|
|
144027
|
+
* RFC-0203 follow-up — delayed-hide entry-point invoked from button mouseleave.
|
|
144028
|
+
* Mirrors AlarmNotificationTooltip.startDelayedHide.
|
|
144029
|
+
*/
|
|
144030
|
+
startDelayedHide() {
|
|
144031
|
+
if (this.isPinned) return;
|
|
144032
|
+
if (this._isMouseOver) return;
|
|
144033
|
+
if (this._hideTimer) clearTimeout(this._hideTimer);
|
|
144034
|
+
this._hideTimer = setTimeout(() => {
|
|
144035
|
+
this._hideTimer = null;
|
|
144036
|
+
if (this.isOpen && !this.isPinned && !this._isMouseOver) this.hide();
|
|
144037
|
+
}, _HeaderAnnotationsPanel.DELAYED_HIDE_MS);
|
|
144038
|
+
}
|
|
143950
144039
|
/** Remove the panel DOM + listeners. After this, `show()` recreates. */
|
|
143951
144040
|
destroy() {
|
|
143952
144041
|
this._unbindWindowListeners();
|
|
144042
|
+
if (this._hideTimer) {
|
|
144043
|
+
clearTimeout(this._hideTimer);
|
|
144044
|
+
this._hideTimer = null;
|
|
144045
|
+
}
|
|
143953
144046
|
if (this.vlist) {
|
|
143954
144047
|
this.vlist.destroy();
|
|
143955
144048
|
this.vlist = null;
|
|
@@ -143961,6 +144054,7 @@ var HeaderAnnotationsPanel = class {
|
|
|
143961
144054
|
this.isPinned = false;
|
|
143962
144055
|
this.isMaximized = false;
|
|
143963
144056
|
this.isDragging = false;
|
|
144057
|
+
this._isMouseOver = false;
|
|
143964
144058
|
}
|
|
143965
144059
|
/** Test/inspection helper. */
|
|
143966
144060
|
getActiveTab() {
|
|
@@ -144155,7 +144249,7 @@ var HeaderAnnotationsPanel = class {
|
|
|
144155
144249
|
const bodyHtml = this._renderBody(groups);
|
|
144156
144250
|
return `
|
|
144157
144251
|
<div class="myio-annotations-panel-header" data-region="header" data-drag-handle>
|
|
144158
|
-
<span class="myio-annotations-icon" aria-hidden="true">\
|
|
144252
|
+
<span class="myio-annotations-icon" aria-hidden="true">\u270F\uFE0F</span>
|
|
144159
144253
|
<h2 class="myio-annotations-panel-title" id="${PANEL_DOM_ID}-title">Anota\xE7\xF5es</h2>
|
|
144160
144254
|
<span class="myio-annotations-panel-meta">${totalAllUnfiltered} ativas \xB7 ${pending} pendentes \xB7 ${overdue} vencidas</span>
|
|
144161
144255
|
<div class="myio-annotations-panel-actions">
|
|
@@ -144202,9 +144296,32 @@ var HeaderAnnotationsPanel = class {
|
|
|
144202
144296
|
${this._renderToolbar(filteredCount, totalAllUnfiltered)}
|
|
144203
144297
|
<div class="myio-annotations-body" id="myio-anno-body" role="tabpanel" aria-labelledby="myio-anno-tab-${this.activeTab}">${bodyHtml}</div>
|
|
144204
144298
|
<div class="myio-annotations-panel-footer">
|
|
144205
|
-
<
|
|
144206
|
-
|
|
144207
|
-
|
|
144299
|
+
<div class="myio-annotations-panel-footer-tools">
|
|
144300
|
+
<button class="myio-annotations-panel-footer-iconbtn" type="button" data-action="export-pdf" title="Exportar PDF">
|
|
144301
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor" aria-hidden="true">
|
|
144302
|
+
<path d="M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13z"/>
|
|
144303
|
+
</svg>
|
|
144304
|
+
<span>PDF</span>
|
|
144305
|
+
</button>
|
|
144306
|
+
<button class="myio-annotations-panel-footer-iconbtn" type="button" data-action="export-csv" title="Exportar CSV">
|
|
144307
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor" aria-hidden="true">
|
|
144308
|
+
<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2v-3h2v3zm0-5h-2v-2h2v2zm4 5h-2V8h2v9z"/>
|
|
144309
|
+
</svg>
|
|
144310
|
+
<span>CSV</span>
|
|
144311
|
+
</button>
|
|
144312
|
+
<button class="myio-annotations-panel-footer-iconbtn" type="button" data-action="export" title="Op\xE7\xF5es avan\xE7adas">
|
|
144313
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor" aria-hidden="true">
|
|
144314
|
+
<path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94 0 .32.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/>
|
|
144315
|
+
</svg>
|
|
144316
|
+
</button>
|
|
144317
|
+
</div>
|
|
144318
|
+
<span class="myio-annotations-panel-footer-meta">${groups.length} grupos \xB7 ${filteredCount} anota\xE7\xF5es</span>
|
|
144319
|
+
<button class="myio-annotations-panel-footer-iconbtn" type="button" data-action="refresh" title="Atualizar">
|
|
144320
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="currentColor" aria-hidden="true">
|
|
144321
|
+
<path d="M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>
|
|
144322
|
+
</svg>
|
|
144323
|
+
<span>Atualizar</span>
|
|
144324
|
+
</button>
|
|
144208
144325
|
</div>
|
|
144209
144326
|
`;
|
|
144210
144327
|
}
|
|
@@ -144291,12 +144408,24 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
|
|
|
144291
144408
|
<button type="button" class="myio-annotations-panel-footer-action" data-action="clear-filters">Limpar</button>
|
|
144292
144409
|
</div>`;
|
|
144293
144410
|
}
|
|
144411
|
+
/**
|
|
144412
|
+
* Counts only user-DIVERGING-from-default filters so the toolbar badge
|
|
144413
|
+
* doesn't perpetually show "2" because of the default {created, modified}
|
|
144414
|
+
* status preselection. Default statuses do not count; only:
|
|
144415
|
+
* - selected types
|
|
144416
|
+
* - selected importance levels
|
|
144417
|
+
* - actionable toggle
|
|
144418
|
+
* - 'archived' added to statuses
|
|
144419
|
+
* - 'created' OR 'modified' UNchecked from defaults
|
|
144420
|
+
*/
|
|
144294
144421
|
_activeFilterCount() {
|
|
144295
144422
|
let n = 0;
|
|
144296
144423
|
n += this.filter.types.size;
|
|
144297
|
-
n += this.filter.statuses.size;
|
|
144298
144424
|
n += this.filter.importance.size;
|
|
144299
144425
|
if (this.filter.actionableOnly) n += 1;
|
|
144426
|
+
if (this.filter.statuses.has("archived")) n += 1;
|
|
144427
|
+
if (!this.filter.statuses.has("created")) n += 1;
|
|
144428
|
+
if (!this.filter.statuses.has("modified")) n += 1;
|
|
144300
144429
|
return n;
|
|
144301
144430
|
}
|
|
144302
144431
|
_renderBody(groups) {
|
|
@@ -144304,7 +144433,7 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
|
|
|
144304
144433
|
const hasFilters = this.filter.searchTerm || this._activeFilterCount() > 0;
|
|
144305
144434
|
return `
|
|
144306
144435
|
<div class="myio-annotations-empty">
|
|
144307
|
-
<div class="myio-annotations-empty-icon" aria-hidden="true">\
|
|
144436
|
+
<div class="myio-annotations-empty-icon" aria-hidden="true">\u270F\uFE0F</div>
|
|
144308
144437
|
<div>${hasFilters ? "Nada encontrado para o filtro / busca atual." : "Nenhuma anota\xE7\xE3o ativa."}</div>
|
|
144309
144438
|
</div>`;
|
|
144310
144439
|
}
|
|
@@ -144437,6 +144566,20 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
|
|
|
144437
144566
|
if (exportBtn) {
|
|
144438
144567
|
exportBtn.addEventListener("click", () => this._openExportFlow());
|
|
144439
144568
|
}
|
|
144569
|
+
const exportPdfBtn = this.root.querySelector('[data-action="export-pdf"]');
|
|
144570
|
+
if (exportPdfBtn) {
|
|
144571
|
+
exportPdfBtn.addEventListener(
|
|
144572
|
+
"click",
|
|
144573
|
+
() => this._quickExport({ format: "pdf", levels: ["summary", "consolidated"], scope: "current-tab" })
|
|
144574
|
+
);
|
|
144575
|
+
}
|
|
144576
|
+
const exportCsvBtn = this.root.querySelector('[data-action="export-csv"]');
|
|
144577
|
+
if (exportCsvBtn) {
|
|
144578
|
+
exportCsvBtn.addEventListener(
|
|
144579
|
+
"click",
|
|
144580
|
+
() => this._quickExport({ format: "csv", scope: "current-tab" })
|
|
144581
|
+
);
|
|
144582
|
+
}
|
|
144440
144583
|
const expandAllBtn = this.root.querySelector('[data-action="expand-all"]');
|
|
144441
144584
|
if (expandAllBtn) expandAllBtn.addEventListener("click", () => this._expandAll());
|
|
144442
144585
|
const collapseAllBtn = this.root.querySelector('[data-action="collapse-all"]');
|
|
@@ -144585,6 +144728,38 @@ ${this._renderToolbar(filteredCount, totalAllUnfiltered)}
|
|
|
144585
144728
|
);
|
|
144586
144729
|
}
|
|
144587
144730
|
}
|
|
144731
|
+
/**
|
|
144732
|
+
* RFC-0203 follow-up — Quick export from the footer icons. Skips the modal
|
|
144733
|
+
* for the common case (PDF summary+consolidated, CSV, current tab).
|
|
144734
|
+
*/
|
|
144735
|
+
_quickExport(opts) {
|
|
144736
|
+
const orch = this.opts.getOrchestrator();
|
|
144737
|
+
if (!orch) {
|
|
144738
|
+
this.opts.logger.warn("[HeaderAnnotationsPanel] quickExport: no orchestrator");
|
|
144739
|
+
return;
|
|
144740
|
+
}
|
|
144741
|
+
const customerName = typeof window !== "undefined" && window.MyIOOrchestrator?.customerName || "";
|
|
144742
|
+
try {
|
|
144743
|
+
const devices = this._devicesForScope(opts.scope, orch);
|
|
144744
|
+
if (opts.format === "csv") {
|
|
144745
|
+
exportAnnotationsCsv(devices, {
|
|
144746
|
+
customerName,
|
|
144747
|
+
includeArchived: this.filter.statuses.has("archived")
|
|
144748
|
+
});
|
|
144749
|
+
} else if (opts.format === "pdf") {
|
|
144750
|
+
const fallback = ["summary", "consolidated"];
|
|
144751
|
+
const levels = opts.levels && opts.levels.length > 0 ? opts.levels : fallback;
|
|
144752
|
+
exportAnnotationsPdf(devices, {
|
|
144753
|
+
customerName,
|
|
144754
|
+
levels,
|
|
144755
|
+
includeArchived: this.filter.statuses.has("archived")
|
|
144756
|
+
});
|
|
144757
|
+
}
|
|
144758
|
+
this.opts.logger.debug(`[HeaderAnnotationsPanel] quick-export ${opts.format} ok`);
|
|
144759
|
+
} catch (err) {
|
|
144760
|
+
this.opts.logger.warn("[HeaderAnnotationsPanel] quick-export failed:", err);
|
|
144761
|
+
}
|
|
144762
|
+
}
|
|
144588
144763
|
/**
|
|
144589
144764
|
* RFC-0203 M7 — Opens the export modal and dispatches CSV/PDF generation.
|
|
144590
144765
|
*/
|
package/dist/index.d.cts
CHANGED
|
@@ -19503,6 +19503,9 @@ declare class HeaderAnnotationsPanel {
|
|
|
19503
19503
|
private readonly _onDragEnd;
|
|
19504
19504
|
private readonly _onFocusTrap;
|
|
19505
19505
|
private _searchDebounceTimer;
|
|
19506
|
+
private _hideTimer;
|
|
19507
|
+
private _isMouseOver;
|
|
19508
|
+
private static readonly DELAYED_HIDE_MS;
|
|
19506
19509
|
constructor(options?: HeaderAnnotationsPanelOptions);
|
|
19507
19510
|
/** Render + position + show. Idempotent. */
|
|
19508
19511
|
show(anchorButton: HTMLElement): void;
|
|
@@ -19510,6 +19513,18 @@ declare class HeaderAnnotationsPanel {
|
|
|
19510
19513
|
hide(): void;
|
|
19511
19514
|
/** Toggle convenience. */
|
|
19512
19515
|
toggle(anchorButton: HTMLElement): void;
|
|
19516
|
+
/**
|
|
19517
|
+
* RFC-0203 follow-up — hover-to-open helper for the HEADER button.
|
|
19518
|
+
* Cancels any pending delayed-hide so quickly re-entering keeps the panel.
|
|
19519
|
+
* Does NOT steal keyboard focus (mouse-driven UX).
|
|
19520
|
+
*/
|
|
19521
|
+
showFromHover(anchorButton: HTMLElement): void;
|
|
19522
|
+
private _suppressNextFocus;
|
|
19523
|
+
/**
|
|
19524
|
+
* RFC-0203 follow-up — delayed-hide entry-point invoked from button mouseleave.
|
|
19525
|
+
* Mirrors AlarmNotificationTooltip.startDelayedHide.
|
|
19526
|
+
*/
|
|
19527
|
+
startDelayedHide(): void;
|
|
19513
19528
|
/** Remove the panel DOM + listeners. After this, `show()` recreates. */
|
|
19514
19529
|
destroy(): void;
|
|
19515
19530
|
/** Test/inspection helper. */
|
|
@@ -19544,6 +19559,16 @@ declare class HeaderAnnotationsPanel {
|
|
|
19544
19559
|
private _renderHTML;
|
|
19545
19560
|
private _renderToolbar;
|
|
19546
19561
|
private _renderFilters;
|
|
19562
|
+
/**
|
|
19563
|
+
* Counts only user-DIVERGING-from-default filters so the toolbar badge
|
|
19564
|
+
* doesn't perpetually show "2" because of the default {created, modified}
|
|
19565
|
+
* status preselection. Default statuses do not count; only:
|
|
19566
|
+
* - selected types
|
|
19567
|
+
* - selected importance levels
|
|
19568
|
+
* - actionable toggle
|
|
19569
|
+
* - 'archived' added to statuses
|
|
19570
|
+
* - 'created' OR 'modified' UNchecked from defaults
|
|
19571
|
+
*/
|
|
19547
19572
|
private _activeFilterCount;
|
|
19548
19573
|
private _renderBody;
|
|
19549
19574
|
private _renderGroup;
|
|
@@ -19559,6 +19584,11 @@ declare class HeaderAnnotationsPanel {
|
|
|
19559
19584
|
private _reopenFiltersAfterRender;
|
|
19560
19585
|
private _onTabKeydown;
|
|
19561
19586
|
private _handleItemClick;
|
|
19587
|
+
/**
|
|
19588
|
+
* RFC-0203 follow-up — Quick export from the footer icons. Skips the modal
|
|
19589
|
+
* for the common case (PDF summary+consolidated, CSV, current tab).
|
|
19590
|
+
*/
|
|
19591
|
+
private _quickExport;
|
|
19562
19592
|
/**
|
|
19563
19593
|
* RFC-0203 M7 — Opens the export modal and dispatches CSV/PDF generation.
|
|
19564
19594
|
*/
|
|
@@ -19642,6 +19672,12 @@ declare const DEFAULT_SORT: AnnotationSortKey;
|
|
|
19642
19672
|
* AC-23.
|
|
19643
19673
|
*/
|
|
19644
19674
|
declare function sortGroups(groups: AnnotationGroup[], key: AnnotationSortKey): AnnotationGroup[];
|
|
19675
|
+
/**
|
|
19676
|
+
* Default filter (RFC-0203 follow-up):
|
|
19677
|
+
* - statuses pre-checks {'created','modified'}; 'archived' stays UNchecked
|
|
19678
|
+
* so the panel hides archived by default. User toggles 'archived' to
|
|
19679
|
+
* include archived items (re-fetch is automatic via re-render).
|
|
19680
|
+
*/
|
|
19645
19681
|
declare function createDefaultFilter(): AnnotationFilter;
|
|
19646
19682
|
|
|
19647
19683
|
/**
|