nicklabs-ui 1.0.80 → 1.0.82
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/README.md +58 -24
- package/dist/index.mjs +715 -503
- package/dist/nicklabs-ui.css +1 -1
- package/dist/src/components/NAudioSelect.vue.d.ts +1 -0
- package/dist/src/components/NImageSelect.vue.d.ts +1 -0
- package/dist/src/components/NVideoSelect.vue.d.ts +1 -0
- package/dist/src/types/components/audioselect.d.ts +4 -4
- package/dist/src/types/components/imageselect.d.ts +5 -5
- package/dist/src/types/components/videoselect.d.ts +6 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, Transition as n, TransitionGroup as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createStaticVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeProps as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, onUnmounted as b, openBlock as x, reactive as S, ref as C, renderList as w, renderSlot as T, toDisplayString as E, unref as D, useCssVars as O, vModelText as k, watch as A, withCtx as j, withDirectives as M, withModifiers as N } from "vue";
|
|
2
2
|
//#region src/composables/sharedRouter.ts
|
|
3
3
|
var P = null;
|
|
4
|
-
function
|
|
4
|
+
function F(e) {
|
|
5
5
|
P = e;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function I() {
|
|
8
8
|
return P;
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/components/NButton.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
12
|
+
var ee = ["type", "disabled"], te = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "spinner",
|
|
15
15
|
viewBox: "0 0 24 24",
|
|
16
16
|
fill: "none",
|
|
17
17
|
xmlns: "http://www.w3.org/2000/svg"
|
|
18
|
-
},
|
|
18
|
+
}, L = /* @__PURE__ */ p({
|
|
19
19
|
__name: "NButton",
|
|
20
20
|
props: {
|
|
21
21
|
variant: { default: "none" },
|
|
@@ -63,7 +63,7 @@ var I = ["type", "disabled"], L = {
|
|
|
63
63
|
]),
|
|
64
64
|
type: e.type,
|
|
65
65
|
disabled: e.disabled || e.loading
|
|
66
|
-
}, [e.loading ? (x(), s("svg",
|
|
66
|
+
}, [e.loading ? (x(), s("svg", te, [...n[0] ||= [c("circle", {
|
|
67
67
|
cx: "12",
|
|
68
68
|
cy: "12",
|
|
69
69
|
r: "10",
|
|
@@ -72,13 +72,13 @@ var I = ["type", "disabled"], L = {
|
|
|
72
72
|
"stroke-linecap": "round",
|
|
73
73
|
"stroke-dasharray": "32",
|
|
74
74
|
"stroke-dashoffset": "12"
|
|
75
|
-
}, null, -1)]])) : o("", !0), T(t.$slots, "default", {}, void 0, !0)], 10,
|
|
75
|
+
}, null, -1)]])) : o("", !0), T(t.$slots, "default", {}, void 0, !0)], 10, ee));
|
|
76
76
|
}
|
|
77
77
|
}), R = (e, t) => {
|
|
78
78
|
let n = e.__vccOpts || e;
|
|
79
79
|
for (let [e, r] of t) n[e] = r;
|
|
80
80
|
return n;
|
|
81
|
-
}, z = /* @__PURE__ */ R(
|
|
81
|
+
}, z = /* @__PURE__ */ R(L, [["__scopeId", "data-v-285afe14"]]), B = (e) => e.meta?.breadcrumb ?? "", V = C((e) => e);
|
|
82
82
|
function H() {
|
|
83
83
|
function e(e) {
|
|
84
84
|
B = e;
|
|
@@ -87,7 +87,7 @@ function H() {
|
|
|
87
87
|
V.value = e;
|
|
88
88
|
}
|
|
89
89
|
let n = i(() => {
|
|
90
|
-
let e =
|
|
90
|
+
let e = I();
|
|
91
91
|
if (!e) return [];
|
|
92
92
|
let t = e.currentRoute.value.matched, n = [];
|
|
93
93
|
return t.forEach((e, r) => {
|
|
@@ -101,7 +101,7 @@ function H() {
|
|
|
101
101
|
}), n;
|
|
102
102
|
});
|
|
103
103
|
function r(e) {
|
|
104
|
-
|
|
104
|
+
I()?.push(e);
|
|
105
105
|
}
|
|
106
106
|
function a() {
|
|
107
107
|
V.value = (e) => e;
|
|
@@ -132,7 +132,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
132
132
|
}), [["__scopeId", "data-v-46f3b63f"]]), G = {
|
|
133
133
|
key: 0,
|
|
134
134
|
class: "label"
|
|
135
|
-
},
|
|
135
|
+
}, K = ["disabled"], ie = [
|
|
136
136
|
"type",
|
|
137
137
|
"placeholder",
|
|
138
138
|
"disabled",
|
|
@@ -140,10 +140,10 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
140
140
|
"value",
|
|
141
141
|
"maxlength",
|
|
142
142
|
"autocomplete"
|
|
143
|
-
],
|
|
143
|
+
], q = ["disabled"], ae = {
|
|
144
144
|
key: 2,
|
|
145
145
|
class: "actions"
|
|
146
|
-
},
|
|
146
|
+
}, oe = {
|
|
147
147
|
key: 0,
|
|
148
148
|
xmlns: "http://www.w3.org/2000/svg",
|
|
149
149
|
width: "16",
|
|
@@ -154,7 +154,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
154
154
|
"stroke-width": "2",
|
|
155
155
|
"stroke-linecap": "round",
|
|
156
156
|
"stroke-linejoin": "round"
|
|
157
|
-
},
|
|
157
|
+
}, se = {
|
|
158
158
|
key: 1,
|
|
159
159
|
xmlns: "http://www.w3.org/2000/svg",
|
|
160
160
|
width: "16",
|
|
@@ -165,7 +165,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
165
165
|
"stroke-width": "2",
|
|
166
166
|
"stroke-linecap": "round",
|
|
167
167
|
"stroke-linejoin": "round"
|
|
168
|
-
},
|
|
168
|
+
}, ce = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
169
169
|
__name: "NInput",
|
|
170
170
|
props: {
|
|
171
171
|
modelValue: { default: "" },
|
|
@@ -292,7 +292,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
292
292
|
"stroke-width": "2",
|
|
293
293
|
"stroke-linecap": "round",
|
|
294
294
|
"stroke-linejoin": "round"
|
|
295
|
-
}, [c("path", { d: "M5 12h14" })], -1)]], 8,
|
|
295
|
+
}, [c("path", { d: "M5 12h14" })], -1)]], 8, K)) : o("", !0),
|
|
296
296
|
c("input", {
|
|
297
297
|
type: u.value,
|
|
298
298
|
placeholder: e.placeholder,
|
|
@@ -307,7 +307,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
307
307
|
onChange: i[1] ||= (e) => n("change", e),
|
|
308
308
|
onKeydown: h,
|
|
309
309
|
onCompositionend: _
|
|
310
|
-
}, null, 40,
|
|
310
|
+
}, null, 40, ie),
|
|
311
311
|
a.value ? (x(), s("button", {
|
|
312
312
|
key: 1,
|
|
313
313
|
class: "tool-button",
|
|
@@ -324,18 +324,18 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
324
324
|
"stroke-width": "2",
|
|
325
325
|
"stroke-linecap": "round",
|
|
326
326
|
"stroke-linejoin": "round"
|
|
327
|
-
}, [c("path", { d: "M5 12h14" }), c("path", { d: "M12 5v14" })], -1)]], 8,
|
|
328
|
-
a.value ? o("", !0) : (x(), s("div",
|
|
327
|
+
}, [c("path", { d: "M5 12h14" }), c("path", { d: "M12 5v14" })], -1)]], 8, q)) : o("", !0),
|
|
328
|
+
a.value ? o("", !0) : (x(), s("div", ae, [r.value && !e.disabled ? (x(), s("button", {
|
|
329
329
|
key: 0,
|
|
330
330
|
type: "button",
|
|
331
331
|
onClick: T,
|
|
332
332
|
"aria-label": "Toggle password visibility"
|
|
333
|
-
}, [l.value ? (x(), s("svg",
|
|
333
|
+
}, [l.value ? (x(), s("svg", se, [...i[5] ||= [
|
|
334
334
|
c("path", { d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }, null, -1),
|
|
335
335
|
c("path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }, null, -1),
|
|
336
336
|
c("path", { d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }, null, -1),
|
|
337
337
|
c("path", { d: "m2 2 20 20" }, null, -1)
|
|
338
|
-
]])) : (x(), s("svg",
|
|
338
|
+
]])) : (x(), s("svg", oe, [...i[4] ||= [c("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }, null, -1), c("circle", {
|
|
339
339
|
cx: "12",
|
|
340
340
|
cy: "12",
|
|
341
341
|
r: "3"
|
|
@@ -357,7 +357,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
357
357
|
}, [c("path", { d: "M18 6 6 18" }), c("path", { d: "m6 6 12 12" })], -1)]])) : o("", !0)]))
|
|
358
358
|
], 2)], 2));
|
|
359
359
|
}
|
|
360
|
-
}), [["__scopeId", "data-v-91e7a17e"]]),
|
|
360
|
+
}), [["__scopeId", "data-v-91e7a17e"]]), le = { class: "textarea" }, ue = ["textContent"], de = [
|
|
361
361
|
"rows",
|
|
362
362
|
"placeholder",
|
|
363
363
|
"disabled",
|
|
@@ -366,10 +366,10 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
366
366
|
"maxlength",
|
|
367
367
|
"autocomplete",
|
|
368
368
|
"wrap"
|
|
369
|
-
],
|
|
369
|
+
], fe = {
|
|
370
370
|
key: 1,
|
|
371
371
|
class: "char-count"
|
|
372
|
-
},
|
|
372
|
+
}, pe = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
373
373
|
__name: "NTextarea",
|
|
374
374
|
props: {
|
|
375
375
|
modelValue: { default: "" },
|
|
@@ -419,12 +419,12 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
419
419
|
};
|
|
420
420
|
return y(() => {
|
|
421
421
|
e.autofocus && r.value?.focus();
|
|
422
|
-
}), (t, i) => (x(), s("div",
|
|
422
|
+
}), (t, i) => (x(), s("div", le, [
|
|
423
423
|
e.title ? (x(), s("label", {
|
|
424
424
|
key: 0,
|
|
425
425
|
class: "label",
|
|
426
426
|
textContent: E(e.title)
|
|
427
|
-
}, null, 8,
|
|
427
|
+
}, null, 8, ue)) : o("", !0),
|
|
428
428
|
c("textarea", {
|
|
429
429
|
ref_key: "textareaRef",
|
|
430
430
|
ref: r,
|
|
@@ -443,17 +443,17 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
443
443
|
onChange: i[2] ||= (e) => n("change", e),
|
|
444
444
|
onKeydown: i[3] ||= (e) => n("keydown", e),
|
|
445
445
|
onPaste: i[4] ||= (e) => n("paste", e)
|
|
446
|
-
}, null, 40,
|
|
447
|
-
e.showCount ? (x(), s("div",
|
|
446
|
+
}, null, 40, de),
|
|
447
|
+
e.showCount ? (x(), s("div", fe, E(u.value), 1)) : o("", !0)
|
|
448
448
|
]));
|
|
449
449
|
}
|
|
450
|
-
}), [["__scopeId", "data-v-03ad19c3"]]),
|
|
450
|
+
}), [["__scopeId", "data-v-03ad19c3"]]), me = {
|
|
451
451
|
key: 0,
|
|
452
452
|
class: "label"
|
|
453
|
-
},
|
|
453
|
+
}, he = ["onClick"], ge = ["checked", "disabled"], _e = { class: "text" }, ve = ["checked", "disabled"], J = {
|
|
454
454
|
key: 0,
|
|
455
455
|
class: "text"
|
|
456
|
-
},
|
|
456
|
+
}, ye = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
457
457
|
__name: "NCheckbox",
|
|
458
458
|
props: {
|
|
459
459
|
modelValue: { default: !1 },
|
|
@@ -517,7 +517,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
517
517
|
};
|
|
518
518
|
return y(() => {
|
|
519
519
|
t.autofocus || a.value?.focus();
|
|
520
|
-
}), (n, r) => (x(), s("div", { class: g(["checkbox", { inline: t.inline }]) }, [t.title ? (x(), s("h3",
|
|
520
|
+
}), (n, r) => (x(), s("div", { class: g(["checkbox", { inline: t.inline }]) }, [t.title ? (x(), s("h3", me, E(t.title), 1)) : o("", !0), c("div", { class: g(["group", [t.direction]]) }, [l.value ? (x(), s("label", {
|
|
521
521
|
key: 1,
|
|
522
522
|
class: "item",
|
|
523
523
|
onClick: r[0] ||= N((e) => h(), ["prevent"])
|
|
@@ -526,7 +526,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
526
526
|
type: "checkbox",
|
|
527
527
|
checked: !!t.modelValue,
|
|
528
528
|
disabled: t.disabled
|
|
529
|
-
}, null, 8,
|
|
529
|
+
}, null, 8, ve),
|
|
530
530
|
r[2] ||= c("span", { class: "icon" }, [c("svg", {
|
|
531
531
|
xmlns: "http://www.w3.org/2000/svg",
|
|
532
532
|
width: "24",
|
|
@@ -538,7 +538,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
538
538
|
"stroke-linecap": "round",
|
|
539
539
|
"stroke-linejoin": "round"
|
|
540
540
|
}, [c("path", { d: "M20 6 9 17l-5-5" })])], -1),
|
|
541
|
-
n.$slots.default || t.label ? (x(), s("span",
|
|
541
|
+
n.$slots.default || t.label ? (x(), s("span", J, [T(n.$slots, "default", {}, () => [d(E(t.label), 1)], !0)])) : o("", !0)
|
|
542
542
|
])) : (x(!0), s(e, { key: 0 }, w(t.options, (e, n) => (x(), s("label", {
|
|
543
543
|
key: `${t.formatLabel(e)}${n}`,
|
|
544
544
|
class: "item",
|
|
@@ -548,7 +548,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
548
548
|
type: "checkbox",
|
|
549
549
|
checked: m(t.formatValue(e)),
|
|
550
550
|
disabled: t.disabled
|
|
551
|
-
}, null, 8,
|
|
551
|
+
}, null, 8, ge),
|
|
552
552
|
c("span", { class: g(["icon", { radio: !t.multiple }]) }, [...r[1] ||= [c("svg", {
|
|
553
553
|
xmlns: "http://www.w3.org/2000/svg",
|
|
554
554
|
width: "24",
|
|
@@ -560,13 +560,13 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
560
560
|
"stroke-linecap": "round",
|
|
561
561
|
"stroke-linejoin": "round"
|
|
562
562
|
}, [c("path", { d: "M20 6 9 17l-5-5" })], -1)]], 2),
|
|
563
|
-
c("span",
|
|
564
|
-
], 8,
|
|
563
|
+
c("span", _e, E(t.formatLabel(e)), 1)
|
|
564
|
+
], 8, he))), 128))], 2)], 2));
|
|
565
565
|
}
|
|
566
|
-
}), [["__scopeId", "data-v-1f6a325a"]]),
|
|
566
|
+
}), [["__scopeId", "data-v-1f6a325a"]]), be = { class: "select" }, Y = {
|
|
567
567
|
key: 0,
|
|
568
568
|
class: "label"
|
|
569
|
-
},
|
|
569
|
+
}, X = { class: "select-chips-container" }, xe = ["textContent"], Se = ["onClick"], Z = {
|
|
570
570
|
key: 0,
|
|
571
571
|
class: "search-box"
|
|
572
572
|
}, Ce = { class: "options" }, we = ["onClick"], Te = {
|
|
@@ -664,7 +664,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
664
664
|
let e = Object.keys(p.value), n = e.length;
|
|
665
665
|
return n === 0 ? "" : t.multiple ? `已選 ${n} 項` : t.formatLabel(p.value[e[0]]) ?? "";
|
|
666
666
|
});
|
|
667
|
-
return (n, r) => (x(), s("div",
|
|
667
|
+
return (n, r) => (x(), s("div", be, [t.title ? (x(), s("label", Y, E(t.title), 1)) : o("", !0), c("div", {
|
|
668
668
|
ref_key: "selectGroupRef",
|
|
669
669
|
ref: d,
|
|
670
670
|
class: g(["group", {
|
|
@@ -675,11 +675,11 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
675
675
|
class: g(["trigger", { disabled: t.disabled }]),
|
|
676
676
|
onClick: _
|
|
677
677
|
}, [
|
|
678
|
-
c("div",
|
|
678
|
+
c("div", X, [!m.value || !t.multiple || t.multiple && t.multipleDisplay === "count" ? (x(), s("span", {
|
|
679
679
|
key: 0,
|
|
680
680
|
class: g(["trigger-text", { placeholder: !m.value }]),
|
|
681
681
|
textContent: E(m.value ? j.value : t.placeholder)
|
|
682
|
-
}, null, 10,
|
|
682
|
+
}, null, 10, xe)) : o("", !0), t.multiple && t.multipleDisplay === "tags" ? (x(!0), s(e, { key: 1 }, w(p.value, (e, n) => (x(), s("div", {
|
|
683
683
|
key: `${t.formatLabel(e)}${n}`,
|
|
684
684
|
class: "select-chip"
|
|
685
685
|
}, [c("span", null, E(t.formatLabel(e)), 1), c("span", {
|
|
@@ -695,7 +695,7 @@ var U = { class: "breadcrumbs" }, W = ["onClick"], ne = {
|
|
|
695
695
|
"stroke-width": "2",
|
|
696
696
|
"stroke-linecap": "round",
|
|
697
697
|
"stroke-linejoin": "round"
|
|
698
|
-
}, [c("path", { d: "M18 6 6 18" }), c("path", { d: "m6 6 12 12" })], -1)]], 8,
|
|
698
|
+
}, [c("path", { d: "M18 6 6 18" }), c("path", { d: "m6 6 12 12" })], -1)]], 8, Se)]))), 128)) : o("", !0)]),
|
|
699
699
|
t.clearable && m.value && !t.disabled ? (x(), s("button", {
|
|
700
700
|
key: 0,
|
|
701
701
|
class: "clear-btn",
|
|
@@ -1899,7 +1899,7 @@ var an = { class: "hero-section-container" }, on = { class: "hero-section" }, sn
|
|
|
1899
1899
|
}, l({ _: 2 }, [
|
|
1900
1900
|
e.batchDeletable ? {
|
|
1901
1901
|
name: "batch",
|
|
1902
|
-
fn: j(() => [f(
|
|
1902
|
+
fn: j(() => [f(ye, {
|
|
1903
1903
|
"model-value": m.value,
|
|
1904
1904
|
"onUpdate:modelValue": r[4] ||= () => g()
|
|
1905
1905
|
}, null, 8, ["model-value"])]),
|
|
@@ -1907,7 +1907,7 @@ var an = { class: "hero-section-container" }, on = { class: "hero-section" }, sn
|
|
|
1907
1907
|
} : void 0,
|
|
1908
1908
|
t.$slots.item ? {
|
|
1909
1909
|
name: "item",
|
|
1910
|
-
fn: j(({ item: n, column: r, index: i }) => [e.batchDeletable ? (x(), s("td", ir, [f(
|
|
1910
|
+
fn: j(({ item: n, column: r, index: i }) => [e.batchDeletable ? (x(), s("td", ir, [f(ye, {
|
|
1911
1911
|
onClick: N((e) => h(n), ["stop"]),
|
|
1912
1912
|
"model-value": p(n.id)
|
|
1913
1913
|
}, null, 8, ["onClick", "model-value"])])) : o("", !0), T(t.$slots, "item", {
|
|
@@ -2324,8 +2324,8 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2324
2324
|
"四",
|
|
2325
2325
|
"五",
|
|
2326
2326
|
"六"
|
|
2327
|
-
], P = /* @__PURE__ */ new Date(),
|
|
2328
|
-
function
|
|
2327
|
+
], P = /* @__PURE__ */ new Date(), F = P.getFullYear(), I = P.getMonth(), ee = P.getDate();
|
|
2328
|
+
function te(e, t) {
|
|
2329
2329
|
let n = new Date(e, t, 1).getDay(), r = new Date(e, t + 1, 0).getDate(), i = new Date(e, t, 0).getDate(), a = [];
|
|
2330
2330
|
for (let r = n - 1; r >= 0; r--) {
|
|
2331
2331
|
let n = t === 0 ? 11 : t - 1, o = t === 0 ? e - 1 : e;
|
|
@@ -2351,30 +2351,30 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2351
2351
|
});
|
|
2352
2352
|
return a;
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2354
|
+
function L(e, t) {
|
|
2355
2355
|
return e.year === t.year ? e.month === t.month ? e.day - t.day : e.month - t.month : e.year - t.year;
|
|
2356
2356
|
}
|
|
2357
2357
|
function R(e) {
|
|
2358
2358
|
return String(e).padStart(2, "0");
|
|
2359
2359
|
}
|
|
2360
|
-
let B = C("date"), V = C(/* @__PURE__ */ new Date()), H = C(null), U = C(0), W = C(0), ne = null, re = null, G = i(() => V.value.getFullYear()),
|
|
2360
|
+
let B = C("date"), V = C(/* @__PURE__ */ new Date()), H = C(null), U = C(0), W = C(0), ne = null, re = null, G = i(() => V.value.getFullYear()), K = i(() => V.value.getMonth()), ie = C(Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 12) * 12), q = i(() => {
|
|
2361
2361
|
let e = [];
|
|
2362
|
-
for (let t = 0; t < 12; t++) e.push(
|
|
2362
|
+
for (let t = 0; t < 12; t++) e.push(ie.value + t);
|
|
2363
2363
|
return e;
|
|
2364
2364
|
});
|
|
2365
2365
|
A(G, (e) => {
|
|
2366
|
-
|
|
2366
|
+
ie.value = Math.floor(e / 12) * 12;
|
|
2367
2367
|
}, { immediate: !0 }), A(() => t.modelValue, (e) => {
|
|
2368
2368
|
if (!e) return;
|
|
2369
2369
|
let t = p(String(e));
|
|
2370
2370
|
t && (V.value = new Date(t.year, t.month, 1));
|
|
2371
2371
|
}, { immediate: !0 });
|
|
2372
|
-
let
|
|
2372
|
+
let ae = i(() => te(G.value, K.value)), oe = i(() => {
|
|
2373
2373
|
if (!t.modelValue) return "";
|
|
2374
2374
|
let e = p(String(t.modelValue));
|
|
2375
2375
|
return e ? u(e.year, e.month, e.day, e.hour, e.min) : "";
|
|
2376
|
-
}),
|
|
2377
|
-
function
|
|
2376
|
+
}), se = i(() => t.range ? t.start && t.end ? `${t.start} → ${t.end}` : t.start ? `${t.start} → ...` : "" : oe.value);
|
|
2377
|
+
function ce() {
|
|
2378
2378
|
let e = p(String(t.modelValue));
|
|
2379
2379
|
e ? (V.value = new Date(e.year, e.month, 1), U.value = e.hour, W.value = e.min, H.value = _.value ? {
|
|
2380
2380
|
year: e.year,
|
|
@@ -2383,55 +2383,55 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2383
2383
|
isCurrentMonth: !0
|
|
2384
2384
|
} : null) : (U.value = 0, W.value = 0, H.value = null), B.value = "date";
|
|
2385
2385
|
}
|
|
2386
|
-
function
|
|
2386
|
+
function le(e) {
|
|
2387
2387
|
if (!t.modelValue) return !1;
|
|
2388
2388
|
let n = p(String(t.modelValue));
|
|
2389
2389
|
return n ? n.year === e.year && n.month === e.month && n.day === e.day : !1;
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2392
|
-
return
|
|
2391
|
+
function ue(e) {
|
|
2392
|
+
return F === e.year && I === e.month && ee === e.day;
|
|
2393
2393
|
}
|
|
2394
|
-
function
|
|
2395
|
-
return _.value ? H.value !== null && H.value.year === e.year && H.value.month === e.month && H.value.day === e.day :
|
|
2394
|
+
function de(e) {
|
|
2395
|
+
return _.value ? H.value !== null && H.value.year === e.year && H.value.month === e.month && H.value.day === e.day : le(e);
|
|
2396
2396
|
}
|
|
2397
|
-
function
|
|
2397
|
+
function fe(e) {
|
|
2398
2398
|
let t = u(e.year, e.month, e.day, U.value, W.value);
|
|
2399
2399
|
l("update:modelValue", t), l("change", t);
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2402
|
-
if (_.value) H.value = { ...e }, V.value = new Date(e.year, e.month, 1),
|
|
2401
|
+
function pe(e) {
|
|
2402
|
+
if (_.value) H.value = { ...e }, V.value = new Date(e.year, e.month, 1), fe(e);
|
|
2403
2403
|
else {
|
|
2404
2404
|
let t = u(e.year, e.month, e.day, 0, 0);
|
|
2405
2405
|
l("update:modelValue", t), l("change", t), Be();
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
|
-
function
|
|
2409
|
-
V.value = new Date(e,
|
|
2408
|
+
function me(e) {
|
|
2409
|
+
V.value = new Date(e, K.value, 1), B.value = "date";
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2412
|
-
V.value = new Date(G.value,
|
|
2411
|
+
function he(e) {
|
|
2412
|
+
V.value = new Date(G.value, K.value + e, 1);
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2415
|
-
B.value === "year" ?
|
|
2414
|
+
function ge(e) {
|
|
2415
|
+
B.value === "year" ? ie.value += e * 12 : V.value = new Date(G.value + e, K.value, 1);
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2418
|
-
e === "H" ? U.value = Math.max(0, Math.min(23, U.value + t)) : W.value = Math.max(0, Math.min(59, W.value + t)), H.value &&
|
|
2417
|
+
function _e(e, t) {
|
|
2418
|
+
e === "H" ? U.value = Math.max(0, Math.min(23, U.value + t)) : W.value = Math.max(0, Math.min(59, W.value + t)), H.value && fe(H.value);
|
|
2419
2419
|
}
|
|
2420
|
-
function
|
|
2421
|
-
|
|
2422
|
-
re = setInterval(() =>
|
|
2420
|
+
function ve(e, t) {
|
|
2421
|
+
_e(e, t), ne = setTimeout(() => {
|
|
2422
|
+
re = setInterval(() => _e(e, t), 100);
|
|
2423
2423
|
}, 300);
|
|
2424
2424
|
}
|
|
2425
|
-
function
|
|
2425
|
+
function J() {
|
|
2426
2426
|
ne &&= (clearTimeout(ne), null), re &&= (clearInterval(re), null);
|
|
2427
2427
|
}
|
|
2428
|
-
function
|
|
2428
|
+
function ye(e, t) {
|
|
2429
2429
|
let n = parseInt(e.target.value);
|
|
2430
|
-
t === "H" ? U.value = n : W.value = n, H.value &&
|
|
2430
|
+
t === "H" ? U.value = n : W.value = n, H.value && fe(H.value);
|
|
2431
2431
|
}
|
|
2432
|
-
let
|
|
2433
|
-
year:
|
|
2434
|
-
month:
|
|
2432
|
+
let be = C(F), Y = C(I), X = C(null), xe = C(null), Se = C(null), Z = C(null), Ce = i(() => !!xe.value && !!Se.value), we = i(() => Y.value === 11 ? be.value + 1 : be.value), Te = i(() => Y.value === 11 ? 0 : Y.value + 1), Ee = i(() => te(be.value, Y.value)), De = i(() => te(we.value, Te.value)), Oe = i(() => [{
|
|
2433
|
+
year: be.value,
|
|
2434
|
+
month: Y.value,
|
|
2435
2435
|
days: Ee.value,
|
|
2436
2436
|
isLeft: !0
|
|
2437
2437
|
}, {
|
|
@@ -2449,49 +2449,49 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2449
2449
|
isCurrentMonth: !0
|
|
2450
2450
|
} : null;
|
|
2451
2451
|
}
|
|
2452
|
-
let Ae = i(() =>
|
|
2453
|
-
if (
|
|
2454
|
-
let e =
|
|
2452
|
+
let Ae = i(() => X.value && Z.value ? L(X.value, Z.value) <= 0 ? X.value : Z.value : xe.value ?? ke(t.start)), je = i(() => X.value && Z.value ? L(X.value, Z.value) <= 0 ? Z.value : X.value : Se.value ?? ke(t.end)), Me = i(() => {
|
|
2453
|
+
if (X.value) {
|
|
2454
|
+
let e = X.value;
|
|
2455
2455
|
return `${e.year}-${R(e.month + 1)}-${R(e.day)}`;
|
|
2456
2456
|
}
|
|
2457
|
-
if (
|
|
2458
|
-
let e =
|
|
2457
|
+
if (xe.value) {
|
|
2458
|
+
let e = xe.value;
|
|
2459
2459
|
return `${e.year}-${R(e.month + 1)}-${R(e.day)}`;
|
|
2460
2460
|
}
|
|
2461
2461
|
return t.start;
|
|
2462
2462
|
}), Ne = i(() => {
|
|
2463
|
-
if (
|
|
2464
|
-
if (
|
|
2465
|
-
let e =
|
|
2463
|
+
if (X.value) return "";
|
|
2464
|
+
if (Se.value) {
|
|
2465
|
+
let e = Se.value;
|
|
2466
2466
|
return `${e.year}-${R(e.month + 1)}-${R(e.day)}`;
|
|
2467
2467
|
}
|
|
2468
2468
|
return t.end;
|
|
2469
2469
|
});
|
|
2470
2470
|
function Pe() {
|
|
2471
2471
|
let e = p(t.start) ?? {
|
|
2472
|
-
year:
|
|
2473
|
-
month:
|
|
2472
|
+
year: F,
|
|
2473
|
+
month: I,
|
|
2474
2474
|
day: 1,
|
|
2475
2475
|
hour: 0,
|
|
2476
2476
|
min: 0
|
|
2477
2477
|
};
|
|
2478
|
-
|
|
2478
|
+
be.value = e.year, Y.value = e.month, xe.value = ke(t.start), Se.value = ke(t.end), X.value = null, Z.value = null;
|
|
2479
2479
|
}
|
|
2480
2480
|
function Q() {
|
|
2481
|
-
|
|
2481
|
+
Y.value === 0 ? (be.value--, Y.value = 11) : Y.value--;
|
|
2482
2482
|
}
|
|
2483
2483
|
function Fe() {
|
|
2484
|
-
|
|
2484
|
+
Y.value === 11 ? (be.value++, Y.value = 0) : Y.value++;
|
|
2485
2485
|
}
|
|
2486
2486
|
function Ie(e) {
|
|
2487
|
-
if (!
|
|
2487
|
+
if (!X.value) X.value = { ...e }, xe.value = null, Se.value = null;
|
|
2488
2488
|
else {
|
|
2489
|
-
let t =
|
|
2490
|
-
|
|
2489
|
+
let t = X.value, [n, r] = L(t, e) <= 0 ? [t, e] : [e, t];
|
|
2490
|
+
xe.value = n, Se.value = r, X.value = null, Z.value = null;
|
|
2491
2491
|
}
|
|
2492
2492
|
}
|
|
2493
2493
|
function Le(e) {
|
|
2494
|
-
let t = e.year ===
|
|
2494
|
+
let t = e.year === F && e.month === I && e.day === ee, n = X.value && e.year === X.value.year && e.month === X.value.month && e.day === X.value.day, r = Ae.value, i = je.value, a = r && e.year === r.year && e.month === r.month && e.day === r.day, o = i && e.year === i.year && e.month === i.month && e.day === i.day, s = r && i && L(e, r) > 0 && L(e, i) < 0;
|
|
2495
2495
|
return {
|
|
2496
2496
|
"is-other-month": !e.isCurrentMonth,
|
|
2497
2497
|
"is-today": t && !a && !o,
|
|
@@ -2502,15 +2502,15 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2502
2502
|
};
|
|
2503
2503
|
}
|
|
2504
2504
|
function Re() {
|
|
2505
|
-
if (!
|
|
2506
|
-
let e =
|
|
2505
|
+
if (!xe.value || !Se.value) return;
|
|
2506
|
+
let e = xe.value, t = Se.value, n = `${e.year}-${R(e.month + 1)}-${R(e.day)}`, r = `${t.year}-${R(t.month + 1)}-${R(t.day)}`;
|
|
2507
2507
|
l("update:start", n), l("update:end", r), l("change", n, r), Be();
|
|
2508
2508
|
}
|
|
2509
2509
|
function ze() {
|
|
2510
|
-
t.disabled || (b.value || (t.range ? Pe() :
|
|
2510
|
+
t.disabled || (b.value || (t.range ? Pe() : ce()), b.value = !b.value);
|
|
2511
2511
|
}
|
|
2512
2512
|
function Be() {
|
|
2513
|
-
b.value = !1,
|
|
2513
|
+
b.value = !1, X.value = null, Z.value = null;
|
|
2514
2514
|
}
|
|
2515
2515
|
function Ve() {
|
|
2516
2516
|
B.value = B.value === "date" ? "year" : "date";
|
|
@@ -2522,11 +2522,11 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2522
2522
|
y(() => {
|
|
2523
2523
|
document.addEventListener("mousedown", He), window.addEventListener("resize", O);
|
|
2524
2524
|
}), v(() => {
|
|
2525
|
-
document.removeEventListener("mousedown", He), window.removeEventListener("resize", O), D && clearTimeout(D),
|
|
2525
|
+
document.removeEventListener("mousedown", He), window.removeEventListener("resize", O), D && clearTimeout(D), J();
|
|
2526
2526
|
});
|
|
2527
2527
|
let Ue = (e) => {
|
|
2528
2528
|
if (e.stopPropagation(), t.range) {
|
|
2529
|
-
|
|
2529
|
+
xe.value = null, Se.value = null, X.value = null, Z.value = null, l("update:start", ""), l("update:end", ""), l("change", "", ""), l("clear");
|
|
2530
2530
|
return;
|
|
2531
2531
|
}
|
|
2532
2532
|
l("update:modelValue", ""), l("change", ""), l("clear");
|
|
@@ -2543,7 +2543,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2543
2543
|
}]) }, [c("div", {
|
|
2544
2544
|
class: "picker-trigger",
|
|
2545
2545
|
onClick: ze
|
|
2546
|
-
}, [c("span", { class: g(["text", { placeholder: !
|
|
2546
|
+
}, [c("span", { class: g(["text", { placeholder: !se.value }]) }, E(se.value || t.placeholder), 3), t.clearable && se.value ? (x(), a(z, {
|
|
2547
2547
|
key: 0,
|
|
2548
2548
|
variant: "none",
|
|
2549
2549
|
square: "",
|
|
@@ -2569,7 +2569,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2569
2569
|
c("div", jr, [f(z, {
|
|
2570
2570
|
variant: "ghost",
|
|
2571
2571
|
square: "",
|
|
2572
|
-
onClick: i[0] ||= (e) =>
|
|
2572
|
+
onClick: i[0] ||= (e) => ge(-1)
|
|
2573
2573
|
}, {
|
|
2574
2574
|
default: j(() => [...i[21] ||= [c("svg", {
|
|
2575
2575
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2587,7 +2587,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2587
2587
|
key: 0,
|
|
2588
2588
|
variant: "ghost",
|
|
2589
2589
|
square: "",
|
|
2590
|
-
onClick: i[1] ||= (e) =>
|
|
2590
|
+
onClick: i[1] ||= (e) => he(-1)
|
|
2591
2591
|
}, {
|
|
2592
2592
|
default: j(() => [...i[22] ||= [c("svg", {
|
|
2593
2593
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2605,12 +2605,12 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2605
2605
|
c("div", {
|
|
2606
2606
|
class: "header-title",
|
|
2607
2607
|
onClick: Ve
|
|
2608
|
-
}, [B.value === "date" ? (x(), s(e, { key: 0 }, [d(E(k[
|
|
2608
|
+
}, [B.value === "date" ? (x(), s(e, { key: 0 }, [d(E(k[K.value]) + " " + E(G.value), 1)], 64)) : (x(), s(e, { key: 1 }, [d(E(q.value[0]) + " - " + E(q.value[q.value.length - 1]), 1)], 64))]),
|
|
2609
2609
|
c("div", Mr, [B.value === "date" ? (x(), a(z, {
|
|
2610
2610
|
key: 0,
|
|
2611
2611
|
variant: "ghost",
|
|
2612
2612
|
square: "",
|
|
2613
|
-
onClick: i[2] ||= (e) =>
|
|
2613
|
+
onClick: i[2] ||= (e) => he(1)
|
|
2614
2614
|
}, {
|
|
2615
2615
|
default: j(() => [...i[23] ||= [c("svg", {
|
|
2616
2616
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2627,7 +2627,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2627
2627
|
})) : o("", !0), f(z, {
|
|
2628
2628
|
variant: "ghost",
|
|
2629
2629
|
square: "",
|
|
2630
|
-
onClick: i[3] ||= (e) =>
|
|
2630
|
+
onClick: i[3] ||= (e) => ge(1)
|
|
2631
2631
|
}, {
|
|
2632
2632
|
default: j(() => [...i[24] ||= [c("svg", {
|
|
2633
2633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2646,13 +2646,13 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2646
2646
|
c("div", Nr, [B.value === "date" ? (x(), s(e, { key: 0 }, [c("div", Pr, [(x(), s(e, null, w(M, (e) => c("span", {
|
|
2647
2647
|
key: e,
|
|
2648
2648
|
class: "weekday"
|
|
2649
|
-
}, E(e), 1)), 64))]), c("div", Fr, [(x(!0), s(e, null, w(
|
|
2649
|
+
}, E(e), 1)), 64))]), c("div", Fr, [(x(!0), s(e, null, w(ae.value, (e, t) => (x(), a(z, {
|
|
2650
2650
|
key: t,
|
|
2651
|
-
variant:
|
|
2652
|
-
intent:
|
|
2651
|
+
variant: de(e) ? "solid" : ue(e) ? "mute" : "ghost",
|
|
2652
|
+
intent: de(e) || ue(e) ? "primary" : "none",
|
|
2653
2653
|
class: g(["day-cell", { "is-not-current": !e.isCurrentMonth }]),
|
|
2654
2654
|
padding: "0",
|
|
2655
|
-
onClick: (t) =>
|
|
2655
|
+
onClick: (t) => pe(e)
|
|
2656
2656
|
}, {
|
|
2657
2657
|
default: j(() => [d(E(e.day), 1)]),
|
|
2658
2658
|
_: 2
|
|
@@ -2661,12 +2661,12 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2661
2661
|
"intent",
|
|
2662
2662
|
"class",
|
|
2663
2663
|
"onClick"
|
|
2664
|
-
]))), 128))])], 64)) : (x(), s("div", Ir, [(x(!0), s(e, null, w(
|
|
2664
|
+
]))), 128))])], 64)) : (x(), s("div", Ir, [(x(!0), s(e, null, w(q.value, (e) => (x(), a(z, {
|
|
2665
2665
|
key: e,
|
|
2666
2666
|
variant: e === G.value ? "solid" : "ghost",
|
|
2667
2667
|
intent: e === G.value ? "primary" : "none",
|
|
2668
2668
|
class: "year-cell",
|
|
2669
|
-
onClick: (t) =>
|
|
2669
|
+
onClick: (t) => me(e)
|
|
2670
2670
|
}, {
|
|
2671
2671
|
default: j(() => [d(E(e), 1)]),
|
|
2672
2672
|
_: 2
|
|
@@ -2682,9 +2682,9 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2682
2682
|
square: "",
|
|
2683
2683
|
size: "sm",
|
|
2684
2684
|
class: "time-step",
|
|
2685
|
-
onMousedown: i[4] ||= N((e) =>
|
|
2686
|
-
onMouseup:
|
|
2687
|
-
onMouseleave:
|
|
2685
|
+
onMousedown: i[4] ||= N((e) => ve("H", -1), ["prevent"]),
|
|
2686
|
+
onMouseup: J,
|
|
2687
|
+
onMouseleave: J
|
|
2688
2688
|
}, {
|
|
2689
2689
|
default: j(() => [...i[25] ||= [c("svg", {
|
|
2690
2690
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2705,16 +2705,16 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2705
2705
|
min: "0",
|
|
2706
2706
|
max: "23",
|
|
2707
2707
|
value: U.value,
|
|
2708
|
-
onInput: i[5] ||= (e) =>
|
|
2708
|
+
onInput: i[5] ||= (e) => ye(e, "H")
|
|
2709
2709
|
}, null, 40, Br),
|
|
2710
2710
|
f(z, {
|
|
2711
2711
|
variant: "ghost",
|
|
2712
2712
|
square: "",
|
|
2713
2713
|
size: "sm",
|
|
2714
2714
|
class: "time-step",
|
|
2715
|
-
onMousedown: i[6] ||= N((e) =>
|
|
2716
|
-
onMouseup:
|
|
2717
|
-
onMouseleave:
|
|
2715
|
+
onMousedown: i[6] ||= N((e) => ve("H", 1), ["prevent"]),
|
|
2716
|
+
onMouseup: J,
|
|
2717
|
+
onMouseleave: J
|
|
2718
2718
|
}, {
|
|
2719
2719
|
default: j(() => [...i[26] ||= [c("svg", {
|
|
2720
2720
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2737,9 +2737,9 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2737
2737
|
square: "",
|
|
2738
2738
|
size: "sm",
|
|
2739
2739
|
class: "time-step",
|
|
2740
|
-
onMousedown: i[7] ||= N((e) =>
|
|
2741
|
-
onMouseup:
|
|
2742
|
-
onMouseleave:
|
|
2740
|
+
onMousedown: i[7] ||= N((e) => ve("m", -1), ["prevent"]),
|
|
2741
|
+
onMouseup: J,
|
|
2742
|
+
onMouseleave: J
|
|
2743
2743
|
}, {
|
|
2744
2744
|
default: j(() => [...i[28] ||= [c("svg", {
|
|
2745
2745
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2760,16 +2760,16 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2760
2760
|
min: "0",
|
|
2761
2761
|
max: "59",
|
|
2762
2762
|
value: W.value,
|
|
2763
|
-
onInput: i[8] ||= (e) =>
|
|
2763
|
+
onInput: i[8] ||= (e) => ye(e, "m")
|
|
2764
2764
|
}, null, 40, Ur),
|
|
2765
2765
|
f(z, {
|
|
2766
2766
|
variant: "ghost",
|
|
2767
2767
|
square: "",
|
|
2768
2768
|
size: "sm",
|
|
2769
2769
|
class: "time-step",
|
|
2770
|
-
onMousedown: i[9] ||= N((e) =>
|
|
2771
|
-
onMouseup:
|
|
2772
|
-
onMouseleave:
|
|
2770
|
+
onMousedown: i[9] ||= N((e) => ve("m", 1), ["prevent"]),
|
|
2771
|
+
onMouseup: J,
|
|
2772
|
+
onMouseleave: J
|
|
2773
2773
|
}, {
|
|
2774
2774
|
default: j(() => [...i[29] ||= [c("svg", {
|
|
2775
2775
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2800,7 +2800,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2800
2800
|
c("div", qr, [f(z, {
|
|
2801
2801
|
variant: "ghost",
|
|
2802
2802
|
square: "",
|
|
2803
|
-
onClick: i[10] ||= (e) =>
|
|
2803
|
+
onClick: i[10] ||= (e) => ge(-1)
|
|
2804
2804
|
}, {
|
|
2805
2805
|
default: j(() => [...i[31] ||= [c("svg", {
|
|
2806
2806
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2818,7 +2818,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2818
2818
|
key: 0,
|
|
2819
2819
|
variant: "ghost",
|
|
2820
2820
|
square: "",
|
|
2821
|
-
onClick: i[11] ||= (e) =>
|
|
2821
|
+
onClick: i[11] ||= (e) => he(-1)
|
|
2822
2822
|
}, {
|
|
2823
2823
|
default: j(() => [...i[32] ||= [c("svg", {
|
|
2824
2824
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2836,12 +2836,12 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2836
2836
|
c("div", {
|
|
2837
2837
|
class: "header-title",
|
|
2838
2838
|
onClick: Ve
|
|
2839
|
-
}, [B.value === "date" ? (x(), s(e, { key: 0 }, [d(E(k[
|
|
2839
|
+
}, [B.value === "date" ? (x(), s(e, { key: 0 }, [d(E(k[K.value]) + " " + E(G.value), 1)], 64)) : (x(), s(e, { key: 1 }, [d(E(q.value[0]) + " - " + E(q.value[q.value.length - 1]), 1)], 64))]),
|
|
2840
2840
|
c("div", Jr, [B.value === "date" ? (x(), a(z, {
|
|
2841
2841
|
key: 0,
|
|
2842
2842
|
variant: "ghost",
|
|
2843
2843
|
square: "",
|
|
2844
|
-
onClick: i[12] ||= (e) =>
|
|
2844
|
+
onClick: i[12] ||= (e) => he(1)
|
|
2845
2845
|
}, {
|
|
2846
2846
|
default: j(() => [...i[33] ||= [c("svg", {
|
|
2847
2847
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2858,7 +2858,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2858
2858
|
})) : o("", !0), f(z, {
|
|
2859
2859
|
variant: "ghost",
|
|
2860
2860
|
square: "",
|
|
2861
|
-
onClick: i[13] ||= (e) =>
|
|
2861
|
+
onClick: i[13] ||= (e) => ge(1)
|
|
2862
2862
|
}, {
|
|
2863
2863
|
default: j(() => [...i[34] ||= [c("svg", {
|
|
2864
2864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2877,13 +2877,13 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2877
2877
|
c("div", Yr, [B.value === "date" ? (x(), s(e, { key: 0 }, [c("div", Xr, [(x(), s(e, null, w(M, (e) => c("span", {
|
|
2878
2878
|
key: e,
|
|
2879
2879
|
class: "weekday"
|
|
2880
|
-
}, E(e), 1)), 64))]), c("div", Zr, [(x(!0), s(e, null, w(
|
|
2880
|
+
}, E(e), 1)), 64))]), c("div", Zr, [(x(!0), s(e, null, w(ae.value, (e, t) => (x(), a(z, {
|
|
2881
2881
|
key: t,
|
|
2882
|
-
variant:
|
|
2883
|
-
intent:
|
|
2882
|
+
variant: de(e) ? "solid" : ue(e) ? "mute" : "ghost",
|
|
2883
|
+
intent: de(e) || ue(e) ? "primary" : "none",
|
|
2884
2884
|
class: g(["day-cell", { "is-not-current": !e.isCurrentMonth }]),
|
|
2885
2885
|
padding: "0",
|
|
2886
|
-
onClick: (t) =>
|
|
2886
|
+
onClick: (t) => pe(e)
|
|
2887
2887
|
}, {
|
|
2888
2888
|
default: j(() => [d(E(e.day), 1)]),
|
|
2889
2889
|
_: 2
|
|
@@ -2892,12 +2892,12 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2892
2892
|
"intent",
|
|
2893
2893
|
"class",
|
|
2894
2894
|
"onClick"
|
|
2895
|
-
]))), 128))])], 64)) : (x(), s("div", Qr, [(x(!0), s(e, null, w(
|
|
2895
|
+
]))), 128))])], 64)) : (x(), s("div", Qr, [(x(!0), s(e, null, w(q.value, (e) => (x(), a(z, {
|
|
2896
2896
|
key: e,
|
|
2897
2897
|
variant: e === G.value ? "solid" : "ghost",
|
|
2898
2898
|
intent: e === G.value ? "primary" : "none",
|
|
2899
2899
|
class: "year-cell",
|
|
2900
|
-
onClick: (t) =>
|
|
2900
|
+
onClick: (t) => me(e)
|
|
2901
2901
|
}, {
|
|
2902
2902
|
default: j(() => [d(E(e), 1)]),
|
|
2903
2903
|
_: 2
|
|
@@ -2913,9 +2913,9 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2913
2913
|
square: "",
|
|
2914
2914
|
size: "sm",
|
|
2915
2915
|
class: "time-step",
|
|
2916
|
-
onMousedown: i[14] ||= N((e) =>
|
|
2917
|
-
onMouseup:
|
|
2918
|
-
onMouseleave:
|
|
2916
|
+
onMousedown: i[14] ||= N((e) => ve("H", -1), ["prevent"]),
|
|
2917
|
+
onMouseup: J,
|
|
2918
|
+
onMouseleave: J
|
|
2919
2919
|
}, {
|
|
2920
2920
|
default: j(() => [...i[35] ||= [c("svg", {
|
|
2921
2921
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2936,16 +2936,16 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2936
2936
|
min: "0",
|
|
2937
2937
|
max: "23",
|
|
2938
2938
|
value: U.value,
|
|
2939
|
-
onInput: i[15] ||= (e) =>
|
|
2939
|
+
onInput: i[15] ||= (e) => ye(e, "H")
|
|
2940
2940
|
}, null, 40, ni),
|
|
2941
2941
|
f(z, {
|
|
2942
2942
|
variant: "ghost",
|
|
2943
2943
|
square: "",
|
|
2944
2944
|
size: "sm",
|
|
2945
2945
|
class: "time-step",
|
|
2946
|
-
onMousedown: i[16] ||= N((e) =>
|
|
2947
|
-
onMouseup:
|
|
2948
|
-
onMouseleave:
|
|
2946
|
+
onMousedown: i[16] ||= N((e) => ve("H", 1), ["prevent"]),
|
|
2947
|
+
onMouseup: J,
|
|
2948
|
+
onMouseleave: J
|
|
2949
2949
|
}, {
|
|
2950
2950
|
default: j(() => [...i[36] ||= [c("svg", {
|
|
2951
2951
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2968,9 +2968,9 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2968
2968
|
square: "",
|
|
2969
2969
|
size: "sm",
|
|
2970
2970
|
class: "time-step",
|
|
2971
|
-
onMousedown: i[17] ||= N((e) =>
|
|
2972
|
-
onMouseup:
|
|
2973
|
-
onMouseleave:
|
|
2971
|
+
onMousedown: i[17] ||= N((e) => ve("m", -1), ["prevent"]),
|
|
2972
|
+
onMouseup: J,
|
|
2973
|
+
onMouseleave: J
|
|
2974
2974
|
}, {
|
|
2975
2975
|
default: j(() => [...i[38] ||= [c("svg", {
|
|
2976
2976
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2991,16 +2991,16 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
2991
2991
|
min: "0",
|
|
2992
2992
|
max: "59",
|
|
2993
2993
|
value: W.value,
|
|
2994
|
-
onInput: i[18] ||= (e) =>
|
|
2994
|
+
onInput: i[18] ||= (e) => ye(e, "m")
|
|
2995
2995
|
}, null, 40, ai),
|
|
2996
2996
|
f(z, {
|
|
2997
2997
|
variant: "ghost",
|
|
2998
2998
|
square: "",
|
|
2999
2999
|
size: "sm",
|
|
3000
3000
|
class: "time-step",
|
|
3001
|
-
onMousedown: i[19] ||= N((e) =>
|
|
3002
|
-
onMouseup:
|
|
3003
|
-
onMouseleave:
|
|
3001
|
+
onMousedown: i[19] ||= N((e) => ve("m", 1), ["prevent"]),
|
|
3002
|
+
onMouseup: J,
|
|
3003
|
+
onMouseleave: J
|
|
3004
3004
|
}, {
|
|
3005
3005
|
default: j(() => [...i[39] ||= [c("svg", {
|
|
3006
3006
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3124,7 +3124,7 @@ var ur = { class: "icon-wrap" }, dr = ["innerHTML"], fr = {
|
|
|
3124
3124
|
}, [c("path", { d: "m15 18-6-6 6-6" })], -1)]]),
|
|
3125
3125
|
_: 1
|
|
3126
3126
|
})]),
|
|
3127
|
-
c("div", Ti, E(k[
|
|
3127
|
+
c("div", Ti, E(k[Y.value]) + " " + E(be.value), 1),
|
|
3128
3128
|
c("div", Ei, [f(z, {
|
|
3129
3129
|
variant: "ghost",
|
|
3130
3130
|
square: "",
|
|
@@ -3426,13 +3426,20 @@ var ea = {
|
|
|
3426
3426
|
}, ta = ["textContent"], na = {
|
|
3427
3427
|
key: 1,
|
|
3428
3428
|
class: "count-chip"
|
|
3429
|
-
}, ra = { class: "grid" }, ia =
|
|
3429
|
+
}, ra = { class: "grid" }, ia = {
|
|
3430
|
+
key: 0,
|
|
3431
|
+
class: "icon",
|
|
3432
|
+
"aria-hidden": "true"
|
|
3433
|
+
}, aa = ["textContent"], oa = ["textContent"], sa = ["onClick"], ca = ["src"], la = {
|
|
3430
3434
|
key: 1,
|
|
3431
3435
|
class: "placeholder-label"
|
|
3432
|
-
},
|
|
3436
|
+
}, ua = { class: "duration" }, da = { class: "card-body" }, fa = ["title"], pa = { class: "file-meta" }, ma = { key: 0 }, ha = {
|
|
3437
|
+
key: 1,
|
|
3438
|
+
class: "dot-separator"
|
|
3439
|
+
}, ga = { key: 2 }, _a = { class: "card-actions" }, va = ["onClick"], ya = ["disabled", "onClick"], ba = { class: "vi-modal-card" }, xa = { class: "vi-modal-media" }, Sa = ["src"], Ca = {
|
|
3433
3440
|
key: 1,
|
|
3434
3441
|
class: "vi-modal-placeholder"
|
|
3435
|
-
},
|
|
3442
|
+
}, wa = { class: "vi-modal-bar" }, Ta = { class: "vi-modal-info" }, Ea = { class: "modal-name" }, Da = { class: "modal-meta" }, Oa = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
3436
3443
|
__name: "NVideoSelect",
|
|
3437
3444
|
props: {
|
|
3438
3445
|
modelValue: { default: () => [] },
|
|
@@ -3446,6 +3453,10 @@ var ea = {
|
|
|
3446
3453
|
type: Boolean,
|
|
3447
3454
|
default: !1
|
|
3448
3455
|
},
|
|
3456
|
+
readonly: {
|
|
3457
|
+
type: Boolean,
|
|
3458
|
+
default: !1
|
|
3459
|
+
},
|
|
3449
3460
|
title: { default: "" },
|
|
3450
3461
|
showCount: {
|
|
3451
3462
|
type: Boolean,
|
|
@@ -3466,20 +3477,32 @@ var ea = {
|
|
|
3466
3477
|
"error"
|
|
3467
3478
|
],
|
|
3468
3479
|
setup(r, { emit: l }) {
|
|
3469
|
-
let
|
|
3480
|
+
let u = l, p = C(!1), h = C(null), [_, y, b] = $i(), { confirm: S } = Rt(), T = i(() => r.modelValue.length), O = (e) => e == null ? "—" : e < 1024 ? e + " B" : e < 1048576 ? (e / 1024).toFixed(0) + " KB" : e < 1073741824 ? (e / 1048576).toFixed(1) + " MB" : (e / 1073741824).toFixed(2) + " GB", k = (e) => {
|
|
3470
3481
|
if (e == null || isNaN(e)) return "0:00";
|
|
3471
3482
|
let t = Math.round(e), n = Math.floor(t / 60), r = t % 60;
|
|
3472
3483
|
return n + ":" + (r < 10 ? "0" : "") + r;
|
|
3473
|
-
},
|
|
3484
|
+
}, M = (e) => e.width && e.height ? e.width + "×" + e.height : "—", P = (e) => {
|
|
3485
|
+
if (e.name) return e.name;
|
|
3486
|
+
try {
|
|
3487
|
+
let t = new URL(e.url, window.location.href).pathname;
|
|
3488
|
+
return decodeURIComponent(t.split("/").filter(Boolean).pop() ?? "影片");
|
|
3489
|
+
} catch {
|
|
3490
|
+
return "影片";
|
|
3491
|
+
}
|
|
3492
|
+
}, F = (e) => {
|
|
3493
|
+
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
3494
|
+
}, I = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : "v" + Math.random().toString(36).slice(2, 9), ee = (e) => {
|
|
3474
3495
|
let t = r.accept.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
3475
3496
|
if (t.length === 0) return e.type.startsWith("video/");
|
|
3476
3497
|
let n = e.type.toLowerCase(), i = e.name.toLowerCase();
|
|
3477
3498
|
return t.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? n.startsWith(e.slice(0, -1)) : n === e);
|
|
3478
|
-
},
|
|
3499
|
+
}, te = (e) => {
|
|
3479
3500
|
if (!e.url) return;
|
|
3480
3501
|
let t = document.createElement("video");
|
|
3481
3502
|
t.preload = "metadata";
|
|
3482
3503
|
let n = () => {
|
|
3504
|
+
t.removeEventListener("loadedmetadata", i), t.removeEventListener("error", n), t.removeAttribute("src"), t.load();
|
|
3505
|
+
}, i = () => {
|
|
3483
3506
|
if (r.modelValue.some((t) => t.id === e.id)) {
|
|
3484
3507
|
let n = r.modelValue.map((n) => n.id === e.id ? {
|
|
3485
3508
|
...n,
|
|
@@ -3487,38 +3510,44 @@ var ea = {
|
|
|
3487
3510
|
width: t.videoWidth,
|
|
3488
3511
|
height: t.videoHeight
|
|
3489
3512
|
} : n);
|
|
3490
|
-
|
|
3513
|
+
u("update:modelValue", n), u("change", n);
|
|
3491
3514
|
}
|
|
3492
|
-
|
|
3515
|
+
n();
|
|
3493
3516
|
};
|
|
3494
|
-
t.addEventListener("loadedmetadata", n), t.src = e.url;
|
|
3495
|
-
}, L = (
|
|
3496
|
-
|
|
3517
|
+
t.addEventListener("loadedmetadata", i), t.addEventListener("error", n), t.src = e.url;
|
|
3518
|
+
}, L = /* @__PURE__ */ new Set();
|
|
3519
|
+
A(() => r.modelValue, (e) => {
|
|
3520
|
+
e.forEach((e) => {
|
|
3521
|
+
!e.url || L.has(e.id) || (L.add(e.id), (e.duration == null || e.width == null) && te(e));
|
|
3522
|
+
});
|
|
3523
|
+
}, { immediate: !0 });
|
|
3524
|
+
let R = (e) => {
|
|
3525
|
+
if (r.disabled || r.readonly) return;
|
|
3497
3526
|
let t = [], n = !1;
|
|
3498
3527
|
if (Array.prototype.forEach.call(e, (e) => {
|
|
3499
|
-
if (!
|
|
3500
|
-
|
|
3528
|
+
if (!ee(e)) {
|
|
3529
|
+
u("error", {
|
|
3501
3530
|
type: "type",
|
|
3502
3531
|
file: e
|
|
3503
3532
|
});
|
|
3504
3533
|
return;
|
|
3505
3534
|
}
|
|
3506
3535
|
if (r.maxSize > 0 && e.size > r.maxSize * 1024 * 1024) {
|
|
3507
|
-
|
|
3536
|
+
u("error", {
|
|
3508
3537
|
type: "size",
|
|
3509
3538
|
file: e
|
|
3510
3539
|
});
|
|
3511
3540
|
return;
|
|
3512
3541
|
}
|
|
3513
3542
|
if (!r.multiple && r.modelValue.length + t.length >= 1) {
|
|
3514
|
-
n ||= (
|
|
3543
|
+
n ||= (u("error", {
|
|
3515
3544
|
type: "count",
|
|
3516
3545
|
file: e
|
|
3517
3546
|
}), !0);
|
|
3518
3547
|
return;
|
|
3519
3548
|
}
|
|
3520
3549
|
t.push({
|
|
3521
|
-
id:
|
|
3550
|
+
id: I(),
|
|
3522
3551
|
file: e,
|
|
3523
3552
|
name: e.name,
|
|
3524
3553
|
size: e.size,
|
|
@@ -3529,89 +3558,109 @@ var ea = {
|
|
|
3529
3558
|
});
|
|
3530
3559
|
}), t.length === 0) return;
|
|
3531
3560
|
let i = [...r.modelValue, ...t];
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3561
|
+
u("update:modelValue", i), u("change", i), u("add", t), t.forEach((e) => {
|
|
3562
|
+
L.add(e.id), te(e);
|
|
3563
|
+
});
|
|
3564
|
+
}, z = async () => {
|
|
3565
|
+
if (!(r.disabled || r.readonly)) if (r.multiple) {
|
|
3535
3566
|
let e = await $.input.custom(r.accept, !0);
|
|
3536
3567
|
if (e.length === 0) return;
|
|
3537
|
-
|
|
3568
|
+
R(e.map((e) => e.file));
|
|
3538
3569
|
} else {
|
|
3539
3570
|
let e = await $.input.custom(r.accept, !1);
|
|
3540
3571
|
if (!e) return;
|
|
3541
|
-
|
|
3572
|
+
R([e.file]);
|
|
3542
3573
|
}
|
|
3543
|
-
},
|
|
3544
|
-
if (r.disabled) return;
|
|
3574
|
+
}, B = async (e) => {
|
|
3575
|
+
if (r.disabled || r.readonly) return;
|
|
3545
3576
|
let t = r.modelValue.find((t) => t.id === e);
|
|
3546
|
-
if (!t || !await
|
|
3577
|
+
if (!t || !await S(`確定要移除「${P(t)}」嗎?`, {
|
|
3547
3578
|
title: "移除影片",
|
|
3548
3579
|
status: "danger",
|
|
3549
3580
|
confirmText: "移除",
|
|
3550
3581
|
cancelText: "取消"
|
|
3551
3582
|
})) return;
|
|
3552
|
-
|
|
3583
|
+
F(t.url);
|
|
3553
3584
|
let n = r.modelValue.filter((t) => t.id !== e);
|
|
3554
|
-
|
|
3555
|
-
},
|
|
3556
|
-
|
|
3557
|
-
},
|
|
3558
|
-
|
|
3559
|
-
},
|
|
3560
|
-
let e =
|
|
3585
|
+
u("update:modelValue", n), u("change", n), u("remove", t);
|
|
3586
|
+
}, V = (e) => {
|
|
3587
|
+
h.value = e, y();
|
|
3588
|
+
}, H = () => {
|
|
3589
|
+
b();
|
|
3590
|
+
}, U = i(() => {
|
|
3591
|
+
let e = h.value;
|
|
3561
3592
|
return e ? [
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
].join(" · ") : "";
|
|
3566
|
-
}),
|
|
3567
|
-
e.key === "Escape" &&
|
|
3568
|
-
},
|
|
3569
|
-
A(
|
|
3570
|
-
e ? (
|
|
3593
|
+
e.size == null ? null : O(e.size),
|
|
3594
|
+
e.width && e.height ? M(e) : null,
|
|
3595
|
+
k(e.duration)
|
|
3596
|
+
].filter(Boolean).join(" · ") : "";
|
|
3597
|
+
}), W = (e) => {
|
|
3598
|
+
e.key === "Escape" && H();
|
|
3599
|
+
}, ne = "";
|
|
3600
|
+
A(_, (e) => {
|
|
3601
|
+
e ? (ne = document.body.style.overflow, document.body.style.overflow = "hidden", document.addEventListener("keydown", W)) : (document.body.style.overflow = ne, document.removeEventListener("keydown", W));
|
|
3571
3602
|
}), v(() => {
|
|
3572
|
-
document.body.style.overflow =
|
|
3573
|
-
e.url && URL.revokeObjectURL(e.url);
|
|
3574
|
-
});
|
|
3603
|
+
document.body.style.overflow = ne, document.removeEventListener("keydown", W), r.autoRevoke && r.modelValue.forEach((e) => F(e.url));
|
|
3575
3604
|
});
|
|
3576
|
-
let
|
|
3577
|
-
onClick:
|
|
3605
|
+
let re = {
|
|
3606
|
+
onClick: z,
|
|
3578
3607
|
onDragenter: (e) => {
|
|
3579
|
-
r.disabled || (e.preventDefault(),
|
|
3608
|
+
r.disabled || r.readonly || (e.preventDefault(), p.value = !0);
|
|
3580
3609
|
},
|
|
3581
3610
|
onDragover: (e) => e.preventDefault(),
|
|
3582
3611
|
onDragleave: (e) => {
|
|
3583
|
-
e.preventDefault(),
|
|
3612
|
+
e.preventDefault(), p.value = !1;
|
|
3584
3613
|
},
|
|
3585
3614
|
onDrop: (e) => {
|
|
3586
|
-
r.disabled || (e.preventDefault(),
|
|
3615
|
+
r.disabled || r.readonly || (e.preventDefault(), p.value = !1, e.dataTransfer?.files?.length && R(e.dataTransfer.files));
|
|
3587
3616
|
}
|
|
3588
3617
|
};
|
|
3589
|
-
return (i, l) => (x(), s("div", { class: g(["video-input", {
|
|
3618
|
+
return (i, l) => (x(), s("div", { class: g(["video-input", {
|
|
3619
|
+
"is-disabled": r.disabled,
|
|
3620
|
+
"is-readonly": r.readonly
|
|
3621
|
+
}]) }, [
|
|
3590
3622
|
r.title || r.showCount ? (x(), s("div", ea, [r.title ? (x(), s("span", {
|
|
3591
3623
|
key: 0,
|
|
3592
3624
|
class: "title",
|
|
3593
3625
|
textContent: E(r.title)
|
|
3594
|
-
}, null, 8, ta)) : o("", !0), r.showCount ? (x(), s("span", na, E(
|
|
3595
|
-
c("div", ra, [
|
|
3626
|
+
}, null, 8, ta)) : o("", !0), r.showCount ? (x(), s("span", na, E(T.value) + " 支", 1)) : o("", !0)])) : o("", !0),
|
|
3627
|
+
c("div", ra, [T.value === 0 ? (x(), s("div", m({
|
|
3596
3628
|
key: 0,
|
|
3597
|
-
class: ["empty", {
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3629
|
+
class: ["empty", {
|
|
3630
|
+
"is-drag": p.value,
|
|
3631
|
+
"is-static": r.readonly
|
|
3632
|
+
}]
|
|
3633
|
+
}, r.readonly ? {} : re), [
|
|
3634
|
+
r.readonly ? o("", !0) : (x(), s("span", ia, [...l[0] ||= [c("svg", {
|
|
3635
|
+
viewBox: "0 0 24 24",
|
|
3636
|
+
fill: "none",
|
|
3637
|
+
stroke: "currentColor",
|
|
3638
|
+
"stroke-width": "1.7",
|
|
3639
|
+
"stroke-linecap": "round",
|
|
3640
|
+
"stroke-linejoin": "round"
|
|
3641
|
+
}, [
|
|
3642
|
+
c("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
3643
|
+
c("path", { d: "M7 9l5-5 5 5" }),
|
|
3644
|
+
c("path", { d: "M12 4v12" })
|
|
3645
|
+
], -1)]])),
|
|
3646
|
+
c("h3", { textContent: E(r.readonly ? "目前沒有影片" : r.emptyTitle) }, null, 8, aa),
|
|
3647
|
+
r.readonly ? o("", !0) : (x(), s("p", {
|
|
3648
|
+
key: 1,
|
|
3649
|
+
textContent: E(r.emptyHint)
|
|
3650
|
+
}, null, 8, oa))
|
|
3602
3651
|
], 16)) : (x(), s(e, { key: 1 }, [(x(!0), s(e, null, w(r.modelValue, (e) => (x(), s("div", {
|
|
3603
3652
|
key: e.id,
|
|
3604
3653
|
class: "card"
|
|
3605
3654
|
}, [c("div", {
|
|
3606
3655
|
class: g(["thumb", { placeholder: !e.url }]),
|
|
3607
|
-
onClick: (t) =>
|
|
3656
|
+
onClick: (t) => V(e)
|
|
3608
3657
|
}, [
|
|
3609
3658
|
e.url ? (x(), s("video", {
|
|
3610
3659
|
key: 0,
|
|
3611
3660
|
src: e.url + "#t=0.5",
|
|
3612
3661
|
muted: "",
|
|
3613
3662
|
preload: "metadata"
|
|
3614
|
-
}, null, 8,
|
|
3663
|
+
}, null, 8, ca)) : (x(), s("div", la, "縮圖預覽")),
|
|
3615
3664
|
l[1] ||= c("div", {
|
|
3616
3665
|
class: "play",
|
|
3617
3666
|
"aria-hidden": "true"
|
|
@@ -3619,21 +3668,21 @@ var ea = {
|
|
|
3619
3668
|
viewBox: "0 0 24 24",
|
|
3620
3669
|
fill: "currentColor"
|
|
3621
3670
|
}, [c("path", { d: "M8 5v14l11-7z" })])], -1),
|
|
3622
|
-
c("div",
|
|
3623
|
-
], 10,
|
|
3671
|
+
c("div", ua, E(k(e.duration)), 1)
|
|
3672
|
+
], 10, sa), c("div", da, [
|
|
3624
3673
|
c("div", {
|
|
3625
3674
|
class: "file-name",
|
|
3626
|
-
title: e
|
|
3627
|
-
}, E(e
|
|
3628
|
-
c("div",
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3675
|
+
title: P(e)
|
|
3676
|
+
}, E(P(e)), 9, fa),
|
|
3677
|
+
c("div", pa, [
|
|
3678
|
+
e.size == null ? o("", !0) : (x(), s("span", ma, E(O(e.size)), 1)),
|
|
3679
|
+
e.size != null && e.width && e.height ? (x(), s("span", ha)) : o("", !0),
|
|
3680
|
+
e.width && e.height ? (x(), s("span", ga, E(M(e)), 1)) : o("", !0)
|
|
3632
3681
|
]),
|
|
3633
|
-
c("div",
|
|
3682
|
+
c("div", _a, [c("button", {
|
|
3634
3683
|
class: "action preview",
|
|
3635
|
-
onClick: (t) =>
|
|
3636
|
-
}, [...l[
|
|
3684
|
+
onClick: (t) => V(e)
|
|
3685
|
+
}, [...l[2] ||= [c("svg", {
|
|
3637
3686
|
viewBox: "0 0 24 24",
|
|
3638
3687
|
fill: "none",
|
|
3639
3688
|
stroke: "currentColor",
|
|
@@ -3644,23 +3693,24 @@ var ea = {
|
|
|
3644
3693
|
cx: "12",
|
|
3645
3694
|
cy: "12",
|
|
3646
3695
|
r: "3"
|
|
3647
|
-
})], -1), d(" 預覽 ", -1)]], 8,
|
|
3696
|
+
})], -1), d(" 預覽 ", -1)]], 8, va), r.readonly ? o("", !0) : (x(), s("button", {
|
|
3697
|
+
key: 0,
|
|
3648
3698
|
class: "action delete",
|
|
3649
3699
|
"aria-label": "刪除",
|
|
3650
3700
|
disabled: r.disabled,
|
|
3651
|
-
onClick: N((t) =>
|
|
3652
|
-
}, [...l[
|
|
3701
|
+
onClick: N((t) => B(e.id), ["stop"])
|
|
3702
|
+
}, [...l[3] ||= [c("svg", {
|
|
3653
3703
|
viewBox: "0 0 24 24",
|
|
3654
3704
|
fill: "none",
|
|
3655
3705
|
stroke: "currentColor",
|
|
3656
3706
|
"stroke-width": "2",
|
|
3657
3707
|
"stroke-linecap": "round",
|
|
3658
3708
|
"stroke-linejoin": "round"
|
|
3659
|
-
}, [c("path", { d: "M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }), c("path", { d: "M10 11v6M14 11v6" })], -1)]], 8,
|
|
3660
|
-
])]))), 128)), r.multiple ? (x(), s("div", m({
|
|
3709
|
+
}, [c("path", { d: "M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }), c("path", { d: "M10 11v6M14 11v6" })], -1)]], 8, ya))])
|
|
3710
|
+
])]))), 128)), r.multiple && !r.readonly ? (x(), s("div", m({
|
|
3661
3711
|
key: 0,
|
|
3662
|
-
class: ["add-card", { "is-drag":
|
|
3663
|
-
},
|
|
3712
|
+
class: ["add-card", { "is-drag": p.value }]
|
|
3713
|
+
}, re), [...l[4] ||= [
|
|
3664
3714
|
c("span", {
|
|
3665
3715
|
class: "plus",
|
|
3666
3716
|
"aria-hidden": "true"
|
|
@@ -3676,23 +3726,23 @@ var ea = {
|
|
|
3676
3726
|
c("span", { class: "hint" }, "點擊或拖放檔案 · MP4 / MOV / WebM", -1)
|
|
3677
3727
|
]], 16)) : o("", !0)], 64))]),
|
|
3678
3728
|
(x(), a(t, { to: "body" }, [f(n, { name: "vi-modal" }, {
|
|
3679
|
-
default: j(() => [D(
|
|
3729
|
+
default: j(() => [D(_) ? (x(), s("div", {
|
|
3680
3730
|
key: 0,
|
|
3681
3731
|
class: "vi-modal",
|
|
3682
|
-
onClick: N(
|
|
3683
|
-
}, [c("div",
|
|
3732
|
+
onClick: N(H, ["self"])
|
|
3733
|
+
}, [c("div", ba, [c("div", xa, [h.value?.url ? (x(), s("video", {
|
|
3684
3734
|
key: 0,
|
|
3685
|
-
src:
|
|
3735
|
+
src: h.value.url,
|
|
3686
3736
|
controls: "",
|
|
3687
3737
|
autoplay: "",
|
|
3688
3738
|
playsinline: "",
|
|
3689
3739
|
controlslist: "nofullscreen nodownload noremoteplayback noplaybackrate",
|
|
3690
3740
|
disablepictureinpicture: ""
|
|
3691
|
-
}, null, 8,
|
|
3741
|
+
}, null, 8, Sa)) : (x(), s("div", Ca, " 示範影片 · 上傳真實檔案即可在此播放 "))]), c("div", wa, [c("div", Ta, [c("div", Ea, E(h.value ? P(h.value) : ""), 1), c("div", Da, E(U.value), 1)]), c("button", {
|
|
3692
3742
|
class: "vi-modal-close",
|
|
3693
3743
|
"aria-label": "關閉",
|
|
3694
|
-
onClick:
|
|
3695
|
-
}, [...l[
|
|
3744
|
+
onClick: H
|
|
3745
|
+
}, [...l[5] ||= [c("svg", {
|
|
3696
3746
|
viewBox: "0 0 24 24",
|
|
3697
3747
|
fill: "none",
|
|
3698
3748
|
stroke: "currentColor",
|
|
@@ -3704,19 +3754,26 @@ var ea = {
|
|
|
3704
3754
|
})]))
|
|
3705
3755
|
], 2));
|
|
3706
3756
|
}
|
|
3707
|
-
}), [["__scopeId", "data-v-
|
|
3757
|
+
}), [["__scopeId", "data-v-414cc3f4"]]), ka = {
|
|
3708
3758
|
key: 0,
|
|
3709
3759
|
class: "head"
|
|
3710
|
-
},
|
|
3760
|
+
}, Aa = ["textContent"], ja = {
|
|
3711
3761
|
key: 1,
|
|
3712
3762
|
class: "count-chip"
|
|
3713
|
-
},
|
|
3763
|
+
}, Ma = { class: "grid" }, Na = {
|
|
3764
|
+
key: 0,
|
|
3765
|
+
class: "icon",
|
|
3766
|
+
"aria-hidden": "true"
|
|
3767
|
+
}, Pa = ["textContent"], Fa = ["textContent"], Ia = ["onClick"], La = ["src", "alt"], Ra = {
|
|
3714
3768
|
key: 1,
|
|
3715
3769
|
class: "placeholder-label"
|
|
3716
|
-
},
|
|
3770
|
+
}, za = { class: "card-body" }, Ba = ["title"], Va = { class: "file-meta" }, Ha = { key: 0 }, Ua = {
|
|
3771
|
+
key: 1,
|
|
3772
|
+
class: "dot-separator"
|
|
3773
|
+
}, Wa = { key: 2 }, Ga = { class: "card-actions" }, Ka = ["onClick"], qa = ["disabled", "onClick"], Ja = { class: "ii-modal-card" }, Ya = { class: "ii-modal-media" }, Xa = ["src", "alt"], Za = {
|
|
3717
3774
|
key: 1,
|
|
3718
3775
|
class: "ii-modal-ph"
|
|
3719
|
-
},
|
|
3776
|
+
}, Qa = { class: "ii-modal-bar" }, $a = { class: "ii-modal-info" }, eo = { class: "modal-name" }, to = { class: "modal-meta" }, no = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
3720
3777
|
__name: "NImageSelect",
|
|
3721
3778
|
props: {
|
|
3722
3779
|
modelValue: { default: () => [] },
|
|
@@ -3730,6 +3787,10 @@ var ea = {
|
|
|
3730
3787
|
type: Boolean,
|
|
3731
3788
|
default: !1
|
|
3732
3789
|
},
|
|
3790
|
+
readonly: {
|
|
3791
|
+
type: Boolean,
|
|
3792
|
+
default: !1
|
|
3793
|
+
},
|
|
3733
3794
|
title: { default: "" },
|
|
3734
3795
|
showCount: {
|
|
3735
3796
|
type: Boolean,
|
|
@@ -3750,52 +3811,70 @@ var ea = {
|
|
|
3750
3811
|
"error"
|
|
3751
3812
|
],
|
|
3752
3813
|
setup(r, { emit: l }) {
|
|
3753
|
-
let
|
|
3814
|
+
let u = l, p = C(!1), h = C(null), [_, y, b] = $i(), { confirm: S } = Rt(), T = i(() => r.modelValue.length), O = (e) => e == null ? "—" : e < 1024 ? e + " B" : e < 1048576 ? (e / 1024).toFixed(0) + " KB" : e < 1073741824 ? (e / 1048576).toFixed(1) + " MB" : (e / 1073741824).toFixed(2) + " GB", k = (e) => e.width && e.height ? e.width + "×" + e.height : "—", M = (e) => {
|
|
3815
|
+
if (e.name) return e.name;
|
|
3816
|
+
try {
|
|
3817
|
+
let t = new URL(e.url, window.location.href).pathname;
|
|
3818
|
+
return decodeURIComponent(t.split("/").filter(Boolean).pop() ?? "圖片");
|
|
3819
|
+
} catch {
|
|
3820
|
+
return "圖片";
|
|
3821
|
+
}
|
|
3822
|
+
}, P = (e) => {
|
|
3823
|
+
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
3824
|
+
}, F = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : "i" + Math.random().toString(36).slice(2, 9), I = (e) => {
|
|
3754
3825
|
let t = r.accept.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
3755
3826
|
if (t.length === 0) return e.type.startsWith("image/");
|
|
3756
3827
|
let n = e.type.toLowerCase(), i = e.name.toLowerCase();
|
|
3757
3828
|
return t.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? n.startsWith(e.slice(0, -1)) : n === e);
|
|
3758
|
-
},
|
|
3829
|
+
}, ee = (e) => {
|
|
3759
3830
|
if (!e.url) return;
|
|
3760
3831
|
let t = new Image(), n = () => {
|
|
3832
|
+
t.removeEventListener("load", i), t.removeEventListener("error", n), t.removeAttribute("src");
|
|
3833
|
+
}, i = () => {
|
|
3761
3834
|
if (r.modelValue.some((t) => t.id === e.id)) {
|
|
3762
3835
|
let n = r.modelValue.map((n) => n.id === e.id ? {
|
|
3763
3836
|
...n,
|
|
3764
3837
|
width: t.naturalWidth,
|
|
3765
3838
|
height: t.naturalHeight
|
|
3766
3839
|
} : n);
|
|
3767
|
-
|
|
3840
|
+
u("update:modelValue", n), u("change", n);
|
|
3768
3841
|
}
|
|
3769
|
-
|
|
3842
|
+
n();
|
|
3770
3843
|
};
|
|
3771
|
-
t.addEventListener("load", n), t.src = e.url;
|
|
3772
|
-
},
|
|
3773
|
-
|
|
3844
|
+
t.addEventListener("load", i), t.addEventListener("error", n), t.src = e.url;
|
|
3845
|
+
}, te = /* @__PURE__ */ new Set();
|
|
3846
|
+
A(() => r.modelValue, (e) => {
|
|
3847
|
+
e.forEach((e) => {
|
|
3848
|
+
!e.url || te.has(e.id) || (te.add(e.id), (e.width == null || e.height == null) && ee(e));
|
|
3849
|
+
});
|
|
3850
|
+
}, { immediate: !0 });
|
|
3851
|
+
let L = (e) => {
|
|
3852
|
+
if (r.disabled || r.readonly) return;
|
|
3774
3853
|
let t = [], n = !1;
|
|
3775
3854
|
if (Array.prototype.forEach.call(e, (e) => {
|
|
3776
|
-
if (!
|
|
3777
|
-
|
|
3855
|
+
if (!I(e)) {
|
|
3856
|
+
u("error", {
|
|
3778
3857
|
type: "type",
|
|
3779
3858
|
file: e
|
|
3780
3859
|
});
|
|
3781
3860
|
return;
|
|
3782
3861
|
}
|
|
3783
3862
|
if (r.maxSize > 0 && e.size > r.maxSize * 1024 * 1024) {
|
|
3784
|
-
|
|
3863
|
+
u("error", {
|
|
3785
3864
|
type: "size",
|
|
3786
3865
|
file: e
|
|
3787
3866
|
});
|
|
3788
3867
|
return;
|
|
3789
3868
|
}
|
|
3790
3869
|
if (!r.multiple && r.modelValue.length + t.length >= 1) {
|
|
3791
|
-
n ||= (
|
|
3870
|
+
n ||= (u("error", {
|
|
3792
3871
|
type: "count",
|
|
3793
3872
|
file: e
|
|
3794
3873
|
}), !0);
|
|
3795
3874
|
return;
|
|
3796
3875
|
}
|
|
3797
3876
|
t.push({
|
|
3798
|
-
id:
|
|
3877
|
+
id: F(),
|
|
3799
3878
|
file: e,
|
|
3800
3879
|
name: e.name,
|
|
3801
3880
|
size: e.size,
|
|
@@ -3805,84 +3884,114 @@ var ea = {
|
|
|
3805
3884
|
});
|
|
3806
3885
|
}), t.length === 0) return;
|
|
3807
3886
|
let i = [...r.modelValue, ...t];
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3887
|
+
u("update:modelValue", i), u("change", i), u("add", t), t.forEach((e) => {
|
|
3888
|
+
te.add(e.id), ee(e);
|
|
3889
|
+
});
|
|
3890
|
+
}, R = async () => {
|
|
3891
|
+
if (!(r.disabled || r.readonly)) if (r.multiple) {
|
|
3811
3892
|
let e = await $.input.custom(r.accept, !0);
|
|
3812
3893
|
if (e.length === 0) return;
|
|
3813
|
-
|
|
3894
|
+
L(e.map((e) => e.file));
|
|
3814
3895
|
} else {
|
|
3815
3896
|
let e = await $.input.custom(r.accept, !1);
|
|
3816
3897
|
if (!e) return;
|
|
3817
|
-
|
|
3898
|
+
L([e.file]);
|
|
3818
3899
|
}
|
|
3819
|
-
},
|
|
3820
|
-
if (r.disabled) return;
|
|
3900
|
+
}, z = async (e) => {
|
|
3901
|
+
if (r.disabled || r.readonly) return;
|
|
3821
3902
|
let t = r.modelValue.find((t) => t.id === e);
|
|
3822
|
-
if (!t || !await
|
|
3903
|
+
if (!t || !await S(`確定要移除「${M(t)}」嗎?`, {
|
|
3823
3904
|
title: "移除圖片",
|
|
3824
3905
|
status: "danger",
|
|
3825
3906
|
confirmText: "移除",
|
|
3826
3907
|
cancelText: "取消"
|
|
3827
3908
|
})) return;
|
|
3828
|
-
|
|
3909
|
+
P(t.url);
|
|
3829
3910
|
let n = r.modelValue.filter((t) => t.id !== e);
|
|
3830
|
-
|
|
3831
|
-
},
|
|
3832
|
-
|
|
3833
|
-
},
|
|
3834
|
-
|
|
3835
|
-
},
|
|
3836
|
-
let e =
|
|
3837
|
-
return e ? [
|
|
3838
|
-
}),
|
|
3839
|
-
e.key === "Escape" &&
|
|
3840
|
-
},
|
|
3841
|
-
A(
|
|
3842
|
-
e ? (
|
|
3911
|
+
u("update:modelValue", n), u("change", n), u("remove", t);
|
|
3912
|
+
}, B = (e) => {
|
|
3913
|
+
h.value = e, y();
|
|
3914
|
+
}, V = () => {
|
|
3915
|
+
b();
|
|
3916
|
+
}, H = i(() => {
|
|
3917
|
+
let e = h.value;
|
|
3918
|
+
return e ? [e.size == null ? null : O(e.size), e.width && e.height ? k(e) : null].filter(Boolean).join(" · ") : "";
|
|
3919
|
+
}), U = (e) => {
|
|
3920
|
+
e.key === "Escape" && V();
|
|
3921
|
+
}, W = "";
|
|
3922
|
+
A(_, (e) => {
|
|
3923
|
+
e ? (W = document.body.style.overflow, document.body.style.overflow = "hidden", document.addEventListener("keydown", U)) : (document.body.style.overflow = W, document.removeEventListener("keydown", U));
|
|
3843
3924
|
}), v(() => {
|
|
3844
|
-
document.body.style.overflow =
|
|
3845
|
-
e.url && URL.revokeObjectURL(e.url);
|
|
3846
|
-
});
|
|
3925
|
+
document.body.style.overflow = W, document.removeEventListener("keydown", U), r.autoRevoke && r.modelValue.forEach((e) => P(e.url));
|
|
3847
3926
|
});
|
|
3848
|
-
let
|
|
3849
|
-
onClick:
|
|
3927
|
+
let ne = {
|
|
3928
|
+
onClick: R,
|
|
3850
3929
|
onDragenter: (e) => {
|
|
3851
|
-
r.disabled || (e.preventDefault(),
|
|
3930
|
+
r.disabled || r.readonly || (e.preventDefault(), p.value = !0);
|
|
3852
3931
|
},
|
|
3853
3932
|
onDragover: (e) => e.preventDefault(),
|
|
3854
3933
|
onDragleave: (e) => {
|
|
3855
|
-
e.preventDefault(),
|
|
3934
|
+
e.preventDefault(), p.value = !1;
|
|
3856
3935
|
},
|
|
3857
3936
|
onDrop: (e) => {
|
|
3858
|
-
r.disabled || (e.preventDefault(),
|
|
3937
|
+
r.disabled || r.readonly || (e.preventDefault(), p.value = !1, e.dataTransfer?.files?.length && L(e.dataTransfer.files));
|
|
3859
3938
|
}
|
|
3860
3939
|
};
|
|
3861
|
-
return (i, l) => (x(), s("div", { class: g(["image-input", {
|
|
3862
|
-
|
|
3940
|
+
return (i, l) => (x(), s("div", { class: g(["image-input", {
|
|
3941
|
+
"is-disabled": r.disabled,
|
|
3942
|
+
"is-readonly": r.readonly
|
|
3943
|
+
}]) }, [
|
|
3944
|
+
r.title || r.showCount ? (x(), s("div", ka, [r.title ? (x(), s("span", {
|
|
3863
3945
|
key: 0,
|
|
3864
3946
|
class: "title",
|
|
3865
3947
|
textContent: E(r.title)
|
|
3866
|
-
}, null, 8,
|
|
3867
|
-
c("div",
|
|
3948
|
+
}, null, 8, Aa)) : o("", !0), r.showCount ? (x(), s("span", ja, E(T.value) + " 張", 1)) : o("", !0)])) : o("", !0),
|
|
3949
|
+
c("div", Ma, [T.value === 0 ? (x(), s("div", m({
|
|
3868
3950
|
key: 0,
|
|
3869
|
-
class: ["empty", {
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3951
|
+
class: ["empty", {
|
|
3952
|
+
"is-drag": p.value,
|
|
3953
|
+
"is-static": r.readonly
|
|
3954
|
+
}]
|
|
3955
|
+
}, r.readonly ? {} : ne), [
|
|
3956
|
+
r.readonly ? o("", !0) : (x(), s("span", Na, [...l[0] ||= [c("svg", {
|
|
3957
|
+
viewBox: "0 0 24 24",
|
|
3958
|
+
fill: "none",
|
|
3959
|
+
stroke: "currentColor",
|
|
3960
|
+
"stroke-width": "2",
|
|
3961
|
+
"stroke-linecap": "round",
|
|
3962
|
+
"stroke-linejoin": "round"
|
|
3963
|
+
}, [
|
|
3964
|
+
c("rect", {
|
|
3965
|
+
x: "3",
|
|
3966
|
+
y: "3",
|
|
3967
|
+
width: "18",
|
|
3968
|
+
height: "18",
|
|
3969
|
+
rx: "2"
|
|
3970
|
+
}),
|
|
3971
|
+
c("circle", {
|
|
3972
|
+
cx: "8.5",
|
|
3973
|
+
cy: "8.5",
|
|
3974
|
+
r: "1.5"
|
|
3975
|
+
}),
|
|
3976
|
+
c("path", { d: "M21 15l-5-5L5 21" })
|
|
3977
|
+
], -1)]])),
|
|
3978
|
+
c("h3", { textContent: E(r.readonly ? "目前沒有圖片" : r.emptyTitle) }, null, 8, Pa),
|
|
3979
|
+
r.readonly ? o("", !0) : (x(), s("p", {
|
|
3980
|
+
key: 1,
|
|
3981
|
+
textContent: E(r.emptyHint)
|
|
3982
|
+
}, null, 8, Fa))
|
|
3874
3983
|
], 16)) : (x(), s(e, { key: 1 }, [(x(!0), s(e, null, w(r.modelValue, (e) => (x(), s("div", {
|
|
3875
3984
|
key: e.id,
|
|
3876
3985
|
class: "card"
|
|
3877
3986
|
}, [c("div", {
|
|
3878
3987
|
class: g(["thumb", { placeholder: !e.url }]),
|
|
3879
|
-
onClick: (t) =>
|
|
3988
|
+
onClick: (t) => B(e)
|
|
3880
3989
|
}, [e.url ? (x(), s("img", {
|
|
3881
3990
|
key: 0,
|
|
3882
3991
|
src: e.url,
|
|
3883
|
-
alt: e
|
|
3992
|
+
alt: M(e),
|
|
3884
3993
|
loading: "lazy"
|
|
3885
|
-
}, null, 8,
|
|
3994
|
+
}, null, 8, La)) : (x(), s("div", Ra, "縮圖預覽")), l[1] ||= c("div", {
|
|
3886
3995
|
class: "zoom",
|
|
3887
3996
|
"aria-hidden": "true"
|
|
3888
3997
|
}, [c("svg", {
|
|
@@ -3896,20 +4005,20 @@ var ea = {
|
|
|
3896
4005
|
cx: "11",
|
|
3897
4006
|
cy: "11",
|
|
3898
4007
|
r: "7"
|
|
3899
|
-
}), c("path", { d: "m21 21-4.3-4.3M11 8v6M8 11h6" })])], -1)], 10,
|
|
4008
|
+
}), c("path", { d: "m21 21-4.3-4.3M11 8v6M8 11h6" })])], -1)], 10, Ia), c("div", za, [
|
|
3900
4009
|
c("div", {
|
|
3901
4010
|
class: "file-name",
|
|
3902
|
-
title: e
|
|
3903
|
-
}, E(e
|
|
3904
|
-
c("div",
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
4011
|
+
title: M(e)
|
|
4012
|
+
}, E(M(e)), 9, Ba),
|
|
4013
|
+
c("div", Va, [
|
|
4014
|
+
e.size == null ? o("", !0) : (x(), s("span", Ha, E(O(e.size)), 1)),
|
|
4015
|
+
e.size != null && e.width && e.height ? (x(), s("span", Ua)) : o("", !0),
|
|
4016
|
+
e.width && e.height ? (x(), s("span", Wa, E(k(e)), 1)) : o("", !0)
|
|
3908
4017
|
]),
|
|
3909
|
-
c("div",
|
|
4018
|
+
c("div", Ga, [c("button", {
|
|
3910
4019
|
class: "action preview",
|
|
3911
|
-
onClick: (t) =>
|
|
3912
|
-
}, [...l[
|
|
4020
|
+
onClick: (t) => B(e)
|
|
4021
|
+
}, [...l[2] ||= [c("svg", {
|
|
3913
4022
|
viewBox: "0 0 24 24",
|
|
3914
4023
|
fill: "none",
|
|
3915
4024
|
stroke: "currentColor",
|
|
@@ -3920,23 +4029,24 @@ var ea = {
|
|
|
3920
4029
|
cx: "12",
|
|
3921
4030
|
cy: "12",
|
|
3922
4031
|
r: "3"
|
|
3923
|
-
})], -1), d(" 預覽 ", -1)]], 8,
|
|
4032
|
+
})], -1), d(" 預覽 ", -1)]], 8, Ka), r.readonly ? o("", !0) : (x(), s("button", {
|
|
4033
|
+
key: 0,
|
|
3924
4034
|
class: "action delete",
|
|
3925
4035
|
"aria-label": "刪除",
|
|
3926
4036
|
disabled: r.disabled,
|
|
3927
|
-
onClick: N((t) =>
|
|
3928
|
-
}, [...l[
|
|
4037
|
+
onClick: N((t) => z(e.id), ["stop"])
|
|
4038
|
+
}, [...l[3] ||= [c("svg", {
|
|
3929
4039
|
viewBox: "0 0 24 24",
|
|
3930
4040
|
fill: "none",
|
|
3931
4041
|
stroke: "currentColor",
|
|
3932
4042
|
"stroke-width": "2",
|
|
3933
4043
|
"stroke-linecap": "round",
|
|
3934
4044
|
"stroke-linejoin": "round"
|
|
3935
|
-
}, [c("path", { d: "M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }), c("path", { d: "M10 11v6M14 11v6" })], -1)]], 8,
|
|
3936
|
-
])]))), 128)), r.multiple ? (x(), s("div", m({
|
|
4045
|
+
}, [c("path", { d: "M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }), c("path", { d: "M10 11v6M14 11v6" })], -1)]], 8, qa))])
|
|
4046
|
+
])]))), 128)), r.multiple && !r.readonly ? (x(), s("div", m({
|
|
3937
4047
|
key: 0,
|
|
3938
|
-
class: ["add-card", { "is-drag":
|
|
3939
|
-
},
|
|
4048
|
+
class: ["add-card", { "is-drag": p.value }]
|
|
4049
|
+
}, ne), [...l[4] ||= [
|
|
3940
4050
|
c("span", {
|
|
3941
4051
|
class: "plus",
|
|
3942
4052
|
"aria-hidden": "true"
|
|
@@ -3952,19 +4062,19 @@ var ea = {
|
|
|
3952
4062
|
c("span", { class: "hint" }, "點擊或拖放檔案 · JPG / PNG / WebP / GIF", -1)
|
|
3953
4063
|
]], 16)) : o("", !0)], 64))]),
|
|
3954
4064
|
(x(), a(t, { to: "body" }, [f(n, { name: "ii-modal" }, {
|
|
3955
|
-
default: j(() => [D(
|
|
4065
|
+
default: j(() => [D(_) ? (x(), s("div", {
|
|
3956
4066
|
key: 0,
|
|
3957
4067
|
class: "ii-modal",
|
|
3958
|
-
onClick: N(
|
|
3959
|
-
}, [c("div",
|
|
4068
|
+
onClick: N(V, ["self"])
|
|
4069
|
+
}, [c("div", Ja, [c("div", Ya, [h.value?.url ? (x(), s("img", {
|
|
3960
4070
|
key: 0,
|
|
3961
|
-
src:
|
|
3962
|
-
alt:
|
|
3963
|
-
}, null, 8,
|
|
4071
|
+
src: h.value.url,
|
|
4072
|
+
alt: h.value ? M(h.value) : ""
|
|
4073
|
+
}, null, 8, Xa)) : (x(), s("div", Za, " 示範圖片 · 上傳真實檔案即可在此檢視 "))]), c("div", Qa, [c("div", $a, [c("div", eo, E(h.value ? M(h.value) : ""), 1), c("div", to, E(H.value), 1)]), c("button", {
|
|
3964
4074
|
class: "ii-modal-close",
|
|
3965
4075
|
"aria-label": "關閉",
|
|
3966
|
-
onClick:
|
|
3967
|
-
}, [...l[
|
|
4076
|
+
onClick: V
|
|
4077
|
+
}, [...l[5] ||= [c("svg", {
|
|
3968
4078
|
viewBox: "0 0 24 24",
|
|
3969
4079
|
fill: "none",
|
|
3970
4080
|
stroke: "currentColor",
|
|
@@ -3976,32 +4086,40 @@ var ea = {
|
|
|
3976
4086
|
})]))
|
|
3977
4087
|
], 2));
|
|
3978
4088
|
}
|
|
3979
|
-
}), [["__scopeId", "data-v-
|
|
4089
|
+
}), [["__scopeId", "data-v-0531aeda"]]), ro = {
|
|
3980
4090
|
key: 0,
|
|
3981
4091
|
class: "head"
|
|
3982
|
-
},
|
|
4092
|
+
}, io = ["textContent"], ao = {
|
|
3983
4093
|
key: 1,
|
|
3984
4094
|
class: "count-chip"
|
|
3985
|
-
},
|
|
4095
|
+
}, oo = {
|
|
4096
|
+
key: 0,
|
|
4097
|
+
class: "icon",
|
|
4098
|
+
"aria-hidden": "true"
|
|
4099
|
+
}, so = ["textContent"], co = ["textContent"], lo = {
|
|
3986
4100
|
key: 2,
|
|
3987
4101
|
class: "list"
|
|
3988
|
-
},
|
|
4102
|
+
}, uo = [
|
|
3989
4103
|
"src",
|
|
4104
|
+
"onLoadedmetadata",
|
|
3990
4105
|
"onTimeupdate",
|
|
3991
4106
|
"onEnded"
|
|
3992
|
-
],
|
|
4107
|
+
], fo = [
|
|
3993
4108
|
"aria-label",
|
|
3994
4109
|
"disabled",
|
|
3995
4110
|
"onClick"
|
|
3996
|
-
],
|
|
4111
|
+
], po = {
|
|
3997
4112
|
key: 0,
|
|
3998
4113
|
viewBox: "0 0 24 24",
|
|
3999
4114
|
fill: "currentColor"
|
|
4000
|
-
},
|
|
4115
|
+
}, mo = {
|
|
4001
4116
|
key: 1,
|
|
4002
4117
|
viewBox: "0 0 24 24",
|
|
4003
4118
|
fill: "currentColor"
|
|
4004
|
-
},
|
|
4119
|
+
}, ho = { class: "meta" }, go = ["title"], _o = { class: "sub" }, vo = ["onMousedown", "onTouchstart"], yo = {
|
|
4120
|
+
key: 1,
|
|
4121
|
+
class: "track"
|
|
4122
|
+
}, bo = { class: "time" }, xo = ["disabled", "onClick"], So = { class: "meta" }, Co = { class: "name" }, wo = 256, To = 5, Eo = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
4005
4123
|
__name: "NAudioSelect",
|
|
4006
4124
|
props: {
|
|
4007
4125
|
modelValue: { default: () => [] },
|
|
@@ -4015,6 +4133,10 @@ var ea = {
|
|
|
4015
4133
|
type: Boolean,
|
|
4016
4134
|
default: !1
|
|
4017
4135
|
},
|
|
4136
|
+
readonly: {
|
|
4137
|
+
type: Boolean,
|
|
4138
|
+
default: !1
|
|
4139
|
+
},
|
|
4018
4140
|
title: { default: "" },
|
|
4019
4141
|
showCount: {
|
|
4020
4142
|
type: Boolean,
|
|
@@ -4035,81 +4157,110 @@ var ea = {
|
|
|
4035
4157
|
"error"
|
|
4036
4158
|
],
|
|
4037
4159
|
setup(t, { emit: n }) {
|
|
4038
|
-
let r =
|
|
4039
|
-
|
|
4040
|
-
|
|
4160
|
+
let r = /* @__PURE__ */ new Map(), a = (e, t, n) => {
|
|
4161
|
+
let i = r.get(e);
|
|
4162
|
+
if (i) return i.refCount += 1, i;
|
|
4163
|
+
let a = {
|
|
4164
|
+
peaks: t,
|
|
4165
|
+
duration: n,
|
|
4166
|
+
refCount: 1
|
|
4167
|
+
};
|
|
4168
|
+
return r.set(e, a), a;
|
|
4169
|
+
}, l = (e, t) => {
|
|
4170
|
+
if (!e) return;
|
|
4171
|
+
let n = r.get(e);
|
|
4172
|
+
n && (--n.refCount, t && n.refCount <= 0 && r.delete(e));
|
|
4173
|
+
}, f = n, { confirm: p } = Rt(), h = C(!1), y = C([]), b = C(null), T = S({}), D = S({}), O = S({}), k = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Map(), M = (e, t, n) => {
|
|
4174
|
+
a(e, t, n), j.set(e, (j.get(e) ?? 0) + 1);
|
|
4175
|
+
}, P = (e, t) => {
|
|
4176
|
+
if (!e) return;
|
|
4177
|
+
let n = j.get(e) ?? 0;
|
|
4178
|
+
n <= 0 || (n === 1 ? j.delete(e) : j.set(e, n - 1), l(e, t));
|
|
4179
|
+
}, F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), ee = (e, t) => {
|
|
4180
|
+
t ? F.set(e, t) : F.delete(e);
|
|
4181
|
+
}, te = i(() => t.modelValue.length), L = (e) => e == null ? "—" : e < 1024 ? e + " B" : e < 1048576 ? (e / 1024).toFixed(0) + " KB" : e < 1073741824 ? (e / 1048576).toFixed(1) + " MB" : (e / 1073741824).toFixed(2) + " GB", R = (e) => {
|
|
4041
4182
|
if (e == null || isNaN(e)) return "0:00";
|
|
4042
4183
|
let t = Math.floor(e), n = Math.floor(t / 60), r = t % 60;
|
|
4043
4184
|
return n + ":" + (r < 10 ? "0" : "") + r;
|
|
4044
|
-
},
|
|
4185
|
+
}, z = () => typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : "a" + Math.random().toString(36).slice(2, 9), B = (e) => {
|
|
4186
|
+
if (e.name) return e.name;
|
|
4187
|
+
try {
|
|
4188
|
+
let t = new URL(e.url, window.location.href).pathname;
|
|
4189
|
+
return decodeURIComponent(t.split("/").filter(Boolean).pop() ?? "音訊");
|
|
4190
|
+
} catch {
|
|
4191
|
+
return "音訊";
|
|
4192
|
+
}
|
|
4193
|
+
}, V = (e) => {
|
|
4194
|
+
e?.startsWith("blob:") && URL.revokeObjectURL(e);
|
|
4195
|
+
}, H = (e) => {
|
|
4045
4196
|
let n = t.accept.split(",").map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
4046
4197
|
if (n.length === 0) return e.type.startsWith("audio/");
|
|
4047
4198
|
let r = e.type.toLowerCase(), i = e.name.toLowerCase();
|
|
4048
4199
|
return n.some((e) => e.startsWith(".") ? i.endsWith(e) : e.endsWith("/*") ? r.startsWith(e.slice(0, -1)) : r === e);
|
|
4049
|
-
},
|
|
4050
|
-
let t = await
|
|
4051
|
-
for (let e = 0; e <
|
|
4052
|
-
let t = 0,
|
|
4053
|
-
for (let e =
|
|
4054
|
-
let
|
|
4055
|
-
|
|
4200
|
+
}, U = null, W = () => (U ||= new (window.AudioContext || window.webkitAudioContext)(), U), ne = async (e) => {
|
|
4201
|
+
let t = await W().decodeAudioData(e.slice(0)), n = t.getChannelData(0), r = Math.floor(n.length / wo) || 1, i = Array(wo), a = 0;
|
|
4202
|
+
for (let e = 0; e < wo; e++) {
|
|
4203
|
+
let t = 0, o = e * r, s = Math.min(n.length, o + r);
|
|
4204
|
+
for (let e = o; e < s; e++) {
|
|
4205
|
+
let r = Math.abs(n[e]);
|
|
4206
|
+
r > t && (t = r);
|
|
4056
4207
|
}
|
|
4057
|
-
|
|
4208
|
+
i[e] = t, t > a && (a = t);
|
|
4058
4209
|
}
|
|
4059
|
-
let
|
|
4060
|
-
for (let e = 0; e <
|
|
4210
|
+
let o = a > 0 ? 1 / a : 1;
|
|
4211
|
+
for (let e = 0; e < wo; e++) i[e] = Math.max(.06, i[e] * o);
|
|
4061
4212
|
return {
|
|
4062
|
-
peaks:
|
|
4063
|
-
duration:
|
|
4213
|
+
peaks: i,
|
|
4214
|
+
duration: t.duration
|
|
4064
4215
|
};
|
|
4065
|
-
},
|
|
4066
|
-
let t =
|
|
4216
|
+
}, re = (e) => e.arrayBuffer().then((e) => ne(e)), G = (e) => {
|
|
4217
|
+
let t = I.get(e), n = T[e];
|
|
4067
4218
|
if (!t || !n) return;
|
|
4068
4219
|
let r = t.clientWidth;
|
|
4069
4220
|
if (r <= 0) {
|
|
4070
|
-
requestAnimationFrame(() =>
|
|
4221
|
+
requestAnimationFrame(() => G(e));
|
|
4071
4222
|
return;
|
|
4072
4223
|
}
|
|
4073
|
-
let i = Math.max(8, Math.min(n.length, Math.floor((r + 2) /
|
|
4074
|
-
if (
|
|
4224
|
+
let i = Math.max(8, Math.min(n.length, Math.floor((r + 2) / To)));
|
|
4225
|
+
if (D[e] && D[e].length === i) return;
|
|
4075
4226
|
let a = Array(i);
|
|
4076
4227
|
for (let e = 0; e < i; e++) {
|
|
4077
4228
|
let t = Math.floor(e * n.length / i), r = Math.max(t + 1, Math.floor((e + 1) * n.length / i)), o = 0;
|
|
4078
4229
|
for (let e = t; e < r; e++) n[e] > o && (o = n[e]);
|
|
4079
4230
|
a[e] = o;
|
|
4080
4231
|
}
|
|
4081
|
-
|
|
4082
|
-
},
|
|
4232
|
+
D[e] = a;
|
|
4233
|
+
}, K = typeof ResizeObserver < "u" ? new ResizeObserver((e) => {
|
|
4083
4234
|
e.forEach((e) => {
|
|
4084
4235
|
let t = e.target.dataset.waveId;
|
|
4085
|
-
t &&
|
|
4236
|
+
t && G(t);
|
|
4086
4237
|
});
|
|
4087
|
-
}) : null,
|
|
4088
|
-
let n =
|
|
4089
|
-
if (n &&
|
|
4238
|
+
}) : null, ie = (e, t) => {
|
|
4239
|
+
let n = I.get(e);
|
|
4240
|
+
if (n && K && K.unobserve(n), t) {
|
|
4090
4241
|
let n = t;
|
|
4091
|
-
n.dataset.waveId = e,
|
|
4092
|
-
} else
|
|
4093
|
-
},
|
|
4094
|
-
if (t.disabled) return;
|
|
4095
|
-
let n = [],
|
|
4242
|
+
n.dataset.waveId = e, I.set(e, n), K ? K.observe(n) : G(e);
|
|
4243
|
+
} else I.delete(e);
|
|
4244
|
+
}, q = (e) => {
|
|
4245
|
+
if (t.disabled || t.readonly) return;
|
|
4246
|
+
let n = [], r = !1;
|
|
4096
4247
|
Array.prototype.forEach.call(e, (e) => {
|
|
4097
|
-
if (!
|
|
4098
|
-
|
|
4248
|
+
if (!H(e)) {
|
|
4249
|
+
f("error", {
|
|
4099
4250
|
type: "type",
|
|
4100
4251
|
file: e
|
|
4101
4252
|
});
|
|
4102
4253
|
return;
|
|
4103
4254
|
}
|
|
4104
4255
|
if (t.maxSize > 0 && e.size > t.maxSize * 1024 * 1024) {
|
|
4105
|
-
|
|
4256
|
+
f("error", {
|
|
4106
4257
|
type: "size",
|
|
4107
4258
|
file: e
|
|
4108
4259
|
});
|
|
4109
4260
|
return;
|
|
4110
4261
|
}
|
|
4111
|
-
if (!t.multiple && t.modelValue.length + n.length +
|
|
4112
|
-
|
|
4262
|
+
if (!t.multiple && t.modelValue.length + n.length + y.value.length >= 1) {
|
|
4263
|
+
r ||= (f("error", {
|
|
4113
4264
|
type: "count",
|
|
4114
4265
|
file: e
|
|
4115
4266
|
}), !0);
|
|
@@ -4117,139 +4268,196 @@ var ea = {
|
|
|
4117
4268
|
}
|
|
4118
4269
|
n.push(e);
|
|
4119
4270
|
}), n.length !== 0 && n.forEach((e) => {
|
|
4120
|
-
let n = "p" +
|
|
4121
|
-
|
|
4271
|
+
let n = "p" + z();
|
|
4272
|
+
y.value.push({
|
|
4122
4273
|
tag: n,
|
|
4123
4274
|
name: e.name
|
|
4124
|
-
}),
|
|
4125
|
-
let
|
|
4126
|
-
id:
|
|
4275
|
+
}), re(e).then(({ peaks: n, duration: r }) => {
|
|
4276
|
+
let i = {
|
|
4277
|
+
id: z(),
|
|
4127
4278
|
file: e,
|
|
4128
4279
|
name: e.name,
|
|
4129
4280
|
size: e.size,
|
|
4130
|
-
duration:
|
|
4281
|
+
duration: r,
|
|
4131
4282
|
url: URL.createObjectURL(e)
|
|
4132
4283
|
};
|
|
4133
|
-
|
|
4134
|
-
let
|
|
4135
|
-
|
|
4284
|
+
T[i.id] = n, O[i.id] = 0, k.add(i.id), M(i.url, n, r);
|
|
4285
|
+
let a = [...t.modelValue, i];
|
|
4286
|
+
f("update:modelValue", a), f("change", a), f("add", [i]);
|
|
4136
4287
|
}).catch(() => {
|
|
4137
|
-
|
|
4288
|
+
f("error", {
|
|
4138
4289
|
type: "type",
|
|
4139
4290
|
file: e
|
|
4140
4291
|
});
|
|
4141
4292
|
}).finally(() => {
|
|
4142
|
-
|
|
4293
|
+
y.value = y.value.filter((e) => e.tag !== n);
|
|
4143
4294
|
});
|
|
4144
4295
|
});
|
|
4145
|
-
},
|
|
4146
|
-
if (!t.disabled) if (t.multiple) {
|
|
4296
|
+
}, ae = async () => {
|
|
4297
|
+
if (!(t.disabled || t.readonly)) if (t.multiple) {
|
|
4147
4298
|
let e = await $.input.custom(t.accept, !0);
|
|
4148
4299
|
if (e.length === 0) return;
|
|
4149
|
-
|
|
4300
|
+
q(e.map((e) => e.file));
|
|
4150
4301
|
} else {
|
|
4151
4302
|
let e = await $.input.custom(t.accept, !1);
|
|
4152
4303
|
if (!e) return;
|
|
4153
|
-
|
|
4304
|
+
q([e.file]);
|
|
4154
4305
|
}
|
|
4155
|
-
},
|
|
4156
|
-
if (t.disabled) return;
|
|
4306
|
+
}, oe = async (e) => {
|
|
4307
|
+
if (t.disabled || t.readonly) return;
|
|
4157
4308
|
let n = t.modelValue.find((t) => t.id === e);
|
|
4158
|
-
if (!n || !await
|
|
4309
|
+
if (!n || !await p(`確定要移除「${B(n)}」嗎?`, {
|
|
4159
4310
|
title: "移除音訊",
|
|
4160
4311
|
status: "danger",
|
|
4161
4312
|
confirmText: "移除",
|
|
4162
4313
|
cancelText: "取消"
|
|
4163
4314
|
})) return;
|
|
4164
|
-
|
|
4165
|
-
let
|
|
4166
|
-
|
|
4167
|
-
},
|
|
4168
|
-
let e =
|
|
4169
|
-
e &&
|
|
4170
|
-
},
|
|
4171
|
-
let n =
|
|
4315
|
+
b.value === e && se(), V(n.url), P(n.url, !0), delete T[e], delete D[e], delete O[e], k.delete(e);
|
|
4316
|
+
let r = t.modelValue.filter((t) => t.id !== e);
|
|
4317
|
+
f("update:modelValue", r), f("change", r), f("remove", n);
|
|
4318
|
+
}, se = () => {
|
|
4319
|
+
let e = b.value;
|
|
4320
|
+
e && F.get(e)?.pause(), b.value = null;
|
|
4321
|
+
}, ce = (e) => {
|
|
4322
|
+
let n = F.get(e);
|
|
4172
4323
|
if (!n) return;
|
|
4173
|
-
if (
|
|
4174
|
-
n.pause(),
|
|
4324
|
+
if (b.value === e) {
|
|
4325
|
+
n.pause(), b.value = null;
|
|
4175
4326
|
return;
|
|
4176
4327
|
}
|
|
4177
|
-
|
|
4328
|
+
b.value && F.get(b.value)?.pause();
|
|
4178
4329
|
let r = t.modelValue.find((t) => t.id === e);
|
|
4179
|
-
(n.ended || r?.duration && n.currentTime >= r.duration) && (n.currentTime = 0),
|
|
4180
|
-
},
|
|
4181
|
-
|
|
4182
|
-
},
|
|
4183
|
-
|
|
4184
|
-
},
|
|
4185
|
-
let n =
|
|
4330
|
+
(n.ended || r?.duration && n.currentTime >= r.duration) && (n.currentTime = 0), b.value = e, n.play();
|
|
4331
|
+
}, le = (e, t) => {
|
|
4332
|
+
O[e] = t.target.currentTime;
|
|
4333
|
+
}, ue = (e) => {
|
|
4334
|
+
b.value === e && (b.value = null), O[e] = 0;
|
|
4335
|
+
}, de = (e, t) => {
|
|
4336
|
+
let n = F.get(e), r = I.get(e);
|
|
4186
4337
|
if (!n || !r || !n.duration || isNaN(n.duration)) return;
|
|
4187
4338
|
let i = r.getBoundingClientRect();
|
|
4188
|
-
n.currentTime = Math.min(Math.max((t - i.left) / i.width, 0), 1) * n.duration,
|
|
4189
|
-
},
|
|
4339
|
+
n.currentTime = Math.min(Math.max((t - i.left) / i.width, 0), 1) * n.duration, O[e] = n.currentTime;
|
|
4340
|
+
}, fe = (e, n) => {
|
|
4190
4341
|
if (t.disabled) return;
|
|
4191
|
-
n.preventDefault(),
|
|
4342
|
+
n.preventDefault(), de(e, ("touches" in n ? n.touches[0] : n).clientX);
|
|
4192
4343
|
let r = (t) => {
|
|
4193
|
-
|
|
4344
|
+
de(e, ("touches" in t ? t.touches[0] : t).clientX);
|
|
4194
4345
|
}, i = () => {
|
|
4195
4346
|
window.removeEventListener("mousemove", r), window.removeEventListener("mouseup", i), window.removeEventListener("touchmove", r), window.removeEventListener("touchend", i);
|
|
4196
4347
|
};
|
|
4197
4348
|
window.addEventListener("mousemove", r), window.addEventListener("mouseup", i), window.addEventListener("touchmove", r, { passive: !1 }), window.addEventListener("touchend", i);
|
|
4198
|
-
},
|
|
4349
|
+
}, pe = (e, t) => {
|
|
4199
4350
|
if (!e.duration || isNaN(e.duration)) return !1;
|
|
4200
|
-
let n =
|
|
4351
|
+
let n = D[e.id]?.length || 0;
|
|
4201
4352
|
if (n === 0) return !1;
|
|
4202
|
-
let r = (
|
|
4353
|
+
let r = (O[e.id] || 0) / e.duration;
|
|
4203
4354
|
return (t + .5) / n <= r;
|
|
4355
|
+
}, me = (e) => !e.duration || isNaN(e.duration) ? 0 : Math.min(1, (O[e.id] || 0) / e.duration), he = (e, n) => {
|
|
4356
|
+
let r = t.modelValue.find((t) => t.id === e);
|
|
4357
|
+
if (!r || r.duration != null) return;
|
|
4358
|
+
let i = t.modelValue.map((t) => t.id === e ? {
|
|
4359
|
+
...t,
|
|
4360
|
+
duration: n
|
|
4361
|
+
} : t);
|
|
4362
|
+
f("update:modelValue", i), f("change", i);
|
|
4363
|
+
}, ge = (e, n, r) => {
|
|
4364
|
+
t.modelValue.some((t) => t.id === e) && (T[e] = n, G(e), he(e, r));
|
|
4365
|
+
}, _e = async (e) => {
|
|
4366
|
+
O[e.id] ?? (O[e.id] = 0);
|
|
4367
|
+
let t = r.get(e.url);
|
|
4368
|
+
if (t) {
|
|
4369
|
+
M(e.url, t.peaks, t.duration), ge(e.id, t.peaks, t.duration);
|
|
4370
|
+
return;
|
|
4371
|
+
}
|
|
4372
|
+
try {
|
|
4373
|
+
let { peaks: t, duration: n } = await ne(await (await fetch(e.url)).arrayBuffer());
|
|
4374
|
+
M(e.url, t, n), ge(e.id, t, n);
|
|
4375
|
+
} catch {}
|
|
4376
|
+
}, ve = (e, t) => {
|
|
4377
|
+
let n = t.target.duration;
|
|
4378
|
+
!isNaN(n) && isFinite(n) && he(e, n);
|
|
4204
4379
|
};
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
e.url
|
|
4208
|
-
})
|
|
4380
|
+
A(() => t.modelValue, (e) => {
|
|
4381
|
+
e.forEach((e) => {
|
|
4382
|
+
!e.url || k.has(e.id) || (k.add(e.id), T[e.id] || _e(e));
|
|
4383
|
+
});
|
|
4384
|
+
}, { immediate: !0 }), v(() => {
|
|
4385
|
+
t.autoRevoke && t.modelValue.forEach((e) => V(e.url)), j.forEach((e, t) => {
|
|
4386
|
+
for (let n = 0; n < e; n++) l(t, !1);
|
|
4387
|
+
}), j.clear(), K?.disconnect(), U &&= (U.close(), null);
|
|
4209
4388
|
});
|
|
4210
|
-
let
|
|
4211
|
-
onClick:
|
|
4389
|
+
let J = {
|
|
4390
|
+
onClick: ae,
|
|
4212
4391
|
onDragenter: (e) => {
|
|
4213
|
-
t.disabled || (e.preventDefault(),
|
|
4392
|
+
t.disabled || t.readonly || (e.preventDefault(), h.value = !0);
|
|
4214
4393
|
},
|
|
4215
4394
|
onDragover: (e) => e.preventDefault(),
|
|
4216
4395
|
onDragleave: (e) => {
|
|
4217
|
-
e.preventDefault(),
|
|
4396
|
+
e.preventDefault(), h.value = !1;
|
|
4218
4397
|
},
|
|
4219
4398
|
onDrop: (e) => {
|
|
4220
|
-
t.disabled || (e.preventDefault(),
|
|
4399
|
+
t.disabled || t.readonly || (e.preventDefault(), h.value = !1, e.dataTransfer?.files?.length && q(e.dataTransfer.files));
|
|
4221
4400
|
}
|
|
4222
4401
|
};
|
|
4223
|
-
return (n, r) => (x(), s("div", { class: g(["audio-input", {
|
|
4402
|
+
return (n, r) => (x(), s("div", { class: g(["audio-input", {
|
|
4403
|
+
"is-disabled": t.disabled,
|
|
4404
|
+
"is-readonly": t.readonly
|
|
4405
|
+
}]) }, [t.title || t.showCount ? (x(), s("div", ro, [t.title ? (x(), s("span", {
|
|
4224
4406
|
key: 0,
|
|
4225
4407
|
class: "title",
|
|
4226
4408
|
textContent: E(t.title)
|
|
4227
|
-
}, null, 8,
|
|
4409
|
+
}, null, 8, io)) : o("", !0), t.showCount ? (x(), s("span", ao, E(te.value) + " 首", 1)) : o("", !0)])) : o("", !0), te.value === 0 && y.value.length === 0 ? (x(), s("div", m({
|
|
4228
4410
|
key: 1,
|
|
4229
|
-
class: ["empty", {
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4411
|
+
class: ["empty", {
|
|
4412
|
+
"is-drag": h.value,
|
|
4413
|
+
"is-static": t.readonly
|
|
4414
|
+
}]
|
|
4415
|
+
}, t.readonly ? {} : J), [
|
|
4416
|
+
t.readonly ? o("", !0) : (x(), s("span", oo, [...r[0] ||= [c("svg", {
|
|
4417
|
+
viewBox: "0 0 24 24",
|
|
4418
|
+
fill: "none",
|
|
4419
|
+
stroke: "currentColor",
|
|
4420
|
+
"stroke-width": "1.7",
|
|
4421
|
+
"stroke-linecap": "round",
|
|
4422
|
+
"stroke-linejoin": "round"
|
|
4423
|
+
}, [
|
|
4424
|
+
c("path", { d: "M9 18V5l12-2v13" }),
|
|
4425
|
+
c("circle", {
|
|
4426
|
+
cx: "6",
|
|
4427
|
+
cy: "18",
|
|
4428
|
+
r: "3"
|
|
4429
|
+
}),
|
|
4430
|
+
c("circle", {
|
|
4431
|
+
cx: "18",
|
|
4432
|
+
cy: "16",
|
|
4433
|
+
r: "3"
|
|
4434
|
+
})
|
|
4435
|
+
], -1)]])),
|
|
4436
|
+
c("h3", { textContent: E(t.readonly ? "目前沒有音訊" : t.emptyTitle) }, null, 8, so),
|
|
4437
|
+
t.readonly ? o("", !0) : (x(), s("p", {
|
|
4438
|
+
key: 1,
|
|
4439
|
+
textContent: E(t.emptyHint)
|
|
4440
|
+
}, null, 8, co))
|
|
4441
|
+
], 16)) : (x(), s("div", lo, [
|
|
4235
4442
|
(x(!0), s(e, null, w(t.modelValue, (n) => (x(), s("div", {
|
|
4236
4443
|
key: n.id,
|
|
4237
|
-
class: g(["row", { "is-playing":
|
|
4444
|
+
class: g(["row", { "is-playing": b.value === n.id }])
|
|
4238
4445
|
}, [
|
|
4239
4446
|
c("audio", {
|
|
4240
4447
|
ref_for: !0,
|
|
4241
|
-
ref: (e) =>
|
|
4448
|
+
ref: (e) => ee(n.id, e),
|
|
4242
4449
|
src: n.url,
|
|
4243
4450
|
preload: "metadata",
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4451
|
+
onLoadedmetadata: (e) => ve(n.id, e),
|
|
4452
|
+
onTimeupdate: (e) => le(n.id, e),
|
|
4453
|
+
onEnded: (e) => ue(n.id)
|
|
4454
|
+
}, null, 40, uo),
|
|
4247
4455
|
c("button", {
|
|
4248
4456
|
class: "play-btn",
|
|
4249
|
-
"aria-label":
|
|
4457
|
+
"aria-label": b.value === n.id ? "暫停" : "播放",
|
|
4250
4458
|
disabled: !n.url,
|
|
4251
|
-
onClick: (e) =>
|
|
4252
|
-
}, [
|
|
4459
|
+
onClick: (e) => ce(n.id)
|
|
4460
|
+
}, [b.value === n.id ? (x(), s("svg", po, [...r[1] ||= [c("rect", {
|
|
4253
4461
|
x: "6",
|
|
4254
4462
|
y: "5",
|
|
4255
4463
|
width: "4",
|
|
@@ -4261,28 +4469,32 @@ var ea = {
|
|
|
4261
4469
|
width: "4",
|
|
4262
4470
|
height: "14",
|
|
4263
4471
|
rx: "1"
|
|
4264
|
-
}, null, -1)]])) : (x(), s("svg",
|
|
4265
|
-
c("div",
|
|
4472
|
+
}, null, -1)]])) : (x(), s("svg", mo, [...r[2] ||= [c("path", { d: "M8 5v14l11-7z" }, null, -1)]]))], 8, fo),
|
|
4473
|
+
c("div", ho, [c("div", {
|
|
4266
4474
|
class: "name",
|
|
4267
|
-
title: n
|
|
4268
|
-
}, E(n
|
|
4475
|
+
title: B(n)
|
|
4476
|
+
}, E(B(n)), 9, go), c("div", _o, [n.size == null ? o("", !0) : (x(), s(e, { key: 0 }, [d(E(L(n.size)) + " · ", 1)], 64)), d(" " + E(R(n.duration)), 1)])]),
|
|
4269
4477
|
c("div", {
|
|
4270
|
-
class: "wave",
|
|
4478
|
+
class: g(["wave", { "is-track": !D[n.id]?.length }]),
|
|
4271
4479
|
ref_for: !0,
|
|
4272
|
-
ref: (e) =>
|
|
4273
|
-
onMousedown: (e) =>
|
|
4274
|
-
onTouchstart: (e) =>
|
|
4275
|
-
}, [(x(!0), s(e,
|
|
4480
|
+
ref: (e) => ie(n.id, e),
|
|
4481
|
+
onMousedown: (e) => fe(n.id, e),
|
|
4482
|
+
onTouchstart: (e) => fe(n.id, e)
|
|
4483
|
+
}, [D[n.id]?.length ? (x(!0), s(e, { key: 0 }, w(D[n.id], (e, t) => (x(), s("span", {
|
|
4276
4484
|
key: t,
|
|
4277
|
-
class: g(["bar", { "is-played":
|
|
4485
|
+
class: g(["bar", { "is-played": pe(n, t) }]),
|
|
4278
4486
|
style: _({ height: Math.max(2, Math.round(e * 34)) + "px" })
|
|
4279
|
-
}, null, 6))), 128))
|
|
4280
|
-
|
|
4281
|
-
|
|
4487
|
+
}, null, 6))), 128)) : (x(), s("div", yo, [c("div", {
|
|
4488
|
+
class: "track-fill",
|
|
4489
|
+
style: _({ width: me(n) * 100 + "%" })
|
|
4490
|
+
}, null, 4)]))], 42, vo),
|
|
4491
|
+
c("div", bo, E(R(O[n.id] || 0)) + " / " + E(R(n.duration)), 1),
|
|
4492
|
+
t.readonly ? o("", !0) : (x(), s("button", {
|
|
4493
|
+
key: 0,
|
|
4282
4494
|
class: "del-btn",
|
|
4283
4495
|
"aria-label": "刪除",
|
|
4284
4496
|
disabled: t.disabled,
|
|
4285
|
-
onClick: N((e) =>
|
|
4497
|
+
onClick: N((e) => oe(n.id), ["stop"])
|
|
4286
4498
|
}, [...r[3] ||= [c("svg", {
|
|
4287
4499
|
viewBox: "0 0 24 24",
|
|
4288
4500
|
fill: "none",
|
|
@@ -4290,9 +4502,9 @@ var ea = {
|
|
|
4290
4502
|
"stroke-width": "1.8",
|
|
4291
4503
|
"stroke-linecap": "round",
|
|
4292
4504
|
"stroke-linejoin": "round"
|
|
4293
|
-
}, [c("path", { d: "M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14" })], -1)]], 8,
|
|
4505
|
+
}, [c("path", { d: "M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14" })], -1)]], 8, xo))
|
|
4294
4506
|
], 2))), 128)),
|
|
4295
|
-
(x(!0), s(e, null, w(
|
|
4507
|
+
(x(!0), s(e, null, w(y.value, (e) => (x(), s("div", {
|
|
4296
4508
|
key: e.tag,
|
|
4297
4509
|
class: "row is-pending"
|
|
4298
4510
|
}, [r[5] ||= c("span", {
|
|
@@ -4304,20 +4516,20 @@ var ea = {
|
|
|
4304
4516
|
stroke: "currentColor",
|
|
4305
4517
|
"stroke-width": "2",
|
|
4306
4518
|
"stroke-linecap": "round"
|
|
4307
|
-
}, [c("path", { d: "M12 3a9 9 0 1 0 9 9" })])], -1), c("div",
|
|
4308
|
-
t.multiple ? (x(), s("div", m({
|
|
4519
|
+
}, [c("path", { d: "M12 3a9 9 0 1 0 9 9" })])], -1), c("div", So, [c("div", Co, E(e.name), 1), r[4] ||= c("div", { class: "sub" }, "解析波形中…", -1)])]))), 128)),
|
|
4520
|
+
t.multiple && !t.readonly ? (x(), s("div", m({
|
|
4309
4521
|
key: 0,
|
|
4310
|
-
class: ["add", { "is-drag":
|
|
4311
|
-
},
|
|
4522
|
+
class: ["add", { "is-drag": h.value }]
|
|
4523
|
+
}, J), [...r[6] ||= [u("<span class=\"plus\" aria-hidden=\"true\" data-v-a06aebbd><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" data-v-a06aebbd><path d=\"M12 5v14M5 12h14\" data-v-a06aebbd></path></svg></span><div class=\"add-text\" data-v-a06aebbd><div class=\"t\" data-v-a06aebbd>新增音訊</div><div class=\"d\" data-v-a06aebbd>點擊或拖放檔案 · MP3 / WAV / OGG / M4A</div></div>", 2)]], 16)) : o("", !0)
|
|
4312
4524
|
]))], 2));
|
|
4313
4525
|
}
|
|
4314
|
-
}), [["__scopeId", "data-v-
|
|
4526
|
+
}), [["__scopeId", "data-v-a06aebbd"]]), Do = { class: "header" }, Oo = { class: "brand-logo" }, ko = { class: "logo-text" }, Ao = { class: "logo-icon" }, jo = { class: "nav" }, Mo = ["onClick"], No = ["innerHTML"], Po = { class: "nav-list" }, Fo = ["href", "onClick"], Io = ["innerHTML"], Lo = { class: "nav-text" }, Ro = ["href", "onClick"], zo = { class: "title no-children" }, Bo = ["innerHTML"], Vo = { class: "user-capsule" }, Ho = { class: "user-avatar" }, Uo = ["src"], Wo = {
|
|
4315
4527
|
key: 1,
|
|
4316
4528
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4317
4529
|
width: "36",
|
|
4318
4530
|
height: "36",
|
|
4319
4531
|
viewBox: "0 0 36 36"
|
|
4320
|
-
},
|
|
4532
|
+
}, Go = { class: "user-info" }, Ko = { class: "user-name-row" }, qo = { class: "user-name" }, Jo = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
4321
4533
|
__name: "NSidebar",
|
|
4322
4534
|
props: {
|
|
4323
4535
|
title: { default: "" },
|
|
@@ -4370,8 +4582,8 @@ var ea = {
|
|
|
4370
4582
|
class: "content",
|
|
4371
4583
|
onMouseenter: v[2] ||= (e) => p.value = !0
|
|
4372
4584
|
}, [
|
|
4373
|
-
T(r.$slots, "header", {}, () => [c("div",
|
|
4374
|
-
c("div",
|
|
4585
|
+
T(r.$slots, "header", {}, () => [c("div", Do, [c("div", Oo, [c("span", ko, E(n.title), 1), c("span", Ao, E(n.title.substring(0, 1).toUpperCase()), 1)])])], !0),
|
|
4586
|
+
c("div", jo, [(x(!0), s(e, null, w(n.menus, (t) => (x(), s(e, null, [t.children?.length ? (x(), s("div", {
|
|
4375
4587
|
key: 0,
|
|
4376
4588
|
class: g(["menu", {
|
|
4377
4589
|
open: D(i)(t.title),
|
|
@@ -4380,7 +4592,7 @@ var ea = {
|
|
|
4380
4592
|
}, [c("div", {
|
|
4381
4593
|
class: "title",
|
|
4382
4594
|
onClick: (e) => D(o)(t.title)
|
|
4383
|
-
}, [c("div", null, [c("div", { innerHTML: t.icon }, null, 8,
|
|
4595
|
+
}, [c("div", null, [c("div", { innerHTML: t.icon }, null, 8, No), c("span", null, E(t.title), 1)]), v[6] ||= c("svg", {
|
|
4384
4596
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4385
4597
|
width: "14",
|
|
4386
4598
|
height: "14",
|
|
@@ -4391,23 +4603,23 @@ var ea = {
|
|
|
4391
4603
|
"stroke-linecap": "round",
|
|
4392
4604
|
"stroke-linejoin": "round",
|
|
4393
4605
|
class: "icon"
|
|
4394
|
-
}, [c("path", { d: "m9 18 6-6-6-6" })], -1)], 8,
|
|
4606
|
+
}, [c("path", { d: "m9 18 6-6-6-6" })], -1)], 8, Mo), c("div", Po, [c("div", null, [(x(!0), s(e, null, w(t.children, (e) => (x(), s("a", {
|
|
4395
4607
|
href: e.route,
|
|
4396
4608
|
onClick: N((t) => h(e), ["prevent"])
|
|
4397
|
-
}, [c("div", { class: g(["nav-item", { active: D(d)(e, n.currentPath) }]) }, [c("div", { innerHTML: e.icon }, null, 8,
|
|
4609
|
+
}, [c("div", { class: g(["nav-item", { active: D(d)(e, n.currentPath) }]) }, [c("div", { innerHTML: e.icon }, null, 8, Io), c("span", Lo, E(e.title), 1)], 2)], 8, Fo))), 256))])])], 2)) : (x(), s("div", {
|
|
4398
4610
|
key: 1,
|
|
4399
4611
|
class: g(["menu", { active: t.route === n.currentPath }])
|
|
4400
4612
|
}, [c("a", {
|
|
4401
4613
|
href: t.route,
|
|
4402
4614
|
onClick: N((e) => _(t), ["prevent"])
|
|
4403
|
-
}, [c("div",
|
|
4404
|
-
c("div",
|
|
4405
|
-
c("div",
|
|
4615
|
+
}, [c("div", zo, [c("div", null, [c("div", { innerHTML: t.icon }, null, 8, Bo), c("span", null, E(t.title), 1)])])], 8, Ro)], 2))], 64))), 256))]),
|
|
4616
|
+
c("div", Vo, [T(r.$slots, "user", {}, () => [
|
|
4617
|
+
c("div", Ho, [n.userAvatarUrl ? (x(), s("img", {
|
|
4406
4618
|
key: 0,
|
|
4407
4619
|
src: n.userAvatarUrl,
|
|
4408
4620
|
alt: "User Avatar"
|
|
4409
|
-
}, null, 8,
|
|
4410
|
-
c("div",
|
|
4621
|
+
}, null, 8, Uo)) : (x(), s("svg", Wo, [...v[7] ||= [u("<defs data-v-2c73c218><clipPath id=\"avatarClip\" data-v-2c73c218><circle cx=\"18\" cy=\"18\" r=\"18\" data-v-2c73c218></circle></clipPath></defs><circle cx=\"18\" cy=\"18\" r=\"18\" fill=\"#dbeafe\" data-v-2c73c218></circle><g clip-path=\"url(#avatarClip)\" data-v-2c73c218><circle cx=\"18\" cy=\"14\" r=\"6\" fill=\"#2563eb\" data-v-2c73c218></circle><path d=\"M6,34 Q6,24 18,24 Q30,24 30,34\" fill=\"#2563eb\" data-v-2c73c218></path></g>", 3)]]))]),
|
|
4622
|
+
c("div", Go, [c("div", Ko, [c("span", qo, E(n.userName), 1)])]),
|
|
4411
4623
|
f(z, {
|
|
4412
4624
|
class: "logout-btn",
|
|
4413
4625
|
intent: "error",
|
|
@@ -4446,7 +4658,7 @@ var ea = {
|
|
|
4446
4658
|
}, null, 2)]))
|
|
4447
4659
|
], 34));
|
|
4448
4660
|
}
|
|
4449
|
-
}), [["__scopeId", "data-v-2c73c218"]]),
|
|
4661
|
+
}), [["__scopeId", "data-v-2c73c218"]]), Yo = { class: "layout" }, Xo = { class: "main-content" }, Zo = { class: "copyright" }, Qo = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
4450
4662
|
__name: "NLayout",
|
|
4451
4663
|
props: {
|
|
4452
4664
|
title: { default: "NICKLABS" },
|
|
@@ -4462,7 +4674,7 @@ var ea = {
|
|
|
4462
4674
|
emits: ["logout", "navigate"],
|
|
4463
4675
|
setup(e, { emit: t }) {
|
|
4464
4676
|
let n = rn(), r = t;
|
|
4465
|
-
return (t, i) => (x(), s("div",
|
|
4677
|
+
return (t, i) => (x(), s("div", Yo, [e.isShowSidebar ? (x(), a(Jo, {
|
|
4466
4678
|
key: 0,
|
|
4467
4679
|
title: e.title,
|
|
4468
4680
|
userName: e.userName,
|
|
@@ -4478,18 +4690,18 @@ var ea = {
|
|
|
4478
4690
|
"isOpen",
|
|
4479
4691
|
"menus",
|
|
4480
4692
|
"currentPath"
|
|
4481
|
-
])) : o("", !0), c("main",
|
|
4693
|
+
])) : o("", !0), c("main", Xo, [T(t.$slots, "default", {}, void 0, !0), c("div", Zo, E(e.copyright), 1)])]));
|
|
4482
4694
|
}
|
|
4483
|
-
}), [["__scopeId", "data-v-41b1eb44"]]),
|
|
4695
|
+
}), [["__scopeId", "data-v-41b1eb44"]]), $o = { class: "topbar" }, es = { class: "topbar-left" }, ts = { class: "topbar-right" }, ns = {
|
|
4484
4696
|
key: 0,
|
|
4485
4697
|
class: "pill"
|
|
4486
|
-
},
|
|
4698
|
+
}, rs = {
|
|
4487
4699
|
key: 0,
|
|
4488
4700
|
class: "name"
|
|
4489
|
-
},
|
|
4701
|
+
}, is = {
|
|
4490
4702
|
key: 1,
|
|
4491
4703
|
class: "separator"
|
|
4492
|
-
},
|
|
4704
|
+
}, as = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
4493
4705
|
__name: "NNavigation",
|
|
4494
4706
|
props: {
|
|
4495
4707
|
isShowSidebar: {
|
|
@@ -4514,7 +4726,7 @@ var ea = {
|
|
|
4514
4726
|
let n = t, r = () => {
|
|
4515
4727
|
document.fullscreenElement ? document.exitFullscreen?.() : document.documentElement.requestFullscreen();
|
|
4516
4728
|
};
|
|
4517
|
-
return (t, i) => (x(), s("header",
|
|
4729
|
+
return (t, i) => (x(), s("header", $o, [c("div", es, [e.isShowSidebar ? (x(), a(z, {
|
|
4518
4730
|
key: 0,
|
|
4519
4731
|
onClick: i[0] ||= (e) => n("toggleSidebar"),
|
|
4520
4732
|
padding: "8px"
|
|
@@ -4557,9 +4769,9 @@ var ea = {
|
|
|
4557
4769
|
c("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
4558
4770
|
], -1)]]),
|
|
4559
4771
|
_: 1
|
|
4560
|
-
})) : o("", !0)]), c("div",
|
|
4561
|
-
e.isShowUser ? (x(), s("span",
|
|
4562
|
-
e.isShowUser && e.isShowLogoutButton ? (x(), s("div",
|
|
4772
|
+
})) : o("", !0)]), c("div", ts, [e.isShowUser || e.isShowLogoutButton ? (x(), s("div", ns, [
|
|
4773
|
+
e.isShowUser ? (x(), s("span", rs, "Nick")) : o("", !0),
|
|
4774
|
+
e.isShowUser && e.isShowLogoutButton ? (x(), s("div", is)) : o("", !0),
|
|
4563
4775
|
e.isShowLogoutButton ? (x(), a(z, {
|
|
4564
4776
|
key: 2,
|
|
4565
4777
|
variant: "mute",
|
|
@@ -4585,10 +4797,10 @@ var ea = {
|
|
|
4585
4797
|
})) : o("", !0)
|
|
4586
4798
|
])) : o("", !0)])]));
|
|
4587
4799
|
}
|
|
4588
|
-
}), [["__scopeId", "data-v-f38a4beb"]]),
|
|
4800
|
+
}), [["__scopeId", "data-v-f38a4beb"]]), os = { class: "brand" }, ss = ["src", "alt"], cs = {
|
|
4589
4801
|
key: 1,
|
|
4590
4802
|
class: "icon"
|
|
4591
|
-
},
|
|
4803
|
+
}, ls = { key: 2 }, us = { key: 3 }, ds = /* @__PURE__ */ R(/* @__PURE__ */ p({
|
|
4592
4804
|
__name: "NLoginLayout",
|
|
4593
4805
|
props: {
|
|
4594
4806
|
backgroundImage: { default: "" },
|
|
@@ -4606,15 +4818,15 @@ var ea = {
|
|
|
4606
4818
|
radius: "xl",
|
|
4607
4819
|
class: "card"
|
|
4608
4820
|
}, {
|
|
4609
|
-
default: j(() => [c("div",
|
|
4821
|
+
default: j(() => [c("div", os, [
|
|
4610
4822
|
t.value ? (x(), s("img", {
|
|
4611
4823
|
key: 0,
|
|
4612
4824
|
class: "logo-img",
|
|
4613
4825
|
src: e.logo,
|
|
4614
4826
|
alt: e.title
|
|
4615
|
-
}, null, 8,
|
|
4616
|
-
e.title ? (x(), s("h1",
|
|
4617
|
-
e.description ? (x(), s("p",
|
|
4827
|
+
}, null, 8, ss)) : (x(), s("div", cs, E(e.logo), 1)),
|
|
4828
|
+
e.title ? (x(), s("h1", ls, E(e.title), 1)) : o("", !0),
|
|
4829
|
+
e.description ? (x(), s("p", us, E(e.description), 1)) : o("", !0)
|
|
4618
4830
|
]), T(n.$slots, "default", {}, void 0, !0)]),
|
|
4619
4831
|
_: 3
|
|
4620
4832
|
})], 4));
|
|
@@ -4622,19 +4834,19 @@ var ea = {
|
|
|
4622
4834
|
}), [["__scopeId", "data-v-f0866bc5"]]);
|
|
4623
4835
|
//#endregion
|
|
4624
4836
|
//#region src/composables/useRouteModal.ts
|
|
4625
|
-
function
|
|
4837
|
+
function fs(e) {
|
|
4626
4838
|
let t = i(() => {
|
|
4627
|
-
let t =
|
|
4839
|
+
let t = I();
|
|
4628
4840
|
return t ? t.currentRoute.value.matched.some((t) => t.name === e.routeName) : !1;
|
|
4629
|
-
}), n = i(() =>
|
|
4841
|
+
}), n = i(() => I()?.currentRoute.value.params ?? {});
|
|
4630
4842
|
function r(t = {}) {
|
|
4631
|
-
|
|
4843
|
+
I()?.push({
|
|
4632
4844
|
name: e.routeName,
|
|
4633
4845
|
params: t
|
|
4634
4846
|
});
|
|
4635
4847
|
}
|
|
4636
4848
|
function a() {
|
|
4637
|
-
let t =
|
|
4849
|
+
let t = I();
|
|
4638
4850
|
t && (window.history.state?.back ? t.back() : e.parentRouteName ? t.push({ name: e.parentRouteName }) : t.back());
|
|
4639
4851
|
}
|
|
4640
4852
|
return {
|
|
@@ -4646,12 +4858,12 @@ function ns(e) {
|
|
|
4646
4858
|
}
|
|
4647
4859
|
//#endregion
|
|
4648
4860
|
//#region src/index.ts
|
|
4649
|
-
var
|
|
4861
|
+
var ps = {
|
|
4650
4862
|
NButton: z,
|
|
4651
4863
|
NBreadcrumb: re,
|
|
4652
|
-
NInput:
|
|
4653
|
-
NTextarea:
|
|
4654
|
-
NCheckbox:
|
|
4864
|
+
NInput: ce,
|
|
4865
|
+
NTextarea: pe,
|
|
4866
|
+
NCheckbox: ye,
|
|
4655
4867
|
NSelect: Oe,
|
|
4656
4868
|
NFileSelect: $t,
|
|
4657
4869
|
NForm: xn,
|
|
@@ -4668,18 +4880,18 @@ var rs = {
|
|
|
4668
4880
|
NDrawer: Ui,
|
|
4669
4881
|
NAlert: Qi,
|
|
4670
4882
|
NTable: nr,
|
|
4671
|
-
NVideoSelect:
|
|
4672
|
-
NImageSelect:
|
|
4673
|
-
NAudioSelect:
|
|
4674
|
-
NLayout:
|
|
4675
|
-
NNavigation:
|
|
4676
|
-
NSidebar:
|
|
4883
|
+
NVideoSelect: Oa,
|
|
4884
|
+
NImageSelect: no,
|
|
4885
|
+
NAudioSelect: Eo,
|
|
4886
|
+
NLayout: Qo,
|
|
4887
|
+
NNavigation: as,
|
|
4888
|
+
NSidebar: Jo,
|
|
4677
4889
|
NCard: Sn,
|
|
4678
|
-
NLoginLayout:
|
|
4679
|
-
},
|
|
4680
|
-
Object.entries(
|
|
4890
|
+
NLoginLayout: ds
|
|
4891
|
+
}, ms = { install(e, t = {}) {
|
|
4892
|
+
Object.entries(ps).forEach(([t, n]) => {
|
|
4681
4893
|
e.component(t, n);
|
|
4682
|
-
}), t.router &&
|
|
4894
|
+
}), t.router && F(t.router);
|
|
4683
4895
|
} };
|
|
4684
4896
|
//#endregion
|
|
4685
|
-
export { Qi as NAlert,
|
|
4897
|
+
export { Qi as NAlert, Eo as NAudioSelect, z as NButton, Sn as NCard, ye as NCheckbox, wr as NCode, Mi as NDatePicker, Ui as NDrawer, Mn as NEmpty, $t as NFileSelect, xn as NForm, no as NImageSelect, ce as NInput, Qo as NLayout, or as NList, Un as NLoading, ds as NLoginLayout, Ri as NModal, as as NNavigation, Oe as NSelect, Jo as NSidebar, Er as NSwitch, nr as NTable, Dr as NTag, pe as NTextarea, hr as NToast, Ni as NTooltip, Oa as NVideoSelect, ms as NickLabsUI, Rt as useAlert, H as useBreadcrumb, $i as useDisclosure, fs as useRouteModal, rn as useSidebarManager, lr as useToast };
|