@xiaou66/u-web-ui 0.152.0 → 0.153.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +43 -38
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -358,9 +358,15 @@ declare type loadStatusCompute<T> = ComputedRef<(uniqueKey: T) => boolean>;
|
|
|
358
358
|
* 菜单项
|
|
359
359
|
*/
|
|
360
360
|
export declare interface MenuItem {
|
|
361
|
+
id?: string;
|
|
361
362
|
title: string;
|
|
362
363
|
icon: string;
|
|
363
364
|
menu?: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* 单击事件
|
|
367
|
+
* @param e 事件
|
|
368
|
+
*/
|
|
369
|
+
onClick?: (item: MenuRouterItem) => void;
|
|
364
370
|
}
|
|
365
371
|
|
|
366
372
|
export declare type MenuRouterItem = ((RouteRecord | RouteRecordRaw) & {
|
package/dist/index.es.js
CHANGED
|
@@ -154,7 +154,7 @@ let LeftMenuEvents = /* @__PURE__ */ function(e) {
|
|
|
154
154
|
const LeftMenuEventDispatch = { refresh: () => {
|
|
155
155
|
window.dispatchEvent(new CustomEvent(LeftMenuEvents.Refresh));
|
|
156
156
|
} };
|
|
157
|
-
var LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
157
|
+
var _hoisted_1$5 = { class: "title" }, LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
158
158
|
__name: "LeftMenu",
|
|
159
159
|
props: /* @__PURE__ */ mergeModels({
|
|
160
160
|
hideOperations: {
|
|
@@ -191,7 +191,7 @@ var LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
191
191
|
h();
|
|
192
192
|
});
|
|
193
193
|
function g(e) {
|
|
194
|
-
d.push({ name: e.name });
|
|
194
|
+
e.meta.onClick ? e.meta.onClick(e) : d.push({ name: e.name });
|
|
195
195
|
}
|
|
196
196
|
function v(e) {
|
|
197
197
|
return e.children ? e.children.filter((e) => e.meta?.menu) : [];
|
|
@@ -233,11 +233,16 @@ var LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
233
233
|
}, 1032, ["index"])) : (openBlock(), createBlock(l, {
|
|
234
234
|
key: 1,
|
|
235
235
|
index: String(t.name),
|
|
236
|
+
id: t.meta?.id || "",
|
|
236
237
|
onClick: (e) => g(t)
|
|
237
238
|
}, {
|
|
238
|
-
default: withCtx(() => [createVNode(r, { class: normalizeClass(t.meta.icon) }, null, 8, ["class"]), createElementVNode("span",
|
|
239
|
+
default: withCtx(() => [createVNode(r, { class: normalizeClass(["icon", t.meta.icon]) }, null, 8, ["class"]), createElementVNode("span", _hoisted_1$5, toDisplayString(t.meta.title), 1)]),
|
|
239
240
|
_: 2
|
|
240
|
-
}, 1032, [
|
|
241
|
+
}, 1032, [
|
|
242
|
+
"index",
|
|
243
|
+
"id",
|
|
244
|
+
"onClick"
|
|
245
|
+
]))], 64))), 128))]),
|
|
241
246
|
_: 1
|
|
242
247
|
}, 8, [
|
|
243
248
|
"default-active",
|
|
@@ -570,7 +575,7 @@ var LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
570
575
|
let r = w(e ?? t);
|
|
571
576
|
return r.isPx ? r.size : r.size * n;
|
|
572
577
|
}
|
|
573
|
-
function
|
|
578
|
+
function Xe(e, t) {
|
|
574
579
|
return parseFloat(e) / parseFloat(t);
|
|
575
580
|
}
|
|
576
581
|
let F = {
|
|
@@ -585,7 +590,7 @@ var LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
585
590
|
}
|
|
586
591
|
function L(e, t) {
|
|
587
592
|
if (!t) return;
|
|
588
|
-
let n = T.value.isPx ? `${e}px` :
|
|
593
|
+
let n = T.value.isPx ? `${e}px` : Xe(e, t);
|
|
589
594
|
C.value !== n && (C.value = n, c("update:size", n));
|
|
590
595
|
}
|
|
591
596
|
function R(e, t) {
|
|
@@ -1117,13 +1122,13 @@ var LeftMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
1117
1122
|
if (f.value) {
|
|
1118
1123
|
let { clientWidth: e, clientHeight: t, offsetWidth: n, offsetHeight: r, scrollWidth: i, scrollHeight: a, scrollTop: o, scrollLeft: s } = f.value;
|
|
1119
1124
|
S.value = i > e, C.value = a > t, E.value = w.value && T.value;
|
|
1120
|
-
let l = c.type === "embed" && E.value ? n - d.value : n, u = c.type === "embed" && E.value ? r - d.value : r, h = Math.round(l / Math.min(i / e, l / SCROLLBAR_THUMB_MIN_SIZE)), _ = l - h, v = (i - e) / _, b = Math.round(u / Math.min(a / t, u / SCROLLBAR_THUMB_MIN_SIZE)), x = u - b,
|
|
1125
|
+
let l = c.type === "embed" && E.value ? n - d.value : n, u = c.type === "embed" && E.value ? r - d.value : r, h = Math.round(l / Math.min(i / e, l / SCROLLBAR_THUMB_MIN_SIZE)), _ = l - h, v = (i - e) / _, b = Math.round(u / Math.min(a / t, u / SCROLLBAR_THUMB_MIN_SIZE)), x = u - b, Je = (a - t) / x;
|
|
1121
1126
|
if (p.value = {
|
|
1122
1127
|
ratio: v,
|
|
1123
1128
|
thumbSize: h,
|
|
1124
1129
|
max: _
|
|
1125
1130
|
}, m.value = {
|
|
1126
|
-
ratio:
|
|
1131
|
+
ratio: Je,
|
|
1127
1132
|
thumbSize: b,
|
|
1128
1133
|
max: x
|
|
1129
1134
|
}, o > 0) {
|
|
@@ -1358,7 +1363,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1358
1363
|
"clear"
|
|
1359
1364
|
], ["update:modelValue"]),
|
|
1360
1365
|
setup(c, { expose: l, emit: d }) {
|
|
1361
|
-
let f = c, p = d, m = ref(), h = ref(), b = ref(), x = ref(!1), S = ref(!1), C = ref(),
|
|
1366
|
+
let f = c, p = d, m = ref(), h = ref(), b = ref(), x = ref(!1), S = ref(!1), C = ref(), Ye = ref(!1), T = ref({
|
|
1362
1367
|
top: "0px",
|
|
1363
1368
|
left: "0px",
|
|
1364
1369
|
width: "0px",
|
|
@@ -1438,9 +1443,9 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1438
1443
|
A.value = "hour", M.value?.focus();
|
|
1439
1444
|
}, J = () => {
|
|
1440
1445
|
A.value = "minute", F.value?.focus();
|
|
1441
|
-
},
|
|
1446
|
+
}, Ze = () => {
|
|
1442
1447
|
f.disabled || (x.value = !0, S.value = !0, A.value || q());
|
|
1443
|
-
},
|
|
1448
|
+
}, Qe = (e) => {
|
|
1444
1449
|
e.preventDefault();
|
|
1445
1450
|
let t = e.target, n = e.data || "";
|
|
1446
1451
|
if (!/^\d$/.test(n)) {
|
|
@@ -1454,7 +1459,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1454
1459
|
t.textContent = i, Y("hour", i), I.length === 2 && nextTick(() => {
|
|
1455
1460
|
J();
|
|
1456
1461
|
});
|
|
1457
|
-
},
|
|
1462
|
+
}, $e = (e) => {
|
|
1458
1463
|
e.preventDefault();
|
|
1459
1464
|
let t = e.target, n = e.data || "";
|
|
1460
1465
|
if (!/^\d$/.test(n)) {
|
|
@@ -1477,35 +1482,35 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1477
1482
|
});
|
|
1478
1483
|
C.value && n && C.value.scrollTop(n.offsetTop);
|
|
1479
1484
|
}
|
|
1480
|
-
}, $e = () => {
|
|
1481
|
-
A.value = "hour", S.value = !0, I = "";
|
|
1482
1485
|
}, et = () => {
|
|
1486
|
+
A.value = "hour", S.value = !0, I = "";
|
|
1487
|
+
}, tt = () => {
|
|
1483
1488
|
A.value = null, S.value = !1, X();
|
|
1484
1489
|
}, X = () => {
|
|
1485
1490
|
console.log("autoFillTime", B.value), B.value = G(W(B.value || "")), console.log("autoFillTime", G(W(B.value || "")), W(B.value || ""));
|
|
1486
|
-
}, tt = () => {
|
|
1487
|
-
A.value = "minute", S.value = !0, L = "";
|
|
1488
1491
|
}, nt = () => {
|
|
1492
|
+
A.value = "minute", S.value = !0, L = "";
|
|
1493
|
+
}, rt = () => {
|
|
1489
1494
|
A.value = null, S.value = !1, X();
|
|
1490
|
-
}, rt = (e) => {
|
|
1491
|
-
e.key === "Tab" || e.key === "ArrowRight" ? (e.preventDefault(), J()) : e.key === "Enter" && (e.preventDefault(), x.value = !x.value);
|
|
1492
1495
|
}, it = (e) => {
|
|
1496
|
+
e.key === "Tab" || e.key === "ArrowRight" ? (e.preventDefault(), J()) : e.key === "Enter" && (e.preventDefault(), x.value = !x.value);
|
|
1497
|
+
}, at = (e) => {
|
|
1493
1498
|
e.key === "Tab" || e.key === "ArrowLeft" ? (e.preventDefault(), q()) : e.key === "Enter" && (e.preventDefault(), x.value = !x.value);
|
|
1494
1499
|
}, Z = () => {
|
|
1495
1500
|
B.value = "", p("change", ""), p("clear"), I = "", L = "", nextTick(() => {
|
|
1496
1501
|
q();
|
|
1497
1502
|
});
|
|
1498
|
-
},
|
|
1499
|
-
B.value = e, p("change", e), x.value = !1,
|
|
1503
|
+
}, ot = (e) => {
|
|
1504
|
+
B.value = e, p("change", e), x.value = !1, Ye.value = !0, A.value = null, nextTick(() => {
|
|
1500
1505
|
h.value?.focus();
|
|
1501
1506
|
});
|
|
1502
|
-
}, ot = () => {
|
|
1503
|
-
q();
|
|
1504
1507
|
}, st = () => {
|
|
1508
|
+
q();
|
|
1509
|
+
}, ct = () => {
|
|
1505
1510
|
M.value?.blur(), F.value?.blur(), A.value = null;
|
|
1506
|
-
}, Q = 0, $ = null,
|
|
1511
|
+
}, Q = 0, $ = null, lt = () => {
|
|
1507
1512
|
Q++, x.value = !0;
|
|
1508
|
-
},
|
|
1513
|
+
}, ut = () => {
|
|
1509
1514
|
$ && clearTimeout($);
|
|
1510
1515
|
let e = Q + 1;
|
|
1511
1516
|
Q = e, $ = setTimeout(() => {
|
|
@@ -1513,8 +1518,8 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1513
1518
|
}, 100);
|
|
1514
1519
|
};
|
|
1515
1520
|
return l({
|
|
1516
|
-
focus:
|
|
1517
|
-
blur:
|
|
1521
|
+
focus: st,
|
|
1522
|
+
blur: ct
|
|
1518
1523
|
}), (r, c) => (openBlock(), createElementBlock("div", { class: normalizeClass(["time-select", {
|
|
1519
1524
|
"time-select--disabled": f.disabled,
|
|
1520
1525
|
"time-select--border": f.border
|
|
@@ -1522,8 +1527,8 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1522
1527
|
ref_key: "inputWrapperRef",
|
|
1523
1528
|
ref: b,
|
|
1524
1529
|
class: "time-select__input-wrapper",
|
|
1525
|
-
onFocusin:
|
|
1526
|
-
onFocusout:
|
|
1530
|
+
onFocusin: lt,
|
|
1531
|
+
onFocusout: ut
|
|
1527
1532
|
}, [
|
|
1528
1533
|
f.prefixIcon ? (openBlock(), createElementBlock("div", _hoisted_1, c[0] ||= [createElementVNode("svg", {
|
|
1529
1534
|
class: "time-select__icon",
|
|
@@ -1537,17 +1542,17 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1537
1542
|
"time-select__input--disabled": f.disabled,
|
|
1538
1543
|
"time-select__input--readonly": !f.editable
|
|
1539
1544
|
}]),
|
|
1540
|
-
onClick:
|
|
1545
|
+
onClick: Ze
|
|
1541
1546
|
}, [
|
|
1542
1547
|
createElementVNode("div", {
|
|
1543
1548
|
ref_key: "hourRef",
|
|
1544
1549
|
ref: M,
|
|
1545
1550
|
class: normalizeClass(["time-select__time-part time-select__hour", { "time-select__time-part--selected": A.value === "hour" }]),
|
|
1546
1551
|
contenteditable: f.editable && !f.disabled,
|
|
1547
|
-
onInput:
|
|
1548
|
-
onFocus:
|
|
1549
|
-
onBlur:
|
|
1550
|
-
onKeydown:
|
|
1552
|
+
onInput: Qe,
|
|
1553
|
+
onFocus: et,
|
|
1554
|
+
onBlur: tt,
|
|
1555
|
+
onKeydown: it,
|
|
1551
1556
|
onClick: withModifiers(q, ["stop"])
|
|
1552
1557
|
}, toDisplayString(R.value), 43, _hoisted_2),
|
|
1553
1558
|
c[1] ||= createElementVNode("span", { class: "time-select__separator" }, ":", -1),
|
|
@@ -1556,10 +1561,10 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1556
1561
|
ref: F,
|
|
1557
1562
|
class: normalizeClass(["time-select__time-part time-select__minute", { "time-select__time-part--selected": A.value === "minute" }]),
|
|
1558
1563
|
contenteditable: f.editable && !f.disabled,
|
|
1559
|
-
onInput:
|
|
1560
|
-
onFocus:
|
|
1561
|
-
onBlur:
|
|
1562
|
-
onKeydown:
|
|
1564
|
+
onInput: $e,
|
|
1565
|
+
onFocus: nt,
|
|
1566
|
+
onBlur: rt,
|
|
1567
|
+
onKeydown: at,
|
|
1563
1568
|
onClick: withModifiers(J, ["stop"])
|
|
1564
1569
|
}, toDisplayString(z.value), 43, _hoisted_3)
|
|
1565
1570
|
], 2),
|
|
@@ -1593,7 +1598,7 @@ var LazyLoader_default = /* @__PURE__ */ defineComponent({
|
|
|
1593
1598
|
key: e,
|
|
1594
1599
|
class: normalizeClass(["time-select__option", { "time-select__option--selected": e === G(W(B.value)) }]),
|
|
1595
1600
|
"data-value": e,
|
|
1596
|
-
onClick: (t) =>
|
|
1601
|
+
onClick: (t) => ot(e)
|
|
1597
1602
|
}, toDisplayString(e), 11, _hoisted_4))), 128))]),
|
|
1598
1603
|
_: 1
|
|
1599
1604
|
}, 8, ["size"])], 6)) : createCommentVNode("", !0)]),
|