@cyberpunk-vue/components 1.9.24 → 1.10.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/dialog/index.d.ts +61 -0
- package/dist/dialog/src/dialog.d.ts +32 -0
- package/dist/dialog/src/dialog.vue.d.ts +37 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +165 -97
- package/dist/menu/index.d.ts +15 -0
- package/dist/menu/src/menu.d.ts +14 -0
- package/dist/menu/src/menu.vue.d.ts +9 -0
- package/dist/menu-nav/index.d.ts +9 -0
- package/dist/menu-nav/src/menu-nav.d.ts +9 -1
- package/dist/menu-nav/src/menu-nav.vue.d.ts +9 -0
- package/dist/segmented/index.d.ts +15 -4
- package/dist/segmented/src/segmented.d.ts +17 -2
- package/dist/segmented/src/segmented.vue.d.ts +15 -4
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -5107,6 +5107,26 @@ var ae = {
|
|
|
5107
5107
|
type: [String, Object],
|
|
5108
5108
|
default: void 0
|
|
5109
5109
|
},
|
|
5110
|
+
loading: {
|
|
5111
|
+
type: Boolean,
|
|
5112
|
+
default: !1
|
|
5113
|
+
},
|
|
5114
|
+
loadingText: {
|
|
5115
|
+
type: String,
|
|
5116
|
+
default: "加载中..."
|
|
5117
|
+
},
|
|
5118
|
+
loadingClass: {
|
|
5119
|
+
type: [
|
|
5120
|
+
String,
|
|
5121
|
+
Object,
|
|
5122
|
+
Array
|
|
5123
|
+
],
|
|
5124
|
+
default: void 0
|
|
5125
|
+
},
|
|
5126
|
+
loadingStyle: {
|
|
5127
|
+
type: [String, Object],
|
|
5128
|
+
default: void 0
|
|
5129
|
+
},
|
|
5110
5130
|
zIndex: {
|
|
5111
5131
|
type: Number,
|
|
5112
5132
|
default: 2e3
|
|
@@ -5204,6 +5224,7 @@ var ae = {
|
|
|
5204
5224
|
D.is("center", m.center),
|
|
5205
5225
|
D.is("draggable", m.draggable),
|
|
5206
5226
|
D.is("dragging", K.value),
|
|
5227
|
+
D.is("loading", m.loading),
|
|
5207
5228
|
D.is("shaking", I.value),
|
|
5208
5229
|
m.dialogClass
|
|
5209
5230
|
]), ce = r(() => [
|
|
@@ -5221,52 +5242,52 @@ var ae = {
|
|
|
5221
5242
|
D.e("overlay"),
|
|
5222
5243
|
m.overlayClass,
|
|
5223
5244
|
m.modalClass
|
|
5224
|
-
]), fe = r(() => m.title || w.header || w.title || m.showClose),
|
|
5245
|
+
]), fe = r(() => [D.e("loading-overlay"), m.loadingClass]), pe = r(() => m.title || w.header || w.title || m.showClose), me = r(() => !!w.footer || m.showConfirmButton || m.showCancelButton), ge = r(() => m.type && m.type !== "default" ? m.type : "primary"), _e = r(() => m.color || ""), ve = r(() => {
|
|
5225
5246
|
if (m.beforeClose) return m.beforeClose;
|
|
5226
5247
|
let e = E["before-close"] ?? E.beforeClose;
|
|
5227
5248
|
return typeof e == "function" ? e : void 0;
|
|
5228
|
-
}),
|
|
5249
|
+
}), ye = () => {
|
|
5229
5250
|
k.value = !1;
|
|
5230
|
-
},
|
|
5251
|
+
}, be = () => {
|
|
5231
5252
|
let e = (e) => {
|
|
5232
|
-
e ||
|
|
5253
|
+
e || ye();
|
|
5233
5254
|
};
|
|
5234
|
-
|
|
5235
|
-
}, ye = () => {
|
|
5236
|
-
m.closeOnClickModal ? ve() : W();
|
|
5237
|
-
}, be = () => {
|
|
5238
|
-
h("confirm"), ve();
|
|
5255
|
+
ve.value ? ve.value(e) : e();
|
|
5239
5256
|
}, xe = () => {
|
|
5240
|
-
|
|
5241
|
-
}, Se = (
|
|
5242
|
-
|
|
5243
|
-
}, we = (
|
|
5257
|
+
m.closeOnClickModal ? be() : W();
|
|
5258
|
+
}, Se = () => {
|
|
5259
|
+
h("confirm"), be();
|
|
5260
|
+
}, we = () => {
|
|
5261
|
+
h("cancel"), be();
|
|
5262
|
+
}, Te = (e) => {
|
|
5263
|
+
e.key === "Escape" && k.value && (m.closeOnEscape ? be() : W());
|
|
5264
|
+
}, Ee = (e) => {
|
|
5244
5265
|
e.stopPropagation();
|
|
5245
|
-
},
|
|
5266
|
+
}, De = () => {
|
|
5246
5267
|
h("opened");
|
|
5247
|
-
},
|
|
5248
|
-
h("closed"),
|
|
5249
|
-
},
|
|
5250
|
-
m.lockScroll && (
|
|
5251
|
-
},
|
|
5252
|
-
m.lockScroll && (document.body.style.overflow =
|
|
5268
|
+
}, Oe = () => {
|
|
5269
|
+
h("closed"), je(), m.destroyOnClose && (A.value = !1);
|
|
5270
|
+
}, ke = "", Ae = () => {
|
|
5271
|
+
m.lockScroll && (ke = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
5272
|
+
}, je = () => {
|
|
5273
|
+
m.lockScroll && (document.body.style.overflow = ke);
|
|
5253
5274
|
};
|
|
5254
5275
|
return R(() => m.modelValue, (e) => {
|
|
5255
5276
|
e ? (A.value = !0, k.value = !0, h("open"), _(() => {
|
|
5256
|
-
Z(),
|
|
5257
|
-
})) : k.value &&
|
|
5277
|
+
Z(), Ae(), document.addEventListener("keydown", Te), m.draggable && window.addEventListener("resize", Q);
|
|
5278
|
+
})) : k.value && ye();
|
|
5258
5279
|
}), R(k, (e) => {
|
|
5259
|
-
!e && m.modelValue && (h("close"), h("update:modelValue", !1), document.removeEventListener("keydown",
|
|
5280
|
+
!e && m.modelValue && (h("close"), h("update:modelValue", !1), document.removeEventListener("keydown", Te), window.removeEventListener("resize", Q));
|
|
5260
5281
|
}), R(() => m.fullscreen, (e) => {
|
|
5261
5282
|
z.value && (e ? (J = z.value.style.transform, z.value.style.transform = "") : z.value.style.transform = J);
|
|
5262
5283
|
}), x(() => {
|
|
5263
5284
|
m.modelValue && (A.value = !0, k.value = !0, _(() => {
|
|
5264
|
-
|
|
5285
|
+
Ae(), document.addEventListener("keydown", Te), m.draggable && window.addEventListener("resize", Q);
|
|
5265
5286
|
}));
|
|
5266
5287
|
}), b(() => {
|
|
5267
|
-
|
|
5288
|
+
je(), document.removeEventListener("keydown", Te), window.removeEventListener("resize", Q);
|
|
5268
5289
|
}), c({
|
|
5269
|
-
close:
|
|
5290
|
+
close: be,
|
|
5270
5291
|
resetPosition: Z,
|
|
5271
5292
|
visible: k
|
|
5272
5293
|
}), (e, r) => (S(), i(t, {
|
|
@@ -5274,17 +5295,17 @@ var ae = {
|
|
|
5274
5295
|
disabled: !e.appendToBody
|
|
5275
5296
|
}, [u(n, {
|
|
5276
5297
|
name: N(D).namespace + "-dialog-fade",
|
|
5277
|
-
onAfterEnter:
|
|
5278
|
-
onAfterLeave:
|
|
5298
|
+
onAfterEnter: De,
|
|
5299
|
+
onAfterLeave: Oe
|
|
5279
5300
|
}, {
|
|
5280
5301
|
default: B(() => [(e.destroyOnClose ? k.value : A.value || k.value) ? V((S(), o("div", {
|
|
5281
5302
|
key: 0,
|
|
5282
5303
|
class: v(de.value),
|
|
5283
5304
|
style: y(ae.value),
|
|
5284
|
-
onClick: U(
|
|
5305
|
+
onClick: U(xe, ["self"])
|
|
5285
5306
|
}, [s("div", {
|
|
5286
5307
|
class: v(oe.value),
|
|
5287
|
-
onClick: U(
|
|
5308
|
+
onClick: U(xe, ["self"])
|
|
5288
5309
|
}, [s("div", g({
|
|
5289
5310
|
ref_key: "panelRef",
|
|
5290
5311
|
ref: z
|
|
@@ -5293,7 +5314,7 @@ var ae = {
|
|
|
5293
5314
|
style: ie.value,
|
|
5294
5315
|
role: "dialog",
|
|
5295
5316
|
"aria-modal": "true",
|
|
5296
|
-
onClick:
|
|
5317
|
+
onClick: Ee,
|
|
5297
5318
|
onAnimationend: G
|
|
5298
5319
|
}), [
|
|
5299
5320
|
s("div", { class: v(N(D).e("decor")) }, null, 2),
|
|
@@ -5301,7 +5322,7 @@ var ae = {
|
|
|
5301
5322
|
key: 0,
|
|
5302
5323
|
class: v(N(D).e("cover"))
|
|
5303
5324
|
}, [O(e.$slots, "cover")], 2)) : a("", !0),
|
|
5304
|
-
|
|
5325
|
+
pe.value ? (S(), o("div", {
|
|
5305
5326
|
key: 1,
|
|
5306
5327
|
ref_key: "headerRef",
|
|
5307
5328
|
ref: H,
|
|
@@ -5318,7 +5339,7 @@ var ae = {
|
|
|
5318
5339
|
variant: "ghost",
|
|
5319
5340
|
size: "sm",
|
|
5320
5341
|
"aria-label": "Close",
|
|
5321
|
-
onClick:
|
|
5342
|
+
onClick: be
|
|
5322
5343
|
}, null, 8, [
|
|
5323
5344
|
"class",
|
|
5324
5345
|
"shape",
|
|
@@ -5329,26 +5350,26 @@ var ae = {
|
|
|
5329
5350
|
class: v(le.value),
|
|
5330
5351
|
style: y(e.bodyStyle)
|
|
5331
5352
|
}, [O(e.$slots, "default")], 6),
|
|
5332
|
-
|
|
5353
|
+
me.value ? (S(), o("div", {
|
|
5333
5354
|
key: 2,
|
|
5334
5355
|
class: v(ue.value),
|
|
5335
5356
|
style: y(e.footerStyle)
|
|
5336
5357
|
}, [O(e.$slots, "footer", {
|
|
5337
|
-
close:
|
|
5338
|
-
confirm:
|
|
5358
|
+
close: be,
|
|
5359
|
+
confirm: Se
|
|
5339
5360
|
}, () => [e.showCancelButton ? (S(), i(N(Ce), {
|
|
5340
5361
|
key: 0,
|
|
5341
5362
|
class: v(N(D).e("cancel-btn")),
|
|
5342
|
-
onClick:
|
|
5363
|
+
onClick: we
|
|
5343
5364
|
}, {
|
|
5344
5365
|
default: B(() => [l(j(e.cancelText || "取消"), 1)]),
|
|
5345
5366
|
_: 1
|
|
5346
5367
|
}, 8, ["class"])) : a("", !0), e.showConfirmButton ? (S(), i(N(Ce), {
|
|
5347
5368
|
key: 1,
|
|
5348
5369
|
class: v(N(D).e("confirm-btn")),
|
|
5349
|
-
type:
|
|
5350
|
-
color:
|
|
5351
|
-
onClick:
|
|
5370
|
+
type: ge.value,
|
|
5371
|
+
color: _e.value,
|
|
5372
|
+
onClick: Se
|
|
5352
5373
|
}, {
|
|
5353
5374
|
default: B(() => [l(j(e.confirmText || "确认"), 1)]),
|
|
5354
5375
|
_: 1
|
|
@@ -5356,7 +5377,18 @@ var ae = {
|
|
|
5356
5377
|
"class",
|
|
5357
5378
|
"type",
|
|
5358
5379
|
"color"
|
|
5359
|
-
])) : a("", !0)])], 6)) : a("", !0)
|
|
5380
|
+
])) : a("", !0)])], 6)) : a("", !0),
|
|
5381
|
+
u(n, { name: "cp-dialog-loading" }, {
|
|
5382
|
+
default: B(() => [e.loading ? (S(), o("div", {
|
|
5383
|
+
key: 0,
|
|
5384
|
+
class: v(fe.value),
|
|
5385
|
+
style: y(e.loadingStyle)
|
|
5386
|
+
}, [O(e.$slots, "loading", {}, () => [u(N(he), { color: ne.value || void 0 }, null, 8, ["color"]), e.loadingText ? (S(), o("span", {
|
|
5387
|
+
key: 0,
|
|
5388
|
+
class: v(N(D).e("loading-text"))
|
|
5389
|
+
}, j(e.loadingText), 3)) : a("", !0)])], 6)) : a("", !0)]),
|
|
5390
|
+
_: 3
|
|
5391
|
+
})
|
|
5360
5392
|
], 16)], 2)], 6)), [[L, k.value]]) : a("", !0)]),
|
|
5361
5393
|
_: 3
|
|
5362
5394
|
}, 8, ["name"])], 8, ["disabled"]));
|
|
@@ -5668,6 +5700,10 @@ var ae = {
|
|
|
5668
5700
|
type: String,
|
|
5669
5701
|
default: "solid"
|
|
5670
5702
|
},
|
|
5703
|
+
size: {
|
|
5704
|
+
type: [String, Number],
|
|
5705
|
+
default: "md"
|
|
5706
|
+
},
|
|
5671
5707
|
defaultActive: {
|
|
5672
5708
|
type: String,
|
|
5673
5709
|
default: ""
|
|
@@ -5706,77 +5742,87 @@ var ae = {
|
|
|
5706
5742
|
props: mr,
|
|
5707
5743
|
emits: hr,
|
|
5708
5744
|
setup(e, { emit: t }) {
|
|
5709
|
-
let n = e, i = t, a = Y("menu"), s = f()?.appContext.config.globalProperties.$router, c =
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
},
|
|
5745
|
+
let n = e, i = t, a = Y("menu"), s = f()?.appContext.config.globalProperties.$router, c = {
|
|
5746
|
+
sm: 13,
|
|
5747
|
+
md: 14,
|
|
5748
|
+
lg: 16
|
|
5749
|
+
}, l = T(n.defaultActive), u = T([]), d = T(new Set(n.defaultOpeneds)), p = T(new Set(n.defaultOpeneds)), m = T(!1), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), b = (e, t) => {
|
|
5714
5750
|
h.set(e, [...t]);
|
|
5715
|
-
},
|
|
5751
|
+
}, w = (e) => {
|
|
5716
5752
|
h.delete(e);
|
|
5753
|
+
}, E = (e, t) => {
|
|
5754
|
+
g.set(e, [...t]);
|
|
5717
5755
|
}, D = (e) => {
|
|
5718
|
-
|
|
5756
|
+
g.delete(e);
|
|
5757
|
+
}, k = (e) => {
|
|
5758
|
+
if (h.has(e)) return {
|
|
5719
5759
|
index: e,
|
|
5720
|
-
indexPath:
|
|
5760
|
+
indexPath: h.get(e)
|
|
5721
5761
|
};
|
|
5722
5762
|
let t = null;
|
|
5723
|
-
for (let [n, r] of
|
|
5763
|
+
for (let [n, r] of h) n !== "/" && (e.startsWith(n + "/") || e.startsWith(n + "?")) && (!t || n.length > t.index.length) && (t = {
|
|
5724
5764
|
index: n,
|
|
5725
5765
|
indexPath: r
|
|
5726
5766
|
});
|
|
5727
5767
|
return t;
|
|
5728
|
-
},
|
|
5768
|
+
}, A = (e) => {
|
|
5729
5769
|
if (!e) return;
|
|
5730
|
-
let t =
|
|
5770
|
+
let t = k(e);
|
|
5731
5771
|
if (t) {
|
|
5732
|
-
|
|
5733
|
-
let e = new Set(
|
|
5734
|
-
for (let n of t.indexPath) n !== t.index &&
|
|
5735
|
-
|
|
5772
|
+
l.value = t.index, u.value = t.indexPath;
|
|
5773
|
+
let e = new Set(d.value);
|
|
5774
|
+
for (let n of t.indexPath) n !== t.index && g.has(n) && e.add(n);
|
|
5775
|
+
d.value = e, n.collapse || (p.value = new Set(e));
|
|
5736
5776
|
}
|
|
5737
5777
|
};
|
|
5738
5778
|
R(() => n.defaultActive, (e) => {
|
|
5739
|
-
|
|
5779
|
+
A(e);
|
|
5740
5780
|
}), R(() => n.collapse, (e) => {
|
|
5741
|
-
e ? (
|
|
5742
|
-
|
|
5743
|
-
}, 350)) :
|
|
5781
|
+
e ? (m.value = !0, p.value = new Set(d.value), d.value = /* @__PURE__ */ new Set(), setTimeout(() => {
|
|
5782
|
+
m.value = !1;
|
|
5783
|
+
}, 350)) : d.value = new Set(p.value);
|
|
5744
5784
|
}, { flush: "sync" });
|
|
5745
|
-
let
|
|
5746
|
-
n.router || (
|
|
5747
|
-
}, j = (e, t) => {
|
|
5748
|
-
let r = new Set(u.value);
|
|
5749
|
-
r.has(e) || (n.uniqueOpened && r.clear(), r.add(e), u.value = r, i("open", e, t), n.collapse || (d.value = new Set(r)));
|
|
5785
|
+
let j = (e, t) => {
|
|
5786
|
+
n.router || (l.value = e, u.value = t), i("select", e, t);
|
|
5750
5787
|
}, N = (e, t) => {
|
|
5751
|
-
let r = new Set(
|
|
5752
|
-
r.has(e) && (r.
|
|
5788
|
+
let r = new Set(d.value);
|
|
5789
|
+
r.has(e) || (n.uniqueOpened && r.clear(), r.add(e), d.value = r, i("open", e, t), n.collapse || (p.value = new Set(r)));
|
|
5753
5790
|
}, P = (e, t) => {
|
|
5754
|
-
|
|
5791
|
+
let r = new Set(d.value);
|
|
5792
|
+
r.has(e) && (r.delete(e), d.value = r, i("close", e, t), n.collapse || (p.value = new Set(r)));
|
|
5793
|
+
}, F = (e, t) => {
|
|
5794
|
+
d.value.has(e) ? P(e, t) : N(e, t);
|
|
5755
5795
|
};
|
|
5756
5796
|
x(() => {
|
|
5757
5797
|
_(() => {
|
|
5758
|
-
|
|
5798
|
+
A(l.value);
|
|
5759
5799
|
}), n.router && s && R(() => s.currentRoute.value.path, (e) => {
|
|
5760
|
-
|
|
5800
|
+
A(e);
|
|
5761
5801
|
});
|
|
5762
5802
|
});
|
|
5763
|
-
let
|
|
5803
|
+
let I = 0, L = () => `__cp_auto_${++I}`, z = r(() => [
|
|
5764
5804
|
a.b(),
|
|
5765
5805
|
a.m(n.mode),
|
|
5766
5806
|
a.m(`shape-${n.shape}`),
|
|
5767
5807
|
a.m(n.variant),
|
|
5808
|
+
W(n.size) && a.m(n.size),
|
|
5768
5809
|
a.is("collapse", n.collapse && n.mode === "vertical"),
|
|
5810
|
+
a.is("custom-size", !W(n.size)),
|
|
5769
5811
|
n.type === "default" ? "" : a.m(n.type),
|
|
5770
5812
|
n.color ? a.is("custom-color") : ""
|
|
5771
|
-
]),
|
|
5813
|
+
]), B = r(() => {
|
|
5772
5814
|
let e = {};
|
|
5815
|
+
if (!W(n.size)) {
|
|
5816
|
+
let t = K(n.size, c);
|
|
5817
|
+
e["--cp-menu-font-size"] = t, e["--cp-menu-item-height"] = `calc(${t} * 3.25)`, e["--cp-menu-icon-size"] = `calc(${t} * 1.15)`, e["--cp-menu-group-title-font-size"] = `calc(${t} * 0.8)`;
|
|
5818
|
+
}
|
|
5773
5819
|
return n.color && (e["--cp-menu-active-color"] = n.color, e["--cp-menu-active-color-light"] = `color-mix(in srgb, ${n.color} 20%, transparent)`), e;
|
|
5774
5820
|
});
|
|
5775
5821
|
return C(gr, {
|
|
5776
|
-
generateIndex:
|
|
5777
|
-
activeIndex:
|
|
5778
|
-
activeIndexPath:
|
|
5779
|
-
openedMenus:
|
|
5822
|
+
generateIndex: L,
|
|
5823
|
+
activeIndex: l,
|
|
5824
|
+
activeIndexPath: u,
|
|
5825
|
+
openedMenus: d,
|
|
5780
5826
|
mode: n.mode,
|
|
5781
5827
|
collapse: M(n, "collapse"),
|
|
5782
5828
|
type: n.type,
|
|
@@ -5784,18 +5830,18 @@ var ae = {
|
|
|
5784
5830
|
variant: n.variant,
|
|
5785
5831
|
router: n.router,
|
|
5786
5832
|
color: n.color,
|
|
5787
|
-
handleSelect:
|
|
5788
|
-
handleSubMenuClick:
|
|
5789
|
-
openMenu:
|
|
5790
|
-
closeMenu:
|
|
5791
|
-
addItem:
|
|
5792
|
-
removeItem:
|
|
5793
|
-
addSubMenu:
|
|
5794
|
-
removeSubMenu:
|
|
5795
|
-
suppressTransition:
|
|
5833
|
+
handleSelect: j,
|
|
5834
|
+
handleSubMenuClick: F,
|
|
5835
|
+
openMenu: N,
|
|
5836
|
+
closeMenu: P,
|
|
5837
|
+
addItem: b,
|
|
5838
|
+
removeItem: w,
|
|
5839
|
+
addSubMenu: E,
|
|
5840
|
+
removeSubMenu: D,
|
|
5841
|
+
suppressTransition: m
|
|
5796
5842
|
}), (e, t) => (S(), o("ul", {
|
|
5797
|
-
class: v(
|
|
5798
|
-
style: y(
|
|
5843
|
+
class: v(z.value),
|
|
5844
|
+
style: y(B.value),
|
|
5799
5845
|
role: "menubar"
|
|
5800
5846
|
}, [O(e.$slots, "default")], 6));
|
|
5801
5847
|
}
|
|
@@ -6475,6 +6521,10 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6475
6521
|
type: String,
|
|
6476
6522
|
default: "vertical"
|
|
6477
6523
|
},
|
|
6524
|
+
size: {
|
|
6525
|
+
type: [String, Number],
|
|
6526
|
+
default: "md"
|
|
6527
|
+
},
|
|
6478
6528
|
defaultActive: {
|
|
6479
6529
|
type: String,
|
|
6480
6530
|
default: ""
|
|
@@ -6530,6 +6580,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6530
6580
|
}, d = (e) => !!e.group;
|
|
6531
6581
|
return (t, n) => (S(), i(N(vr), {
|
|
6532
6582
|
mode: t.mode,
|
|
6583
|
+
size: t.size,
|
|
6533
6584
|
"default-active": t.defaultActive,
|
|
6534
6585
|
"default-openeds": t.defaultOpeneds,
|
|
6535
6586
|
"unique-opened": t.uniqueOpened,
|
|
@@ -6607,6 +6658,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6607
6658
|
_: 1
|
|
6608
6659
|
}, 8, [
|
|
6609
6660
|
"mode",
|
|
6661
|
+
"size",
|
|
6610
6662
|
"default-active",
|
|
6611
6663
|
"default-openeds",
|
|
6612
6664
|
"unique-opened",
|
|
@@ -7048,10 +7100,15 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7048
7100
|
block: {
|
|
7049
7101
|
type: Boolean,
|
|
7050
7102
|
default: !1
|
|
7103
|
+
},
|
|
7104
|
+
clearable: {
|
|
7105
|
+
type: Boolean,
|
|
7106
|
+
default: !1
|
|
7051
7107
|
}
|
|
7052
7108
|
}, ci = {
|
|
7053
|
-
"update:modelValue": (e) => typeof e == "string" || typeof e == "number",
|
|
7054
|
-
change: (e) => typeof e == "string" || typeof e == "number"
|
|
7109
|
+
"update:modelValue": (e) => e === void 0 || typeof e == "string" || typeof e == "number",
|
|
7110
|
+
change: (e) => e === void 0 || typeof e == "string" || typeof e == "number",
|
|
7111
|
+
clear: () => !0
|
|
7055
7112
|
}, li = [
|
|
7056
7113
|
"disabled",
|
|
7057
7114
|
"aria-checked",
|
|
@@ -7080,7 +7137,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7080
7137
|
let t = w.value[e];
|
|
7081
7138
|
E.value = {
|
|
7082
7139
|
width: `${t.offsetWidth}px`,
|
|
7083
|
-
transform: `translateX(calc(${t.offsetLeft}px + var(--cp-segmented-indicator-offset,
|
|
7140
|
+
transform: `translateX(calc(${t.offsetLeft}px + var(--cp-segmented-indicator-offset, 0px)))`,
|
|
7084
7141
|
opacity: "1"
|
|
7085
7142
|
};
|
|
7086
7143
|
};
|
|
@@ -7106,9 +7163,19 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7106
7163
|
]), F = r(() => {
|
|
7107
7164
|
let e = {};
|
|
7108
7165
|
return l.color && (e["--cp-segmented-color"] = l.color, e["--cp-segmented-color-light"] = `${l.color}25`), W(l.size) || (e["--cp-segmented-height"] = K(l.size, h)), e;
|
|
7109
|
-
}), I = (
|
|
7110
|
-
p.value ||
|
|
7111
|
-
}, L = (e) =>
|
|
7166
|
+
}), I = () => {
|
|
7167
|
+
p.value || l.modelValue === void 0 || (u("update:modelValue", void 0), u("change", void 0), u("clear"));
|
|
7168
|
+
}, L = (e) => {
|
|
7169
|
+
if (!(p.value || e.disabled)) {
|
|
7170
|
+
if (e.value === l.modelValue) {
|
|
7171
|
+
l.clearable && I();
|
|
7172
|
+
return;
|
|
7173
|
+
}
|
|
7174
|
+
u("update:modelValue", e.value), u("change", e.value);
|
|
7175
|
+
}
|
|
7176
|
+
}, z = (e) => {
|
|
7177
|
+
e.key === "Escape" && (!l.clearable || p.value || l.modelValue !== void 0 && (e.preventDefault(), I()));
|
|
7178
|
+
}, B = (e) => [
|
|
7112
7179
|
d.e("item"),
|
|
7113
7180
|
d.is("active", e.value === l.modelValue),
|
|
7114
7181
|
d.is("disabled", !!e.disabled)
|
|
@@ -7118,7 +7185,8 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7118
7185
|
ref: C,
|
|
7119
7186
|
class: v(P.value),
|
|
7120
7187
|
style: y(F.value),
|
|
7121
|
-
role: "radiogroup"
|
|
7188
|
+
role: "radiogroup",
|
|
7189
|
+
onKeydown: z
|
|
7122
7190
|
}, [s("div", {
|
|
7123
7191
|
class: v(N(d).e("indicator")),
|
|
7124
7192
|
style: y(E.value)
|
|
@@ -7126,16 +7194,16 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7126
7194
|
key: e.value,
|
|
7127
7195
|
ref_for: !0,
|
|
7128
7196
|
ref: (e) => O(e, n),
|
|
7129
|
-
class: v(
|
|
7197
|
+
class: v(B(e)),
|
|
7130
7198
|
disabled: p.value || e.disabled,
|
|
7131
7199
|
type: "button",
|
|
7132
7200
|
role: "radio",
|
|
7133
7201
|
"aria-checked": e.value === t.modelValue,
|
|
7134
|
-
onClick: (t) =>
|
|
7202
|
+
onClick: (t) => L(e)
|
|
7135
7203
|
}, [e.icon ? (S(), i(A(e.icon), {
|
|
7136
7204
|
key: 0,
|
|
7137
7205
|
class: v(N(d).e("item-icon"))
|
|
7138
|
-
}, null, 8, ["class"])) : a("", !0), s("span", { class: v(N(d).e("item-label")) }, j(e.label), 3)], 10, li))), 128))],
|
|
7206
|
+
}, null, 8, ["class"])) : a("", !0), s("span", { class: v(N(d).e("item-label")) }, j(e.label), 3)], 10, li))), 128))], 38));
|
|
7139
7207
|
}
|
|
7140
7208
|
})), di = {
|
|
7141
7209
|
data: {
|
package/dist/menu/index.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export declare const CpMenu: import('../utils').SFCWithInstall<{
|
|
|
27
27
|
readonly type: import('vue').PropType<import('.').MenuVariant>;
|
|
28
28
|
readonly default: "solid";
|
|
29
29
|
};
|
|
30
|
+
readonly size: {
|
|
31
|
+
readonly type: import('vue').PropType<import('.').MenuSize>;
|
|
32
|
+
readonly default: "md";
|
|
33
|
+
};
|
|
30
34
|
readonly defaultActive: {
|
|
31
35
|
readonly type: StringConstructor;
|
|
32
36
|
readonly default: "";
|
|
@@ -64,6 +68,7 @@ export declare const CpMenu: import('../utils').SFCWithInstall<{
|
|
|
64
68
|
close: (index: string, indexPath: string[]) => void;
|
|
65
69
|
open: (index: string, indexPath: string[]) => void;
|
|
66
70
|
}, import('vue').PublicProps, {
|
|
71
|
+
readonly size: import('@cyberpunk-vue/hooks').Size;
|
|
67
72
|
readonly mode: import('.').MenuMode;
|
|
68
73
|
readonly type: import('.').MenuType;
|
|
69
74
|
readonly color: string;
|
|
@@ -94,6 +99,10 @@ export declare const CpMenu: import('../utils').SFCWithInstall<{
|
|
|
94
99
|
readonly type: import('vue').PropType<import('.').MenuVariant>;
|
|
95
100
|
readonly default: "solid";
|
|
96
101
|
};
|
|
102
|
+
readonly size: {
|
|
103
|
+
readonly type: import('vue').PropType<import('.').MenuSize>;
|
|
104
|
+
readonly default: "md";
|
|
105
|
+
};
|
|
97
106
|
readonly defaultActive: {
|
|
98
107
|
readonly type: StringConstructor;
|
|
99
108
|
readonly default: "";
|
|
@@ -127,6 +136,7 @@ export declare const CpMenu: import('../utils').SFCWithInstall<{
|
|
|
127
136
|
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
128
137
|
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
129
138
|
}>, {}, {}, {}, {}, {
|
|
139
|
+
readonly size: import('@cyberpunk-vue/hooks').Size;
|
|
130
140
|
readonly mode: import('.').MenuMode;
|
|
131
141
|
readonly type: import('.').MenuType;
|
|
132
142
|
readonly color: string;
|
|
@@ -154,6 +164,10 @@ export declare const CpMenu: import('../utils').SFCWithInstall<{
|
|
|
154
164
|
readonly type: import('vue').PropType<import('.').MenuVariant>;
|
|
155
165
|
readonly default: "solid";
|
|
156
166
|
};
|
|
167
|
+
readonly size: {
|
|
168
|
+
readonly type: import('vue').PropType<import('.').MenuSize>;
|
|
169
|
+
readonly default: "md";
|
|
170
|
+
};
|
|
157
171
|
readonly defaultActive: {
|
|
158
172
|
readonly type: StringConstructor;
|
|
159
173
|
readonly default: "";
|
|
@@ -191,6 +205,7 @@ export declare const CpMenu: import('../utils').SFCWithInstall<{
|
|
|
191
205
|
close: (index: string, indexPath: string[]) => void;
|
|
192
206
|
open: (index: string, indexPath: string[]) => void;
|
|
193
207
|
}, string, {
|
|
208
|
+
readonly size: import('@cyberpunk-vue/hooks').Size;
|
|
194
209
|
readonly mode: import('.').MenuMode;
|
|
195
210
|
readonly type: import('.').MenuType;
|
|
196
211
|
readonly color: string;
|
package/dist/menu/src/menu.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
import { Size } from '@cyberpunk-vue/hooks';
|
|
2
3
|
/**
|
|
3
4
|
* Menu 颜色类型
|
|
4
5
|
*/
|
|
@@ -22,6 +23,7 @@ export type MenuShape = 'clip' | 'no-clip' | 'round' | 'circle';
|
|
|
22
23
|
* - `note` - 透明背景 + 发光条高亮(旧默认样式)
|
|
23
24
|
*/
|
|
24
25
|
export type MenuVariant = 'solid' | 'outline' | 'note';
|
|
26
|
+
export type MenuSize = Size;
|
|
25
27
|
/**
|
|
26
28
|
* CpMenu 组件 Props 定义
|
|
27
29
|
*
|
|
@@ -114,6 +116,18 @@ export declare const menuProps: {
|
|
|
114
116
|
readonly type: PropType<MenuVariant>;
|
|
115
117
|
readonly default: "solid";
|
|
116
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* 菜单尺寸
|
|
121
|
+
* - `sm` - 更紧凑的字号与行高
|
|
122
|
+
* - `md` - 默认尺寸
|
|
123
|
+
* - `lg` - 更大的字号与行高
|
|
124
|
+
* - 也支持数字 (px) 或带单位字符串 (如 '1rem')
|
|
125
|
+
* @default 'md'
|
|
126
|
+
*/
|
|
127
|
+
readonly size: {
|
|
128
|
+
readonly type: PropType<MenuSize>;
|
|
129
|
+
readonly default: "md";
|
|
130
|
+
};
|
|
117
131
|
/**
|
|
118
132
|
* 默认激活的菜单项 index。
|
|
119
133
|
* 支持前缀匹配:传入 `/model-specs/xxx` 会自动匹配 `index="/model-specs"` 的菜单项,
|
|
@@ -20,6 +20,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
20
20
|
readonly type: import('vue').PropType<import('./menu').MenuVariant>;
|
|
21
21
|
readonly default: "solid";
|
|
22
22
|
};
|
|
23
|
+
readonly size: {
|
|
24
|
+
readonly type: import('vue').PropType<import('./menu').MenuSize>;
|
|
25
|
+
readonly default: "md";
|
|
26
|
+
};
|
|
23
27
|
readonly defaultActive: {
|
|
24
28
|
readonly type: StringConstructor;
|
|
25
29
|
readonly default: "";
|
|
@@ -65,6 +69,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
65
69
|
readonly type: import('vue').PropType<import('./menu').MenuVariant>;
|
|
66
70
|
readonly default: "solid";
|
|
67
71
|
};
|
|
72
|
+
readonly size: {
|
|
73
|
+
readonly type: import('vue').PropType<import('./menu').MenuSize>;
|
|
74
|
+
readonly default: "md";
|
|
75
|
+
};
|
|
68
76
|
readonly defaultActive: {
|
|
69
77
|
readonly type: StringConstructor;
|
|
70
78
|
readonly default: "";
|
|
@@ -98,6 +106,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
98
106
|
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
99
107
|
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
100
108
|
}>, {
|
|
109
|
+
readonly size: import('@cyberpunk-vue/hooks').Size;
|
|
101
110
|
readonly mode: import('./menu').MenuMode;
|
|
102
111
|
readonly type: import('./menu').MenuType;
|
|
103
112
|
readonly color: string;
|
package/dist/menu-nav/index.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export declare const CpMenuNav: import('../utils').SFCWithInstall<import('vue').
|
|
|
19
19
|
readonly type: import('vue').PropType<import('..').MenuMode>;
|
|
20
20
|
readonly default: "vertical";
|
|
21
21
|
};
|
|
22
|
+
readonly size: {
|
|
23
|
+
readonly type: import('vue').PropType<import('..').MenuSize>;
|
|
24
|
+
readonly default: "md";
|
|
25
|
+
};
|
|
22
26
|
readonly defaultActive: {
|
|
23
27
|
readonly type: StringConstructor;
|
|
24
28
|
readonly default: "";
|
|
@@ -68,6 +72,10 @@ export declare const CpMenuNav: import('../utils').SFCWithInstall<import('vue').
|
|
|
68
72
|
readonly type: import('vue').PropType<import('..').MenuMode>;
|
|
69
73
|
readonly default: "vertical";
|
|
70
74
|
};
|
|
75
|
+
readonly size: {
|
|
76
|
+
readonly type: import('vue').PropType<import('..').MenuSize>;
|
|
77
|
+
readonly default: "md";
|
|
78
|
+
};
|
|
71
79
|
readonly defaultActive: {
|
|
72
80
|
readonly type: StringConstructor;
|
|
73
81
|
readonly default: "";
|
|
@@ -109,6 +117,7 @@ export declare const CpMenuNav: import('../utils').SFCWithInstall<import('vue').
|
|
|
109
117
|
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
110
118
|
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
111
119
|
}>, {
|
|
120
|
+
readonly size: import('@cyberpunk-vue/hooks').Size;
|
|
112
121
|
readonly mode: import('..').MenuMode;
|
|
113
122
|
readonly type: import('..').MenuType;
|
|
114
123
|
readonly color: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { IconValue } from '../../icon/src/icon';
|
|
3
|
-
import { MenuType, MenuMode, MenuShape, MenuVariant } from '../../menu/src/menu';
|
|
3
|
+
import { MenuType, MenuMode, MenuShape, MenuVariant, MenuSize } from '../../menu/src/menu';
|
|
4
4
|
/**
|
|
5
5
|
* 菜单项数据结构
|
|
6
6
|
*
|
|
@@ -68,6 +68,14 @@ export declare const menuNavProps: {
|
|
|
68
68
|
readonly type: PropType<MenuMode>;
|
|
69
69
|
readonly default: "vertical";
|
|
70
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* 菜单尺寸
|
|
73
|
+
* @default 'md'
|
|
74
|
+
*/
|
|
75
|
+
readonly size: {
|
|
76
|
+
readonly type: PropType<MenuSize>;
|
|
77
|
+
readonly default: "md";
|
|
78
|
+
};
|
|
71
79
|
/**
|
|
72
80
|
* 默认激活项 index
|
|
73
81
|
* @default ''
|