@xiaou66/u-web-ui 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +325 -297
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, toHandlers, toRefs, unref, useAttrs, useModel, useSlots, watch, withCtx, withModifiers } from "vue";
|
|
1
|
+
import { Fragment, KeepAlive, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, mergeModels, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, toDisplayString, toHandlers, toRefs, unref, useAttrs, useModel, useSlots, watch, withCtx, withModifiers } from "vue";
|
|
2
2
|
import { ElAside, ElButton, ElContainer, ElDivider, ElHeader, ElIcon, ElMain, ElMenu, ElMenuItem, ElSubMenu } from "element-plus/es";
|
|
3
3
|
import { useRoute, useRouter } from "vue-router";
|
|
4
4
|
import { useEventListener } from "@vueuse/core";
|
|
@@ -68,7 +68,7 @@ var BackTop_default = /* @__PURE__ */ defineComponent({
|
|
|
68
68
|
},
|
|
69
69
|
emits: ["click"],
|
|
70
70
|
setup(e, { emit: t }) {
|
|
71
|
-
let
|
|
71
|
+
let n = e, l = t, u = getClassPrefix("back-top"), d = ref(!1), f = ref(), p = computed(() => !n.targetContainer), m = null, h = ((e) => {
|
|
72
72
|
let t = () => {
|
|
73
73
|
m === null && (m = requestAnimationFrame(() => {
|
|
74
74
|
e(), m = null;
|
|
@@ -79,29 +79,29 @@ var BackTop_default = /* @__PURE__ */ defineComponent({
|
|
|
79
79
|
}, t;
|
|
80
80
|
})(() => {
|
|
81
81
|
if (f.value) {
|
|
82
|
-
let { visibleHeight: e } =
|
|
82
|
+
let { visibleHeight: e } = n;
|
|
83
83
|
d.value = (p.value ? window.pageYOffset : f.value.scrollTop) >= e;
|
|
84
84
|
}
|
|
85
|
-
}), g = (e) => typeof e == "string" ? (console.log("container: ", document.querySelector(e)), document.querySelector(e)) : e,
|
|
85
|
+
}), g = (e) => typeof e == "string" ? (console.log("container: ", document.querySelector(e)), document.querySelector(e)) : e, _ = (e, t, n) => {
|
|
86
86
|
e.addEventListener(t, n);
|
|
87
|
-
},
|
|
87
|
+
}, y = (e, t, n) => {
|
|
88
88
|
e.removeEventListener(t, n);
|
|
89
89
|
};
|
|
90
90
|
onMounted(() => {
|
|
91
|
-
f.value = p.value ? document?.documentElement : g(
|
|
91
|
+
f.value = p.value ? document?.documentElement : g(n.targetContainer), f.value && (_(p.value ? window : f.value, "scroll", h), h());
|
|
92
92
|
}), onUnmounted(() => {
|
|
93
|
-
h.cancel(), f.value &&
|
|
93
|
+
h.cancel(), f.value && y(p.value ? window : f.value, "scroll", h);
|
|
94
94
|
});
|
|
95
|
-
let
|
|
95
|
+
let S = () => {
|
|
96
96
|
if (!f.value) return;
|
|
97
97
|
l("click");
|
|
98
|
-
let e = p.value ? window.pageYOffset : f.value.scrollTop, { duration: t } =
|
|
99
|
-
let a =
|
|
100
|
-
p.value ? window.scrollTo(0, s) : f.value && (f.value.scrollTop = s), o < 1 && requestAnimationFrame(
|
|
98
|
+
let e = p.value ? window.pageYOffset : f.value.scrollTop, { duration: t } = n, r = performance.now(), i = (n) => {
|
|
99
|
+
let a = n - r, o = Math.min(a / t, 1), s = e * (1 - (1 - (1 - o) ** 3));
|
|
100
|
+
p.value ? window.scrollTo(0, s) : f.value && (f.value.scrollTop = s), o < 1 && requestAnimationFrame(i);
|
|
101
101
|
};
|
|
102
|
-
requestAnimationFrame(
|
|
103
|
-
},
|
|
104
|
-
let { right: e = 28, bottom: t = 50 } =
|
|
102
|
+
requestAnimationFrame(i);
|
|
103
|
+
}, C = computed(() => {
|
|
104
|
+
let { right: e = 28, bottom: t = 50 } = n.position || {};
|
|
105
105
|
return {
|
|
106
106
|
right: `${e}px`,
|
|
107
107
|
bottom: `${t}px`
|
|
@@ -111,8 +111,8 @@ var BackTop_default = /* @__PURE__ */ defineComponent({
|
|
|
111
111
|
default: withCtx(() => [d.value ? (openBlock(), createElementBlock("div", {
|
|
112
112
|
key: 0,
|
|
113
113
|
class: normalizeClass([unref(u), { [`${unref(u)}-${e.size}`]: e.size !== "default" }]),
|
|
114
|
-
style: normalizeStyle(
|
|
115
|
-
onClick:
|
|
114
|
+
style: normalizeStyle(C.value),
|
|
115
|
+
onClick: S
|
|
116
116
|
}, [renderSlot(e.$slots, "default", {}, () => [createElementVNode("button", { class: normalizeClass(`${unref(u)}-btn`) }, [(openBlock(), createElementBlock("svg", {
|
|
117
117
|
class: normalizeClass(`${unref(u)}-icon`),
|
|
118
118
|
viewBox: "0 0 24 24",
|
|
@@ -125,7 +125,7 @@ var BackTop_default = /* @__PURE__ */ defineComponent({
|
|
|
125
125
|
__name: "WebBaseLayout",
|
|
126
126
|
setup(e) {
|
|
127
127
|
return (e, t) => {
|
|
128
|
-
let n = ElHeader, r = ElAside,
|
|
128
|
+
let n = ElHeader, r = ElAside, i = ElMain, s = ElContainer;
|
|
129
129
|
return openBlock(), createBlock(s, { class: "h-screen" }, {
|
|
130
130
|
default: withCtx(() => [e.$slots.header ? (openBlock(), createBlock(n, { key: 0 }, {
|
|
131
131
|
default: withCtx(() => [renderSlot(e.$slots, "header")]),
|
|
@@ -137,7 +137,7 @@ var BackTop_default = /* @__PURE__ */ defineComponent({
|
|
|
137
137
|
}, {
|
|
138
138
|
default: withCtx(() => [renderSlot(e.$slots, "left")]),
|
|
139
139
|
_: 3
|
|
140
|
-
})) : createCommentVNode("", !0), createVNode(
|
|
140
|
+
})) : createCommentVNode("", !0), createVNode(i, { class: "h-full overflow-hidden" }, {
|
|
141
141
|
default: withCtx(() => [renderSlot(e.$slots, "default")]),
|
|
142
142
|
_: 3
|
|
143
143
|
})]),
|
|
@@ -176,13 +176,13 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
176
176
|
}),
|
|
177
177
|
emits: ["update:collapsed"],
|
|
178
178
|
setup(t, { expose: n }) {
|
|
179
|
-
let r = t,
|
|
179
|
+
let r = t, i = useModel(t, "collapsed");
|
|
180
180
|
function l() {
|
|
181
|
-
|
|
181
|
+
i.value = !i.value;
|
|
182
182
|
}
|
|
183
|
-
let
|
|
183
|
+
let u = useRouter(), f = useRoute(), p = ref([]);
|
|
184
184
|
function m() {
|
|
185
|
-
p.value =
|
|
185
|
+
p.value = u.getRoutes().filter((e) => e.meta).filter((e) => e.path.split("/").length <= 2).filter((e) => e.meta.menu);
|
|
186
186
|
}
|
|
187
187
|
function h() {
|
|
188
188
|
r.loadRouter ? p.value = r.loadRouter() : m();
|
|
@@ -191,20 +191,20 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
191
191
|
h();
|
|
192
192
|
});
|
|
193
193
|
function g(e) {
|
|
194
|
-
e.meta.onClick ? e.meta.onClick(e) :
|
|
194
|
+
e.meta.onClick ? e.meta.onClick(e) : u.push({ name: e.name });
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function _(e) {
|
|
197
197
|
return e.children ? e.children.filter((e) => e.meta?.menu) : [];
|
|
198
198
|
}
|
|
199
199
|
return r.refreshEventListener && useEventListener(document, LeftMenuEvents.Refresh, h), n({
|
|
200
200
|
changeCollapsed: l,
|
|
201
201
|
refreshRouter: h
|
|
202
202
|
}), (t, n) => {
|
|
203
|
-
let r = ElIcon, l = ElMenuItem,
|
|
203
|
+
let r = ElIcon, l = ElMenuItem, u = ElSubMenu, m = ElMenu;
|
|
204
204
|
return openBlock(), createElementBlock("div", {
|
|
205
205
|
class: normalizeClass(["left-menu horizontal-collapse-transition", {
|
|
206
|
-
"collapsed-width":
|
|
207
|
-
"collapsed-width-small":
|
|
206
|
+
"collapsed-width": i.value,
|
|
207
|
+
"collapsed-width-small": i.value && t.size === "small"
|
|
208
208
|
}]),
|
|
209
209
|
style: { transition: "width 300ms linear" }
|
|
210
210
|
}, [t.$slots.logo ? (openBlock(), createElementBlock("div", {
|
|
@@ -212,16 +212,16 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
212
212
|
class: normalizeClass(["u-web-left-menu-logo", { "u-web-left-menu-logo-small": t.size === "small" }])
|
|
213
213
|
}, [renderSlot(t.$slots, "logo")], 2)) : createCommentVNode("", !0), createVNode(m, {
|
|
214
214
|
"default-active": String(unref(f).name),
|
|
215
|
-
collapse:
|
|
215
|
+
collapse: i.value,
|
|
216
216
|
"popper-class": t.size === "small" ? "u-web-left-menu u-web-left-menu-small" : "u-web-left-menu",
|
|
217
217
|
class: normalizeClass(["u-web-left-menu", { "u-web-left-menu-small": t.size === "small" }])
|
|
218
218
|
}, {
|
|
219
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(p.value, (t) => (openBlock(), createElementBlock(Fragment, { key: String(t.name) }, [
|
|
219
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(p.value, (t) => (openBlock(), createElementBlock(Fragment, { key: String(t.name) }, [_(t).length > 0 ? (openBlock(), createBlock(u, {
|
|
220
220
|
key: 0,
|
|
221
221
|
index: String(t.name)
|
|
222
222
|
}, {
|
|
223
223
|
title: withCtx(() => [createVNode(r, { class: normalizeClass(t.meta.icon) }, null, 8, ["class"]), createElementVNode("span", null, toDisplayString(t.meta.title), 1)]),
|
|
224
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
224
|
+
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(_(t), (e) => (openBlock(), createBlock(l, {
|
|
225
225
|
key: String(e.name),
|
|
226
226
|
index: String(e.name),
|
|
227
227
|
onClick: (t) => g(e)
|
|
@@ -266,8 +266,8 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
266
266
|
},
|
|
267
267
|
emits: ["click"],
|
|
268
268
|
setup(e, { emit: t }) {
|
|
269
|
-
let n = e, r = t, i = getBuildCurrentClassPrefix("context-menu", "item"),
|
|
270
|
-
if (!n.disabled) if (e.stopPropagation(), r("click", n.value, e),
|
|
269
|
+
let n = e, r = t, i = getBuildCurrentClassPrefix("context-menu", "item"), a = inject("handleSelect", null), l = (e) => {
|
|
270
|
+
if (!n.disabled) if (e.stopPropagation(), r("click", n.value, e), a) a(n.value, e);
|
|
271
271
|
else {
|
|
272
272
|
let t = new CustomEvent("context-menu-select", {
|
|
273
273
|
detail: {
|
|
@@ -320,32 +320,32 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
320
320
|
},
|
|
321
321
|
emits: ["select"],
|
|
322
322
|
setup(e, { emit: t }) {
|
|
323
|
-
let n = e, r = t, i = getBuildCurrentClassPrefix("context-menu", "item"),
|
|
323
|
+
let n = e, r = t, i = getBuildCurrentClassPrefix("context-menu", "item"), a = getBuildCurrentClassPrefix("context-menu", "submenu"), l = getBuildCurrentClassPrefix("context-menu", "menu"), u = ref(), d = ref(), f = ref(!1), p = reactive({
|
|
324
324
|
left: "0px",
|
|
325
325
|
top: "0px"
|
|
326
|
-
}), h = inject("handleSelect", null),
|
|
327
|
-
|
|
326
|
+
}), h = inject("handleSelect", null), g = null, y = null, w = !1, E = !1, D = () => {
|
|
327
|
+
g &&= (clearTimeout(g), null), y &&= (clearTimeout(y), null);
|
|
328
328
|
}, k = () => {
|
|
329
|
-
n.disabled || !u.value || (
|
|
329
|
+
n.disabled || !u.value || (D(), p.left = "100%", p.top = "0px", f.value = !0, nextTick(() => {
|
|
330
330
|
j();
|
|
331
331
|
}));
|
|
332
332
|
}, A = () => {
|
|
333
|
-
!
|
|
334
|
-
!
|
|
333
|
+
!w && !E && (D(), y = setTimeout(() => {
|
|
334
|
+
!w && !E && (f.value = !1);
|
|
335
335
|
}, 100));
|
|
336
336
|
}, j = () => {
|
|
337
337
|
if (!d.value || !u.value) return;
|
|
338
338
|
let e = d.value, t = u.value, n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight, o = r.right + 4, s = r.left - n.width - 4;
|
|
339
|
-
o + n.width > i && s > 4 ?
|
|
339
|
+
o + n.width > i && s > 4 ? p.left = "-" + (n.width + 4) + "px" : p.left = "100%", r.top + n.height > a ? p.top = Math.min(0, a - r.top - n.height - 4) + "px" : r.top < 4 ? p.top = 4 - r.top + "px" : p.top = "0px";
|
|
340
340
|
}, M = () => {
|
|
341
|
-
n.disabled || (
|
|
341
|
+
n.disabled || (w = !0, D(), g = setTimeout(() => {
|
|
342
342
|
k();
|
|
343
343
|
}, 150));
|
|
344
344
|
}, N = () => {
|
|
345
|
-
|
|
345
|
+
w = !1, A();
|
|
346
346
|
}, P = () => {
|
|
347
|
-
E = !0,
|
|
348
|
-
},
|
|
347
|
+
E = !0, D();
|
|
348
|
+
}, Ze = () => {
|
|
349
349
|
E = !1, A();
|
|
350
350
|
}, I = (e, t) => {
|
|
351
351
|
f.value = !1, r("select", e, t), h && h(e, t);
|
|
@@ -357,10 +357,10 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
357
357
|
}, z = (e) => {
|
|
358
358
|
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
359
359
|
}, B = (e) => {
|
|
360
|
-
if (!n.disabled) if (e.stopPropagation(), e.preventDefault(),
|
|
360
|
+
if (!n.disabled) if (e.stopPropagation(), e.preventDefault(), D(), f.value) f.value = !1;
|
|
361
361
|
else {
|
|
362
362
|
if (!u.value) return;
|
|
363
|
-
|
|
363
|
+
p.left = "100%", p.top = "0px", f.value = !0, nextTick(() => {
|
|
364
364
|
j();
|
|
365
365
|
});
|
|
366
366
|
}
|
|
@@ -382,16 +382,16 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
382
382
|
return onMounted(() => {
|
|
383
383
|
document.addEventListener("click", V), document.addEventListener("mousedown", V), document.addEventListener("keydown", H), document.addEventListener("contextmenu", U);
|
|
384
384
|
}), onUnmounted(() => {
|
|
385
|
-
|
|
385
|
+
D(), document.removeEventListener("click", V), document.removeEventListener("mousedown", V), document.removeEventListener("keydown", H), document.removeEventListener("contextmenu", U);
|
|
386
386
|
}), (e, t) => (openBlock(), createElementBlock("div", {
|
|
387
387
|
ref_key: "triggerRef",
|
|
388
388
|
ref: u,
|
|
389
389
|
class: normalizeClass([
|
|
390
390
|
unref(i)(),
|
|
391
|
-
unref(
|
|
391
|
+
unref(a)(),
|
|
392
392
|
{
|
|
393
393
|
[unref(i)("disabled")]: e.disabled,
|
|
394
|
-
[unref(
|
|
394
|
+
[unref(a)("active")]: f.value
|
|
395
395
|
}
|
|
396
396
|
]),
|
|
397
397
|
onContextmenu: withModifiers(R, ["prevent", "stop"]),
|
|
@@ -404,16 +404,16 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
404
404
|
class: normalizeClass([unref(i)("icon"), e.icon])
|
|
405
405
|
}, toDisplayString(e.icon), 3)) : createCommentVNode("", !0),
|
|
406
406
|
createElementVNode("span", { class: normalizeClass(unref(i)("label")) }, toDisplayString(e.label), 3),
|
|
407
|
-
createElementVNode("span", { class: normalizeClass(unref(
|
|
407
|
+
createElementVNode("span", { class: normalizeClass(unref(a)("arrow")) }, "▶", 2),
|
|
408
408
|
f.value ? (openBlock(), createElementBlock("div", {
|
|
409
409
|
key: 1,
|
|
410
410
|
ref_key: "submenuRef",
|
|
411
411
|
ref: d,
|
|
412
|
-
class: normalizeClass([unref(l)(), unref(
|
|
413
|
-
style: normalizeStyle(
|
|
412
|
+
class: normalizeClass([unref(l)(), unref(a)("popup")]),
|
|
413
|
+
style: normalizeStyle(p),
|
|
414
414
|
onContextmenu: withModifiers(z, ["prevent", "stop"]),
|
|
415
415
|
onMouseenter: P,
|
|
416
|
-
onMouseleave:
|
|
416
|
+
onMouseleave: Ze,
|
|
417
417
|
onContextMenuSelect: L
|
|
418
418
|
}, [renderSlot(e.$slots, "default")], 38)) : createCommentVNode("", !0)
|
|
419
419
|
], 34));
|
|
@@ -441,69 +441,69 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
441
441
|
"open",
|
|
442
442
|
"close"
|
|
443
443
|
],
|
|
444
|
-
setup(
|
|
445
|
-
let
|
|
444
|
+
setup(t, { expose: i, emit: l }) {
|
|
445
|
+
let u = t, f = l, p = getBuildCurrentClassPrefix("context-menu"), m = ref(), h = ref(), y = ref(!1), w = reactive({
|
|
446
446
|
left: "0px",
|
|
447
447
|
top: "0px"
|
|
448
448
|
});
|
|
449
449
|
function E() {
|
|
450
|
-
let e = Array.isArray(
|
|
450
|
+
let e = Array.isArray(u.trigger) ? u.trigger : [u.trigger], t = {};
|
|
451
451
|
return e.includes("click") && (t.onClick = D), e.includes("context-menu") && (t.onContextmenu = D), t;
|
|
452
452
|
}
|
|
453
453
|
let D = (e) => {
|
|
454
|
-
|
|
454
|
+
u.disabled || isFunction(u.disabled) && u.disabled() || (e.preventDefault(), e.stopPropagation(), w.left = e.clientX + "px", w.top = e.clientY + "px", y.value = !0, nextTick(() => {
|
|
455
455
|
O(e.clientX, e.clientY);
|
|
456
456
|
}), f("open"));
|
|
457
457
|
}, O = (e, t) => {
|
|
458
|
-
if (!
|
|
459
|
-
let n =
|
|
460
|
-
e + n.width > r && (a = r - n.width - 4 - (
|
|
458
|
+
if (!h.value) return;
|
|
459
|
+
let n = h.value.getBoundingClientRect(), r = window.innerWidth, i = window.innerHeight, a = e, o = t;
|
|
460
|
+
e + n.width > r && (a = r - n.width - 4 - (u.boundaryOffset.x || 0)), t + n.height > i && (o = i - n.height - 4 - (u.boundaryOffset.y || 0)), a = Math.max(4, a), o = Math.max(4, o), w.left = a + "px", w.top = o + "px";
|
|
461
461
|
}, k = () => {
|
|
462
|
-
|
|
462
|
+
y.value = !1, f("close");
|
|
463
463
|
}, A = (e, t) => {
|
|
464
|
-
f("select", e, t),
|
|
464
|
+
f("select", e, t), u.hideOnSelect && (y.value = !1, f("close"));
|
|
465
465
|
}, j = (e) => {
|
|
466
|
-
if (!
|
|
467
|
-
let t = e.target, n =
|
|
466
|
+
if (!y.value) return;
|
|
467
|
+
let t = e.target, n = h.value, r = m.value;
|
|
468
468
|
if (e.button === 2 || e.which === 3) return;
|
|
469
469
|
let i = n && n.contains(t), a = r && r.contains(t);
|
|
470
|
-
!i && !a && (
|
|
470
|
+
!i && !a && (y.value = !1, f("close"));
|
|
471
471
|
}, M = (e) => {
|
|
472
|
-
e.key === "Escape" &&
|
|
472
|
+
e.key === "Escape" && y.value && (y.value = !1, f("close"));
|
|
473
473
|
}, N = (e) => {
|
|
474
|
-
|
|
475
|
-
},
|
|
476
|
-
|
|
474
|
+
y.value && (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
475
|
+
}, P = () => {
|
|
476
|
+
y.value = !1, f("close");
|
|
477
477
|
};
|
|
478
|
-
return provide("handleSelect", A), provide("closeMenu",
|
|
478
|
+
return provide("handleSelect", A), provide("closeMenu", P), onMounted(() => {
|
|
479
479
|
document.addEventListener("click", j), document.addEventListener("mousedown", j), document.addEventListener("keydown", M), document.addEventListener("contextmenu", N);
|
|
480
480
|
}), onUnmounted(() => {
|
|
481
481
|
document.removeEventListener("click", j), document.removeEventListener("mousedown", j), document.removeEventListener("keydown", M), document.removeEventListener("contextmenu", N);
|
|
482
|
-
}),
|
|
483
|
-
close:
|
|
482
|
+
}), i({
|
|
483
|
+
close: P,
|
|
484
484
|
openContextMenu: D
|
|
485
|
-
}), (
|
|
485
|
+
}), (t, i) => (openBlock(), createElementBlock(Fragment, null, [
|
|
486
486
|
createElementVNode("div", mergeProps({
|
|
487
487
|
ref_key: "triggerRef",
|
|
488
488
|
ref: m,
|
|
489
489
|
class: unref(p)("trigger")
|
|
490
|
-
}, { ...E() }), [renderSlot(
|
|
490
|
+
}, { ...E() }), [renderSlot(t.$slots, "default")], 16),
|
|
491
491
|
(openBlock(), createBlock(Teleport, { to: "body" }, [createVNode(Transition, { name: unref(p)("menu-transition") }, {
|
|
492
|
-
default: withCtx(() => [
|
|
492
|
+
default: withCtx(() => [y.value ? (openBlock(), createElementBlock("div", {
|
|
493
493
|
key: 0,
|
|
494
494
|
ref_key: "menuRef",
|
|
495
|
-
ref:
|
|
495
|
+
ref: h,
|
|
496
496
|
class: normalizeClass([
|
|
497
497
|
unref(p)(),
|
|
498
498
|
unref(p)("menu"),
|
|
499
|
-
unref(p)(`menu-${
|
|
499
|
+
unref(p)(`menu-${u.size}`)
|
|
500
500
|
]),
|
|
501
|
-
style: normalizeStyle(
|
|
502
|
-
onContextmenu:
|
|
503
|
-
}, [renderSlot(
|
|
501
|
+
style: normalizeStyle(w),
|
|
502
|
+
onContextmenu: i[0] ||= withModifiers(() => {}, ["prevent"])
|
|
503
|
+
}, [renderSlot(t.$slots, "content")], 38)) : createCommentVNode("", !0)]),
|
|
504
504
|
_: 3
|
|
505
505
|
}, 8, ["name"])])),
|
|
506
|
-
(openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
506
|
+
(openBlock(), createBlock(Teleport, { to: "body" }, [y.value ? (openBlock(), createElementBlock("div", {
|
|
507
507
|
key: 0,
|
|
508
508
|
class: normalizeClass([unref(p)(), unref(p)("mask")]),
|
|
509
509
|
onClick: k,
|
|
@@ -548,11 +548,11 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
548
548
|
"update:size"
|
|
549
549
|
],
|
|
550
550
|
setup(e, { emit: t }) {
|
|
551
|
-
let n = e,
|
|
551
|
+
let n = e, r = t, { direction: l, size: u, defaultSize: d, min: f, max: p } = toRefs(n), m = ref(0), h = ref(), g = ref(), y = getClassPrefix("split-panel"), x = getClassPrefix("split-trigger"), S = ref(d.value);
|
|
552
552
|
watch(u, (e) => {
|
|
553
|
-
e !== void 0 && (
|
|
553
|
+
e !== void 0 && (S.value = e);
|
|
554
554
|
}, { immediate: !0 });
|
|
555
|
-
function
|
|
555
|
+
function C(e) {
|
|
556
556
|
let t = typeof e == "string" ? parseFloat(e) : e, n = "";
|
|
557
557
|
return n = typeof e == "number" || String(t) === String(e) ? t > 1 ? "px" : "%" : "px", {
|
|
558
558
|
size: t,
|
|
@@ -560,22 +560,22 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
560
560
|
isPx: n === "px"
|
|
561
561
|
};
|
|
562
562
|
}
|
|
563
|
-
let
|
|
564
|
-
[`${
|
|
565
|
-
[`${
|
|
566
|
-
}]),
|
|
567
|
-
[`${
|
|
568
|
-
[`${
|
|
569
|
-
[`${
|
|
563
|
+
let w = computed(() => C(S.value)), E = computed(() => l.value === "horizontal"), O = computed(() => [y, {
|
|
564
|
+
[`${y}-horizontal`]: E.value,
|
|
565
|
+
[`${y}-vertical`]: !E.value
|
|
566
|
+
}]), k = computed(() => [x, {
|
|
567
|
+
[`${x}-horizontal`]: E.value,
|
|
568
|
+
[`${x}-vertical`]: !E.value,
|
|
569
|
+
[`${x}-disabled`]: n.disabled
|
|
570
570
|
}]), j = computed(() => {
|
|
571
|
-
let { size: e, unit: t, isPx: n } =
|
|
571
|
+
let { size: e, unit: t, isPx: n } = w.value;
|
|
572
572
|
return { flex: `0 0 calc(${n ? e : e * 100}${t} - ${m.value / 2}px)` };
|
|
573
573
|
});
|
|
574
574
|
function M({ size: e, defaultSize: t = "0px", containerSize: n }) {
|
|
575
|
-
let r =
|
|
575
|
+
let r = C(e ?? t);
|
|
576
576
|
return r.isPx ? r.size : r.size * n;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function N(e, t) {
|
|
579
579
|
return parseFloat(e) / parseFloat(t);
|
|
580
580
|
}
|
|
581
581
|
let F = {
|
|
@@ -585,13 +585,13 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
585
585
|
startSize: 0
|
|
586
586
|
};
|
|
587
587
|
async function I() {
|
|
588
|
-
let e = () =>
|
|
588
|
+
let e = () => E.value ? h.value?.clientWidth || 0 : h.value?.clientHeight || 0;
|
|
589
589
|
return (!h.value || !e()) && await nextTick(), e();
|
|
590
590
|
}
|
|
591
591
|
function L(e, t) {
|
|
592
592
|
if (!t) return;
|
|
593
|
-
let n =
|
|
594
|
-
|
|
593
|
+
let n = w.value.isPx ? `${e}px` : N(e, t);
|
|
594
|
+
S.value !== n && (S.value = n, r("update:size", n));
|
|
595
595
|
}
|
|
596
596
|
function R(e, t) {
|
|
597
597
|
let n = M({
|
|
@@ -615,7 +615,7 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
615
615
|
}) + (r - n)}px`, e);
|
|
616
616
|
}
|
|
617
617
|
function B(e) {
|
|
618
|
-
|
|
618
|
+
r("moving", e), L(E.value ? z({
|
|
619
619
|
startContainerSize: F.startContainerSize,
|
|
620
620
|
startSize: F.startSize,
|
|
621
621
|
startPosition: F.startPageX,
|
|
@@ -628,24 +628,24 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
628
628
|
}), F.startContainerSize);
|
|
629
629
|
}
|
|
630
630
|
function V(e) {
|
|
631
|
-
window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", V), window.removeEventListener("contextmenu", V), document.body.style.cursor = "default",
|
|
631
|
+
window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", V), window.removeEventListener("contextmenu", V), document.body.style.cursor = "default", r("moveEnd", e);
|
|
632
632
|
}
|
|
633
633
|
async function H(e) {
|
|
634
|
-
n.disabled || (
|
|
634
|
+
n.disabled || (r("moveStart", e), F.startPageX = e.pageX, F.startPageY = e.pageY, F.startContainerSize = await I(), F.startSize = S.value, window.addEventListener("mousemove", B), window.addEventListener("mouseup", V), window.addEventListener("contextmenu", V), document.body.style.cursor = E.value ? "col-resize" : "row-resize");
|
|
635
635
|
}
|
|
636
636
|
function U() {
|
|
637
|
-
if (
|
|
638
|
-
let { width: e, height: t } =
|
|
639
|
-
m.value =
|
|
637
|
+
if (g.value) {
|
|
638
|
+
let { width: e, height: t } = g.value.getBoundingClientRect();
|
|
639
|
+
m.value = E.value ? e || 0 : t || 0;
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
return onMounted(async () => {
|
|
643
643
|
let e = await I();
|
|
644
|
-
L(R(
|
|
644
|
+
L(R(S.value, e), e), U();
|
|
645
645
|
let t = new ResizeObserver(() => {
|
|
646
646
|
U();
|
|
647
647
|
});
|
|
648
|
-
return
|
|
648
|
+
return g.value && t.observe(g.value), () => {
|
|
649
649
|
t.disconnect();
|
|
650
650
|
};
|
|
651
651
|
}), (e, t) => (openBlock(), createBlock(resolveDynamicComponent(e.component), {
|
|
@@ -655,21 +655,21 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
655
655
|
}, {
|
|
656
656
|
default: withCtx(() => [
|
|
657
657
|
createElementVNode("div", {
|
|
658
|
-
class: normalizeClass([`${unref(
|
|
658
|
+
class: normalizeClass([`${unref(y)}-pane`, `${unref(y)}-pane-first`]),
|
|
659
659
|
style: normalizeStyle(j.value)
|
|
660
660
|
}, [renderSlot(e.$slots, "first")], 6),
|
|
661
661
|
e.disabled ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
662
662
|
key: 0,
|
|
663
663
|
ref_key: "triggerRef",
|
|
664
|
-
ref:
|
|
665
|
-
class: normalizeClass(
|
|
664
|
+
ref: g,
|
|
665
|
+
class: normalizeClass(k.value),
|
|
666
666
|
onMousedown: H
|
|
667
|
-
}, [renderSlot(e.$slots, "resize-trigger", {}, () => [createElementVNode("div", { class: normalizeClass(`${unref(
|
|
668
|
-
createElementVNode("div", { class: normalizeClass(`${unref(
|
|
669
|
-
createElementVNode("div", { class: normalizeClass(`${unref(
|
|
670
|
-
createElementVNode("div", { class: normalizeClass(`${unref(
|
|
667
|
+
}, [renderSlot(e.$slots, "resize-trigger", {}, () => [createElementVNode("div", { class: normalizeClass(`${unref(x)}-icon`) }, [renderSlot(e.$slots, "resize-trigger-icon", {}, () => [
|
|
668
|
+
createElementVNode("div", { class: normalizeClass(`${unref(x)}-line`) }, null, 2),
|
|
669
|
+
createElementVNode("div", { class: normalizeClass(`${unref(x)}-line`) }, null, 2),
|
|
670
|
+
createElementVNode("div", { class: normalizeClass(`${unref(x)}-line`) }, null, 2)
|
|
671
671
|
])], 2)])], 34)),
|
|
672
|
-
createElementVNode("div", { class: normalizeClass([`${unref(
|
|
672
|
+
createElementVNode("div", { class: normalizeClass([`${unref(y)}-pane`, `${unref(y)}-pane-second`]) }, [renderSlot(e.$slots, "second")], 2)
|
|
673
673
|
]),
|
|
674
674
|
_: 3
|
|
675
675
|
}, 8, ["class"]));
|
|
@@ -678,8 +678,8 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
678
678
|
__name: "UtoolsBaseLayout",
|
|
679
679
|
setup(e) {
|
|
680
680
|
return (e, t) => {
|
|
681
|
-
let n = ElAside, r = ElMain,
|
|
682
|
-
return openBlock(), createBlock(
|
|
681
|
+
let n = ElAside, r = ElMain, i = ElContainer;
|
|
682
|
+
return openBlock(), createBlock(i, { class: "h-screen min-h-0" }, {
|
|
683
683
|
default: withCtx(() => [createVNode(n, { width: "auto" }, {
|
|
684
684
|
default: withCtx(() => [renderSlot(e.$slots, "left")]),
|
|
685
685
|
_: 3
|
|
@@ -701,40 +701,56 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
701
701
|
loadRouter: {},
|
|
702
702
|
refreshEventListener: { type: Boolean },
|
|
703
703
|
title: { default: "utools demo" },
|
|
704
|
-
size: { default: "default" }
|
|
704
|
+
size: { default: "default" },
|
|
705
|
+
keepAlive: { type: [Boolean, Object] }
|
|
705
706
|
},
|
|
706
707
|
setup(e) {
|
|
707
|
-
let
|
|
708
|
-
function
|
|
709
|
-
|
|
708
|
+
let n = e, r = ref(!0), l = ref();
|
|
709
|
+
function u() {
|
|
710
|
+
r.value = !1;
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function f(e) {
|
|
712
713
|
return e instanceof Element && !!e.closest(".el-popper");
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
-
return e instanceof Node && !!
|
|
715
|
+
function p(e) {
|
|
716
|
+
return e instanceof Node && !!l.value?.contains(e);
|
|
717
|
+
}
|
|
718
|
+
function m(e) {
|
|
719
|
+
f(e?.relatedTarget ?? null) || (r.value = !0);
|
|
716
720
|
}
|
|
717
|
-
|
|
718
|
-
|
|
721
|
+
useEventListener(document, "mouseover", (e) => {
|
|
722
|
+
r.value || p(e.target) || f(e.target) || (r.value = !0);
|
|
723
|
+
});
|
|
724
|
+
let h = computed(() => typeof n.keepAlive == "boolean" ? {
|
|
725
|
+
enabled: n.keepAlive,
|
|
726
|
+
include: void 0,
|
|
727
|
+
exclude: void 0,
|
|
728
|
+
max: void 0
|
|
729
|
+
} : {
|
|
730
|
+
enabled: n.keepAlive?.enabled === !0,
|
|
731
|
+
include: n.keepAlive?.include,
|
|
732
|
+
exclude: n.keepAlive?.exclude,
|
|
733
|
+
max: n.keepAlive?.max
|
|
734
|
+
});
|
|
735
|
+
function _(e, t) {
|
|
736
|
+
return !h.value.enabled || !e ? !1 : t.meta?.keepAlive !== !1;
|
|
719
737
|
}
|
|
720
|
-
return
|
|
721
|
-
|
|
722
|
-
}), (e, i) => {
|
|
723
|
-
let a = resolveComponent("router-view");
|
|
738
|
+
return (e, n) => {
|
|
739
|
+
let i = resolveComponent("RouterView");
|
|
724
740
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [createVNode(UtoolsBaseLayout_default, null, {
|
|
725
741
|
left: withCtx(() => [createElementVNode("div", {
|
|
726
742
|
ref_key: "menuRef",
|
|
727
|
-
ref:
|
|
743
|
+
ref: l,
|
|
728
744
|
class: normalizeClass(unref(getClassPrefix)("utools", "left-menu")),
|
|
729
|
-
onMouseenter:
|
|
730
|
-
onMouseleave:
|
|
745
|
+
onMouseenter: u,
|
|
746
|
+
onMouseleave: m
|
|
731
747
|
}, [createVNode(unref(LeftMenu_default), mergeProps({
|
|
732
748
|
loadRouter: e.loadRouter,
|
|
733
749
|
refreshEventListener: e.refreshEventListener,
|
|
734
750
|
size: e.size
|
|
735
751
|
}, {
|
|
736
|
-
collapsed:
|
|
737
|
-
"onUpdate:collapsed":
|
|
752
|
+
collapsed: r.value,
|
|
753
|
+
"onUpdate:collapsed": n[0] ||= (e) => r.value = e
|
|
738
754
|
}), {
|
|
739
755
|
logo: withCtx(() => [renderSlot(e.$slots, "logo", {}, () => [createElementVNode("div", _hoisted_2$1, [createElementVNode("div", {
|
|
740
756
|
class: "h-auto overflow-hidden flex flex-shrink-0",
|
|
@@ -748,7 +764,19 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
748
764
|
}, 16, ["collapsed"])], 34)]),
|
|
749
765
|
default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(getClassPrefix)("utools", "content-wrapper")) }, [
|
|
750
766
|
createElementVNode("div", _hoisted_5, [renderSlot(e.$slots, "header-tips")]),
|
|
751
|
-
createElementVNode("div", _hoisted_6, [createElementVNode("div", _hoisted_7, [createVNode(
|
|
767
|
+
createElementVNode("div", _hoisted_6, [createElementVNode("div", _hoisted_7, [createVNode(i, null, {
|
|
768
|
+
default: withCtx(({ Component: e, route: n }) => [_(e, n) ? (openBlock(), createBlock(KeepAlive, {
|
|
769
|
+
key: 0,
|
|
770
|
+
include: h.value.include,
|
|
771
|
+
exclude: h.value.exclude,
|
|
772
|
+
max: h.value.max
|
|
773
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(e)))], 1032, [
|
|
774
|
+
"include",
|
|
775
|
+
"exclude",
|
|
776
|
+
"max"
|
|
777
|
+
])) : e ? (openBlock(), createBlock(resolveDynamicComponent(e), { key: 1 })) : createCommentVNode("", !0)]),
|
|
778
|
+
_: 1
|
|
779
|
+
})])]),
|
|
752
780
|
renderSlot(e.$slots, "footer", {}, () => [createElementVNode("div", _hoisted_8, " © " + toDisplayString((/* @__PURE__ */ new Date()).getFullYear()) + " [xiaou]。保留所有权利 ", 1)])
|
|
753
781
|
], 2)]),
|
|
754
782
|
_: 3
|
|
@@ -764,14 +792,14 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
764
792
|
},
|
|
765
793
|
emits: ["back"],
|
|
766
794
|
setup(e) {
|
|
767
|
-
let t = e, n = getBuildCurrentClassPrefix("page-header"),
|
|
795
|
+
let t = e, n = getBuildCurrentClassPrefix("page-header"), r = computed(() => {
|
|
768
796
|
let e = [n()];
|
|
769
797
|
return t.size !== "default" && e.push(n(t.size)), e;
|
|
770
|
-
}),
|
|
798
|
+
}), a = computed(() => isEventExist("onBack"));
|
|
771
799
|
return (e, t) => {
|
|
772
|
-
let
|
|
773
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(
|
|
774
|
-
|
|
800
|
+
let i = ElButton, l = ElDivider;
|
|
801
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(r.value) }, [createElementVNode("div", { class: normalizeClass(["flex items-center", unref(n)("header")]) }, [
|
|
802
|
+
a.value || e.$slots.prefix ? renderSlot(e.$slots, "prefix", { key: 0 }, () => [createVNode(i, {
|
|
775
803
|
class: normalizeClass(unref(n)("header", "back")),
|
|
776
804
|
onClick: t[0] ||= (t) => e.$emit("back"),
|
|
777
805
|
link: ""
|
|
@@ -781,7 +809,7 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
781
809
|
__: [1]
|
|
782
810
|
}, 8, ["class"])]) : createCommentVNode("", !0),
|
|
783
811
|
createElementVNode("div", { class: normalizeClass(unref(n)("title")) }, [renderSlot(e.$slots, "title", {}, () => [createTextVNode(toDisplayString(e.title), 1)])], 2),
|
|
784
|
-
createVNode(
|
|
812
|
+
createVNode(l, {
|
|
785
813
|
class: normalizeClass(unref(n)("divider")),
|
|
786
814
|
direction: "vertical"
|
|
787
815
|
}, null, 8, ["class"]),
|
|
@@ -803,21 +831,21 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
803
831
|
background: { default: "var(--u-color-bg-3)" }
|
|
804
832
|
},
|
|
805
833
|
setup(e) {
|
|
806
|
-
let t = e, n = useAttrs(),
|
|
834
|
+
let t = e, n = useAttrs(), r = computed(() => "onClick" in n || "onClickCapture" in n), a = computed(() => {
|
|
807
835
|
let e = [];
|
|
808
|
-
return e.push(getClassPrefix("setting-item")),
|
|
809
|
-
}),
|
|
810
|
-
function
|
|
811
|
-
|
|
836
|
+
return e.push(getClassPrefix("setting-item")), r.value && e.push("cursor-pointer"), t.size !== "default" && e.push(getClassPrefix("setting-item", t.size)), e;
|
|
837
|
+
}), o = ref({ background: t.background });
|
|
838
|
+
function l() {
|
|
839
|
+
o.value = {};
|
|
812
840
|
}
|
|
813
841
|
function d() {
|
|
814
|
-
|
|
842
|
+
o.value = { background: t.background };
|
|
815
843
|
}
|
|
816
844
|
return (e, t) => (openBlock(), createElementBlock("div", mergeProps({
|
|
817
845
|
class: [...a.value],
|
|
818
|
-
style: { ...
|
|
819
|
-
}, toHandlers({ ...
|
|
820
|
-
onMouseenter:
|
|
846
|
+
style: { ...o.value }
|
|
847
|
+
}, toHandlers({ ...r.value && { click: e.$attrs.onClick || e.$attrs.onClickCapture } }, !0), {
|
|
848
|
+
onMouseenter: l,
|
|
821
849
|
onMouseleave: d
|
|
822
850
|
}), [createElementVNode("div", _hoisted_1$3, [createElementVNode("div", null, [createElementVNode("div", { class: normalizeClass(["u-fx u-gap5 u-fac", unref(getClassPrefix)("setting-item-title")]) }, [renderSlot(e.$slots, "title", {}, () => [createTextVNode(toDisplayString(e.title), 1)])], 2), renderSlot(e.$slots, "desc", {}, () => [createElementVNode("div", { class: normalizeClass(unref(getClassPrefix)("setting-item-desc")) }, toDisplayString(e.desc), 3)])]), createElementVNode("div", null, [renderSlot(e.$slots, "default")])]), createElementVNode("div", null, [renderSlot(e.$slots, "extra")])], 16));
|
|
823
851
|
}
|
|
@@ -894,65 +922,65 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
894
922
|
"blur"
|
|
895
923
|
], ["update:value"]),
|
|
896
924
|
setup(t, { emit: n }) {
|
|
897
|
-
let
|
|
898
|
-
|
|
899
|
-
let g = computed(() =>
|
|
900
|
-
let n = e ?
|
|
901
|
-
|
|
902
|
-
},
|
|
903
|
-
if (
|
|
904
|
-
let t = !g.value, n = t ?
|
|
925
|
+
let r = useModel(t, "value"), a = t, l = n, d = useSlots(), { size: f } = toRefs(a), p = getBuildCurrentClassPrefix("switch-plus")(), m = computed(() => a.disabled), h = computed(() => a.size);
|
|
926
|
+
r.value === !1 && a.defaultChecked && (r.value = a.checkedValue);
|
|
927
|
+
let g = computed(() => r.value === a.checkedValue), _ = ref(!1), y = computed(() => _.value || a.loading), b = (e, t) => {
|
|
928
|
+
let n = e ? a.checkedValue : a.uncheckedValue;
|
|
929
|
+
r.value = n, l("change", n, t);
|
|
930
|
+
}, x = async (e) => {
|
|
931
|
+
if (y.value || m.value) return;
|
|
932
|
+
let t = !g.value, n = t ? a.checkedValue : a.uncheckedValue, r = a.beforeChange;
|
|
905
933
|
if (isFunction(r)) {
|
|
906
|
-
|
|
934
|
+
_.value = !0;
|
|
907
935
|
try {
|
|
908
|
-
(await r(n) ?? !0) &&
|
|
936
|
+
(await r(n) ?? !0) && b(t, e);
|
|
909
937
|
} finally {
|
|
910
|
-
|
|
938
|
+
_.value = !1;
|
|
911
939
|
}
|
|
912
|
-
} else
|
|
940
|
+
} else b(t, e);
|
|
941
|
+
}, S = (e) => {
|
|
942
|
+
l("focus", e);
|
|
913
943
|
}, C = (e) => {
|
|
914
|
-
|
|
915
|
-
}, w = (e) => {
|
|
916
|
-
u("blur", e);
|
|
944
|
+
l("blur", e);
|
|
917
945
|
};
|
|
918
|
-
watch(
|
|
919
|
-
(isUndefined(e) || isNull(e)) && (
|
|
946
|
+
watch(r, (e) => {
|
|
947
|
+
(isUndefined(e) || isNull(e)) && (r.value = a.uncheckedValue);
|
|
920
948
|
});
|
|
921
|
-
let
|
|
949
|
+
let w = computed(() => [
|
|
922
950
|
p,
|
|
923
|
-
`${p}-type-${
|
|
951
|
+
`${p}-type-${a.type}`,
|
|
924
952
|
{
|
|
925
953
|
[`${p}-medium`]: h.value === "medium",
|
|
926
954
|
[`${p}-small`]: h.value === "small",
|
|
927
955
|
[`${p}-mini`]: h.value === "mini",
|
|
928
956
|
[`${p}-checked`]: g.value,
|
|
929
957
|
[`${p}-disabled`]: m.value,
|
|
930
|
-
[`${p}-loading`]:
|
|
931
|
-
[`${p}-custom-color`]:
|
|
958
|
+
[`${p}-loading`]: y.value,
|
|
959
|
+
[`${p}-custom-color`]: a.type === "line" && (a.checkedColor || a.uncheckedColor)
|
|
932
960
|
}
|
|
933
961
|
]), E = computed(() => {
|
|
934
|
-
if (g.value &&
|
|
935
|
-
if (!g.value &&
|
|
936
|
-
}),
|
|
937
|
-
if (!
|
|
938
|
-
if (g.value &&
|
|
939
|
-
if (!g.value &&
|
|
962
|
+
if (g.value && a.checkedColor) return a.type === "line" ? { "--custom-color": a.checkedColor } : { backgroundColor: a.checkedColor };
|
|
963
|
+
if (!g.value && a.uncheckedColor) return a.type === "line" ? { "--custom-color": a.uncheckedColor } : { backgroundColor: a.uncheckedColor };
|
|
964
|
+
}), D = computed(() => {
|
|
965
|
+
if (!y.value) {
|
|
966
|
+
if (g.value && a.checkedColor) return { color: a.checkedColor };
|
|
967
|
+
if (!g.value && a.uncheckedColor) return { color: a.uncheckedColor };
|
|
940
968
|
}
|
|
941
969
|
});
|
|
942
970
|
return (t, n) => (openBlock(), createElementBlock("button", {
|
|
943
971
|
type: "button",
|
|
944
972
|
role: "switch",
|
|
945
973
|
"aria-checked": g.value,
|
|
946
|
-
class: normalizeClass(
|
|
974
|
+
class: normalizeClass(w.value),
|
|
947
975
|
style: normalizeStyle(E.value),
|
|
948
|
-
disabled: m.value ||
|
|
949
|
-
onClick:
|
|
950
|
-
onFocus:
|
|
951
|
-
onBlur:
|
|
976
|
+
disabled: m.value || y.value,
|
|
977
|
+
onClick: x,
|
|
978
|
+
onFocus: S,
|
|
979
|
+
onBlur: C
|
|
952
980
|
}, [createElementVNode("span", {
|
|
953
981
|
class: normalizeClass(`${unref(p)}-handle`),
|
|
954
|
-
style: normalizeStyle(
|
|
955
|
-
}, [createElementVNode("span", { class: normalizeClass(`${unref(p)}-handle-icon`) }, [
|
|
982
|
+
style: normalizeStyle(D.value)
|
|
983
|
+
}, [createElementVNode("span", { class: normalizeClass(`${unref(p)}-handle-icon`) }, [y.value ? (openBlock(), createElementBlock("span", {
|
|
956
984
|
key: 0,
|
|
957
985
|
class: normalizeClass(["i-p-loading", `${unref(p)}-loading-icon`])
|
|
958
986
|
}, null, 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [g.value ? renderSlot(t.$slots, "checked-icon", { key: 0 }) : renderSlot(t.$slots, "unchecked-icon", { key: 1 })], 64))], 2)], 6), t.type !== "line" && unref(f) !== "small" && (unref(d).checked || t.checkedText || unref(d).unchecked || t.uncheckedText) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("span", { class: normalizeClass(`${unref(p)}-text-holder`) }, [g.value ? renderSlot(t.$slots, "checked", { key: 0 }, () => [createTextVNode(toDisplayString(t.checkedText), 1)]) : renderSlot(t.$slots, "unchecked", { key: 1 }, () => [createTextVNode(toDisplayString(t.uncheckedText), 1)])], 2), createElementVNode("span", { class: normalizeClass(`${unref(p)}-text`) }, [g.value ? renderSlot(t.$slots, "checked", { key: 0 }, () => [createTextVNode(toDisplayString(t.checkedText), 1)]) : renderSlot(t.$slots, "unchecked", { key: 1 }, () => [createTextVNode(toDisplayString(t.uncheckedText), 1)])], 2)], 64)) : createCommentVNode("", !0)], 46, _hoisted_1$1));
|
|
@@ -1052,7 +1080,7 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1052
1080
|
},
|
|
1053
1081
|
emits: ["scroll"],
|
|
1054
1082
|
setup(e, { expose: t, emit: n }) {
|
|
1055
|
-
let
|
|
1083
|
+
let r = e, a = n, o = getClassPrefix("scrollbar"), l = ref(), u = ref(), d = computed(() => r.direction === "horizontal" ? {
|
|
1056
1084
|
size: "width",
|
|
1057
1085
|
direction: "left",
|
|
1058
1086
|
offset: "offsetWidth",
|
|
@@ -1063,46 +1091,46 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1063
1091
|
offset: "offsetHeight",
|
|
1064
1092
|
client: "clientY"
|
|
1065
1093
|
}), f = ref(0), p = ref(!1), m = ref(0), h = computed(() => ({
|
|
1066
|
-
[d.value.size]: `${
|
|
1094
|
+
[d.value.size]: `${r.data?.thumbSize ?? 0}px`,
|
|
1067
1095
|
[d.value.direction]: `${f.value}px`
|
|
1068
1096
|
})), g = (e) => {
|
|
1069
|
-
e.preventDefault(), u.value && (m.value = e[d.value.client] - u.value.getBoundingClientRect()[d.value.direction], p.value = !0, on(window, "mousemove",
|
|
1070
|
-
},
|
|
1097
|
+
e.preventDefault(), u.value && (m.value = e[d.value.client] - u.value.getBoundingClientRect()[d.value.direction], p.value = !0, on(window, "mousemove", b), on(window, "mouseup", x), on(window, "contextmenu", x));
|
|
1098
|
+
}, _ = (e) => {
|
|
1071
1099
|
if (e.preventDefault(), u.value) {
|
|
1072
|
-
let t =
|
|
1100
|
+
let t = y(e[d.value.client] > u.value.getBoundingClientRect()[d.value.direction] ? f.value + (r.data?.thumbSize ?? 0) : f.value - (r.data?.thumbSize ?? 0));
|
|
1073
1101
|
t !== f.value && (f.value = t, a("scroll", t));
|
|
1074
1102
|
}
|
|
1075
|
-
},
|
|
1103
|
+
}, y = (e) => e < 0 ? 0 : r.data && e > r.data.max ? r.data.max : e, b = (e) => {
|
|
1076
1104
|
if (l.value && u.value) {
|
|
1077
|
-
let t =
|
|
1105
|
+
let t = y(e[d.value.client] - l.value.getBoundingClientRect()[d.value.direction] - m.value);
|
|
1078
1106
|
t !== f.value && (f.value = t, a("scroll", t));
|
|
1079
1107
|
}
|
|
1080
|
-
},
|
|
1081
|
-
p.value = !1, off(window, "mousemove",
|
|
1082
|
-
},
|
|
1083
|
-
p.value || (e =
|
|
1084
|
-
},
|
|
1085
|
-
`${
|
|
1086
|
-
`${
|
|
1087
|
-
`${
|
|
1088
|
-
{ [`${
|
|
1108
|
+
}, x = () => {
|
|
1109
|
+
p.value = !1, off(window, "mousemove", b), off(window, "mouseup", x);
|
|
1110
|
+
}, S = (e) => {
|
|
1111
|
+
p.value || (e = y(e), e !== f.value && (f.value = e));
|
|
1112
|
+
}, C = computed(() => [
|
|
1113
|
+
`${o}-thumb`,
|
|
1114
|
+
`${o}-thumb-direction-${r.direction}`,
|
|
1115
|
+
`${o}-thumb-size-${r.size}`,
|
|
1116
|
+
{ [`${o}-thumb-dragging`]: p.value }
|
|
1089
1117
|
]);
|
|
1090
|
-
return t({ setOffset:
|
|
1118
|
+
return t({ setOffset: S }), (e, t) => (openBlock(), createElementBlock("div", {
|
|
1091
1119
|
ref_key: "trackRef",
|
|
1092
1120
|
ref: l,
|
|
1093
1121
|
class: normalizeClass([
|
|
1094
|
-
`${unref(
|
|
1095
|
-
`${unref(
|
|
1096
|
-
`${unref(
|
|
1122
|
+
`${unref(o)}-track`,
|
|
1123
|
+
`${unref(o)}-track-direction-${e.direction}`,
|
|
1124
|
+
`${unref(o)}-track-size-${r.size}`
|
|
1097
1125
|
]),
|
|
1098
|
-
onMousedown: withModifiers(
|
|
1126
|
+
onMousedown: withModifiers(_, ["self"])
|
|
1099
1127
|
}, [createElementVNode("div", {
|
|
1100
1128
|
ref_key: "thumbRef",
|
|
1101
1129
|
ref: u,
|
|
1102
|
-
class: normalizeClass(
|
|
1130
|
+
class: normalizeClass(C.value),
|
|
1103
1131
|
style: normalizeStyle(h.value),
|
|
1104
1132
|
onMousedown: g
|
|
1105
|
-
}, [createElementVNode("div", { class: normalizeClass(`${unref(
|
|
1133
|
+
}, [createElementVNode("div", { class: normalizeClass(`${unref(o)}-thumb-bar`) }, null, 2)], 38)], 34));
|
|
1106
1134
|
}
|
|
1107
1135
|
}), SCROLLBAR_THUMB_MIN_SIZE = 20, SCROLLBAR_TRACK_SIZE = 15, Scrollbar_default = /* @__PURE__ */ defineComponent({
|
|
1108
1136
|
__name: "Scrollbar",
|
|
@@ -1132,26 +1160,26 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1132
1160
|
},
|
|
1133
1161
|
emits: ["scroll"],
|
|
1134
1162
|
setup(e, { expose: t, emit: n }) {
|
|
1135
|
-
let
|
|
1163
|
+
let r = e, l = n, u = getClassPrefix("scrollbar"), d = computed(() => r.size === "small" ? SCROLLBAR_TRACK_SIZE * .8 : SCROLLBAR_TRACK_SIZE), f = ref(), p = ref(), m = ref(), h = ref(), _ = ref(), y = ref(!1), S = ref(!1), C = computed(() => y.value && !r.disableHorizontal), w = computed(() => S.value && !r.disableVertical), E = ref(!1), D = null, O = () => {
|
|
1136
1164
|
if (f.value) {
|
|
1137
|
-
let { clientWidth: e, clientHeight: t, offsetWidth: n, offsetHeight:
|
|
1138
|
-
|
|
1139
|
-
let l =
|
|
1165
|
+
let { clientWidth: e, clientHeight: t, offsetWidth: n, offsetHeight: i, scrollWidth: a, scrollHeight: o, scrollTop: s, scrollLeft: c } = f.value;
|
|
1166
|
+
y.value = a > e, S.value = o > t, E.value = C.value && w.value;
|
|
1167
|
+
let l = r.type === "embed" && E.value ? n - d.value : n, u = r.type === "embed" && E.value ? i - d.value : i, g = Math.round(l / Math.min(a / e, l / SCROLLBAR_THUMB_MIN_SIZE)), v = l - g, Ye = (a - e) / v, b = Math.round(u / Math.min(o / t, u / SCROLLBAR_THUMB_MIN_SIZE)), x = u - b, Xe = (o - t) / x;
|
|
1140
1168
|
if (p.value = {
|
|
1141
|
-
ratio:
|
|
1142
|
-
thumbSize:
|
|
1143
|
-
max:
|
|
1169
|
+
ratio: Ye,
|
|
1170
|
+
thumbSize: g,
|
|
1171
|
+
max: v
|
|
1144
1172
|
}, m.value = {
|
|
1145
|
-
ratio:
|
|
1173
|
+
ratio: Xe,
|
|
1146
1174
|
thumbSize: b,
|
|
1147
1175
|
max: x
|
|
1148
|
-
},
|
|
1149
|
-
let e = Math.round(
|
|
1150
|
-
|
|
1176
|
+
}, s > 0) {
|
|
1177
|
+
let e = Math.round(s / (m.value?.ratio ?? 1));
|
|
1178
|
+
_.value?.setOffset(e);
|
|
1151
1179
|
}
|
|
1152
|
-
if (
|
|
1153
|
-
let e = Math.round(
|
|
1154
|
-
|
|
1180
|
+
if (c > 0) {
|
|
1181
|
+
let e = Math.round(c / (p.value?.ratio ?? 1));
|
|
1182
|
+
h.value?.setOffset(e);
|
|
1155
1183
|
}
|
|
1156
1184
|
}
|
|
1157
1185
|
}, k = () => {
|
|
@@ -1168,13 +1196,13 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1168
1196
|
});
|
|
1169
1197
|
let A = (e) => {
|
|
1170
1198
|
if (f.value) {
|
|
1171
|
-
if (
|
|
1199
|
+
if (C.value && !r.disableHorizontal) {
|
|
1172
1200
|
let e = Math.round(f.value.scrollLeft / (p.value?.ratio ?? 1));
|
|
1173
|
-
|
|
1201
|
+
h.value?.setOffset(e);
|
|
1174
1202
|
}
|
|
1175
|
-
if (
|
|
1203
|
+
if (w.value && !r.disableVertical) {
|
|
1176
1204
|
let e = Math.round(f.value.scrollTop / (m.value?.ratio ?? 1));
|
|
1177
|
-
|
|
1205
|
+
_.value?.setOffset(e);
|
|
1178
1206
|
}
|
|
1179
1207
|
}
|
|
1180
1208
|
l("scroll", e);
|
|
@@ -1184,13 +1212,13 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1184
1212
|
f.value && f.value.scrollTo({ top: e * (m.value?.ratio ?? 1) });
|
|
1185
1213
|
}, N = computed(() => {
|
|
1186
1214
|
let e = {};
|
|
1187
|
-
return
|
|
1215
|
+
return r.type === "track" && (C.value && (e.paddingBottom = `${d.value}px`), w.value && (e.paddingRight = `${d.value}px`)), [e, r.outerStyle];
|
|
1188
1216
|
}), P = computed(() => [
|
|
1189
1217
|
`${u}`,
|
|
1190
|
-
`${u}-type-${
|
|
1191
|
-
`${u}-size-${
|
|
1218
|
+
`${u}-type-${r.type}`,
|
|
1219
|
+
`${u}-size-${r.size}`,
|
|
1192
1220
|
{ [`${u}-both`]: E.value },
|
|
1193
|
-
|
|
1221
|
+
r.outerClass
|
|
1194
1222
|
]);
|
|
1195
1223
|
return t({
|
|
1196
1224
|
scrollTo: (e, t) => {
|
|
@@ -1214,28 +1242,28 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1214
1242
|
ref: f,
|
|
1215
1243
|
class: `${unref(u)}-container`
|
|
1216
1244
|
}, e.$attrs, { onScroll: A }), [renderSlot(e.$slots, "default")], 16),
|
|
1217
|
-
!e.hide &&
|
|
1245
|
+
!e.hide && C.value ? (openBlock(), createBlock(thumb_default, {
|
|
1218
1246
|
key: 0,
|
|
1219
1247
|
ref_key: "horizontalThumbRef",
|
|
1220
|
-
ref:
|
|
1248
|
+
ref: h,
|
|
1221
1249
|
data: p.value,
|
|
1222
1250
|
direction: "horizontal",
|
|
1223
1251
|
both: E.value,
|
|
1224
|
-
size:
|
|
1252
|
+
size: r.size,
|
|
1225
1253
|
onScroll: j
|
|
1226
1254
|
}, null, 8, [
|
|
1227
1255
|
"data",
|
|
1228
1256
|
"both",
|
|
1229
1257
|
"size"
|
|
1230
1258
|
])) : createCommentVNode("", !0),
|
|
1231
|
-
!e.hide &&
|
|
1259
|
+
!e.hide && w.value ? (openBlock(), createBlock(thumb_default, {
|
|
1232
1260
|
key: 1,
|
|
1233
1261
|
ref_key: "verticalThumbRef",
|
|
1234
|
-
ref:
|
|
1262
|
+
ref: _,
|
|
1235
1263
|
data: m.value,
|
|
1236
1264
|
direction: "vertical",
|
|
1237
1265
|
both: E.value,
|
|
1238
|
-
size:
|
|
1266
|
+
size: r.size,
|
|
1239
1267
|
onScroll: M
|
|
1240
1268
|
}, null, 8, [
|
|
1241
1269
|
"data",
|
|
@@ -1305,11 +1333,11 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1305
1333
|
},
|
|
1306
1334
|
emits: ["load"],
|
|
1307
1335
|
setup(e, { emit: t }) {
|
|
1308
|
-
let n = e, r = t, i = ref(!1), a = ref(), { start:
|
|
1336
|
+
let n = e, r = t, i = ref(!1), a = ref(), { start: o, stop: c } = useGlobalIntersectionObserver((e) => {
|
|
1309
1337
|
e && (i.value = !0, r("load"), c());
|
|
1310
1338
|
}, { rootMargin: `${n.distance}px` });
|
|
1311
1339
|
return watch(a, (e) => {
|
|
1312
|
-
e &&
|
|
1340
|
+
e && o(e);
|
|
1313
1341
|
}, { immediate: !0 }), (e, t) => i.value ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("div", {
|
|
1314
1342
|
key: 1,
|
|
1315
1343
|
ref_key: "box",
|
|
@@ -1379,15 +1407,15 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1379
1407
|
"focus",
|
|
1380
1408
|
"clear"
|
|
1381
1409
|
], ["update:modelValue"]),
|
|
1382
|
-
setup(
|
|
1383
|
-
let f =
|
|
1410
|
+
setup(t, { expose: l, emit: u }) {
|
|
1411
|
+
let f = t, p = u, m = ref(), h = ref(), g = ref(), b = ref(!1), x = ref(!1), S = ref(), C = ref(!1), T = ref({
|
|
1384
1412
|
top: "0px",
|
|
1385
1413
|
left: "0px",
|
|
1386
1414
|
width: "0px",
|
|
1387
1415
|
position: "fixed"
|
|
1388
1416
|
}), E = () => {
|
|
1389
|
-
if (!f.teleport || !
|
|
1390
|
-
let e =
|
|
1417
|
+
if (!f.teleport || !g.value) return;
|
|
1418
|
+
let e = g.value.getBoundingClientRect();
|
|
1391
1419
|
T.value = {
|
|
1392
1420
|
top: `${e.bottom + 4}px`,
|
|
1393
1421
|
left: `${e.left}px`,
|
|
@@ -1395,18 +1423,18 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1395
1423
|
position: "fixed"
|
|
1396
1424
|
};
|
|
1397
1425
|
};
|
|
1398
|
-
watch(
|
|
1426
|
+
watch(b, (e) => {
|
|
1399
1427
|
e && f.teleport && nextTick(E);
|
|
1400
1428
|
});
|
|
1401
|
-
let
|
|
1402
|
-
watch(
|
|
1403
|
-
e && f.teleport ? (
|
|
1404
|
-
|
|
1405
|
-
}, k =
|
|
1429
|
+
let D = null, k = null;
|
|
1430
|
+
watch(b, (e) => {
|
|
1431
|
+
e && f.teleport ? (D = () => {
|
|
1432
|
+
b.value && E();
|
|
1433
|
+
}, k = D, window.addEventListener("scroll", D, !0), window.addEventListener("resize", k)) : (D &&= (window.removeEventListener("scroll", D, !0), null), k &&= (window.removeEventListener("resize", k), null));
|
|
1406
1434
|
}), onBeforeUnmount(() => {
|
|
1407
|
-
|
|
1435
|
+
D && window.removeEventListener("scroll", D, !0), k && window.removeEventListener("resize", k);
|
|
1408
1436
|
});
|
|
1409
|
-
let A = ref(null),
|
|
1437
|
+
let A = ref(null), j = ref(), N = ref(), I = "", L = "", R = computed(() => {
|
|
1410
1438
|
if (!B.value) return "--";
|
|
1411
1439
|
let [e] = B.value.split(":");
|
|
1412
1440
|
return e || "--";
|
|
@@ -1414,7 +1442,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1414
1442
|
if (!B.value) return "--";
|
|
1415
1443
|
let [, e] = B.value.split(":");
|
|
1416
1444
|
return e || "--";
|
|
1417
|
-
}), B = useModel(
|
|
1445
|
+
}), B = useModel(t, "modelValue"), V = computed(() => f.clearable && !f.disabled && B.value && (x.value || b.value)), H = computed(() => {
|
|
1418
1446
|
let e = [], t = U(f.start), n = U(f.end), r = U(f.step);
|
|
1419
1447
|
if (!t || !n || !r) return e;
|
|
1420
1448
|
let i = t, a = n.hours * 60 + n.minutes;
|
|
@@ -1457,12 +1485,12 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1457
1485
|
return !0;
|
|
1458
1486
|
}
|
|
1459
1487
|
let q = () => {
|
|
1460
|
-
A.value = "hour",
|
|
1488
|
+
A.value = "hour", j.value?.focus();
|
|
1461
1489
|
}, J = () => {
|
|
1462
|
-
A.value = "minute",
|
|
1463
|
-
},
|
|
1464
|
-
f.disabled || (
|
|
1465
|
-
},
|
|
1490
|
+
A.value = "minute", N.value?.focus();
|
|
1491
|
+
}, Qe = () => {
|
|
1492
|
+
f.disabled || (b.value = !0, x.value = !0, A.value || q());
|
|
1493
|
+
}, $e = (e) => {
|
|
1466
1494
|
e.preventDefault();
|
|
1467
1495
|
let t = e.target, n = e.data || "";
|
|
1468
1496
|
if (!/^\d$/.test(n)) {
|
|
@@ -1476,7 +1504,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1476
1504
|
t.textContent = i, Y("hour", i), I.length === 2 && nextTick(() => {
|
|
1477
1505
|
J();
|
|
1478
1506
|
});
|
|
1479
|
-
},
|
|
1507
|
+
}, et = (e) => {
|
|
1480
1508
|
e.preventDefault();
|
|
1481
1509
|
let t = e.target, n = e.data || "";
|
|
1482
1510
|
if (!/^\d$/.test(n)) {
|
|
@@ -1488,7 +1516,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1488
1516
|
r > 59 && (L = n, r = parseInt(n));
|
|
1489
1517
|
let i = L.padStart(2, "0");
|
|
1490
1518
|
t.textContent = i, Y("minute", i), L.length === 2 && nextTick(() => {
|
|
1491
|
-
|
|
1519
|
+
b.value = !1, N.value?.blur();
|
|
1492
1520
|
});
|
|
1493
1521
|
}, Y = (e, t) => {
|
|
1494
1522
|
let [n, r] = (B.value || "00:00").split(":"), i;
|
|
@@ -1497,57 +1525,57 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1497
1525
|
let n = e.getAttribute("data-value");
|
|
1498
1526
|
return !!(n && t?.hours && n.split(":")[0] === t.hours.padStart(2, "0"));
|
|
1499
1527
|
});
|
|
1500
|
-
|
|
1528
|
+
S.value && n && S.value.scrollTop(n.offsetTop);
|
|
1501
1529
|
}
|
|
1502
|
-
}, et = () => {
|
|
1503
|
-
A.value = "hour", S.value = !0, I = "";
|
|
1504
1530
|
}, tt = () => {
|
|
1505
|
-
A.value =
|
|
1531
|
+
A.value = "hour", x.value = !0, I = "";
|
|
1532
|
+
}, nt = () => {
|
|
1533
|
+
A.value = null, x.value = !1, X();
|
|
1506
1534
|
}, X = () => {
|
|
1507
1535
|
console.log("autoFillTime", B.value), B.value = G(W(B.value || "")), console.log("autoFillTime", G(W(B.value || "")), W(B.value || ""));
|
|
1508
|
-
}, nt = () => {
|
|
1509
|
-
A.value = "minute", S.value = !0, L = "";
|
|
1510
1536
|
}, rt = () => {
|
|
1511
|
-
A.value =
|
|
1512
|
-
}, it = (
|
|
1513
|
-
|
|
1537
|
+
A.value = "minute", x.value = !0, L = "";
|
|
1538
|
+
}, it = () => {
|
|
1539
|
+
A.value = null, x.value = !1, X();
|
|
1514
1540
|
}, at = (e) => {
|
|
1515
|
-
e.key === "Tab" || e.key === "
|
|
1541
|
+
e.key === "Tab" || e.key === "ArrowRight" ? (e.preventDefault(), J()) : e.key === "Enter" && (e.preventDefault(), b.value = !b.value);
|
|
1542
|
+
}, ot = (e) => {
|
|
1543
|
+
e.key === "Tab" || e.key === "ArrowLeft" ? (e.preventDefault(), q()) : e.key === "Enter" && (e.preventDefault(), b.value = !b.value);
|
|
1516
1544
|
}, Z = () => {
|
|
1517
1545
|
B.value = "", p("change", ""), p("clear"), I = "", L = "", nextTick(() => {
|
|
1518
1546
|
q();
|
|
1519
1547
|
});
|
|
1520
|
-
},
|
|
1521
|
-
B.value = e, p("change", e),
|
|
1548
|
+
}, st = (e) => {
|
|
1549
|
+
B.value = e, p("change", e), b.value = !1, C.value = !0, A.value = null, nextTick(() => {
|
|
1522
1550
|
h.value?.focus();
|
|
1523
1551
|
});
|
|
1524
|
-
}, st = () => {
|
|
1525
|
-
q();
|
|
1526
1552
|
}, ct = () => {
|
|
1527
|
-
|
|
1528
|
-
},
|
|
1529
|
-
|
|
1530
|
-
}, ut = () => {
|
|
1553
|
+
q();
|
|
1554
|
+
}, lt = () => {
|
|
1555
|
+
j.value?.blur(), N.value?.blur(), A.value = null;
|
|
1556
|
+
}, Q = 0, $ = null, ut = () => {
|
|
1557
|
+
Q++, b.value = !0;
|
|
1558
|
+
}, dt = () => {
|
|
1531
1559
|
$ && clearTimeout($);
|
|
1532
1560
|
let e = Q + 1;
|
|
1533
1561
|
Q = e, $ = setTimeout(() => {
|
|
1534
|
-
e === Q && (
|
|
1562
|
+
e === Q && (b.value = !1);
|
|
1535
1563
|
}, 100);
|
|
1536
1564
|
};
|
|
1537
1565
|
return l({
|
|
1538
|
-
focus:
|
|
1539
|
-
blur:
|
|
1540
|
-
}), (
|
|
1566
|
+
focus: ct,
|
|
1567
|
+
blur: lt
|
|
1568
|
+
}), (t, i) => (openBlock(), createElementBlock("div", { class: normalizeClass(["time-select", {
|
|
1541
1569
|
"time-select--disabled": f.disabled,
|
|
1542
1570
|
"time-select--border": f.border
|
|
1543
1571
|
}]) }, [createElementVNode("div", {
|
|
1544
1572
|
ref_key: "inputWrapperRef",
|
|
1545
|
-
ref:
|
|
1573
|
+
ref: g,
|
|
1546
1574
|
class: "time-select__input-wrapper",
|
|
1547
|
-
onFocusin:
|
|
1548
|
-
onFocusout:
|
|
1575
|
+
onFocusin: ut,
|
|
1576
|
+
onFocusout: dt
|
|
1549
1577
|
}, [
|
|
1550
|
-
f.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1,
|
|
1578
|
+
f.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1, i[0] ||= [createElementVNode("svg", {
|
|
1551
1579
|
class: "time-select__icon",
|
|
1552
1580
|
viewBox: "0 0 24 24",
|
|
1553
1581
|
fill: "currentColor"
|
|
@@ -1559,29 +1587,29 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1559
1587
|
"time-select__input--disabled": f.disabled,
|
|
1560
1588
|
"time-select__input--readonly": !f.editable
|
|
1561
1589
|
}]),
|
|
1562
|
-
onClick:
|
|
1590
|
+
onClick: Qe
|
|
1563
1591
|
}, [
|
|
1564
1592
|
createElementVNode("div", {
|
|
1565
1593
|
ref_key: "hourRef",
|
|
1566
|
-
ref:
|
|
1594
|
+
ref: j,
|
|
1567
1595
|
class: normalizeClass(["time-select__time-part time-select__hour", { "time-select__time-part--selected": A.value === "hour" }]),
|
|
1568
1596
|
contenteditable: f.editable && !f.disabled,
|
|
1569
|
-
onInput:
|
|
1570
|
-
onFocus:
|
|
1571
|
-
onBlur:
|
|
1572
|
-
onKeydown:
|
|
1597
|
+
onInput: $e,
|
|
1598
|
+
onFocus: tt,
|
|
1599
|
+
onBlur: nt,
|
|
1600
|
+
onKeydown: at,
|
|
1573
1601
|
onClick: withModifiers(q, ["stop"])
|
|
1574
1602
|
}, toDisplayString(R.value), 43, _hoisted_2),
|
|
1575
|
-
|
|
1603
|
+
i[1] ||= createElementVNode("span", { class: "time-select__separator" }, ":", -1),
|
|
1576
1604
|
createElementVNode("div", {
|
|
1577
1605
|
ref_key: "minuteRef",
|
|
1578
|
-
ref:
|
|
1606
|
+
ref: N,
|
|
1579
1607
|
class: normalizeClass(["time-select__time-part time-select__minute", { "time-select__time-part--selected": A.value === "minute" }]),
|
|
1580
1608
|
contenteditable: f.editable && !f.disabled,
|
|
1581
|
-
onInput:
|
|
1582
|
-
onFocus:
|
|
1583
|
-
onBlur:
|
|
1584
|
-
onKeydown:
|
|
1609
|
+
onInput: et,
|
|
1610
|
+
onFocus: rt,
|
|
1611
|
+
onBlur: it,
|
|
1612
|
+
onKeydown: ot,
|
|
1585
1613
|
onClick: withModifiers(J, ["stop"])
|
|
1586
1614
|
}, toDisplayString(z.value), 43, _hoisted_3)
|
|
1587
1615
|
], 2),
|
|
@@ -1590,7 +1618,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1590
1618
|
class: "time-select__clear",
|
|
1591
1619
|
onMousedown: withModifiers(Z, ["prevent"]),
|
|
1592
1620
|
onClick: withModifiers(Z, ["prevent"])
|
|
1593
|
-
},
|
|
1621
|
+
}, i[2] ||= [createElementVNode("svg", {
|
|
1594
1622
|
class: "time-select__icon",
|
|
1595
1623
|
viewBox: "0 0 24 24",
|
|
1596
1624
|
fill: "currentColor"
|
|
@@ -1599,7 +1627,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1599
1627
|
to: "body",
|
|
1600
1628
|
disabled: !f.teleport
|
|
1601
1629
|
}, [createVNode(Transition, { name: "time-select-dropdown" }, {
|
|
1602
|
-
default: withCtx(() => [
|
|
1630
|
+
default: withCtx(() => [b.value && !f.disabled ? (openBlock(), createElementBlock("div", {
|
|
1603
1631
|
key: 0,
|
|
1604
1632
|
class: normalizeClass(["time-select__dropdown", { "time-select__dropdown--teleport": f.teleport }]),
|
|
1605
1633
|
style: normalizeStyle(f.teleport ? T.value : void 0),
|
|
@@ -1607,7 +1635,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1607
1635
|
ref: m
|
|
1608
1636
|
}, [createVNode(unref(Scrollbar_default), {
|
|
1609
1637
|
ref_key: "scrollbarRef",
|
|
1610
|
-
ref:
|
|
1638
|
+
ref: S,
|
|
1611
1639
|
size: f.size === "small" ? "small" : "default",
|
|
1612
1640
|
class: "time-select__options"
|
|
1613
1641
|
}, {
|
|
@@ -1615,7 +1643,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1615
1643
|
key: e,
|
|
1616
1644
|
class: normalizeClass(["time-select__option", { "time-select__option--selected": e === G(W(B.value)) }]),
|
|
1617
1645
|
"data-value": e,
|
|
1618
|
-
onClick: (t) =>
|
|
1646
|
+
onClick: (t) => st(e)
|
|
1619
1647
|
}, toDisplayString(e), 11, _hoisted_4))), 128))]),
|
|
1620
1648
|
_: 1
|
|
1621
1649
|
}, 8, ["size"])], 6)) : createCommentVNode("", !0)]),
|