myio-js-library 0.1.189 → 0.1.190
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 +54 -45
- package/dist/index.js +54 -45
- package/dist/myio-js-library.umd.js +54 -45
- package/dist/myio-js-library.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24307,6 +24307,9 @@ var ANNOTATIONS_STYLES = `
|
|
|
24307
24307
|
transition: all 0.2s ease;
|
|
24308
24308
|
font-weight: 600;
|
|
24309
24309
|
font-size: 13px;
|
|
24310
|
+
position: relative;
|
|
24311
|
+
z-index: 10;
|
|
24312
|
+
pointer-events: auto;
|
|
24310
24313
|
}
|
|
24311
24314
|
|
|
24312
24315
|
.annotations-create-btn:hover {
|
|
@@ -24314,15 +24317,22 @@ var ANNOTATIONS_STYLES = `
|
|
|
24314
24317
|
box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
|
|
24315
24318
|
}
|
|
24316
24319
|
|
|
24320
|
+
.annotations-create-btn:active {
|
|
24321
|
+
transform: translateY(0);
|
|
24322
|
+
box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
|
|
24323
|
+
}
|
|
24324
|
+
|
|
24317
24325
|
.annotations-create-btn__icon {
|
|
24318
24326
|
font-size: 28px;
|
|
24319
24327
|
line-height: 1;
|
|
24328
|
+
pointer-events: none;
|
|
24320
24329
|
}
|
|
24321
24330
|
|
|
24322
24331
|
.annotations-create-btn__text {
|
|
24323
24332
|
font-size: 11px;
|
|
24324
24333
|
text-transform: uppercase;
|
|
24325
24334
|
letter-spacing: 0.5px;
|
|
24335
|
+
pointer-events: none;
|
|
24326
24336
|
}
|
|
24327
24337
|
|
|
24328
24338
|
/* New Annotation Modal Overlay */
|
|
@@ -25651,18 +25661,29 @@ var AnnotationsTab = class {
|
|
|
25651
25661
|
}
|
|
25652
25662
|
isOverdue(annotation) {
|
|
25653
25663
|
if (!annotation.dueDate || annotation.status === "archived") return false;
|
|
25654
|
-
|
|
25664
|
+
try {
|
|
25665
|
+
const dueDate = new Date(annotation.dueDate);
|
|
25666
|
+
if (isNaN(dueDate.getTime())) return false;
|
|
25667
|
+
return dueDate < /* @__PURE__ */ new Date();
|
|
25668
|
+
} catch (e) {
|
|
25669
|
+
return false;
|
|
25670
|
+
}
|
|
25655
25671
|
}
|
|
25656
25672
|
formatDate(isoString) {
|
|
25657
25673
|
if (!isoString) return "-";
|
|
25658
|
-
|
|
25659
|
-
|
|
25660
|
-
|
|
25661
|
-
|
|
25662
|
-
|
|
25663
|
-
|
|
25664
|
-
|
|
25665
|
-
|
|
25674
|
+
try {
|
|
25675
|
+
const date = new Date(isoString);
|
|
25676
|
+
if (isNaN(date.getTime())) return "-";
|
|
25677
|
+
return date.toLocaleDateString("pt-BR", {
|
|
25678
|
+
day: "2-digit",
|
|
25679
|
+
month: "2-digit",
|
|
25680
|
+
year: "numeric",
|
|
25681
|
+
hour: "2-digit",
|
|
25682
|
+
minute: "2-digit"
|
|
25683
|
+
});
|
|
25684
|
+
} catch (e) {
|
|
25685
|
+
return "-";
|
|
25686
|
+
}
|
|
25666
25687
|
}
|
|
25667
25688
|
renderCard(annotation) {
|
|
25668
25689
|
const canModify = canModifyAnnotation(annotation, this.permissions);
|
|
@@ -25723,7 +25744,7 @@ var AnnotationsTab = class {
|
|
|
25723
25744
|
const typeColor = ANNOTATION_TYPE_COLORS[annotation.type];
|
|
25724
25745
|
const importanceColor = IMPORTANCE_COLORS[annotation.importance];
|
|
25725
25746
|
const statusColor = STATUS_COLORS[annotation.status];
|
|
25726
|
-
const date =
|
|
25747
|
+
const date = this.formatDate(annotation.createdAt);
|
|
25727
25748
|
const truncatedText = annotation.text.length > 50 ? annotation.text.substring(0, 50) + "..." : annotation.text;
|
|
25728
25749
|
return `
|
|
25729
25750
|
<div class="annotation-row ${annotation.status === "archived" ? "annotation-row--archived" : ""}" data-id="${annotation.id}">
|
|
@@ -25785,9 +25806,13 @@ var AnnotationsTab = class {
|
|
|
25785
25806
|
// ============================================
|
|
25786
25807
|
attachEventListeners() {
|
|
25787
25808
|
const openModalBtn = this.container.querySelector("#open-new-annotation-modal");
|
|
25788
|
-
|
|
25789
|
-
|
|
25790
|
-
|
|
25809
|
+
if (openModalBtn) {
|
|
25810
|
+
openModalBtn.onclick = () => {
|
|
25811
|
+
this.showNewAnnotationModal();
|
|
25812
|
+
};
|
|
25813
|
+
} else {
|
|
25814
|
+
console.warn("[AnnotationsTab] Create button not found");
|
|
25815
|
+
}
|
|
25791
25816
|
this.setupMultiselectDropdown("filter-status", (values) => {
|
|
25792
25817
|
if (values.includes("all") || values.length === 0) {
|
|
25793
25818
|
this.filters.statusList = void 0;
|
|
@@ -26025,16 +26050,14 @@ var AnnotationsTab = class {
|
|
|
26025
26050
|
</div>
|
|
26026
26051
|
</div>
|
|
26027
26052
|
|
|
26028
|
-
<!-- Due Date
|
|
26053
|
+
<!-- Due Date -->
|
|
26029
26054
|
<div class="annotations-form__field" style="margin-bottom: 16px;">
|
|
26030
26055
|
<label class="annotations-form__label">Data Limite (opcional)</label>
|
|
26031
26056
|
<input
|
|
26032
|
-
type="
|
|
26057
|
+
type="datetime-local"
|
|
26033
26058
|
class="annotations-form__input"
|
|
26034
26059
|
id="new-annotation-due-date"
|
|
26035
|
-
|
|
26036
|
-
readonly
|
|
26037
|
-
style="cursor: pointer;"
|
|
26060
|
+
style="cursor: text;"
|
|
26038
26061
|
>
|
|
26039
26062
|
</div>
|
|
26040
26063
|
</div>
|
|
@@ -26083,24 +26106,6 @@ var AnnotationsTab = class {
|
|
|
26083
26106
|
});
|
|
26084
26107
|
}
|
|
26085
26108
|
const dueDateInput = overlay.querySelector("#new-annotation-due-date");
|
|
26086
|
-
if (dueDateInput) {
|
|
26087
|
-
try {
|
|
26088
|
-
this.modalDateRangePicker = await createDateRangePicker2(dueDateInput, {
|
|
26089
|
-
includeTime: true,
|
|
26090
|
-
timePrecision: "minute",
|
|
26091
|
-
locale: "pt-BR",
|
|
26092
|
-
parentEl: overlay.querySelector(".annotations-modal"),
|
|
26093
|
-
onApply: (result) => {
|
|
26094
|
-
dueDateInput.setAttribute("data-due-date", result.startISO);
|
|
26095
|
-
}
|
|
26096
|
-
});
|
|
26097
|
-
} catch (error) {
|
|
26098
|
-
console.warn("[AnnotationsTab] Modal DateRangePicker initialization failed:", error);
|
|
26099
|
-
dueDateInput.type = "datetime-local";
|
|
26100
|
-
dueDateInput.removeAttribute("readonly");
|
|
26101
|
-
dueDateInput.style.cursor = "text";
|
|
26102
|
-
}
|
|
26103
|
-
}
|
|
26104
26109
|
const closeModal = () => {
|
|
26105
26110
|
this.modalDateRangePicker?.destroy?.();
|
|
26106
26111
|
this.modalDateRangePicker = null;
|
|
@@ -26118,11 +26123,15 @@ var AnnotationsTab = class {
|
|
|
26118
26123
|
const selectedImportance = overlay.querySelector(".importance-option.selected");
|
|
26119
26124
|
const importance = parseInt(selectedImportance?.dataset.importance || "3");
|
|
26120
26125
|
let dueDate;
|
|
26121
|
-
|
|
26122
|
-
|
|
26123
|
-
|
|
26124
|
-
|
|
26125
|
-
|
|
26126
|
+
if (dueDateInput?.value) {
|
|
26127
|
+
try {
|
|
26128
|
+
const dateValue = new Date(dueDateInput.value);
|
|
26129
|
+
if (!isNaN(dateValue.getTime())) {
|
|
26130
|
+
dueDate = dateValue.toISOString();
|
|
26131
|
+
}
|
|
26132
|
+
} catch (e) {
|
|
26133
|
+
console.warn("[AnnotationsTab] Invalid due date value:", dueDateInput.value);
|
|
26134
|
+
}
|
|
26126
26135
|
}
|
|
26127
26136
|
const text = textArea.value.trim();
|
|
26128
26137
|
if (text) {
|
|
@@ -26369,12 +26378,12 @@ var AnnotationsTab = class {
|
|
|
26369
26378
|
</div>
|
|
26370
26379
|
<div class="annotation-detail__field">
|
|
26371
26380
|
<div class="annotation-detail__label">Data de Cria\xE7\xE3o</div>
|
|
26372
|
-
<div class="annotation-detail__value">${
|
|
26381
|
+
<div class="annotation-detail__value">${this.formatDate(annotation.createdAt)}</div>
|
|
26373
26382
|
</div>
|
|
26374
26383
|
${annotation.dueDate ? `
|
|
26375
26384
|
<div class="annotation-detail__field">
|
|
26376
26385
|
<div class="annotation-detail__label">Data Limite</div>
|
|
26377
|
-
<div class="annotation-detail__value">${
|
|
26386
|
+
<div class="annotation-detail__value">${this.formatDate(annotation.dueDate)}</div>
|
|
26378
26387
|
</div>
|
|
26379
26388
|
` : ""}
|
|
26380
26389
|
<div class="annotation-detail__field">
|
|
@@ -26385,7 +26394,7 @@ var AnnotationsTab = class {
|
|
|
26385
26394
|
<div class="annotation-detail__field">
|
|
26386
26395
|
<div class="annotation-detail__label">Reconhecido por</div>
|
|
26387
26396
|
<div class="annotation-detail__value">
|
|
26388
|
-
${annotation.acknowledgedBy?.name} em ${
|
|
26397
|
+
${annotation.acknowledgedBy?.name} em ${this.formatDate(annotation.acknowledgedAt || "")}
|
|
26389
26398
|
</div>
|
|
26390
26399
|
</div>
|
|
26391
26400
|
` : ""}
|
|
@@ -26393,7 +26402,7 @@ var AnnotationsTab = class {
|
|
|
26393
26402
|
<div class="annotation-detail__history-title">Hist\xF3rico (${annotation.history.length} eventos)</div>
|
|
26394
26403
|
${annotation.history.map((h) => `
|
|
26395
26404
|
<div class="annotation-detail__history-item">
|
|
26396
|
-
<strong>${h.action}</strong> por ${h.userName} em ${
|
|
26405
|
+
<strong>${h.action}</strong> por ${h.userName} em ${this.formatDate(h.timestamp)}
|
|
26397
26406
|
</div>
|
|
26398
26407
|
`).join("")}
|
|
26399
26408
|
</div>
|
package/dist/index.js
CHANGED
|
@@ -24138,6 +24138,9 @@ var ANNOTATIONS_STYLES = `
|
|
|
24138
24138
|
transition: all 0.2s ease;
|
|
24139
24139
|
font-weight: 600;
|
|
24140
24140
|
font-size: 13px;
|
|
24141
|
+
position: relative;
|
|
24142
|
+
z-index: 10;
|
|
24143
|
+
pointer-events: auto;
|
|
24141
24144
|
}
|
|
24142
24145
|
|
|
24143
24146
|
.annotations-create-btn:hover {
|
|
@@ -24145,15 +24148,22 @@ var ANNOTATIONS_STYLES = `
|
|
|
24145
24148
|
box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
|
|
24146
24149
|
}
|
|
24147
24150
|
|
|
24151
|
+
.annotations-create-btn:active {
|
|
24152
|
+
transform: translateY(0);
|
|
24153
|
+
box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
|
|
24154
|
+
}
|
|
24155
|
+
|
|
24148
24156
|
.annotations-create-btn__icon {
|
|
24149
24157
|
font-size: 28px;
|
|
24150
24158
|
line-height: 1;
|
|
24159
|
+
pointer-events: none;
|
|
24151
24160
|
}
|
|
24152
24161
|
|
|
24153
24162
|
.annotations-create-btn__text {
|
|
24154
24163
|
font-size: 11px;
|
|
24155
24164
|
text-transform: uppercase;
|
|
24156
24165
|
letter-spacing: 0.5px;
|
|
24166
|
+
pointer-events: none;
|
|
24157
24167
|
}
|
|
24158
24168
|
|
|
24159
24169
|
/* New Annotation Modal Overlay */
|
|
@@ -25482,18 +25492,29 @@ var AnnotationsTab = class {
|
|
|
25482
25492
|
}
|
|
25483
25493
|
isOverdue(annotation) {
|
|
25484
25494
|
if (!annotation.dueDate || annotation.status === "archived") return false;
|
|
25485
|
-
|
|
25495
|
+
try {
|
|
25496
|
+
const dueDate = new Date(annotation.dueDate);
|
|
25497
|
+
if (isNaN(dueDate.getTime())) return false;
|
|
25498
|
+
return dueDate < /* @__PURE__ */ new Date();
|
|
25499
|
+
} catch (e) {
|
|
25500
|
+
return false;
|
|
25501
|
+
}
|
|
25486
25502
|
}
|
|
25487
25503
|
formatDate(isoString) {
|
|
25488
25504
|
if (!isoString) return "-";
|
|
25489
|
-
|
|
25490
|
-
|
|
25491
|
-
|
|
25492
|
-
|
|
25493
|
-
|
|
25494
|
-
|
|
25495
|
-
|
|
25496
|
-
|
|
25505
|
+
try {
|
|
25506
|
+
const date = new Date(isoString);
|
|
25507
|
+
if (isNaN(date.getTime())) return "-";
|
|
25508
|
+
return date.toLocaleDateString("pt-BR", {
|
|
25509
|
+
day: "2-digit",
|
|
25510
|
+
month: "2-digit",
|
|
25511
|
+
year: "numeric",
|
|
25512
|
+
hour: "2-digit",
|
|
25513
|
+
minute: "2-digit"
|
|
25514
|
+
});
|
|
25515
|
+
} catch (e) {
|
|
25516
|
+
return "-";
|
|
25517
|
+
}
|
|
25497
25518
|
}
|
|
25498
25519
|
renderCard(annotation) {
|
|
25499
25520
|
const canModify = canModifyAnnotation(annotation, this.permissions);
|
|
@@ -25554,7 +25575,7 @@ var AnnotationsTab = class {
|
|
|
25554
25575
|
const typeColor = ANNOTATION_TYPE_COLORS[annotation.type];
|
|
25555
25576
|
const importanceColor = IMPORTANCE_COLORS[annotation.importance];
|
|
25556
25577
|
const statusColor = STATUS_COLORS[annotation.status];
|
|
25557
|
-
const date =
|
|
25578
|
+
const date = this.formatDate(annotation.createdAt);
|
|
25558
25579
|
const truncatedText = annotation.text.length > 50 ? annotation.text.substring(0, 50) + "..." : annotation.text;
|
|
25559
25580
|
return `
|
|
25560
25581
|
<div class="annotation-row ${annotation.status === "archived" ? "annotation-row--archived" : ""}" data-id="${annotation.id}">
|
|
@@ -25616,9 +25637,13 @@ var AnnotationsTab = class {
|
|
|
25616
25637
|
// ============================================
|
|
25617
25638
|
attachEventListeners() {
|
|
25618
25639
|
const openModalBtn = this.container.querySelector("#open-new-annotation-modal");
|
|
25619
|
-
|
|
25620
|
-
|
|
25621
|
-
|
|
25640
|
+
if (openModalBtn) {
|
|
25641
|
+
openModalBtn.onclick = () => {
|
|
25642
|
+
this.showNewAnnotationModal();
|
|
25643
|
+
};
|
|
25644
|
+
} else {
|
|
25645
|
+
console.warn("[AnnotationsTab] Create button not found");
|
|
25646
|
+
}
|
|
25622
25647
|
this.setupMultiselectDropdown("filter-status", (values) => {
|
|
25623
25648
|
if (values.includes("all") || values.length === 0) {
|
|
25624
25649
|
this.filters.statusList = void 0;
|
|
@@ -25856,16 +25881,14 @@ var AnnotationsTab = class {
|
|
|
25856
25881
|
</div>
|
|
25857
25882
|
</div>
|
|
25858
25883
|
|
|
25859
|
-
<!-- Due Date
|
|
25884
|
+
<!-- Due Date -->
|
|
25860
25885
|
<div class="annotations-form__field" style="margin-bottom: 16px;">
|
|
25861
25886
|
<label class="annotations-form__label">Data Limite (opcional)</label>
|
|
25862
25887
|
<input
|
|
25863
|
-
type="
|
|
25888
|
+
type="datetime-local"
|
|
25864
25889
|
class="annotations-form__input"
|
|
25865
25890
|
id="new-annotation-due-date"
|
|
25866
|
-
|
|
25867
|
-
readonly
|
|
25868
|
-
style="cursor: pointer;"
|
|
25891
|
+
style="cursor: text;"
|
|
25869
25892
|
>
|
|
25870
25893
|
</div>
|
|
25871
25894
|
</div>
|
|
@@ -25914,24 +25937,6 @@ var AnnotationsTab = class {
|
|
|
25914
25937
|
});
|
|
25915
25938
|
}
|
|
25916
25939
|
const dueDateInput = overlay.querySelector("#new-annotation-due-date");
|
|
25917
|
-
if (dueDateInput) {
|
|
25918
|
-
try {
|
|
25919
|
-
this.modalDateRangePicker = await createDateRangePicker2(dueDateInput, {
|
|
25920
|
-
includeTime: true,
|
|
25921
|
-
timePrecision: "minute",
|
|
25922
|
-
locale: "pt-BR",
|
|
25923
|
-
parentEl: overlay.querySelector(".annotations-modal"),
|
|
25924
|
-
onApply: (result) => {
|
|
25925
|
-
dueDateInput.setAttribute("data-due-date", result.startISO);
|
|
25926
|
-
}
|
|
25927
|
-
});
|
|
25928
|
-
} catch (error) {
|
|
25929
|
-
console.warn("[AnnotationsTab] Modal DateRangePicker initialization failed:", error);
|
|
25930
|
-
dueDateInput.type = "datetime-local";
|
|
25931
|
-
dueDateInput.removeAttribute("readonly");
|
|
25932
|
-
dueDateInput.style.cursor = "text";
|
|
25933
|
-
}
|
|
25934
|
-
}
|
|
25935
25940
|
const closeModal = () => {
|
|
25936
25941
|
this.modalDateRangePicker?.destroy?.();
|
|
25937
25942
|
this.modalDateRangePicker = null;
|
|
@@ -25949,11 +25954,15 @@ var AnnotationsTab = class {
|
|
|
25949
25954
|
const selectedImportance = overlay.querySelector(".importance-option.selected");
|
|
25950
25955
|
const importance = parseInt(selectedImportance?.dataset.importance || "3");
|
|
25951
25956
|
let dueDate;
|
|
25952
|
-
|
|
25953
|
-
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
|
|
25957
|
+
if (dueDateInput?.value) {
|
|
25958
|
+
try {
|
|
25959
|
+
const dateValue = new Date(dueDateInput.value);
|
|
25960
|
+
if (!isNaN(dateValue.getTime())) {
|
|
25961
|
+
dueDate = dateValue.toISOString();
|
|
25962
|
+
}
|
|
25963
|
+
} catch (e) {
|
|
25964
|
+
console.warn("[AnnotationsTab] Invalid due date value:", dueDateInput.value);
|
|
25965
|
+
}
|
|
25957
25966
|
}
|
|
25958
25967
|
const text = textArea.value.trim();
|
|
25959
25968
|
if (text) {
|
|
@@ -26200,12 +26209,12 @@ var AnnotationsTab = class {
|
|
|
26200
26209
|
</div>
|
|
26201
26210
|
<div class="annotation-detail__field">
|
|
26202
26211
|
<div class="annotation-detail__label">Data de Cria\xE7\xE3o</div>
|
|
26203
|
-
<div class="annotation-detail__value">${
|
|
26212
|
+
<div class="annotation-detail__value">${this.formatDate(annotation.createdAt)}</div>
|
|
26204
26213
|
</div>
|
|
26205
26214
|
${annotation.dueDate ? `
|
|
26206
26215
|
<div class="annotation-detail__field">
|
|
26207
26216
|
<div class="annotation-detail__label">Data Limite</div>
|
|
26208
|
-
<div class="annotation-detail__value">${
|
|
26217
|
+
<div class="annotation-detail__value">${this.formatDate(annotation.dueDate)}</div>
|
|
26209
26218
|
</div>
|
|
26210
26219
|
` : ""}
|
|
26211
26220
|
<div class="annotation-detail__field">
|
|
@@ -26216,7 +26225,7 @@ var AnnotationsTab = class {
|
|
|
26216
26225
|
<div class="annotation-detail__field">
|
|
26217
26226
|
<div class="annotation-detail__label">Reconhecido por</div>
|
|
26218
26227
|
<div class="annotation-detail__value">
|
|
26219
|
-
${annotation.acknowledgedBy?.name} em ${
|
|
26228
|
+
${annotation.acknowledgedBy?.name} em ${this.formatDate(annotation.acknowledgedAt || "")}
|
|
26220
26229
|
</div>
|
|
26221
26230
|
</div>
|
|
26222
26231
|
` : ""}
|
|
@@ -26224,7 +26233,7 @@ var AnnotationsTab = class {
|
|
|
26224
26233
|
<div class="annotation-detail__history-title">Hist\xF3rico (${annotation.history.length} eventos)</div>
|
|
26225
26234
|
${annotation.history.map((h) => `
|
|
26226
26235
|
<div class="annotation-detail__history-item">
|
|
26227
|
-
<strong>${h.action}</strong> por ${h.userName} em ${
|
|
26236
|
+
<strong>${h.action}</strong> por ${h.userName} em ${this.formatDate(h.timestamp)}
|
|
26228
26237
|
</div>
|
|
26229
26238
|
`).join("")}
|
|
26230
26239
|
</div>
|
|
@@ -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
|
-
|
|
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
|
-
|
|
25304
|
-
|
|
25305
|
-
|
|
25306
|
-
|
|
25307
|
-
|
|
25308
|
-
|
|
25309
|
-
|
|
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 =
|
|
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
|
-
|
|
25434
|
-
|
|
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
|
|
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="
|
|
25702
|
+
type="datetime-local"
|
|
25678
25703
|
class="annotations-form__input"
|
|
25679
25704
|
id="new-annotation-due-date"
|
|
25680
|
-
|
|
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
|
-
|
|
25767
|
-
|
|
25768
|
-
|
|
25769
|
-
|
|
25770
|
-
|
|
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">${
|
|
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">${
|
|
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 ${
|
|
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 ${
|
|
26050
|
+
<strong>${h.action}</strong> por ${h.userName} em ${this.formatDate(h.timestamp)}
|
|
26042
26051
|
</div>
|
|
26043
26052
|
`).join("")}
|
|
26044
26053
|
</div>
|