tsviewer 1.0.26 → 1.0.28

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.
@@ -0,0 +1,249 @@
1
+ import "./base-CIy5gWpu.mjs";
2
+ import { E as k } from "./el-overlay-_Fd7WVZL.mjs";
3
+ import { createElementBlock as a, openBlock as i, normalizeClass as T, createCommentVNode as f, createElementVNode as s, renderSlot as d, toDisplayString as u, resolveComponent as B, createBlock as A, withCtx as c, createVNode as r, Fragment as x, createTextVNode as h } from "vue";
4
+ import { e as m, p as V } from "./index-BtnXpu3W.mjs";
5
+ import N from "./BFButton-V2zgKAQA.mjs";
6
+ import { p as C } from "./pathOr-DE7WGRqe.mjs";
7
+ const U = {
8
+ name: "DialogBody",
9
+ setup(e, { slots: t }) {
10
+ return { hasSlot: (l) => !!t[l] };
11
+ },
12
+ props: {
13
+ fixedHeight: {
14
+ type: Boolean,
15
+ default: !1
16
+ }
17
+ },
18
+ computed: {
19
+ classNames: function() {
20
+ const e = this.$slots.icon ? "icon" : "", t = this.fixedHeight ? "fixed-height" : "";
21
+ return `dialog-body ${e} ${t}`;
22
+ }
23
+ }
24
+ }, I = {
25
+ key: 0,
26
+ class: "dialog-body-icon"
27
+ }, H = {
28
+ key: 1,
29
+ class: "dialog-body-heading"
30
+ }, E = { class: "dialog-body-content" };
31
+ function O(e, t, o, l, p, n) {
32
+ return i(), a("div", {
33
+ class: T(n.classNames)
34
+ }, [
35
+ l.hasSlot("icon") ? (i(), a("div", I, [
36
+ d(e.$slots, "icon", {}, void 0, !0)
37
+ ])) : f("", !0),
38
+ l.hasSlot("heading") ? (i(), a("div", H, [
39
+ d(e.$slots, "heading", {}, void 0, !0)
40
+ ])) : f("", !0),
41
+ s("div", E, [
42
+ d(e.$slots, "default", {}, void 0, !0)
43
+ ])
44
+ ], 2);
45
+ }
46
+ const D = /* @__PURE__ */ m(U, [["render", O], ["__scopeId", "data-v-df814a5c"]]), P = {
47
+ name: "IconWarningCircle",
48
+ props: {
49
+ width: {
50
+ type: Number,
51
+ default: 16
52
+ },
53
+ height: {
54
+ type: Number,
55
+ default: 16
56
+ },
57
+ color: {
58
+ type: String,
59
+ default: "currentColor"
60
+ }
61
+ }
62
+ }, z = ["width", "height", "fill"];
63
+ function M(e, t, o, l, p, n) {
64
+ return i(), a("svg", {
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ width: o.width,
67
+ height: o.height,
68
+ fill: o.color,
69
+ viewBox: "0 0 24 24"
70
+ }, t[0] || (t[0] = [
71
+ s("path", {
72
+ pid: "0",
73
+ d: "M22 11.4c-.1-2.7-1.3-5.1-3.3-6.9-.4-.4-1-.3-1.4.1-.4.4-.3 1 .1 1.4 1.6 1.4 2.5 3.4 2.7 5.5.1 2.1-.6 4.2-2 5.8s-3.4 2.5-5.5 2.7c-2.1.1-4.2-.6-5.8-2-1.6-1.4-2.5-3.4-2.7-5.5-.1-2.1.6-4.2 2-5.8 1.3-1.4 3.1-2.4 5-2.6V11c0 .6.4 1 1 1s1-.4 1-1V2h-1C9.2 2 6.4 3.2 4.5 5.3c-1.8 2-2.7 4.6-2.5 7.2.1 2.7 1.3 5.1 3.3 6.9C7.2 21.2 9.6 22 12 22c2.7 0 5.5-1.1 7.5-3.3 1.7-2 2.6-4.6 2.5-7.3z"
74
+ }, null, -1),
75
+ s("circle", {
76
+ pid: "1",
77
+ cx: "12",
78
+ cy: "15.5",
79
+ r: "1.5"
80
+ }, null, -1)
81
+ ]), 8, z);
82
+ }
83
+ const b = /* @__PURE__ */ m(P, [["render", M]]), W = {
84
+ name: "BfDialogHeader",
85
+ props: {
86
+ title: {
87
+ type: String,
88
+ default: ""
89
+ }
90
+ },
91
+ methods: {
92
+ /**
93
+ * Trigger el-dialog close event
94
+ */
95
+ onClose: function() {
96
+ this.$parent.handleClose();
97
+ }
98
+ }
99
+ }, j = { class: "bf-dialog-header" }, F = { class: "bf-dialog-header-title" };
100
+ function Y(e, t, o, l, p, n) {
101
+ return i(), a("div", j, [
102
+ s("span", F, u(o.title), 1),
103
+ this.$slots.tabs ? f("", !0) : (i(), a("button", {
104
+ key: 0,
105
+ class: "icon-close",
106
+ onClick: t[0] || (t[0] = (..._) => n.onClose && n.onClose(..._))
107
+ })),
108
+ d(e.$slots, "tabs", {}, void 0, !0)
109
+ ]);
110
+ }
111
+ const y = /* @__PURE__ */ m(W, [["render", Y], ["__scopeId", "data-v-8fb1f048"]]), q = {
112
+ name: "TsAnnotationDeleteDialog",
113
+ components: {
114
+ BfDialogHeader: y,
115
+ DialogBody: D,
116
+ BfButton: N,
117
+ IconWarningCircle: b
118
+ },
119
+ props: {
120
+ visible: {
121
+ type: Boolean,
122
+ default: !1
123
+ },
124
+ deleteAnnotation: {
125
+ type: Object,
126
+ default: () => ({
127
+ annotation: {},
128
+ withDiscussions: !1
129
+ })
130
+ }
131
+ },
132
+ data: function() {
133
+ return {
134
+ isProcessing: !1
135
+ };
136
+ },
137
+ computed: {
138
+ /**
139
+ * Compute the annotation's name
140
+ * @returns {String}
141
+ */
142
+ annotationDescription: function() {
143
+ return C("", ["annotation", "label"], this.deleteAnnotation);
144
+ },
145
+ annotationDateTime: function() {
146
+ const e = C("", ["annotation", "start"], this.deleteAnnotation);
147
+ return this.getUTCDateString(e) + " " + this.getUTCTimeString(e);
148
+ },
149
+ deleteDiscussions: function() {
150
+ return V(!1, "withDiscussions", this.deleteAnnotation);
151
+ },
152
+ /**
153
+ * Compute copy for the delete button
154
+ * @returns {String}
155
+ */
156
+ btnDeleteCopy: function() {
157
+ return this.deleteDiscussions ? "Yes, I'm sure" : "Delete";
158
+ }
159
+ },
160
+ methods: {
161
+ removeAnnotation: function() {
162
+ this.$emit("delete", this.deleteAnnotation.annotation);
163
+ },
164
+ /**
165
+ * Emit event to update the synced property
166
+ */
167
+ close: function() {
168
+ this.$emit("update:visible", !1);
169
+ },
170
+ /**
171
+ * Callback after the dialog has closed
172
+ * Reset dialog
173
+ */
174
+ onClosed: function() {
175
+ this.isProcessing = !1, this.$emit("update:delete-annotation", {
176
+ annotation: {},
177
+ withDiscussions: !1
178
+ });
179
+ },
180
+ getUTCDateString: function(e) {
181
+ return e > 0 ? (e = new Date(e / 1e3), e.toDateString()) : "unknown";
182
+ },
183
+ getUTCTimeString: function(e) {
184
+ if (e > 0)
185
+ return e = e / 1e3, e = new Date(e), ("0" + e.getUTCHours()).slice(-2) + ":" + ("0" + e.getUTCMinutes()).slice(-2) + ":" + ("0" + e.getUTCSeconds()).slice(-2);
186
+ }
187
+ }
188
+ }, G = { class: "dialog-simple-buttons" };
189
+ function J(e, t, o, l, p, n) {
190
+ const _ = y, v = b, g = B("bf-button"), w = D, $ = k;
191
+ return i(), A($, {
192
+ class: "simple",
193
+ modelValue: o.visible,
194
+ "onUpdate:modelValue": t[0] || (t[0] = (S) => o.visible = S),
195
+ "show-close": !1,
196
+ onClose: n.close,
197
+ onClosed: n.onClosed
198
+ }, {
199
+ default: c(() => [
200
+ r(_, { slot: "title" }),
201
+ r(w, null, {
202
+ default: c(() => [
203
+ r(v, {
204
+ class: "mb-16",
205
+ height: 32,
206
+ width: 32,
207
+ color: "#C14D49"
208
+ }),
209
+ t[5] || (t[5] = s("h2", null, "Delete annotation?", -1)),
210
+ n.deleteDiscussions ? (i(), a(x, { key: 0 }, [
211
+ s("p", null, u(n.annotationDescription) + " - " + u(n.annotationDateTime), 1),
212
+ t[1] || (t[1] = s("hr", null, null, -1)),
213
+ t[2] || (t[2] = s("p", null, " Deleting this annotation will also remove any associated discussions and cannot be undone. ", -1)),
214
+ t[3] || (t[3] = s("p", null, " Are you sure you would like to remove this annotation? ", -1))
215
+ ], 64)) : f("", !0),
216
+ s("div", G, [
217
+ r(g, {
218
+ class: "secondary",
219
+ onClick: n.close
220
+ }, {
221
+ default: c(() => t[4] || (t[4] = [
222
+ h(" Cancel ")
223
+ ])),
224
+ _: 1,
225
+ __: [4]
226
+ }, 8, ["onClick"]),
227
+ r(g, {
228
+ class: "red",
229
+ processing: e.isProcessing,
230
+ onClick: n.removeAnnotation
231
+ }, {
232
+ default: c(() => [
233
+ h(u(n.btnDeleteCopy), 1)
234
+ ]),
235
+ _: 1
236
+ }, 8, ["processing", "onClick"])
237
+ ])
238
+ ]),
239
+ _: 1,
240
+ __: [5]
241
+ })
242
+ ]),
243
+ _: 1
244
+ }, 8, ["modelValue", "onClose", "onClosed"]);
245
+ }
246
+ const ee = /* @__PURE__ */ m(q, [["render", J], ["__scopeId", "data-v-d8d7db08"]]);
247
+ export {
248
+ ee as default
249
+ };
@@ -0,0 +1,8 @@
1
+ var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function l(e) {
3
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
+ }
5
+ export {
6
+ o as c,
7
+ l as g
8
+ };