@xiaou66/u-web-ui 1.0.1 → 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 +329 -291
- 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,30 +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;
|
|
711
|
+
}
|
|
712
|
+
function f(e) {
|
|
713
|
+
return e instanceof Element && !!e.closest(".el-popper");
|
|
714
|
+
}
|
|
715
|
+
function p(e) {
|
|
716
|
+
return e instanceof Node && !!l.value?.contains(e);
|
|
710
717
|
}
|
|
711
|
-
function
|
|
712
|
-
|
|
718
|
+
function m(e) {
|
|
719
|
+
f(e?.relatedTarget ?? null) || (r.value = !0);
|
|
713
720
|
}
|
|
714
|
-
|
|
715
|
-
|
|
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;
|
|
737
|
+
}
|
|
738
|
+
return (e, n) => {
|
|
739
|
+
let i = resolveComponent("RouterView");
|
|
716
740
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [createVNode(UtoolsBaseLayout_default, null, {
|
|
717
741
|
left: withCtx(() => [createElementVNode("div", {
|
|
742
|
+
ref_key: "menuRef",
|
|
743
|
+
ref: l,
|
|
718
744
|
class: normalizeClass(unref(getClassPrefix)("utools", "left-menu")),
|
|
719
|
-
onMouseenter:
|
|
720
|
-
onMouseleave:
|
|
745
|
+
onMouseenter: u,
|
|
746
|
+
onMouseleave: m
|
|
721
747
|
}, [createVNode(unref(LeftMenu_default), mergeProps({
|
|
722
748
|
loadRouter: e.loadRouter,
|
|
723
749
|
refreshEventListener: e.refreshEventListener,
|
|
724
750
|
size: e.size
|
|
725
751
|
}, {
|
|
726
|
-
collapsed:
|
|
727
|
-
"onUpdate:collapsed":
|
|
752
|
+
collapsed: r.value,
|
|
753
|
+
"onUpdate:collapsed": n[0] ||= (e) => r.value = e
|
|
728
754
|
}), {
|
|
729
755
|
logo: withCtx(() => [renderSlot(e.$slots, "logo", {}, () => [createElementVNode("div", _hoisted_2$1, [createElementVNode("div", {
|
|
730
756
|
class: "h-auto overflow-hidden flex flex-shrink-0",
|
|
@@ -738,7 +764,19 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
738
764
|
}, 16, ["collapsed"])], 34)]),
|
|
739
765
|
default: withCtx(() => [createElementVNode("div", { class: normalizeClass(unref(getClassPrefix)("utools", "content-wrapper")) }, [
|
|
740
766
|
createElementVNode("div", _hoisted_5, [renderSlot(e.$slots, "header-tips")]),
|
|
741
|
-
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
|
+
})])]),
|
|
742
780
|
renderSlot(e.$slots, "footer", {}, () => [createElementVNode("div", _hoisted_8, " © " + toDisplayString((/* @__PURE__ */ new Date()).getFullYear()) + " [xiaou]。保留所有权利 ", 1)])
|
|
743
781
|
], 2)]),
|
|
744
782
|
_: 3
|
|
@@ -754,14 +792,14 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
754
792
|
},
|
|
755
793
|
emits: ["back"],
|
|
756
794
|
setup(e) {
|
|
757
|
-
let t = e, n = getBuildCurrentClassPrefix("page-header"),
|
|
795
|
+
let t = e, n = getBuildCurrentClassPrefix("page-header"), r = computed(() => {
|
|
758
796
|
let e = [n()];
|
|
759
797
|
return t.size !== "default" && e.push(n(t.size)), e;
|
|
760
|
-
}),
|
|
798
|
+
}), a = computed(() => isEventExist("onBack"));
|
|
761
799
|
return (e, t) => {
|
|
762
|
-
let
|
|
763
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(
|
|
764
|
-
|
|
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, {
|
|
765
803
|
class: normalizeClass(unref(n)("header", "back")),
|
|
766
804
|
onClick: t[0] ||= (t) => e.$emit("back"),
|
|
767
805
|
link: ""
|
|
@@ -771,7 +809,7 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
771
809
|
__: [1]
|
|
772
810
|
}, 8, ["class"])]) : createCommentVNode("", !0),
|
|
773
811
|
createElementVNode("div", { class: normalizeClass(unref(n)("title")) }, [renderSlot(e.$slots, "title", {}, () => [createTextVNode(toDisplayString(e.title), 1)])], 2),
|
|
774
|
-
createVNode(
|
|
812
|
+
createVNode(l, {
|
|
775
813
|
class: normalizeClass(unref(n)("divider")),
|
|
776
814
|
direction: "vertical"
|
|
777
815
|
}, null, 8, ["class"]),
|
|
@@ -793,21 +831,21 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
793
831
|
background: { default: "var(--u-color-bg-3)" }
|
|
794
832
|
},
|
|
795
833
|
setup(e) {
|
|
796
|
-
let t = e, n = useAttrs(),
|
|
834
|
+
let t = e, n = useAttrs(), r = computed(() => "onClick" in n || "onClickCapture" in n), a = computed(() => {
|
|
797
835
|
let e = [];
|
|
798
|
-
return e.push(getClassPrefix("setting-item")),
|
|
799
|
-
}),
|
|
800
|
-
function
|
|
801
|
-
|
|
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 = {};
|
|
802
840
|
}
|
|
803
841
|
function d() {
|
|
804
|
-
|
|
842
|
+
o.value = { background: t.background };
|
|
805
843
|
}
|
|
806
844
|
return (e, t) => (openBlock(), createElementBlock("div", mergeProps({
|
|
807
845
|
class: [...a.value],
|
|
808
|
-
style: { ...
|
|
809
|
-
}, toHandlers({ ...
|
|
810
|
-
onMouseenter:
|
|
846
|
+
style: { ...o.value }
|
|
847
|
+
}, toHandlers({ ...r.value && { click: e.$attrs.onClick || e.$attrs.onClickCapture } }, !0), {
|
|
848
|
+
onMouseenter: l,
|
|
811
849
|
onMouseleave: d
|
|
812
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));
|
|
813
851
|
}
|
|
@@ -884,65 +922,65 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
884
922
|
"blur"
|
|
885
923
|
], ["update:value"]),
|
|
886
924
|
setup(t, { emit: n }) {
|
|
887
|
-
let
|
|
888
|
-
|
|
889
|
-
let g = computed(() =>
|
|
890
|
-
let n = e ?
|
|
891
|
-
|
|
892
|
-
},
|
|
893
|
-
if (
|
|
894
|
-
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;
|
|
895
933
|
if (isFunction(r)) {
|
|
896
|
-
|
|
934
|
+
_.value = !0;
|
|
897
935
|
try {
|
|
898
|
-
(await r(n) ?? !0) &&
|
|
936
|
+
(await r(n) ?? !0) && b(t, e);
|
|
899
937
|
} finally {
|
|
900
|
-
|
|
938
|
+
_.value = !1;
|
|
901
939
|
}
|
|
902
|
-
} else
|
|
940
|
+
} else b(t, e);
|
|
941
|
+
}, S = (e) => {
|
|
942
|
+
l("focus", e);
|
|
903
943
|
}, C = (e) => {
|
|
904
|
-
|
|
905
|
-
}, w = (e) => {
|
|
906
|
-
u("blur", e);
|
|
944
|
+
l("blur", e);
|
|
907
945
|
};
|
|
908
|
-
watch(
|
|
909
|
-
(isUndefined(e) || isNull(e)) && (
|
|
946
|
+
watch(r, (e) => {
|
|
947
|
+
(isUndefined(e) || isNull(e)) && (r.value = a.uncheckedValue);
|
|
910
948
|
});
|
|
911
|
-
let
|
|
949
|
+
let w = computed(() => [
|
|
912
950
|
p,
|
|
913
|
-
`${p}-type-${
|
|
951
|
+
`${p}-type-${a.type}`,
|
|
914
952
|
{
|
|
915
953
|
[`${p}-medium`]: h.value === "medium",
|
|
916
954
|
[`${p}-small`]: h.value === "small",
|
|
917
955
|
[`${p}-mini`]: h.value === "mini",
|
|
918
956
|
[`${p}-checked`]: g.value,
|
|
919
957
|
[`${p}-disabled`]: m.value,
|
|
920
|
-
[`${p}-loading`]:
|
|
921
|
-
[`${p}-custom-color`]:
|
|
958
|
+
[`${p}-loading`]: y.value,
|
|
959
|
+
[`${p}-custom-color`]: a.type === "line" && (a.checkedColor || a.uncheckedColor)
|
|
922
960
|
}
|
|
923
961
|
]), E = computed(() => {
|
|
924
|
-
if (g.value &&
|
|
925
|
-
if (!g.value &&
|
|
926
|
-
}),
|
|
927
|
-
if (!
|
|
928
|
-
if (g.value &&
|
|
929
|
-
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 };
|
|
930
968
|
}
|
|
931
969
|
});
|
|
932
970
|
return (t, n) => (openBlock(), createElementBlock("button", {
|
|
933
971
|
type: "button",
|
|
934
972
|
role: "switch",
|
|
935
973
|
"aria-checked": g.value,
|
|
936
|
-
class: normalizeClass(
|
|
974
|
+
class: normalizeClass(w.value),
|
|
937
975
|
style: normalizeStyle(E.value),
|
|
938
|
-
disabled: m.value ||
|
|
939
|
-
onClick:
|
|
940
|
-
onFocus:
|
|
941
|
-
onBlur:
|
|
976
|
+
disabled: m.value || y.value,
|
|
977
|
+
onClick: x,
|
|
978
|
+
onFocus: S,
|
|
979
|
+
onBlur: C
|
|
942
980
|
}, [createElementVNode("span", {
|
|
943
981
|
class: normalizeClass(`${unref(p)}-handle`),
|
|
944
|
-
style: normalizeStyle(
|
|
945
|
-
}, [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", {
|
|
946
984
|
key: 0,
|
|
947
985
|
class: normalizeClass(["i-p-loading", `${unref(p)}-loading-icon`])
|
|
948
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));
|
|
@@ -1042,7 +1080,7 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1042
1080
|
},
|
|
1043
1081
|
emits: ["scroll"],
|
|
1044
1082
|
setup(e, { expose: t, emit: n }) {
|
|
1045
|
-
let
|
|
1083
|
+
let r = e, a = n, o = getClassPrefix("scrollbar"), l = ref(), u = ref(), d = computed(() => r.direction === "horizontal" ? {
|
|
1046
1084
|
size: "width",
|
|
1047
1085
|
direction: "left",
|
|
1048
1086
|
offset: "offsetWidth",
|
|
@@ -1053,46 +1091,46 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1053
1091
|
offset: "offsetHeight",
|
|
1054
1092
|
client: "clientY"
|
|
1055
1093
|
}), f = ref(0), p = ref(!1), m = ref(0), h = computed(() => ({
|
|
1056
|
-
[d.value.size]: `${
|
|
1094
|
+
[d.value.size]: `${r.data?.thumbSize ?? 0}px`,
|
|
1057
1095
|
[d.value.direction]: `${f.value}px`
|
|
1058
1096
|
})), g = (e) => {
|
|
1059
|
-
e.preventDefault(), u.value && (m.value = e[d.value.client] - u.value.getBoundingClientRect()[d.value.direction], p.value = !0, on(window, "mousemove",
|
|
1060
|
-
},
|
|
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) => {
|
|
1061
1099
|
if (e.preventDefault(), u.value) {
|
|
1062
|
-
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));
|
|
1063
1101
|
t !== f.value && (f.value = t, a("scroll", t));
|
|
1064
1102
|
}
|
|
1065
|
-
},
|
|
1103
|
+
}, y = (e) => e < 0 ? 0 : r.data && e > r.data.max ? r.data.max : e, b = (e) => {
|
|
1066
1104
|
if (l.value && u.value) {
|
|
1067
|
-
let t =
|
|
1105
|
+
let t = y(e[d.value.client] - l.value.getBoundingClientRect()[d.value.direction] - m.value);
|
|
1068
1106
|
t !== f.value && (f.value = t, a("scroll", t));
|
|
1069
1107
|
}
|
|
1070
|
-
},
|
|
1071
|
-
p.value = !1, off(window, "mousemove",
|
|
1072
|
-
},
|
|
1073
|
-
p.value || (e =
|
|
1074
|
-
},
|
|
1075
|
-
`${
|
|
1076
|
-
`${
|
|
1077
|
-
`${
|
|
1078
|
-
{ [`${
|
|
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 }
|
|
1079
1117
|
]);
|
|
1080
|
-
return t({ setOffset:
|
|
1118
|
+
return t({ setOffset: S }), (e, t) => (openBlock(), createElementBlock("div", {
|
|
1081
1119
|
ref_key: "trackRef",
|
|
1082
1120
|
ref: l,
|
|
1083
1121
|
class: normalizeClass([
|
|
1084
|
-
`${unref(
|
|
1085
|
-
`${unref(
|
|
1086
|
-
`${unref(
|
|
1122
|
+
`${unref(o)}-track`,
|
|
1123
|
+
`${unref(o)}-track-direction-${e.direction}`,
|
|
1124
|
+
`${unref(o)}-track-size-${r.size}`
|
|
1087
1125
|
]),
|
|
1088
|
-
onMousedown: withModifiers(
|
|
1126
|
+
onMousedown: withModifiers(_, ["self"])
|
|
1089
1127
|
}, [createElementVNode("div", {
|
|
1090
1128
|
ref_key: "thumbRef",
|
|
1091
1129
|
ref: u,
|
|
1092
|
-
class: normalizeClass(
|
|
1130
|
+
class: normalizeClass(C.value),
|
|
1093
1131
|
style: normalizeStyle(h.value),
|
|
1094
1132
|
onMousedown: g
|
|
1095
|
-
}, [createElementVNode("div", { class: normalizeClass(`${unref(
|
|
1133
|
+
}, [createElementVNode("div", { class: normalizeClass(`${unref(o)}-thumb-bar`) }, null, 2)], 38)], 34));
|
|
1096
1134
|
}
|
|
1097
1135
|
}), SCROLLBAR_THUMB_MIN_SIZE = 20, SCROLLBAR_TRACK_SIZE = 15, Scrollbar_default = /* @__PURE__ */ defineComponent({
|
|
1098
1136
|
__name: "Scrollbar",
|
|
@@ -1122,26 +1160,26 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1122
1160
|
},
|
|
1123
1161
|
emits: ["scroll"],
|
|
1124
1162
|
setup(e, { expose: t, emit: n }) {
|
|
1125
|
-
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 = () => {
|
|
1126
1164
|
if (f.value) {
|
|
1127
|
-
let { clientWidth: e, clientHeight: t, offsetWidth: n, offsetHeight:
|
|
1128
|
-
|
|
1129
|
-
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;
|
|
1130
1168
|
if (p.value = {
|
|
1131
|
-
ratio:
|
|
1132
|
-
thumbSize:
|
|
1133
|
-
max:
|
|
1169
|
+
ratio: Ye,
|
|
1170
|
+
thumbSize: g,
|
|
1171
|
+
max: v
|
|
1134
1172
|
}, m.value = {
|
|
1135
|
-
ratio:
|
|
1173
|
+
ratio: Xe,
|
|
1136
1174
|
thumbSize: b,
|
|
1137
1175
|
max: x
|
|
1138
|
-
},
|
|
1139
|
-
let e = Math.round(
|
|
1140
|
-
|
|
1176
|
+
}, s > 0) {
|
|
1177
|
+
let e = Math.round(s / (m.value?.ratio ?? 1));
|
|
1178
|
+
_.value?.setOffset(e);
|
|
1141
1179
|
}
|
|
1142
|
-
if (
|
|
1143
|
-
let e = Math.round(
|
|
1144
|
-
|
|
1180
|
+
if (c > 0) {
|
|
1181
|
+
let e = Math.round(c / (p.value?.ratio ?? 1));
|
|
1182
|
+
h.value?.setOffset(e);
|
|
1145
1183
|
}
|
|
1146
1184
|
}
|
|
1147
1185
|
}, k = () => {
|
|
@@ -1158,13 +1196,13 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1158
1196
|
});
|
|
1159
1197
|
let A = (e) => {
|
|
1160
1198
|
if (f.value) {
|
|
1161
|
-
if (
|
|
1199
|
+
if (C.value && !r.disableHorizontal) {
|
|
1162
1200
|
let e = Math.round(f.value.scrollLeft / (p.value?.ratio ?? 1));
|
|
1163
|
-
|
|
1201
|
+
h.value?.setOffset(e);
|
|
1164
1202
|
}
|
|
1165
|
-
if (
|
|
1203
|
+
if (w.value && !r.disableVertical) {
|
|
1166
1204
|
let e = Math.round(f.value.scrollTop / (m.value?.ratio ?? 1));
|
|
1167
|
-
|
|
1205
|
+
_.value?.setOffset(e);
|
|
1168
1206
|
}
|
|
1169
1207
|
}
|
|
1170
1208
|
l("scroll", e);
|
|
@@ -1174,13 +1212,13 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1174
1212
|
f.value && f.value.scrollTo({ top: e * (m.value?.ratio ?? 1) });
|
|
1175
1213
|
}, N = computed(() => {
|
|
1176
1214
|
let e = {};
|
|
1177
|
-
return
|
|
1215
|
+
return r.type === "track" && (C.value && (e.paddingBottom = `${d.value}px`), w.value && (e.paddingRight = `${d.value}px`)), [e, r.outerStyle];
|
|
1178
1216
|
}), P = computed(() => [
|
|
1179
1217
|
`${u}`,
|
|
1180
|
-
`${u}-type-${
|
|
1181
|
-
`${u}-size-${
|
|
1218
|
+
`${u}-type-${r.type}`,
|
|
1219
|
+
`${u}-size-${r.size}`,
|
|
1182
1220
|
{ [`${u}-both`]: E.value },
|
|
1183
|
-
|
|
1221
|
+
r.outerClass
|
|
1184
1222
|
]);
|
|
1185
1223
|
return t({
|
|
1186
1224
|
scrollTo: (e, t) => {
|
|
@@ -1204,28 +1242,28 @@ var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ define
|
|
|
1204
1242
|
ref: f,
|
|
1205
1243
|
class: `${unref(u)}-container`
|
|
1206
1244
|
}, e.$attrs, { onScroll: A }), [renderSlot(e.$slots, "default")], 16),
|
|
1207
|
-
!e.hide &&
|
|
1245
|
+
!e.hide && C.value ? (openBlock(), createBlock(thumb_default, {
|
|
1208
1246
|
key: 0,
|
|
1209
1247
|
ref_key: "horizontalThumbRef",
|
|
1210
|
-
ref:
|
|
1248
|
+
ref: h,
|
|
1211
1249
|
data: p.value,
|
|
1212
1250
|
direction: "horizontal",
|
|
1213
1251
|
both: E.value,
|
|
1214
|
-
size:
|
|
1252
|
+
size: r.size,
|
|
1215
1253
|
onScroll: j
|
|
1216
1254
|
}, null, 8, [
|
|
1217
1255
|
"data",
|
|
1218
1256
|
"both",
|
|
1219
1257
|
"size"
|
|
1220
1258
|
])) : createCommentVNode("", !0),
|
|
1221
|
-
!e.hide &&
|
|
1259
|
+
!e.hide && w.value ? (openBlock(), createBlock(thumb_default, {
|
|
1222
1260
|
key: 1,
|
|
1223
1261
|
ref_key: "verticalThumbRef",
|
|
1224
|
-
ref:
|
|
1262
|
+
ref: _,
|
|
1225
1263
|
data: m.value,
|
|
1226
1264
|
direction: "vertical",
|
|
1227
1265
|
both: E.value,
|
|
1228
|
-
size:
|
|
1266
|
+
size: r.size,
|
|
1229
1267
|
onScroll: M
|
|
1230
1268
|
}, null, 8, [
|
|
1231
1269
|
"data",
|
|
@@ -1295,11 +1333,11 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1295
1333
|
},
|
|
1296
1334
|
emits: ["load"],
|
|
1297
1335
|
setup(e, { emit: t }) {
|
|
1298
|
-
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) => {
|
|
1299
1337
|
e && (i.value = !0, r("load"), c());
|
|
1300
1338
|
}, { rootMargin: `${n.distance}px` });
|
|
1301
1339
|
return watch(a, (e) => {
|
|
1302
|
-
e &&
|
|
1340
|
+
e && o(e);
|
|
1303
1341
|
}, { immediate: !0 }), (e, t) => i.value ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("div", {
|
|
1304
1342
|
key: 1,
|
|
1305
1343
|
ref_key: "box",
|
|
@@ -1369,15 +1407,15 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1369
1407
|
"focus",
|
|
1370
1408
|
"clear"
|
|
1371
1409
|
], ["update:modelValue"]),
|
|
1372
|
-
setup(
|
|
1373
|
-
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({
|
|
1374
1412
|
top: "0px",
|
|
1375
1413
|
left: "0px",
|
|
1376
1414
|
width: "0px",
|
|
1377
1415
|
position: "fixed"
|
|
1378
1416
|
}), E = () => {
|
|
1379
|
-
if (!f.teleport || !
|
|
1380
|
-
let e =
|
|
1417
|
+
if (!f.teleport || !g.value) return;
|
|
1418
|
+
let e = g.value.getBoundingClientRect();
|
|
1381
1419
|
T.value = {
|
|
1382
1420
|
top: `${e.bottom + 4}px`,
|
|
1383
1421
|
left: `${e.left}px`,
|
|
@@ -1385,18 +1423,18 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1385
1423
|
position: "fixed"
|
|
1386
1424
|
};
|
|
1387
1425
|
};
|
|
1388
|
-
watch(
|
|
1426
|
+
watch(b, (e) => {
|
|
1389
1427
|
e && f.teleport && nextTick(E);
|
|
1390
1428
|
});
|
|
1391
|
-
let
|
|
1392
|
-
watch(
|
|
1393
|
-
e && f.teleport ? (
|
|
1394
|
-
|
|
1395
|
-
}, 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));
|
|
1396
1434
|
}), onBeforeUnmount(() => {
|
|
1397
|
-
|
|
1435
|
+
D && window.removeEventListener("scroll", D, !0), k && window.removeEventListener("resize", k);
|
|
1398
1436
|
});
|
|
1399
|
-
let A = ref(null),
|
|
1437
|
+
let A = ref(null), j = ref(), N = ref(), I = "", L = "", R = computed(() => {
|
|
1400
1438
|
if (!B.value) return "--";
|
|
1401
1439
|
let [e] = B.value.split(":");
|
|
1402
1440
|
return e || "--";
|
|
@@ -1404,7 +1442,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1404
1442
|
if (!B.value) return "--";
|
|
1405
1443
|
let [, e] = B.value.split(":");
|
|
1406
1444
|
return e || "--";
|
|
1407
|
-
}), B = useModel(
|
|
1445
|
+
}), B = useModel(t, "modelValue"), V = computed(() => f.clearable && !f.disabled && B.value && (x.value || b.value)), H = computed(() => {
|
|
1408
1446
|
let e = [], t = U(f.start), n = U(f.end), r = U(f.step);
|
|
1409
1447
|
if (!t || !n || !r) return e;
|
|
1410
1448
|
let i = t, a = n.hours * 60 + n.minutes;
|
|
@@ -1447,12 +1485,12 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1447
1485
|
return !0;
|
|
1448
1486
|
}
|
|
1449
1487
|
let q = () => {
|
|
1450
|
-
A.value = "hour",
|
|
1488
|
+
A.value = "hour", j.value?.focus();
|
|
1451
1489
|
}, J = () => {
|
|
1452
|
-
A.value = "minute",
|
|
1453
|
-
},
|
|
1454
|
-
f.disabled || (
|
|
1455
|
-
},
|
|
1490
|
+
A.value = "minute", N.value?.focus();
|
|
1491
|
+
}, Qe = () => {
|
|
1492
|
+
f.disabled || (b.value = !0, x.value = !0, A.value || q());
|
|
1493
|
+
}, $e = (e) => {
|
|
1456
1494
|
e.preventDefault();
|
|
1457
1495
|
let t = e.target, n = e.data || "";
|
|
1458
1496
|
if (!/^\d$/.test(n)) {
|
|
@@ -1466,7 +1504,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1466
1504
|
t.textContent = i, Y("hour", i), I.length === 2 && nextTick(() => {
|
|
1467
1505
|
J();
|
|
1468
1506
|
});
|
|
1469
|
-
},
|
|
1507
|
+
}, et = (e) => {
|
|
1470
1508
|
e.preventDefault();
|
|
1471
1509
|
let t = e.target, n = e.data || "";
|
|
1472
1510
|
if (!/^\d$/.test(n)) {
|
|
@@ -1478,7 +1516,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1478
1516
|
r > 59 && (L = n, r = parseInt(n));
|
|
1479
1517
|
let i = L.padStart(2, "0");
|
|
1480
1518
|
t.textContent = i, Y("minute", i), L.length === 2 && nextTick(() => {
|
|
1481
|
-
|
|
1519
|
+
b.value = !1, N.value?.blur();
|
|
1482
1520
|
});
|
|
1483
1521
|
}, Y = (e, t) => {
|
|
1484
1522
|
let [n, r] = (B.value || "00:00").split(":"), i;
|
|
@@ -1487,57 +1525,57 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1487
1525
|
let n = e.getAttribute("data-value");
|
|
1488
1526
|
return !!(n && t?.hours && n.split(":")[0] === t.hours.padStart(2, "0"));
|
|
1489
1527
|
});
|
|
1490
|
-
|
|
1528
|
+
S.value && n && S.value.scrollTop(n.offsetTop);
|
|
1491
1529
|
}
|
|
1492
|
-
}, et = () => {
|
|
1493
|
-
A.value = "hour", S.value = !0, I = "";
|
|
1494
1530
|
}, tt = () => {
|
|
1495
|
-
A.value =
|
|
1531
|
+
A.value = "hour", x.value = !0, I = "";
|
|
1532
|
+
}, nt = () => {
|
|
1533
|
+
A.value = null, x.value = !1, X();
|
|
1496
1534
|
}, X = () => {
|
|
1497
1535
|
console.log("autoFillTime", B.value), B.value = G(W(B.value || "")), console.log("autoFillTime", G(W(B.value || "")), W(B.value || ""));
|
|
1498
|
-
}, nt = () => {
|
|
1499
|
-
A.value = "minute", S.value = !0, L = "";
|
|
1500
1536
|
}, rt = () => {
|
|
1501
|
-
A.value =
|
|
1502
|
-
}, it = (
|
|
1503
|
-
|
|
1537
|
+
A.value = "minute", x.value = !0, L = "";
|
|
1538
|
+
}, it = () => {
|
|
1539
|
+
A.value = null, x.value = !1, X();
|
|
1504
1540
|
}, at = (e) => {
|
|
1505
|
-
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);
|
|
1506
1544
|
}, Z = () => {
|
|
1507
1545
|
B.value = "", p("change", ""), p("clear"), I = "", L = "", nextTick(() => {
|
|
1508
1546
|
q();
|
|
1509
1547
|
});
|
|
1510
|
-
},
|
|
1511
|
-
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(() => {
|
|
1512
1550
|
h.value?.focus();
|
|
1513
1551
|
});
|
|
1514
|
-
}, st = () => {
|
|
1515
|
-
q();
|
|
1516
1552
|
}, ct = () => {
|
|
1517
|
-
|
|
1518
|
-
},
|
|
1519
|
-
|
|
1520
|
-
}, 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 = () => {
|
|
1521
1559
|
$ && clearTimeout($);
|
|
1522
1560
|
let e = Q + 1;
|
|
1523
1561
|
Q = e, $ = setTimeout(() => {
|
|
1524
|
-
e === Q && (
|
|
1562
|
+
e === Q && (b.value = !1);
|
|
1525
1563
|
}, 100);
|
|
1526
1564
|
};
|
|
1527
1565
|
return l({
|
|
1528
|
-
focus:
|
|
1529
|
-
blur:
|
|
1530
|
-
}), (
|
|
1566
|
+
focus: ct,
|
|
1567
|
+
blur: lt
|
|
1568
|
+
}), (t, i) => (openBlock(), createElementBlock("div", { class: normalizeClass(["time-select", {
|
|
1531
1569
|
"time-select--disabled": f.disabled,
|
|
1532
1570
|
"time-select--border": f.border
|
|
1533
1571
|
}]) }, [createElementVNode("div", {
|
|
1534
1572
|
ref_key: "inputWrapperRef",
|
|
1535
|
-
ref:
|
|
1573
|
+
ref: g,
|
|
1536
1574
|
class: "time-select__input-wrapper",
|
|
1537
|
-
onFocusin:
|
|
1538
|
-
onFocusout:
|
|
1575
|
+
onFocusin: ut,
|
|
1576
|
+
onFocusout: dt
|
|
1539
1577
|
}, [
|
|
1540
|
-
f.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1,
|
|
1578
|
+
f.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1, i[0] ||= [createElementVNode("svg", {
|
|
1541
1579
|
class: "time-select__icon",
|
|
1542
1580
|
viewBox: "0 0 24 24",
|
|
1543
1581
|
fill: "currentColor"
|
|
@@ -1549,29 +1587,29 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1549
1587
|
"time-select__input--disabled": f.disabled,
|
|
1550
1588
|
"time-select__input--readonly": !f.editable
|
|
1551
1589
|
}]),
|
|
1552
|
-
onClick:
|
|
1590
|
+
onClick: Qe
|
|
1553
1591
|
}, [
|
|
1554
1592
|
createElementVNode("div", {
|
|
1555
1593
|
ref_key: "hourRef",
|
|
1556
|
-
ref:
|
|
1594
|
+
ref: j,
|
|
1557
1595
|
class: normalizeClass(["time-select__time-part time-select__hour", { "time-select__time-part--selected": A.value === "hour" }]),
|
|
1558
1596
|
contenteditable: f.editable && !f.disabled,
|
|
1559
|
-
onInput:
|
|
1560
|
-
onFocus:
|
|
1561
|
-
onBlur:
|
|
1562
|
-
onKeydown:
|
|
1597
|
+
onInput: $e,
|
|
1598
|
+
onFocus: tt,
|
|
1599
|
+
onBlur: nt,
|
|
1600
|
+
onKeydown: at,
|
|
1563
1601
|
onClick: withModifiers(q, ["stop"])
|
|
1564
1602
|
}, toDisplayString(R.value), 43, _hoisted_2),
|
|
1565
|
-
|
|
1603
|
+
i[1] ||= createElementVNode("span", { class: "time-select__separator" }, ":", -1),
|
|
1566
1604
|
createElementVNode("div", {
|
|
1567
1605
|
ref_key: "minuteRef",
|
|
1568
|
-
ref:
|
|
1606
|
+
ref: N,
|
|
1569
1607
|
class: normalizeClass(["time-select__time-part time-select__minute", { "time-select__time-part--selected": A.value === "minute" }]),
|
|
1570
1608
|
contenteditable: f.editable && !f.disabled,
|
|
1571
|
-
onInput:
|
|
1572
|
-
onFocus:
|
|
1573
|
-
onBlur:
|
|
1574
|
-
onKeydown:
|
|
1609
|
+
onInput: et,
|
|
1610
|
+
onFocus: rt,
|
|
1611
|
+
onBlur: it,
|
|
1612
|
+
onKeydown: ot,
|
|
1575
1613
|
onClick: withModifiers(J, ["stop"])
|
|
1576
1614
|
}, toDisplayString(z.value), 43, _hoisted_3)
|
|
1577
1615
|
], 2),
|
|
@@ -1580,7 +1618,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1580
1618
|
class: "time-select__clear",
|
|
1581
1619
|
onMousedown: withModifiers(Z, ["prevent"]),
|
|
1582
1620
|
onClick: withModifiers(Z, ["prevent"])
|
|
1583
|
-
},
|
|
1621
|
+
}, i[2] ||= [createElementVNode("svg", {
|
|
1584
1622
|
class: "time-select__icon",
|
|
1585
1623
|
viewBox: "0 0 24 24",
|
|
1586
1624
|
fill: "currentColor"
|
|
@@ -1589,7 +1627,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1589
1627
|
to: "body",
|
|
1590
1628
|
disabled: !f.teleport
|
|
1591
1629
|
}, [createVNode(Transition, { name: "time-select-dropdown" }, {
|
|
1592
|
-
default: withCtx(() => [
|
|
1630
|
+
default: withCtx(() => [b.value && !f.disabled ? (openBlock(), createElementBlock("div", {
|
|
1593
1631
|
key: 0,
|
|
1594
1632
|
class: normalizeClass(["time-select__dropdown", { "time-select__dropdown--teleport": f.teleport }]),
|
|
1595
1633
|
style: normalizeStyle(f.teleport ? T.value : void 0),
|
|
@@ -1597,7 +1635,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1597
1635
|
ref: m
|
|
1598
1636
|
}, [createVNode(unref(Scrollbar_default), {
|
|
1599
1637
|
ref_key: "scrollbarRef",
|
|
1600
|
-
ref:
|
|
1638
|
+
ref: S,
|
|
1601
1639
|
size: f.size === "small" ? "small" : "default",
|
|
1602
1640
|
class: "time-select__options"
|
|
1603
1641
|
}, {
|
|
@@ -1605,7 +1643,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1605
1643
|
key: e,
|
|
1606
1644
|
class: normalizeClass(["time-select__option", { "time-select__option--selected": e === G(W(B.value)) }]),
|
|
1607
1645
|
"data-value": e,
|
|
1608
|
-
onClick: (t) =>
|
|
1646
|
+
onClick: (t) => st(e)
|
|
1609
1647
|
}, toDisplayString(e), 11, _hoisted_4))), 128))]),
|
|
1610
1648
|
_: 1
|
|
1611
1649
|
}, 8, ["size"])], 6)) : createCommentVNode("", !0)]),
|