@campus-admin/core 2.0.8 → 2.1.0
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/PersonalNotes-CpdpdMrP.js +703 -0
- package/dist/PersonalTodos-f4XMo1mg.js +601 -0
- package/dist/ca-BP878D3q.js +143 -0
- package/dist/i18n.d.ts +166 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1652 -1825
- package/dist/layout/CaHeaderBrand.vue.d.ts +4 -0
- package/dist/layout/header-tools.d.ts +30 -0
- package/dist/layout/personal-tools/PersonalNotes.vue.d.ts +9 -0
- package/dist/layout/personal-tools/PersonalTodos.vue.d.ts +9 -0
- package/dist/layout/personal-tools/TodoIcon.vue.d.ts +19 -0
- package/dist/layout/personal-tools/autosave.d.ts +5 -0
- package/dist/layout/personal-tools/done-lines.d.ts +20 -0
- package/dist/layout/personal-tools/list.d.ts +27 -0
- package/dist/layout/personal-tools/position.d.ts +12 -0
- package/dist/layout/personal-tools/shortcuts.d.ts +2 -0
- package/dist/layout/personal-tools/types.d.ts +75 -0
- package/dist/layout/quick-chat/CaQuickChat.vue.d.ts +16 -0
- package/dist/layout/quick-chat/selection.d.ts +4 -0
- package/dist/layout/quick-chat/shortcut.d.ts +1 -0
- package/dist/layout/quick-chat/types.d.ts +45 -0
- package/dist/position-zvf9vBh1.js +71 -0
- package/dist/session-Cvdtq46r.js +389 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +19 -0
- package/package.json +4 -4
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
import { r as e, s as t, t as n } from "./ca-BP878D3q.js";
|
|
2
|
+
import { a as r, i, o as a, r as o, s, t as c } from "./position-zvf9vBh1.js";
|
|
3
|
+
import { Fragment as ee, Teleport as te, computed as l, createBlock as ne, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, nextTick as re, normalizeClass as h, normalizeStyle as ie, onMounted as ae, onUnmounted as oe, openBlock as g, ref as _, renderList as se, toDisplayString as ce, unref as v, vModelText as y, watch as le, withDirectives as b, withKeys as ue, withModifiers as x } from "vue";
|
|
4
|
+
import { CaIcon as de } from "@campus-admin/ui";
|
|
5
|
+
import { useRoute as fe } from "vue-router";
|
|
6
|
+
// packages/core/src/layout/personal-tools/TodoIcon.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var pe = ["stroke-width"], me = ["d"], S = "M8 2.5a5.5 5.5 0 1 0 0 11a5.5 5.5 0 1 0 0-11z", C = "M1.5 8s2.4-4.5 6.5-4.5 6.5 4.5 6.5 4.5-2.4 4.5-6.5 4.5S1.5 8 1.5 8Z M8 6.2a1.8 1.8 0 1 0 0 3.6a1.8 1.8 0 1 0 0-3.6z", w = /* @__PURE__ */ m({
|
|
8
|
+
__name: "TodoIcon",
|
|
9
|
+
props: { name: {} },
|
|
10
|
+
setup(e) {
|
|
11
|
+
let t = {
|
|
12
|
+
grip: "M5.5 4.5h.01 M5.5 8h.01 M5.5 11.5h.01 M10.5 4.5h.01 M10.5 8h.01 M10.5 11.5h.01",
|
|
13
|
+
search: "M7 2.5a4.5 4.5 0 1 0 0 9a4.5 4.5 0 1 0 0-9z M10.3 10.3l3.2 3.2",
|
|
14
|
+
eye: C,
|
|
15
|
+
"eye-off": `${C} M2 2l12 12`,
|
|
16
|
+
close: "M4 4l8 8 M12 4l-8 8",
|
|
17
|
+
plus: "M8 3v10 M3 8h10",
|
|
18
|
+
circle: S,
|
|
19
|
+
"circle-check": `${S} M5.6 8.2l1.7 1.7 3.2-3.4`,
|
|
20
|
+
clock: `${S} M8 5.2v3l2 1.3`,
|
|
21
|
+
trash: "M3 4.5h10 M6.5 4.5V3h3v1.5 M4.5 4.5l.6 8.5h5.8l.6-8.5",
|
|
22
|
+
check: "M4 8.5l2.7 2.7L12 5.5"
|
|
23
|
+
};
|
|
24
|
+
return (n, r) => (g(), d("svg", {
|
|
25
|
+
viewBox: "0 0 16 16",
|
|
26
|
+
width: "14",
|
|
27
|
+
height: "14",
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
"stroke-width": e.name === "grip" ? 2.2 : 1.3,
|
|
31
|
+
"stroke-linecap": "round",
|
|
32
|
+
"stroke-linejoin": "round",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, [f("path", { d: t[e.name] }, null, 8, me)], 8, pe));
|
|
35
|
+
}
|
|
36
|
+
}), T = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?$/;
|
|
37
|
+
function E(e, t) {
|
|
38
|
+
let n = e.trim().slice(0, 500);
|
|
39
|
+
return n ? {
|
|
40
|
+
id: t,
|
|
41
|
+
text: n,
|
|
42
|
+
done: !1,
|
|
43
|
+
due: null
|
|
44
|
+
} : null;
|
|
45
|
+
}
|
|
46
|
+
function he(e, t, n) {
|
|
47
|
+
let r = E(t, n);
|
|
48
|
+
return r && e.length < 200 ? [...e, r] : e;
|
|
49
|
+
}
|
|
50
|
+
function D(e, t, n) {
|
|
51
|
+
return e.some((e) => e.id === t) ? e.map((e) => e.id === t ? {
|
|
52
|
+
...e,
|
|
53
|
+
...n
|
|
54
|
+
} : e) : e;
|
|
55
|
+
}
|
|
56
|
+
var ge = (e, t) => D(e, t, { done: !e.find((e) => e.id === t)?.done });
|
|
57
|
+
function _e(e, t, n) {
|
|
58
|
+
let r = n.trim().slice(0, 500);
|
|
59
|
+
return r ? D(e, t, { text: r }) : e;
|
|
60
|
+
}
|
|
61
|
+
var ve = (e, t, n) => D(e, t, { due: n }), ye = (e, t) => e.filter((e) => e.id !== t);
|
|
62
|
+
function be(e, t, n) {
|
|
63
|
+
let r = e.findIndex((e) => e.id === t), i = e.findIndex((e) => e.id === n);
|
|
64
|
+
if (r < 0 || i < 0 || r === i) return e;
|
|
65
|
+
let a = [...e], [o] = a.splice(r, 1);
|
|
66
|
+
return a.splice(i, 0, o), a;
|
|
67
|
+
}
|
|
68
|
+
function xe(e, t, n) {
|
|
69
|
+
let r = n.trim().toLowerCase();
|
|
70
|
+
return e.filter((e) => (t || !e.done) && (!r || e.text.toLowerCase().includes(r)));
|
|
71
|
+
}
|
|
72
|
+
function Se(e, t) {
|
|
73
|
+
return e && O(t ? `${e}T${t}` : e) ? t ? `${e}T${t}` : e : null;
|
|
74
|
+
}
|
|
75
|
+
function Ce(e) {
|
|
76
|
+
let t = e ? T.exec(e) : null;
|
|
77
|
+
return t ? {
|
|
78
|
+
date: `${t[1]}-${t[2]}-${t[3]}`,
|
|
79
|
+
time: t[4] ? `${t[4]}:${t[5]}` : ""
|
|
80
|
+
} : {
|
|
81
|
+
date: "",
|
|
82
|
+
time: ""
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function O(e) {
|
|
86
|
+
let t = T.exec(e);
|
|
87
|
+
if (!t) return null;
|
|
88
|
+
let [n, r, i] = [
|
|
89
|
+
Number(t[1]),
|
|
90
|
+
Number(t[2]),
|
|
91
|
+
Number(t[3])
|
|
92
|
+
], a = t[4] !== void 0, o = new Date(n, r - 1, i, a ? Number(t[4]) : 0, a ? Number(t[5]) : 0);
|
|
93
|
+
return o.getFullYear() === n && o.getMonth() === r - 1 && o.getDate() === i && (!a || o.getHours() === Number(t[4]) && o.getMinutes() === Number(t[5])) ? {
|
|
94
|
+
at: o,
|
|
95
|
+
hasTime: a
|
|
96
|
+
} : null;
|
|
97
|
+
}
|
|
98
|
+
function we(e, t) {
|
|
99
|
+
let n = !e.done && e.due ? O(e.due) : null;
|
|
100
|
+
if (!n) return !1;
|
|
101
|
+
let r = n.hasTime ? n.at.getTime() : new Date(n.at.getFullYear(), n.at.getMonth(), n.at.getDate() + 1).getTime();
|
|
102
|
+
return t.getTime() >= r;
|
|
103
|
+
}
|
|
104
|
+
function Te(e, t, n) {
|
|
105
|
+
let r = O(e);
|
|
106
|
+
if (!r) return e;
|
|
107
|
+
let { at: i, hasTime: a } = r, o = (e) => Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), s = (o(i) - o(t)) / 864e5, c = s === 0 || s === 1 ? new Intl.RelativeTimeFormat(n, { numeric: "auto" }).format(s, "day") : new Intl.DateTimeFormat(n, {
|
|
108
|
+
month: "short",
|
|
109
|
+
day: "numeric",
|
|
110
|
+
...i.getFullYear() !== t.getFullYear() && { year: "numeric" }
|
|
111
|
+
}).format(i);
|
|
112
|
+
return a ? `${c} ${new Intl.DateTimeFormat(n, {
|
|
113
|
+
hour: "2-digit",
|
|
114
|
+
minute: "2-digit"
|
|
115
|
+
}).format(i)}` : c;
|
|
116
|
+
}
|
|
117
|
+
// packages/core/src/layout/personal-tools/PersonalTodos.vue?vue&type=script&setup=true&lang.ts
|
|
118
|
+
var Ee = [
|
|
119
|
+
"disabled",
|
|
120
|
+
"title",
|
|
121
|
+
"aria-label",
|
|
122
|
+
"aria-keyshortcuts",
|
|
123
|
+
"aria-expanded",
|
|
124
|
+
"aria-controls"
|
|
125
|
+
], De = ["aria-label"], Oe = ["title"], ke = { class: "todo-count" }, Ae = { class: "todo-actions" }, je = [
|
|
126
|
+
"title",
|
|
127
|
+
"aria-label",
|
|
128
|
+
"aria-pressed"
|
|
129
|
+
], Me = [
|
|
130
|
+
"title",
|
|
131
|
+
"aria-label",
|
|
132
|
+
"aria-pressed"
|
|
133
|
+
], Ne = [
|
|
134
|
+
"title",
|
|
135
|
+
"aria-label",
|
|
136
|
+
"aria-expanded"
|
|
137
|
+
], Pe = ["title", "aria-label"], Fe = ["aria-label"], Ie = [
|
|
138
|
+
"title",
|
|
139
|
+
"aria-label",
|
|
140
|
+
"aria-pressed",
|
|
141
|
+
"onClick"
|
|
142
|
+
], Le = {
|
|
143
|
+
key: 1,
|
|
144
|
+
class: "todo-row todo-search"
|
|
145
|
+
}, Re = [
|
|
146
|
+
"aria-label",
|
|
147
|
+
"placeholder",
|
|
148
|
+
"onKeydown"
|
|
149
|
+
], ze = [
|
|
150
|
+
"aria-label",
|
|
151
|
+
"maxlength",
|
|
152
|
+
"disabled",
|
|
153
|
+
"placeholder"
|
|
154
|
+
], Be = [
|
|
155
|
+
"title",
|
|
156
|
+
"aria-label",
|
|
157
|
+
"disabled"
|
|
158
|
+
], Ve = { class: "todo-list" }, He = [
|
|
159
|
+
"draggable",
|
|
160
|
+
"onDragstart",
|
|
161
|
+
"onDragover",
|
|
162
|
+
"onDrop"
|
|
163
|
+
], Ue = { class: "todo-line" }, We = [
|
|
164
|
+
"title",
|
|
165
|
+
"aria-label",
|
|
166
|
+
"onPointerdown"
|
|
167
|
+
], Ge = [
|
|
168
|
+
"title",
|
|
169
|
+
"aria-label",
|
|
170
|
+
"aria-pressed",
|
|
171
|
+
"onClick"
|
|
172
|
+
], Ke = [
|
|
173
|
+
"maxlength",
|
|
174
|
+
"aria-label",
|
|
175
|
+
"onKeydown"
|
|
176
|
+
], qe = ["title", "onClick"], Je = { class: "todo-label" }, Ye = [
|
|
177
|
+
"title",
|
|
178
|
+
"aria-label",
|
|
179
|
+
"aria-expanded",
|
|
180
|
+
"onClick"
|
|
181
|
+
], Xe = [
|
|
182
|
+
"title",
|
|
183
|
+
"aria-label",
|
|
184
|
+
"onClick"
|
|
185
|
+
], Ze = {
|
|
186
|
+
key: 0,
|
|
187
|
+
class: "todo-line todo-duebar"
|
|
188
|
+
}, Qe = ["aria-label"], $e = ["aria-label"], et = ["title", "aria-label"], tt = ["title", "aria-label"], nt = {
|
|
189
|
+
key: 2,
|
|
190
|
+
class: "todo-empty"
|
|
191
|
+
}, rt = 500, it = 280, k = /*#__PURE__*/ e(/* @__PURE__ */ m({
|
|
192
|
+
__name: "PersonalTodos",
|
|
193
|
+
props: {
|
|
194
|
+
token: {},
|
|
195
|
+
provider: {},
|
|
196
|
+
shortcuts: { type: Function }
|
|
197
|
+
},
|
|
198
|
+
setup(e) {
|
|
199
|
+
let { t: m, locale: pe } = t(), me = fe(), S = l(() => a("todo", e.shortcuts)), C = (e) => m(`campus.personalTools.${e}`), T = new AbortController(), E = T.signal, D = _(!1), O = _("yellow"), k = _(null), A = _(null), j = _([]), M = _(!1), N = _(!1), P = _(!1), F = _(""), I = _(!1), L = _(""), R = _(""), z = _(""), B = _(""), V = _(""), H = _(""), at = _(/* @__PURE__ */ new Date()), ot = l(() => xe(j.value, N.value, F.value)), st = l(() => j.value.length >= 200), ct = _(), lt = _(), ut = _(), dt = null, U = 0, W = 0, G = !1, ft = !1, pt = 0;
|
|
200
|
+
async function mt() {
|
|
201
|
+
let t = ++pt;
|
|
202
|
+
try {
|
|
203
|
+
let n = await e.provider.load(e.token, E);
|
|
204
|
+
if (E.aborted || t !== pt) return;
|
|
205
|
+
(!D.value || U === W && !G) && (O.value = n.color, k.value = n.x, A.value = n.y, j.value = n.items), D.value = !0;
|
|
206
|
+
} catch {}
|
|
207
|
+
}
|
|
208
|
+
let ht = r(async () => {
|
|
209
|
+
let t = U;
|
|
210
|
+
G = !0;
|
|
211
|
+
try {
|
|
212
|
+
await e.provider.save(e.token, E, {
|
|
213
|
+
color: O.value,
|
|
214
|
+
x: k.value,
|
|
215
|
+
y: A.value,
|
|
216
|
+
items: j.value
|
|
217
|
+
}), W = t, ft = !1;
|
|
218
|
+
} catch (e) {
|
|
219
|
+
!E.aborted && !ft && (ft = !0, n.toast.error(e instanceof Error ? m("campus.personalTools.todoSaveDetail", { message: e.message }) : m("campus.personalTools.todoSave")));
|
|
220
|
+
} finally {
|
|
221
|
+
G = !1;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
function K() {
|
|
225
|
+
U++, ht.schedule(rt);
|
|
226
|
+
}
|
|
227
|
+
function gt() {
|
|
228
|
+
U !== W && !G && ht.schedule(0);
|
|
229
|
+
}
|
|
230
|
+
function _t() {
|
|
231
|
+
document.visibilityState === "hidden" && gt();
|
|
232
|
+
}
|
|
233
|
+
function vt() {
|
|
234
|
+
U === W && !G && mt();
|
|
235
|
+
}
|
|
236
|
+
let q = _({
|
|
237
|
+
width: window.innerWidth,
|
|
238
|
+
height: window.innerHeight
|
|
239
|
+
}), J = _({
|
|
240
|
+
width: it,
|
|
241
|
+
height: 240
|
|
242
|
+
}), Y = _(), X, yt = l(() => k.value === null || A.value === null ? c({
|
|
243
|
+
x: q.value.width - J.value.width - 24,
|
|
244
|
+
y: 72
|
|
245
|
+
}, q.value, J.value) : i({
|
|
246
|
+
x: k.value,
|
|
247
|
+
y: A.value
|
|
248
|
+
}, q.value, J.value)), bt = l(() => {
|
|
249
|
+
let e = Y.value ?? yt.value;
|
|
250
|
+
return {
|
|
251
|
+
left: `${e.x}px`,
|
|
252
|
+
top: `${e.y}px`
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
function xt() {
|
|
256
|
+
q.value = {
|
|
257
|
+
width: window.innerWidth,
|
|
258
|
+
height: window.innerHeight
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function St(e) {
|
|
262
|
+
e.button !== 0 || X || e.target.closest("button, input") || (e.currentTarget.setPointerCapture(e.pointerId), X = {
|
|
263
|
+
pointer: e.pointerId,
|
|
264
|
+
start: {
|
|
265
|
+
x: e.clientX,
|
|
266
|
+
y: e.clientY
|
|
267
|
+
},
|
|
268
|
+
origin: yt.value,
|
|
269
|
+
moved: !1
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
function Ct(e) {
|
|
273
|
+
if (!X || X.pointer !== e.pointerId) return;
|
|
274
|
+
let t = e.clientX - X.start.x, n = e.clientY - X.start.y;
|
|
275
|
+
!X.moved && Math.hypot(t, n) < 4 || (X.moved = !0, Y.value = c({
|
|
276
|
+
x: X.origin.x + t,
|
|
277
|
+
y: X.origin.y + n
|
|
278
|
+
}, q.value, J.value));
|
|
279
|
+
}
|
|
280
|
+
function wt(e, t = !1) {
|
|
281
|
+
if (!X || X.pointer !== e.pointerId) return;
|
|
282
|
+
let n = Y.value;
|
|
283
|
+
if (X = void 0, Y.value = void 0, t || !n) return;
|
|
284
|
+
let r = o(n, q.value, J.value);
|
|
285
|
+
k.value = r.x, A.value = r.y, K();
|
|
286
|
+
}
|
|
287
|
+
function Tt() {
|
|
288
|
+
let e = he(j.value, L.value, crypto.randomUUID());
|
|
289
|
+
e !== j.value && (j.value = e, L.value = "", K());
|
|
290
|
+
}
|
|
291
|
+
function Et(e) {
|
|
292
|
+
j.value = ge(j.value, e.id), K();
|
|
293
|
+
}
|
|
294
|
+
function Dt(e) {
|
|
295
|
+
B.value === e.id && (B.value = ""), j.value = ye(j.value, e.id), K();
|
|
296
|
+
}
|
|
297
|
+
async function Ot(e) {
|
|
298
|
+
R.value = e.id, z.value = e.text, await re(), lt.value?.querySelector(".todo-edit")?.focus();
|
|
299
|
+
}
|
|
300
|
+
function Z() {
|
|
301
|
+
let e = R.value;
|
|
302
|
+
if (!e) return;
|
|
303
|
+
R.value = "";
|
|
304
|
+
let t = j.value.find((t) => t.id === e);
|
|
305
|
+
if (!t || z.value.trim() === t.text) return;
|
|
306
|
+
let n = _e(j.value, e, z.value);
|
|
307
|
+
n !== j.value && (j.value = n, K());
|
|
308
|
+
}
|
|
309
|
+
function kt(e) {
|
|
310
|
+
B.value === e.id ? B.value = "" : (B.value = e.id, {date: V.value, time: H.value} = Ce(e.due));
|
|
311
|
+
}
|
|
312
|
+
let At = () => {
|
|
313
|
+
let e = /* @__PURE__ */ new Date();
|
|
314
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
315
|
+
};
|
|
316
|
+
function jt() {
|
|
317
|
+
H.value && !V.value && (V.value = At()), V.value || (H.value = ""), j.value = ve(j.value, B.value, Se(V.value, H.value)), K();
|
|
318
|
+
}
|
|
319
|
+
function Mt() {
|
|
320
|
+
V.value = "", H.value = "", jt(), B.value = "";
|
|
321
|
+
}
|
|
322
|
+
let Q = _(""), $ = _(""), Nt = _("");
|
|
323
|
+
function Pt(e, t) {
|
|
324
|
+
$.value = t.id, e.dataTransfer?.setData("text/plain", t.id), e.dataTransfer && (e.dataTransfer.effectAllowed = "move");
|
|
325
|
+
}
|
|
326
|
+
function Ft(e, t) {
|
|
327
|
+
$.value && (e.preventDefault(), Nt.value = t.id);
|
|
328
|
+
}
|
|
329
|
+
function It(e) {
|
|
330
|
+
let t = $.value ? be(j.value, $.value, e.id) : j.value;
|
|
331
|
+
Lt(), t !== j.value && (j.value = t, K());
|
|
332
|
+
}
|
|
333
|
+
function Lt() {
|
|
334
|
+
Q.value = "", $.value = "", Nt.value = "";
|
|
335
|
+
}
|
|
336
|
+
async function Rt() {
|
|
337
|
+
P.value = !P.value, P.value ? (await re(), ct.value?.focus()) : F.value = "";
|
|
338
|
+
}
|
|
339
|
+
function zt(e) {
|
|
340
|
+
I.value = !1, e !== O.value && (O.value = e, K());
|
|
341
|
+
}
|
|
342
|
+
le(M, async (e) => {
|
|
343
|
+
if (e) {
|
|
344
|
+
dt = document.activeElement, await re(), ut.value?.focus();
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
let t = dt;
|
|
348
|
+
dt = null, t instanceof HTMLElement && t.isConnected && t.focus();
|
|
349
|
+
}), le(() => me.path, () => {
|
|
350
|
+
M.value && Z(), M.value = !1, I.value = !1, B.value = "";
|
|
351
|
+
});
|
|
352
|
+
function Bt(e) {
|
|
353
|
+
!D.value || e.defaultPrevented || e.isComposing || !S.value?.matches(e) || e.target instanceof Element && e.target.closest("[aria-modal=\"true\"]") || (e.preventDefault(), !e.repeat && (M.value && Z(), M.value = !M.value));
|
|
354
|
+
}
|
|
355
|
+
function Vt(e) {
|
|
356
|
+
e.key === "Escape" && (e.stopPropagation(), R.value ? R.value = "" : I.value ? I.value = !1 : B.value ? B.value = "" : M.value = !1);
|
|
357
|
+
}
|
|
358
|
+
let Ht;
|
|
359
|
+
le(lt, (e, t, n) => {
|
|
360
|
+
e && (Ht = new ResizeObserver(() => {
|
|
361
|
+
let t = e.getBoundingClientRect();
|
|
362
|
+
J.value = {
|
|
363
|
+
width: t.width || it,
|
|
364
|
+
height: t.height
|
|
365
|
+
};
|
|
366
|
+
}), Ht.observe(e), n(() => Ht?.disconnect()));
|
|
367
|
+
}, { flush: "post" });
|
|
368
|
+
let Ut = _("body");
|
|
369
|
+
function Wt() {
|
|
370
|
+
let e = document.fullscreenElement;
|
|
371
|
+
Ut.value = e instanceof HTMLElement ? e : "body";
|
|
372
|
+
}
|
|
373
|
+
let Gt;
|
|
374
|
+
return ae(() => {
|
|
375
|
+
mt(), Wt(), document.addEventListener("fullscreenchange", Wt), Gt = setInterval(() => {
|
|
376
|
+
at.value = /* @__PURE__ */ new Date();
|
|
377
|
+
}, 6e4), window.addEventListener("keydown", Bt, !0), window.addEventListener("resize", xt), window.addEventListener("focus", vt), document.addEventListener("visibilitychange", _t);
|
|
378
|
+
}), oe(() => {
|
|
379
|
+
clearInterval(Gt), document.removeEventListener("fullscreenchange", Wt), window.removeEventListener("keydown", Bt, !0), window.removeEventListener("resize", xt), window.removeEventListener("focus", vt), document.removeEventListener("visibilitychange", _t), ht.cancel(), U !== W && e.provider.save(e.token, new AbortController().signal, {
|
|
380
|
+
color: O.value,
|
|
381
|
+
x: k.value,
|
|
382
|
+
y: A.value,
|
|
383
|
+
items: j.value
|
|
384
|
+
}).catch(() => {}), T.abort();
|
|
385
|
+
}), (t, n) => (g(), d(ee, null, [f("button", {
|
|
386
|
+
type: "button",
|
|
387
|
+
class: "ca-personal-entry",
|
|
388
|
+
disabled: !D.value,
|
|
389
|
+
title: [M.value ? v(m)("campus.personalTools.closeTodo") : v(m)("campus.personalTools.todo"), S.value?.label].filter(Boolean).join(" · "),
|
|
390
|
+
"aria-label": M.value ? v(m)("campus.personalTools.closeTodo") : v(m)("campus.personalTools.todo"),
|
|
391
|
+
"aria-keyshortcuts": S.value?.aria,
|
|
392
|
+
"aria-expanded": M.value,
|
|
393
|
+
"aria-controls": M.value ? "ca-personal-todo-panel" : void 0,
|
|
394
|
+
onClick: n[0] ||= (e) => M.value = !M.value
|
|
395
|
+
}, [p(v(de), {
|
|
396
|
+
name: e.provider.icon ?? "tickets",
|
|
397
|
+
size: 18,
|
|
398
|
+
fallback: "tickets",
|
|
399
|
+
"aria-hidden": "true"
|
|
400
|
+
}, null, 8, ["name"])], 8, Ee), (g(), ne(te, { to: Ut.value }, [M.value && D.value ? (g(), d("section", {
|
|
401
|
+
key: 0,
|
|
402
|
+
id: "ca-personal-todo-panel",
|
|
403
|
+
ref_key: "panel",
|
|
404
|
+
ref: lt,
|
|
405
|
+
class: h(["todo-panel", `todo-${O.value}`]),
|
|
406
|
+
style: ie(bt.value),
|
|
407
|
+
"aria-label": v(m)("campus.personalTools.todoPanel"),
|
|
408
|
+
onKeydown: Vt
|
|
409
|
+
}, [
|
|
410
|
+
f("header", {
|
|
411
|
+
class: "todo-bar",
|
|
412
|
+
onPointerdown: St,
|
|
413
|
+
onPointermove: Ct,
|
|
414
|
+
onPointerup: n[4] ||= (e) => wt(e),
|
|
415
|
+
onPointercancel: n[5] ||= (e) => wt(e, !0)
|
|
416
|
+
}, [
|
|
417
|
+
f("span", {
|
|
418
|
+
class: "todo-grab",
|
|
419
|
+
title: v(m)("campus.personalTools.drag"),
|
|
420
|
+
"aria-hidden": "true"
|
|
421
|
+
}, [p(w, { name: "grip" })], 8, Oe),
|
|
422
|
+
f("span", ke, ce(j.value.filter((e) => !e.done).length), 1),
|
|
423
|
+
f("span", Ae, [
|
|
424
|
+
f("button", {
|
|
425
|
+
type: "button",
|
|
426
|
+
class: "todo-icon",
|
|
427
|
+
title: v(m)("campus.personalTools.search"),
|
|
428
|
+
"aria-label": v(m)("campus.personalTools.search"),
|
|
429
|
+
"aria-pressed": P.value,
|
|
430
|
+
onClick: Rt
|
|
431
|
+
}, [p(w, { name: "search" })], 8, je),
|
|
432
|
+
f("button", {
|
|
433
|
+
type: "button",
|
|
434
|
+
class: "todo-icon",
|
|
435
|
+
title: N.value ? v(m)("campus.personalTools.hideDone") : v(m)("campus.personalTools.showDone"),
|
|
436
|
+
"aria-label": N.value ? v(m)("campus.personalTools.hideDone") : v(m)("campus.personalTools.showDone"),
|
|
437
|
+
"aria-pressed": N.value,
|
|
438
|
+
onClick: n[1] ||= (e) => N.value = !N.value
|
|
439
|
+
}, [p(w, { name: N.value ? "eye" : "eye-off" }, null, 8, ["name"])], 8, Me),
|
|
440
|
+
f("button", {
|
|
441
|
+
type: "button",
|
|
442
|
+
class: "todo-icon",
|
|
443
|
+
title: v(m)("campus.personalTools.changeColor", { color: C(O.value) }),
|
|
444
|
+
"aria-label": v(m)("campus.personalTools.activeColor", { color: C(O.value) }),
|
|
445
|
+
"aria-expanded": I.value,
|
|
446
|
+
onClick: n[2] ||= (e) => I.value = !I.value
|
|
447
|
+
}, [...n[14] ||= [f("span", {
|
|
448
|
+
class: "todo-swatch",
|
|
449
|
+
"aria-hidden": "true"
|
|
450
|
+
}, null, -1)]], 8, Ne),
|
|
451
|
+
f("button", {
|
|
452
|
+
type: "button",
|
|
453
|
+
class: "todo-icon",
|
|
454
|
+
title: v(m)("campus.personalTools.close"),
|
|
455
|
+
"aria-label": v(m)("campus.personalTools.close"),
|
|
456
|
+
onClick: n[3] ||= (e) => M.value = !1
|
|
457
|
+
}, [p(w, { name: "close" })], 8, Pe)
|
|
458
|
+
])
|
|
459
|
+
], 32),
|
|
460
|
+
I.value ? (g(), d("div", {
|
|
461
|
+
key: 0,
|
|
462
|
+
class: "todo-palette",
|
|
463
|
+
role: "group",
|
|
464
|
+
"aria-label": v(m)("campus.personalTools.todoColor")
|
|
465
|
+
}, [(g(!0), d(ee, null, se(v(s), (e) => (g(), d("button", {
|
|
466
|
+
key: e,
|
|
467
|
+
type: "button",
|
|
468
|
+
class: h(["todo-icon", `todo-${e}`]),
|
|
469
|
+
title: C(e),
|
|
470
|
+
"aria-label": C(e),
|
|
471
|
+
"aria-pressed": e === O.value,
|
|
472
|
+
onClick: (t) => zt(e)
|
|
473
|
+
}, [f("span", {
|
|
474
|
+
class: h(["todo-swatch", { "todo-swatch--on": e === O.value }]),
|
|
475
|
+
"aria-hidden": "true"
|
|
476
|
+
}, null, 2)], 10, Ie))), 128))], 8, Fe)) : u("v-if", !0),
|
|
477
|
+
P.value ? (g(), d("div", Le, [p(w, { name: "search" }), b(f("input", {
|
|
478
|
+
ref_key: "searchBox",
|
|
479
|
+
ref: ct,
|
|
480
|
+
"onUpdate:modelValue": n[6] ||= (e) => F.value = e,
|
|
481
|
+
class: "todo-input",
|
|
482
|
+
type: "search",
|
|
483
|
+
"aria-label": v(m)("campus.personalTools.searchTodo"),
|
|
484
|
+
placeholder: v(m)("campus.personalTools.search"),
|
|
485
|
+
onKeydown: ue(x(Rt, ["stop"]), ["esc"])
|
|
486
|
+
}, null, 40, Re), [[y, F.value]])])) : u("v-if", !0),
|
|
487
|
+
f("form", {
|
|
488
|
+
class: "todo-row todo-add",
|
|
489
|
+
onSubmit: x(Tt, ["prevent"])
|
|
490
|
+
}, [b(f("input", {
|
|
491
|
+
ref_key: "addBox",
|
|
492
|
+
ref: ut,
|
|
493
|
+
"onUpdate:modelValue": n[7] ||= (e) => L.value = e,
|
|
494
|
+
class: "todo-input",
|
|
495
|
+
type: "text",
|
|
496
|
+
"aria-label": v(m)("campus.personalTools.newTodo"),
|
|
497
|
+
maxlength: v(500),
|
|
498
|
+
disabled: st.value,
|
|
499
|
+
placeholder: st.value ? v(m)("campus.personalTools.maxTodos", { count: v(200) }) : v(m)("campus.personalTools.newTodo")
|
|
500
|
+
}, null, 8, ze), [[y, L.value]]), f("button", {
|
|
501
|
+
type: "submit",
|
|
502
|
+
class: "todo-icon",
|
|
503
|
+
title: v(m)("campus.personalTools.add"),
|
|
504
|
+
"aria-label": v(m)("campus.personalTools.add"),
|
|
505
|
+
disabled: st.value || !L.value.trim()
|
|
506
|
+
}, [p(w, { name: "plus" })], 8, Be)], 32),
|
|
507
|
+
f("ul", Ve, [(g(!0), d(ee, null, se(ot.value, (e) => (g(), d("li", {
|
|
508
|
+
key: e.id,
|
|
509
|
+
class: h(["todo-item", {
|
|
510
|
+
"todo-item--done": e.done,
|
|
511
|
+
"todo-item--over": Nt.value === e.id && $.value !== e.id
|
|
512
|
+
}]),
|
|
513
|
+
draggable: Q.value === e.id,
|
|
514
|
+
onDragstart: (t) => Pt(t, e),
|
|
515
|
+
onDragover: (t) => Ft(t, e),
|
|
516
|
+
onDrop: x((t) => It(e), ["prevent"]),
|
|
517
|
+
onDragend: Lt
|
|
518
|
+
}, [f("div", Ue, [
|
|
519
|
+
f("span", {
|
|
520
|
+
class: "todo-handle",
|
|
521
|
+
title: v(m)("campus.personalTools.reorder"),
|
|
522
|
+
"aria-label": v(m)("campus.personalTools.reorder"),
|
|
523
|
+
onPointerdown: (t) => Q.value = e.id,
|
|
524
|
+
onPointerup: n[8] ||= (e) => Q.value = ""
|
|
525
|
+
}, [p(w, { name: "grip" })], 40, We),
|
|
526
|
+
f("button", {
|
|
527
|
+
type: "button",
|
|
528
|
+
class: "todo-icon todo-check",
|
|
529
|
+
title: e.done ? v(m)("campus.personalTools.undoComplete") : v(m)("campus.personalTools.complete"),
|
|
530
|
+
"aria-label": e.done ? v(m)("campus.personalTools.undoComplete") : v(m)("campus.personalTools.complete"),
|
|
531
|
+
"aria-pressed": e.done,
|
|
532
|
+
onClick: (t) => Et(e)
|
|
533
|
+
}, [p(w, { name: e.done ? "circle-check" : "circle" }, null, 8, ["name"])], 8, Ge),
|
|
534
|
+
R.value === e.id ? b((g(), d("input", {
|
|
535
|
+
key: 0,
|
|
536
|
+
"onUpdate:modelValue": n[9] ||= (e) => z.value = e,
|
|
537
|
+
class: "todo-edit",
|
|
538
|
+
maxlength: v(500),
|
|
539
|
+
"aria-label": v(m)("campus.personalTools.editTodo"),
|
|
540
|
+
onKeydown: [ue(x(Z, ["prevent"]), ["enter"]), n[10] ||= ue(x((e) => R.value = "", ["stop"]), ["esc"])],
|
|
541
|
+
onBlur: Z
|
|
542
|
+
}, null, 40, Ke)), [[y, z.value]]) : (g(), d("button", {
|
|
543
|
+
key: 1,
|
|
544
|
+
type: "button",
|
|
545
|
+
class: "todo-text",
|
|
546
|
+
title: e.text,
|
|
547
|
+
onClick: (t) => Ot(e)
|
|
548
|
+
}, [f("span", Je, ce(e.text), 1), e.due ? (g(), d("small", {
|
|
549
|
+
key: 0,
|
|
550
|
+
class: h(["todo-due", { "todo-due--over": v(we)(e, at.value) }])
|
|
551
|
+
}, ce(v(Te)(e.due, at.value, v(pe))), 3)) : u("v-if", !0)], 8, qe)),
|
|
552
|
+
f("button", {
|
|
553
|
+
type: "button",
|
|
554
|
+
class: h(["todo-icon todo-hover", { "todo-icon--set": e.due }]),
|
|
555
|
+
title: e.due ? v(m)("campus.personalTools.editDue") : v(m)("campus.personalTools.setDue"),
|
|
556
|
+
"aria-label": e.due ? v(m)("campus.personalTools.editDue") : v(m)("campus.personalTools.setDue"),
|
|
557
|
+
"aria-expanded": B.value === e.id,
|
|
558
|
+
onClick: (t) => kt(e)
|
|
559
|
+
}, [p(w, { name: "clock" })], 10, Ye),
|
|
560
|
+
f("button", {
|
|
561
|
+
type: "button",
|
|
562
|
+
class: "todo-icon todo-hover",
|
|
563
|
+
title: v(m)("campus.personalTools.remove"),
|
|
564
|
+
"aria-label": v(m)("campus.personalTools.remove"),
|
|
565
|
+
onClick: (t) => Dt(e)
|
|
566
|
+
}, [p(w, { name: "trash" })], 8, Xe)
|
|
567
|
+
]), B.value === e.id ? (g(), d("div", Ze, [
|
|
568
|
+
b(f("input", {
|
|
569
|
+
"onUpdate:modelValue": n[11] ||= (e) => V.value = e,
|
|
570
|
+
class: "todo-input",
|
|
571
|
+
type: "date",
|
|
572
|
+
"aria-label": v(m)("campus.personalTools.dueDate"),
|
|
573
|
+
onChange: jt
|
|
574
|
+
}, null, 40, Qe), [[y, V.value]]),
|
|
575
|
+
b(f("input", {
|
|
576
|
+
"onUpdate:modelValue": n[12] ||= (e) => H.value = e,
|
|
577
|
+
class: "todo-input",
|
|
578
|
+
type: "time",
|
|
579
|
+
"aria-label": v(m)("campus.personalTools.dueTime"),
|
|
580
|
+
onChange: jt
|
|
581
|
+
}, null, 40, $e), [[y, H.value]]),
|
|
582
|
+
f("button", {
|
|
583
|
+
type: "button",
|
|
584
|
+
class: "todo-icon",
|
|
585
|
+
title: v(m)("campus.personalTools.clearDue"),
|
|
586
|
+
"aria-label": v(m)("campus.personalTools.clearDue"),
|
|
587
|
+
onClick: Mt
|
|
588
|
+
}, [p(w, { name: "close" })], 8, et),
|
|
589
|
+
f("button", {
|
|
590
|
+
type: "button",
|
|
591
|
+
class: "todo-icon",
|
|
592
|
+
title: v(m)("campus.personalTools.doneDue"),
|
|
593
|
+
"aria-label": v(m)("campus.personalTools.doneDue"),
|
|
594
|
+
onClick: n[13] ||= (e) => B.value = ""
|
|
595
|
+
}, [p(w, { name: "check" })], 8, tt)
|
|
596
|
+
])) : u("v-if", !0)], 42, He))), 128))]),
|
|
597
|
+
ot.value.length ? u("v-if", !0) : (g(), d("p", nt, ce(F.value.trim() ? v(m)("campus.personalTools.noMatch") : j.value.length && !N.value ? v(m)("campus.personalTools.allDone") : v(m)("campus.personalTools.emptyTodo")), 1))
|
|
598
|
+
], 46, De)) : u("v-if", !0)], 8, ["to"]))], 64));
|
|
599
|
+
}
|
|
600
|
+
}), [["__scopeId", "data-v-82ed92e0"]]);
|
|
601
|
+
export { k as default };
|