@kungal/ui-vue 2.3.1 → 2.4.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/CHANGELOG.md +33 -0
- package/dist/componentNames.d.ts +1 -1
- package/dist/componentNames.d.ts.map +1 -1
- package/dist/components/Shatter.vue.d.ts +52 -0
- package/dist/components/Shatter.vue.d.ts.map +1 -0
- package/dist/components/types.d.ts +55 -0
- package/dist/components/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +427 -110
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { addMonths as Fe, addYears as Ie, eachDayOfInterval as Le, endOfMonth as
|
|
|
7
7
|
import { enUS as Qe, ja as $e, zhCN as et } from "date-fns/locale";
|
|
8
8
|
import { Cropper as tt } from "vue-advanced-cropper";
|
|
9
9
|
//#region src/componentNames.ts
|
|
10
|
-
var nt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAutocomplete.KunAvatar.KunAvatarGroup.KunBadge.KunBrand.KunButton.KunCard.KunCarousel.KunCarouselItem.KunCheckBox.KunChip.KunContent.KunContextMenu.KunCopy.KunDatePicker.KunDivider.KunDrawer.KunDropdown.KunFadeCard.KunFileInput.KunHeader.KunIcon.KunImage.KunImageNative.KunInfo.KunInput.KunLightbox.KunLightboxGallery.KunLightboxGalleryItem.KunLink.KunLoading.KunLoli.KunLoliProvider.KunMarkdown.KunMessageProvider.KunModal.KunNull.KunNumberInput.KunPagination.KunPinInput.KunPopover.KunProgress.KunRadioGroup.KunRating.KunReaction.KunRipple.KunScrollShadow.KunSelect.KunSkeleton.KunSlider.KunSteps.KunSwitch.KunTab.KunTabPanel.KunTabPanels.KunTagInput.KunText.KunTextarea.KunTimeline.KunTimelineItem.KunTooltip.KunUpload.KunUserChip".split("."), rt = Symbol("kun-accordion"), it = /* @__PURE__ */ p({
|
|
10
|
+
var nt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAutocomplete.KunAvatar.KunAvatarGroup.KunBadge.KunBrand.KunButton.KunCard.KunCarousel.KunCarouselItem.KunCheckBox.KunChip.KunContent.KunContextMenu.KunCopy.KunDatePicker.KunDivider.KunDrawer.KunDropdown.KunFadeCard.KunFileInput.KunHeader.KunIcon.KunImage.KunImageNative.KunInfo.KunInput.KunLightbox.KunLightboxGallery.KunLightboxGalleryItem.KunLink.KunLoading.KunLoli.KunLoliProvider.KunMarkdown.KunMessageProvider.KunModal.KunNull.KunNumberInput.KunPagination.KunPinInput.KunPopover.KunProgress.KunRadioGroup.KunRating.KunReaction.KunRipple.KunScrollShadow.KunSelect.KunShatter.KunSkeleton.KunSlider.KunSteps.KunSwitch.KunTab.KunTabPanel.KunTabPanels.KunTagInput.KunText.KunTextarea.KunTimeline.KunTimelineItem.KunTooltip.KunUpload.KunUserChip".split("."), rt = Symbol("kun-accordion"), it = /* @__PURE__ */ p({
|
|
11
11
|
name: "KunAccordion",
|
|
12
12
|
__name: "Accordion",
|
|
13
13
|
props: /*@__PURE__*/ g({
|
|
@@ -5391,7 +5391,323 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5391
5391
|
e.error ? (T(), l("p", js, M(e.error), 1)) : e.description ? (T(), l("p", Ms, M(e.description), 1)) : c("", !0)
|
|
5392
5392
|
], 2));
|
|
5393
5393
|
}
|
|
5394
|
-
}), Ps =
|
|
5394
|
+
}), Ps = /* @__PURE__ */ p({
|
|
5395
|
+
name: "KunShatter",
|
|
5396
|
+
__name: "Shatter",
|
|
5397
|
+
props: /*@__PURE__*/ g({
|
|
5398
|
+
trigger: { default: "manual" },
|
|
5399
|
+
pieces: { default: 24 },
|
|
5400
|
+
duration: { default: 1100 },
|
|
5401
|
+
origin: { default: "center" },
|
|
5402
|
+
spread: { default: 1 },
|
|
5403
|
+
gravity: { default: 1 },
|
|
5404
|
+
rotation: { default: 140 },
|
|
5405
|
+
fade: {
|
|
5406
|
+
type: Boolean,
|
|
5407
|
+
default: !0
|
|
5408
|
+
},
|
|
5409
|
+
easing: { default: "linear" },
|
|
5410
|
+
seed: {},
|
|
5411
|
+
reassemble: {
|
|
5412
|
+
type: Boolean,
|
|
5413
|
+
default: !0
|
|
5414
|
+
},
|
|
5415
|
+
autoRestore: { default: 0 },
|
|
5416
|
+
keepSpace: {
|
|
5417
|
+
type: Boolean,
|
|
5418
|
+
default: !1
|
|
5419
|
+
},
|
|
5420
|
+
disabled: {
|
|
5421
|
+
type: Boolean,
|
|
5422
|
+
default: !1
|
|
5423
|
+
},
|
|
5424
|
+
disableAnimation: {
|
|
5425
|
+
type: Boolean,
|
|
5426
|
+
default: !1
|
|
5427
|
+
},
|
|
5428
|
+
zIndex: { default: 9999 },
|
|
5429
|
+
className: { default: "" }
|
|
5430
|
+
}, {
|
|
5431
|
+
shattered: {
|
|
5432
|
+
type: Boolean,
|
|
5433
|
+
default: !1
|
|
5434
|
+
},
|
|
5435
|
+
shatteredModifiers: {}
|
|
5436
|
+
}),
|
|
5437
|
+
emits: /*@__PURE__*/ g([
|
|
5438
|
+
"shatterStart",
|
|
5439
|
+
"shatterEnd",
|
|
5440
|
+
"restoreEnd"
|
|
5441
|
+
], ["update:shattered"]),
|
|
5442
|
+
setup(e, { expose: t, emit: n }) {
|
|
5443
|
+
let r = e, i = z(e, "shattered"), a = n, o = O(null), s = Te("(prefers-reduced-motion: reduce)"), c = O("idle"), u = null, d = [], f = null, p = {
|
|
5444
|
+
x: 0,
|
|
5445
|
+
y: 0,
|
|
5446
|
+
set: !1
|
|
5447
|
+
}, m = null, h = (e) => {
|
|
5448
|
+
e.style.visibility = "", r.keepSpace ? e.style.visibility = "hidden" : e.style.display = "none";
|
|
5449
|
+
}, g = (e) => {
|
|
5450
|
+
e.style.visibility = "", e.style.display = "";
|
|
5451
|
+
}, _ = (e, t, n) => e < t ? t : e > n ? n : e;
|
|
5452
|
+
function v(e) {
|
|
5453
|
+
return () => {
|
|
5454
|
+
e |= 0, e = e + 1831565813 | 0;
|
|
5455
|
+
let t = Math.imul(e ^ e >>> 15, 1 | e);
|
|
5456
|
+
return t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t, ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
5457
|
+
};
|
|
5458
|
+
}
|
|
5459
|
+
function b(e, t, n, r, i, a) {
|
|
5460
|
+
let o = [], s = Math.hypot(e, t), c = Math.round(n * .68);
|
|
5461
|
+
for (let n = 0; n < c; n++) {
|
|
5462
|
+
let n = r() * Math.PI * 2, c = s * .55 * r() ** 1.7;
|
|
5463
|
+
o.push([_(i + Math.cos(n) * c, 0, e), _(a + Math.sin(n) * c, 0, t)]);
|
|
5464
|
+
}
|
|
5465
|
+
for (let i = c; i < n; i++) o.push([r() * e, r() * t]);
|
|
5466
|
+
return o.map(([e, t]) => [e + (r() - .5) * .5, t + (r() - .5) * .5]);
|
|
5467
|
+
}
|
|
5468
|
+
function C(e, t, n) {
|
|
5469
|
+
let r = (t[0] + n[0]) / 2, i = (t[1] + n[1]) / 2, a = n[0] - t[0], o = n[1] - t[1], s = (e) => (e[0] - r) * a + (e[1] - i) * o, c = [];
|
|
5470
|
+
for (let t = 0; t < e.length; t++) {
|
|
5471
|
+
let n = e[t], r = e[(t + 1) % e.length];
|
|
5472
|
+
if (!n || !r) continue;
|
|
5473
|
+
let i = s(n), a = s(r);
|
|
5474
|
+
if (i <= 0 && c.push(n), i < 0 && a > 0 || i > 0 && a < 0) {
|
|
5475
|
+
let e = i / (i - a);
|
|
5476
|
+
c.push([n[0] + e * (r[0] - n[0]), n[1] + e * (r[1] - n[1])]);
|
|
5477
|
+
}
|
|
5478
|
+
}
|
|
5479
|
+
return c;
|
|
5480
|
+
}
|
|
5481
|
+
function w(e, t, n) {
|
|
5482
|
+
let r = [];
|
|
5483
|
+
for (let i = 0; i < e.length; i++) {
|
|
5484
|
+
let a = e[i];
|
|
5485
|
+
if (!a) continue;
|
|
5486
|
+
let o = [
|
|
5487
|
+
[0, 0],
|
|
5488
|
+
[t, 0],
|
|
5489
|
+
[t, n],
|
|
5490
|
+
[0, n]
|
|
5491
|
+
];
|
|
5492
|
+
for (let t = 0; t < e.length && o.length >= 3; t++) {
|
|
5493
|
+
let n = e[t];
|
|
5494
|
+
i !== t && n && (o = C(o, a, n));
|
|
5495
|
+
}
|
|
5496
|
+
o.length >= 3 && r.push(o);
|
|
5497
|
+
}
|
|
5498
|
+
return r;
|
|
5499
|
+
}
|
|
5500
|
+
function E(e, t) {
|
|
5501
|
+
let n = r.origin;
|
|
5502
|
+
return n === "top" ? [e / 2, 0] : n === "pointer" ? p.set ? [_(p.x, 0, e), _(p.y, 0, t)] : [e / 2, t / 2] : n && typeof n == "object" ? [_(n.x, 0, e), _(n.y, 0, t)] : [e / 2, t / 2];
|
|
5503
|
+
}
|
|
5504
|
+
function D(e, t, n, i, a, o) {
|
|
5505
|
+
let s = v(n || 1), c = w(b(e, t, _(Math.round(r.pieces), 2, 160), s, i, a), e, t), l = r.spread * Math.hypot(e, t) * .5, u = Math.max(1, Math.hypot(Math.max(i, e - i), Math.max(a, t - a))), d = [];
|
|
5506
|
+
for (let e of c) {
|
|
5507
|
+
let t = Infinity, n = Infinity, c = -Infinity, f = -Infinity, p = 0, m = 0;
|
|
5508
|
+
for (let [r, i] of e) r < t && (t = r), i < n && (n = i), r > c && (c = r), i > f && (f = i), p += r, m += i;
|
|
5509
|
+
p /= e.length, m /= e.length;
|
|
5510
|
+
let h = c - t, g = f - n;
|
|
5511
|
+
if (h < .5 || g < .5) continue;
|
|
5512
|
+
let _ = e.map(([e, r]) => `${(e - t).toFixed(2)}px ${(r - n).toFixed(2)}px`).join(","), v = p - i, y = m - a, b = Math.hypot(v, y);
|
|
5513
|
+
if (b < .01) {
|
|
5514
|
+
let e = s() * Math.PI * 2;
|
|
5515
|
+
v = Math.cos(e), y = Math.sin(e), b = 1;
|
|
5516
|
+
}
|
|
5517
|
+
v /= b, y /= b;
|
|
5518
|
+
let x = l * (.32 + s() * .55), S = v * x, C = y * x * .8, w = r.gravity * l * (.85 + s() * .5), T = (s() * 2 - 1) * r.rotation, E = .8 + s() * .16, D = .5 + s() * .18, O = b / u * Math.min(r.duration * .22, 120), k = S, A = C + w, j = [];
|
|
5519
|
+
for (let e = 0; e <= 16; e++) {
|
|
5520
|
+
let t = e / 16, n, i, a, s, c;
|
|
5521
|
+
if (o === "out") {
|
|
5522
|
+
let e = 1 - (1 - t) ** 1.7;
|
|
5523
|
+
n = S * e, i = C * e + w * t * t, a = T * t, s = 1 - (1 - E) * t, c = r.fade ? t < D ? 1 : Math.max(0, 1 - (t - D) / (1 - D)) : 1;
|
|
5524
|
+
} else {
|
|
5525
|
+
let e = 1 - (1 - t) ** 2, o = 1 - e;
|
|
5526
|
+
n = k * o, i = A * o, a = T * o, s = E + (1 - E) * e, c = r.fade ? Math.min(1, t / .4) : 1;
|
|
5527
|
+
}
|
|
5528
|
+
j.push({
|
|
5529
|
+
offset: +t.toFixed(4),
|
|
5530
|
+
transform: `translate3d(${n.toFixed(1)}px, ${i.toFixed(1)}px, 0) rotate(${a.toFixed(1)}deg) scale(${s.toFixed(3)})`,
|
|
5531
|
+
opacity: +c.toFixed(3),
|
|
5532
|
+
easing: "linear"
|
|
5533
|
+
});
|
|
5534
|
+
}
|
|
5535
|
+
d.push({
|
|
5536
|
+
minX: t,
|
|
5537
|
+
minY: n,
|
|
5538
|
+
bw: h,
|
|
5539
|
+
bh: g,
|
|
5540
|
+
clip: _,
|
|
5541
|
+
originX: p - t,
|
|
5542
|
+
originY: m - n,
|
|
5543
|
+
delay: O,
|
|
5544
|
+
kf: j
|
|
5545
|
+
});
|
|
5546
|
+
}
|
|
5547
|
+
return d;
|
|
5548
|
+
}
|
|
5549
|
+
function k(e, t) {
|
|
5550
|
+
let n = o.value;
|
|
5551
|
+
if (!n) return [];
|
|
5552
|
+
let i = e.width, a = e.height, s = n.cloneNode(!0);
|
|
5553
|
+
s.removeAttribute("id"), Object.assign(s.style, {
|
|
5554
|
+
margin: "0",
|
|
5555
|
+
inset: "auto",
|
|
5556
|
+
position: "static",
|
|
5557
|
+
transform: "none",
|
|
5558
|
+
display: "",
|
|
5559
|
+
visibility: "visible"
|
|
5560
|
+
});
|
|
5561
|
+
let c = document.createElement("div");
|
|
5562
|
+
Object.assign(c.style, {
|
|
5563
|
+
position: "absolute",
|
|
5564
|
+
left: `${e.left + window.scrollX}px`,
|
|
5565
|
+
top: `${e.top + window.scrollY}px`,
|
|
5566
|
+
width: `${i}px`,
|
|
5567
|
+
height: `${a}px`,
|
|
5568
|
+
pointerEvents: "none",
|
|
5569
|
+
overflow: "visible",
|
|
5570
|
+
contain: "layout",
|
|
5571
|
+
zIndex: String(r.zIndex)
|
|
5572
|
+
}), c.setAttribute("aria-hidden", "true");
|
|
5573
|
+
let l = document.createDocumentFragment(), d = [];
|
|
5574
|
+
for (let e of t) {
|
|
5575
|
+
let t = document.createElement("div");
|
|
5576
|
+
Object.assign(t.style, {
|
|
5577
|
+
position: "absolute",
|
|
5578
|
+
left: `${e.minX}px`,
|
|
5579
|
+
top: `${e.minY}px`,
|
|
5580
|
+
width: `${e.bw}px`,
|
|
5581
|
+
height: `${e.bh}px`,
|
|
5582
|
+
overflow: "hidden",
|
|
5583
|
+
clipPath: `polygon(${e.clip})`,
|
|
5584
|
+
transformOrigin: `${e.originX.toFixed(2)}px ${e.originY.toFixed(2)}px`,
|
|
5585
|
+
willChange: "transform, opacity",
|
|
5586
|
+
contain: "layout paint",
|
|
5587
|
+
backfaceVisibility: "hidden"
|
|
5588
|
+
});
|
|
5589
|
+
let n = s.cloneNode(!0);
|
|
5590
|
+
Object.assign(n.style, {
|
|
5591
|
+
position: "absolute",
|
|
5592
|
+
left: `${-e.minX}px`,
|
|
5593
|
+
top: `${-e.minY}px`,
|
|
5594
|
+
width: `${i}px`,
|
|
5595
|
+
height: `${a}px`,
|
|
5596
|
+
margin: "0"
|
|
5597
|
+
}), t.appendChild(n), l.appendChild(t), d.push({
|
|
5598
|
+
el: t,
|
|
5599
|
+
desc: e
|
|
5600
|
+
});
|
|
5601
|
+
}
|
|
5602
|
+
return c.appendChild(l), document.body.appendChild(c), u = c, d;
|
|
5603
|
+
}
|
|
5604
|
+
function j(e, t) {
|
|
5605
|
+
if (d = e.map(({ el: e, desc: t }) => e.animate(t.kf, {
|
|
5606
|
+
duration: r.duration,
|
|
5607
|
+
delay: t.delay,
|
|
5608
|
+
easing: r.easing,
|
|
5609
|
+
fill: "both"
|
|
5610
|
+
})), !d.length) {
|
|
5611
|
+
t();
|
|
5612
|
+
return;
|
|
5613
|
+
}
|
|
5614
|
+
Promise.allSettled(d.map((e) => e.finished)).then(t);
|
|
5615
|
+
}
|
|
5616
|
+
function M(e) {
|
|
5617
|
+
let t = o.value;
|
|
5618
|
+
if (!t || c.value !== "idle" || r.disabled) return;
|
|
5619
|
+
let n = t.getBoundingClientRect(), i = n.width, l = n.height;
|
|
5620
|
+
if (a("shatterStart"), c.value = "shattering", s.value || r.disableAnimation || i < 2 || l < 2 || typeof t.animate != "function") {
|
|
5621
|
+
m = null, N();
|
|
5622
|
+
return;
|
|
5623
|
+
}
|
|
5624
|
+
let [u, d] = e ?? E(i, l);
|
|
5625
|
+
m = {
|
|
5626
|
+
seed: (r.seed ?? Math.floor((typeof performance < "u" ? performance.now() : 0) * 1e3)) >>> 0 || 1,
|
|
5627
|
+
ox: u,
|
|
5628
|
+
oy: d
|
|
5629
|
+
};
|
|
5630
|
+
let f = k(n, D(i, l, m.seed, u, d, "out"));
|
|
5631
|
+
t.style.visibility = "hidden", requestAnimationFrame(() => {
|
|
5632
|
+
c.value === "shattering" && j(f, () => {
|
|
5633
|
+
c.value === "shattering" && N();
|
|
5634
|
+
});
|
|
5635
|
+
});
|
|
5636
|
+
}
|
|
5637
|
+
function N() {
|
|
5638
|
+
L();
|
|
5639
|
+
let e = o.value;
|
|
5640
|
+
e && h(e), c.value = "shattered", i.value = !0, a("shatterEnd"), r.autoRestore > 0 && (f = setTimeout(P, r.autoRestore));
|
|
5641
|
+
}
|
|
5642
|
+
function P() {
|
|
5643
|
+
if (f &&= (clearTimeout(f), null), c.value === "idle") {
|
|
5644
|
+
i.value = !1;
|
|
5645
|
+
return;
|
|
5646
|
+
}
|
|
5647
|
+
if (c.value === "restoring") return;
|
|
5648
|
+
L();
|
|
5649
|
+
let e = o.value, t = r.reassemble && !s.value && !r.disableAnimation && !!m && !!e && typeof e?.animate == "function";
|
|
5650
|
+
if (!e || !t || !m) {
|
|
5651
|
+
e && g(e), c.value = "idle", i.value = !1;
|
|
5652
|
+
return;
|
|
5653
|
+
}
|
|
5654
|
+
e.style.display = "", e.style.visibility = "hidden";
|
|
5655
|
+
let n = e.getBoundingClientRect(), a = n.width, l = n.height;
|
|
5656
|
+
if (a < 2 || l < 2) {
|
|
5657
|
+
g(e), c.value = "idle", i.value = !1;
|
|
5658
|
+
return;
|
|
5659
|
+
}
|
|
5660
|
+
c.value = "restoring";
|
|
5661
|
+
let u = k(n, D(a, l, m.seed, m.ox, m.oy, "in"));
|
|
5662
|
+
requestAnimationFrame(() => {
|
|
5663
|
+
c.value === "restoring" && j(u, () => {
|
|
5664
|
+
c.value === "restoring" && F();
|
|
5665
|
+
});
|
|
5666
|
+
});
|
|
5667
|
+
}
|
|
5668
|
+
function F() {
|
|
5669
|
+
L();
|
|
5670
|
+
let e = o.value;
|
|
5671
|
+
e && g(e), c.value = "idle", i.value = !1, a("restoreEnd");
|
|
5672
|
+
}
|
|
5673
|
+
function L() {
|
|
5674
|
+
for (let e of d) try {
|
|
5675
|
+
e.cancel();
|
|
5676
|
+
} catch {}
|
|
5677
|
+
d = [], u &&= (u.remove(), null);
|
|
5678
|
+
}
|
|
5679
|
+
function R(e) {
|
|
5680
|
+
if (r.trigger !== "click" || c.value !== "idle" || r.disabled) return;
|
|
5681
|
+
let t = o.value;
|
|
5682
|
+
if (!t) return;
|
|
5683
|
+
let n = t.getBoundingClientRect();
|
|
5684
|
+
M([e.clientX - n.left, e.clientY - n.top]);
|
|
5685
|
+
}
|
|
5686
|
+
function B(e) {
|
|
5687
|
+
if (r.origin !== "pointer") return;
|
|
5688
|
+
let t = o.value;
|
|
5689
|
+
if (!t) return;
|
|
5690
|
+
let n = t.getBoundingClientRect();
|
|
5691
|
+
p.x = e.clientX - n.left, p.y = e.clientY - n.top, p.set = !0;
|
|
5692
|
+
}
|
|
5693
|
+
return U(i, (e) => {
|
|
5694
|
+
e && c.value === "idle" ? M() : !e && c.value !== "idle" && P();
|
|
5695
|
+
}), S(() => {
|
|
5696
|
+
i.value && M();
|
|
5697
|
+
}), x(() => {
|
|
5698
|
+
f && clearTimeout(f), L();
|
|
5699
|
+
}), t({
|
|
5700
|
+
shatter: (e) => M(e),
|
|
5701
|
+
restore: P
|
|
5702
|
+
}), (t, n) => (T(), l("div", {
|
|
5703
|
+
ref_key: "rootRef",
|
|
5704
|
+
ref: o,
|
|
5705
|
+
class: y(I(Y)("kun-shatter inline-block", e.className)),
|
|
5706
|
+
onClick: R,
|
|
5707
|
+
onPointermovePassive: B
|
|
5708
|
+
}, [A(t.$slots, "default")], 34));
|
|
5709
|
+
}
|
|
5710
|
+
}), Fs = { class: "relative" }, Is = ["aria-label"], Ls = /* @__PURE__ */ p({
|
|
5395
5711
|
name: "KunScrollShadow",
|
|
5396
5712
|
__name: "ScrollShadow",
|
|
5397
5713
|
props: {
|
|
@@ -5420,7 +5736,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5420
5736
|
}
|
|
5421
5737
|
};
|
|
5422
5738
|
});
|
|
5423
|
-
return (i, a) => (T(), l("div",
|
|
5739
|
+
return (i, a) => (T(), l("div", Fs, [
|
|
5424
5740
|
u("div", {
|
|
5425
5741
|
"aria-hidden": "true",
|
|
5426
5742
|
class: y(I(Y)("pointer-events-none absolute z-10 transition-opacity", h.value, p.value ? "opacity-100" : "opacity-0")),
|
|
@@ -5437,7 +5753,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5437
5753
|
ref_key: "contentWrapper",
|
|
5438
5754
|
ref: r,
|
|
5439
5755
|
class: y(I(Y)(e.axis === "horizontal" ? "flex w-max gap-3" : "flex w-full flex-col gap-3", t.contentClass))
|
|
5440
|
-
}, [A(i.$slots, "default")], 2)], 10,
|
|
5756
|
+
}, [A(i.$slots, "default")], 2)], 10, Is),
|
|
5441
5757
|
u("div", {
|
|
5442
5758
|
"aria-hidden": "true",
|
|
5443
5759
|
class: y(I(Y)("pointer-events-none absolute z-10 transition-opacity", g.value, m.value ? "opacity-100" : "opacity-0")),
|
|
@@ -5445,7 +5761,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5445
5761
|
}, null, 6)
|
|
5446
5762
|
]));
|
|
5447
5763
|
}
|
|
5448
|
-
}),
|
|
5764
|
+
}), Rs = /* @__PURE__ */ p({
|
|
5449
5765
|
name: "KunSkeleton",
|
|
5450
5766
|
__name: "Skeleton",
|
|
5451
5767
|
props: {
|
|
@@ -5475,16 +5791,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5475
5791
|
style: b(i.value)
|
|
5476
5792
|
}, null, 6));
|
|
5477
5793
|
}
|
|
5478
|
-
}),
|
|
5794
|
+
}), zs = {
|
|
5479
5795
|
key: 0,
|
|
5480
5796
|
class: "mb-1.5 flex items-center justify-between gap-2"
|
|
5481
|
-
},
|
|
5797
|
+
}, Bs = ["id"], Vs = {
|
|
5482
5798
|
key: 1,
|
|
5483
5799
|
class: "text-default-500 text-sm tabular-nums"
|
|
5484
|
-
},
|
|
5800
|
+
}, Hs = {
|
|
5485
5801
|
key: 0,
|
|
5486
5802
|
class: "bg-content1 text-foreground border-kun pointer-events-none absolute bottom-full left-1/2 mb-2 -translate-x-1/2 rounded-kun-sm border px-2 py-0.5 text-xs font-medium tabular-nums shadow-kun-sm"
|
|
5487
|
-
},
|
|
5803
|
+
}, Us = [
|
|
5488
5804
|
"tabindex",
|
|
5489
5805
|
"aria-label",
|
|
5490
5806
|
"aria-labelledby",
|
|
@@ -5493,16 +5809,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5493
5809
|
"aria-valuemax",
|
|
5494
5810
|
"aria-valuetext",
|
|
5495
5811
|
"aria-disabled"
|
|
5496
|
-
],
|
|
5812
|
+
], Ws = {
|
|
5497
5813
|
key: 0,
|
|
5498
5814
|
class: "relative mt-1 h-4"
|
|
5499
|
-
},
|
|
5815
|
+
}, Gs = {
|
|
5500
5816
|
key: 1,
|
|
5501
5817
|
class: "text-danger mt-1 text-sm"
|
|
5502
|
-
},
|
|
5818
|
+
}, Ks = {
|
|
5503
5819
|
key: 2,
|
|
5504
5820
|
class: "text-default-500 mt-1 text-sm"
|
|
5505
|
-
},
|
|
5821
|
+
}, qs = /* @__PURE__ */ p({
|
|
5506
5822
|
name: "KunSlider",
|
|
5507
5823
|
__name: "Slider",
|
|
5508
5824
|
props: /*@__PURE__*/ g({
|
|
@@ -5652,11 +5968,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5652
5968
|
return w(() => {
|
|
5653
5969
|
R();
|
|
5654
5970
|
}), (n, a) => (T(), l("div", { class: y(I(Y)("w-full", e.disabled && "opacity-50")) }, [
|
|
5655
|
-
e.label || e.showValue ? (T(), l("div",
|
|
5971
|
+
e.label || e.showValue ? (T(), l("div", zs, [e.label ? (T(), l("label", {
|
|
5656
5972
|
key: 0,
|
|
5657
5973
|
id: `${I(d)}-label`,
|
|
5658
5974
|
class: "text-default-700 block text-sm font-medium"
|
|
5659
|
-
}, M(e.label), 9,
|
|
5975
|
+
}, M(e.label), 9, Bs)) : c("", !0), e.showValue ? (T(), l("span", Vs, M(j.value), 1)) : c("", !0)])) : c("", !0),
|
|
5660
5976
|
u("div", {
|
|
5661
5977
|
class: y(["kun-slider relative py-2", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
5662
5978
|
ref_key: "sliderRef",
|
|
@@ -5684,7 +6000,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5684
6000
|
"leave-active-class": "transition duration-kun-exit ease-kun-in",
|
|
5685
6001
|
"leave-to-class": "opacity-0 translate-y-1"
|
|
5686
6002
|
}, {
|
|
5687
|
-
default: G(() => [V.value ? (T(), l("span",
|
|
6003
|
+
default: G(() => [V.value ? (T(), l("span", Hs, M(j.value), 1)) : c("", !0)]),
|
|
5688
6004
|
_: 1
|
|
5689
6005
|
}), u("div", {
|
|
5690
6006
|
class: y(["bg-content1 rounded-full border-2 transition-shadow duration-kun-fast hover:ring-4 focus-visible:ring-4 focus-visible:outline-none active:ring-4", [
|
|
@@ -5708,19 +6024,19 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5708
6024
|
onKeydown: B,
|
|
5709
6025
|
onFocus: a[0] ||= (e) => x.value = !0,
|
|
5710
6026
|
onBlur: a[1] ||= (e) => !v.value && (x.value = !1)
|
|
5711
|
-
}, null, 42,
|
|
5712
|
-
], 2), N.value.some((e) => e.label) ? (T(), l("div",
|
|
6027
|
+
}, null, 42, Us)], 36)
|
|
6028
|
+
], 2), N.value.some((e) => e.label) ? (T(), l("div", Ws, [(T(!0), l(t, null, k(N.value, (e, t) => K((T(), l("span", {
|
|
5713
6029
|
key: t,
|
|
5714
6030
|
class: "text-default-500 absolute -translate-x-1/2 text-xs whitespace-nowrap",
|
|
5715
6031
|
style: b({ left: e.percent + "%" })
|
|
5716
6032
|
}, M(e.label), 5)), [[H, e.label]])), 128))])) : c("", !0)], 34),
|
|
5717
|
-
e.error ? (T(), l("p",
|
|
6033
|
+
e.error ? (T(), l("p", Gs, M(e.error), 1)) : e.description ? (T(), l("p", Ks, M(e.description), 1)) : c("", !0)
|
|
5718
6034
|
], 2));
|
|
5719
6035
|
}
|
|
5720
|
-
}),
|
|
6036
|
+
}), Js = ["aria-current"], Ys = {
|
|
5721
6037
|
key: 0,
|
|
5722
6038
|
class: "text-default-500 mt-0.5 text-xs"
|
|
5723
|
-
},
|
|
6039
|
+
}, Xs = /* @__PURE__ */ p({
|
|
5724
6040
|
name: "KunSteps",
|
|
5725
6041
|
__name: "Steps",
|
|
5726
6042
|
props: {
|
|
@@ -5780,14 +6096,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5780
6096
|
}, null, 8, ["name", "class"])) : (T(), l(t, { key: 2 }, [d(M(i + 1), 1)], 64))], 2), i < e.items.length - 1 ? (T(), l("span", {
|
|
5781
6097
|
key: 0,
|
|
5782
6098
|
class: y(I(Y)("transition-colors", r.value ? "mt-1 w-0.5 flex-1" : "mx-2 h-0.5 flex-1", h(i)))
|
|
5783
|
-
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : I(Y)("mt-2", i < e.items.length - 1 ? "pr-2" : "")) }, [u("p", { class: y(I(Y)("font-medium", a.value.title, p(i) === "pending" ? "text-default-400" : p(i) === "active" ? I(_e)[e.color] : "text-foreground")) }, M(n.title), 3), n.description ? (T(), l("p",
|
|
6099
|
+
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : I(Y)("mt-2", i < e.items.length - 1 ? "pr-2" : "")) }, [u("p", { class: y(I(Y)("font-medium", a.value.title, p(i) === "pending" ? "text-default-400" : p(i) === "active" ? I(_e)[e.color] : "text-foreground")) }, M(n.title), 3), n.description ? (T(), l("p", Ys, M(n.description), 1)) : c("", !0)], 2)], 10, Js))), 128))], 2));
|
|
5784
6100
|
}
|
|
5785
|
-
}),
|
|
6101
|
+
}), Zs = [
|
|
5786
6102
|
"id",
|
|
5787
6103
|
"checked",
|
|
5788
6104
|
"disabled",
|
|
5789
6105
|
"aria-describedby"
|
|
5790
|
-
],
|
|
6106
|
+
], Qs = { class: "relative" }, $s = ["id"], ec = ["id"], tc = /* @__PURE__ */ p({
|
|
5791
6107
|
name: "KunSwitch",
|
|
5792
6108
|
__name: "Switch",
|
|
5793
6109
|
props: /*@__PURE__*/ g({
|
|
@@ -5856,8 +6172,8 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5856
6172
|
disabled: e.disabled,
|
|
5857
6173
|
"aria-describedby": e.error || e.description ? `${I(r)}-desc` : void 0,
|
|
5858
6174
|
onChange: i[0] ||= (e) => n.value = e.target.checked
|
|
5859
|
-
}, null, 40,
|
|
5860
|
-
u("div",
|
|
6175
|
+
}, null, 40, Zs),
|
|
6176
|
+
u("div", Qs, [u("div", { class: y(["rounded-full transition-colors duration-kun-fast ease-kun-standard peer-focus-visible:ring-2 peer-focus-visible:ring-primary/50", [
|
|
5861
6177
|
a.value.track,
|
|
5862
6178
|
n.value ? "bg-primary" : "bg-default-500",
|
|
5863
6179
|
e.disabled ? "opacity-50" : "",
|
|
@@ -5871,13 +6187,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5871
6187
|
key: 0,
|
|
5872
6188
|
id: `${I(r)}-desc`,
|
|
5873
6189
|
class: "text-danger mt-1 text-sm"
|
|
5874
|
-
}, M(e.error), 9,
|
|
6190
|
+
}, M(e.error), 9, $s)) : e.description ? (T(), l("p", {
|
|
5875
6191
|
key: 1,
|
|
5876
6192
|
id: `${I(r)}-desc`,
|
|
5877
6193
|
class: "text-default-500 mt-1 text-sm"
|
|
5878
|
-
}, M(e.description), 9,
|
|
6194
|
+
}, M(e.description), 9, ec)) : c("", !0)]));
|
|
5879
6195
|
}
|
|
5880
|
-
}),
|
|
6196
|
+
}), nc = Symbol("kun-tab-panels"), rc = (e, t) => `${e ?? "kun"}-tab-${t}`, ic = (e, t) => `${e ?? "kun"}-tabpanel-${t}`, ac = ["aria-orientation"], oc = { key: 1 }, sc = /* @__PURE__ */ p({
|
|
5881
6197
|
name: "KunTab",
|
|
5882
6198
|
__name: "Tab",
|
|
5883
6199
|
props: /*@__PURE__*/ g({
|
|
@@ -6013,7 +6329,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6013
6329
|
disabled: e.disabled || r.disabled
|
|
6014
6330
|
}, V = (e, t, n) => {
|
|
6015
6331
|
t.href && e.preventDefault(), L(t, n);
|
|
6016
|
-
}, H = (e) =>
|
|
6332
|
+
}, H = (e) => rc(r.name, e), W = (e) => ic(r.name, e), K = (e) => i.value === e.value, q = o(() => Y("relative", p.value ? "inline-flex flex-col" : "inline-flex", r.fullWidth && "w-full", r.disabled && "opacity-50 cursor-not-allowed", r.scrollable && (p.value ? "max-h-full overflow-y-auto scrollbar-hide" : "max-w-full overflow-x-auto scrollbar-hide"), r.className)), J = o(() => {
|
|
6017
6333
|
let e = p.value ? Y("relative flex flex-col items-stretch", h[r.size]) : Y("relative flex items-center", h[r.size]);
|
|
6018
6334
|
switch (r.variant) {
|
|
6019
6335
|
case "underlined": return Y(e, r.innerClassName);
|
|
@@ -6087,7 +6403,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6087
6403
|
key: 0,
|
|
6088
6404
|
class: "inline-flex shrink-0",
|
|
6089
6405
|
style: b({ fontSize: e.iconSize })
|
|
6090
|
-
}, [f(Q, { name: t.icon }, null, 8, ["name"])], 4)) : c("", !0), t.textValue ? (T(), l("span",
|
|
6406
|
+
}, [f(Q, { name: t.icon }, null, 8, ["name"])], 4)) : c("", !0), t.textValue ? (T(), l("span", oc, M(t.textValue), 1)) : c("", !0)]),
|
|
6091
6407
|
_: 2
|
|
6092
6408
|
}, 1040, [
|
|
6093
6409
|
"id",
|
|
@@ -6099,14 +6415,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6099
6415
|
"style",
|
|
6100
6416
|
"onClick",
|
|
6101
6417
|
"onKeydown"
|
|
6102
|
-
]))), 128))], 10,
|
|
6418
|
+
]))), 128))], 10, ac)], 2));
|
|
6103
6419
|
}
|
|
6104
|
-
}),
|
|
6420
|
+
}), cc = [
|
|
6105
6421
|
"id",
|
|
6106
6422
|
"aria-labelledby",
|
|
6107
6423
|
"tabindex",
|
|
6108
6424
|
"data-kun-tab-hidden"
|
|
6109
|
-
],
|
|
6425
|
+
], lc = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
6110
6426
|
name: "KunTabPanel",
|
|
6111
6427
|
__name: "TabPanel",
|
|
6112
6428
|
props: {
|
|
@@ -6123,7 +6439,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6123
6439
|
},
|
|
6124
6440
|
emits: ["activate"],
|
|
6125
6441
|
setup(e, { emit: t }) {
|
|
6126
|
-
let n = e, r = t, i = m(
|
|
6442
|
+
let n = e, r = t, i = m(nc, null), a = o(() => n.active ?? i?.active.value), s = o(() => a.value === n.value), u = o(() => n.forceMount ? "eager" : n.mount ?? i?.mount.value ?? "eager"), d = o(() => n.hiddenStrategy ?? i?.hiddenStrategy.value ?? "until-found"), f = o(() => n.name ?? i?.name.value), p = o(() => ic(f.value, n.value)), h = o(() => rc(f.value, n.value)), g = O(s.value);
|
|
6127
6443
|
U(s, (e) => {
|
|
6128
6444
|
e && (g.value = !0);
|
|
6129
6445
|
});
|
|
@@ -6158,9 +6474,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6158
6474
|
"data-kun-tab-hidden": !b.value && x.value ? "" : void 0,
|
|
6159
6475
|
class: y(I(Y)("focus:outline-none", e.className)),
|
|
6160
6476
|
onBeforematch: w
|
|
6161
|
-
}, [A(t.$slots, "default", {}, void 0, !0)], 42,
|
|
6477
|
+
}, [A(t.$slots, "default", {}, void 0, !0)], 42, cc)) : c("", !0);
|
|
6162
6478
|
}
|
|
6163
|
-
}), [["__scopeId", "data-v-ccf67b4b"]]),
|
|
6479
|
+
}), [["__scopeId", "data-v-ccf67b4b"]]), uc = /* @__PURE__ */ p({
|
|
6164
6480
|
name: "KunTabPanels",
|
|
6165
6481
|
__name: "TabPanels",
|
|
6166
6482
|
props: /*@__PURE__*/ g({
|
|
@@ -6174,7 +6490,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6174
6490
|
emits: ["update:modelValue"],
|
|
6175
6491
|
setup(e) {
|
|
6176
6492
|
let t = e, n = z(e, "modelValue");
|
|
6177
|
-
return E(
|
|
6493
|
+
return E(nc, {
|
|
6178
6494
|
active: o(() => n.value),
|
|
6179
6495
|
activate: (e) => {
|
|
6180
6496
|
n.value = e;
|
|
@@ -6184,24 +6500,24 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6184
6500
|
name: o(() => t.name)
|
|
6185
6501
|
}), (e, t) => (T(), l("div", null, [A(e.$slots, "default")]));
|
|
6186
6502
|
}
|
|
6187
|
-
}),
|
|
6503
|
+
}), dc = { class: "w-full" }, fc = ["for"], pc = [
|
|
6188
6504
|
"aria-label",
|
|
6189
6505
|
"aria-invalid",
|
|
6190
6506
|
"aria-disabled"
|
|
6191
|
-
],
|
|
6507
|
+
], mc = [
|
|
6192
6508
|
"tabindex",
|
|
6193
6509
|
"aria-label",
|
|
6194
6510
|
"onKeydown"
|
|
6195
|
-
],
|
|
6511
|
+
], hc = ["aria-label", "onClick"], gc = [
|
|
6196
6512
|
"id",
|
|
6197
6513
|
"placeholder",
|
|
6198
6514
|
"disabled",
|
|
6199
6515
|
"readonly",
|
|
6200
6516
|
"aria-describedby"
|
|
6201
|
-
],
|
|
6517
|
+
], _c = {
|
|
6202
6518
|
key: 1,
|
|
6203
6519
|
class: "text-default-400 ml-auto text-xs tabular-nums"
|
|
6204
|
-
},
|
|
6520
|
+
}, vc = ["id"], yc = ["id"], bc = /* @__PURE__ */ p({
|
|
6205
6521
|
name: "KunTagInput",
|
|
6206
6522
|
__name: "TagInput",
|
|
6207
6523
|
props: /*@__PURE__*/ g({
|
|
@@ -6381,12 +6697,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6381
6697
|
lg: "text-base",
|
|
6382
6698
|
xl: "text-lg"
|
|
6383
6699
|
}, ee = o(() => Y("flex flex-wrap items-center transition-shadow", a.value, W[r.size], G[r.size], q[r.size], "border border-transparent", !r.error && "border-kun", r.variant === "flat" && "bg-content1 shadow-kun-sm", r.error ? de.danger : de[r.color], r.error && "border-danger", r.disabled && "opacity-50 cursor-not-allowed bg-default-100", r.readonly && "cursor-default", r.className)), te = o(() => Y("inline-flex items-center gap-1 rounded-full font-medium whitespace-nowrap select-none", ve("flat", r.color), ce[r.size], X[r.color])), ne = o(() => d.value.length >= r.maxTags);
|
|
6384
|
-
return (n, r) => (T(), l("div",
|
|
6700
|
+
return (n, r) => (T(), l("div", dc, [
|
|
6385
6701
|
e.label ? (T(), l("label", {
|
|
6386
6702
|
key: 0,
|
|
6387
6703
|
for: I(S),
|
|
6388
6704
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
6389
|
-
}, M(e.label), 9,
|
|
6705
|
+
}, M(e.label), 9, fc)) : c("", !0),
|
|
6390
6706
|
u("div", {
|
|
6391
6707
|
role: "group",
|
|
6392
6708
|
"aria-label": e.label || "tag input",
|
|
@@ -6418,7 +6734,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6418
6734
|
}, [f(Q, {
|
|
6419
6735
|
name: "lucide:x",
|
|
6420
6736
|
class: "size-3.5"
|
|
6421
|
-
})], 8,
|
|
6737
|
+
})], 8, hc)) : c("", !0)])], 42, mc))), 128)),
|
|
6422
6738
|
e.readonly ? c("", !0) : K((T(), l("input", {
|
|
6423
6739
|
key: 0,
|
|
6424
6740
|
id: I(S),
|
|
@@ -6437,21 +6753,21 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6437
6753
|
onCompositionend: R,
|
|
6438
6754
|
onPaste: B,
|
|
6439
6755
|
onBlur: H
|
|
6440
|
-
}, null, 40,
|
|
6441
|
-
e.showCounter && e.maxTags !== Infinity ? (T(), l("span",
|
|
6442
|
-
], 10,
|
|
6756
|
+
}, null, 40, gc)), [[V, g.value]]),
|
|
6757
|
+
e.showCounter && e.maxTags !== Infinity ? (T(), l("span", _c, M(d.value.length) + "/" + M(e.maxTags), 1)) : c("", !0)
|
|
6758
|
+
], 10, pc),
|
|
6443
6759
|
e.error ? (T(), l("p", {
|
|
6444
6760
|
key: 1,
|
|
6445
6761
|
id: `${I(S)}-msg`,
|
|
6446
6762
|
class: "text-danger mt-1 text-sm"
|
|
6447
|
-
}, M(e.error), 9,
|
|
6763
|
+
}, M(e.error), 9, vc)) : s.value ? (T(), l("p", {
|
|
6448
6764
|
key: 2,
|
|
6449
6765
|
id: `${I(S)}-msg`,
|
|
6450
6766
|
class: "text-default-500 mt-1 text-sm"
|
|
6451
|
-
}, M(s.value), 9,
|
|
6767
|
+
}, M(s.value), 9, yc)) : c("", !0)
|
|
6452
6768
|
]));
|
|
6453
6769
|
}
|
|
6454
|
-
}),
|
|
6770
|
+
}), xc = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
6455
6771
|
name: "KunText",
|
|
6456
6772
|
__name: "Text",
|
|
6457
6773
|
props: {
|
|
@@ -6462,10 +6778,10 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6462
6778
|
let t = e, n = o(() => t.content.replace(/([_/])/g, "$1"));
|
|
6463
6779
|
return (e, r) => (T(), l("span", { class: y(I(Y)("kun-text-block", t.className)) }, M(n.value), 3));
|
|
6464
6780
|
}
|
|
6465
|
-
}), [["__scopeId", "data-v-e9ad81ae"]]),
|
|
6781
|
+
}), [["__scopeId", "data-v-e9ad81ae"]]), Sc = { class: "w-full" }, Cc = ["for"], wc = {
|
|
6466
6782
|
key: 0,
|
|
6467
6783
|
class: "text-danger ml-1"
|
|
6468
|
-
},
|
|
6784
|
+
}, Tc = { class: "relative" }, Ec = [
|
|
6469
6785
|
"id",
|
|
6470
6786
|
"name",
|
|
6471
6787
|
"placeholder",
|
|
@@ -6476,16 +6792,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6476
6792
|
"minlength",
|
|
6477
6793
|
"rows",
|
|
6478
6794
|
"autofocus"
|
|
6479
|
-
],
|
|
6795
|
+
], Dc = {
|
|
6480
6796
|
key: 0,
|
|
6481
6797
|
class: "text-default-500 absolute right-2 bottom-2 text-xs"
|
|
6482
|
-
},
|
|
6798
|
+
}, Oc = {
|
|
6483
6799
|
key: 1,
|
|
6484
6800
|
class: "text-danger mt-1 text-sm"
|
|
6485
|
-
},
|
|
6801
|
+
}, kc = {
|
|
6486
6802
|
key: 2,
|
|
6487
6803
|
class: "text-default-500 mt-1 text-sm"
|
|
6488
|
-
},
|
|
6804
|
+
}, Ac = /* @__PURE__ */ p({
|
|
6489
6805
|
name: "KunTextarea",
|
|
6490
6806
|
__name: "Textarea",
|
|
6491
6807
|
props: /*@__PURE__*/ g({
|
|
@@ -6570,13 +6886,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6570
6886
|
});
|
|
6571
6887
|
},
|
|
6572
6888
|
textareaRef: m
|
|
6573
|
-
}), (t, n) => (T(), l("div",
|
|
6889
|
+
}), (t, n) => (T(), l("div", Sc, [
|
|
6574
6890
|
e.label ? (T(), l("label", {
|
|
6575
6891
|
key: 0,
|
|
6576
6892
|
for: I(p),
|
|
6577
6893
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
6578
|
-
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span",
|
|
6579
|
-
u("div",
|
|
6894
|
+
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span", wc, "*")) : c("", !0)], 8, Cc)) : c("", !0),
|
|
6895
|
+
u("div", Tc, [K(u("textarea", {
|
|
6580
6896
|
id: I(p),
|
|
6581
6897
|
ref_key: "textareaRef",
|
|
6582
6898
|
ref: m,
|
|
@@ -6594,30 +6910,30 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6594
6910
|
onInput: g,
|
|
6595
6911
|
onBlur: n[1] ||= (e) => h("blur", e),
|
|
6596
6912
|
onFocus: n[2] ||= (e) => h("focus", e)
|
|
6597
|
-
}, null, 42,
|
|
6598
|
-
e.error ? (T(), l("p",
|
|
6913
|
+
}, null, 42, Ec), [[V, f.value]]), e.maxlength && e.showCharCount ? (T(), l("div", Dc, M(f.value.length) + "/" + M(e.maxlength), 1)) : c("", !0)]),
|
|
6914
|
+
e.error ? (T(), l("p", Oc, M(e.error), 1)) : s.value ? (T(), l("p", kc, M(s.value), 1)) : c("", !0)
|
|
6599
6915
|
]));
|
|
6600
6916
|
}
|
|
6601
|
-
}),
|
|
6917
|
+
}), jc = /* @__PURE__ */ p({
|
|
6602
6918
|
name: "KunTimeline",
|
|
6603
6919
|
__name: "Timeline",
|
|
6604
6920
|
props: { className: { default: "" } },
|
|
6605
6921
|
setup(e) {
|
|
6606
6922
|
return (t, n) => (T(), l("ol", { class: y(I(Y)("kun-timeline relative", e.className)) }, [A(t.$slots, "default")], 2));
|
|
6607
6923
|
}
|
|
6608
|
-
}),
|
|
6924
|
+
}), Mc = { class: "flex flex-col items-center self-stretch" }, Nc = {
|
|
6609
6925
|
key: 0,
|
|
6610
6926
|
class: "flex flex-wrap items-center justify-between gap-x-3"
|
|
6611
|
-
},
|
|
6927
|
+
}, Pc = {
|
|
6612
6928
|
key: 0,
|
|
6613
6929
|
class: "text-foreground font-medium"
|
|
6614
|
-
},
|
|
6930
|
+
}, Fc = {
|
|
6615
6931
|
key: 1,
|
|
6616
6932
|
class: "text-default-400 text-xs"
|
|
6617
|
-
},
|
|
6933
|
+
}, Ic = {
|
|
6618
6934
|
key: 1,
|
|
6619
6935
|
class: "text-default-600 mt-1 text-sm"
|
|
6620
|
-
},
|
|
6936
|
+
}, Lc = /* @__PURE__ */ p({
|
|
6621
6937
|
name: "KunTimelineItem",
|
|
6622
6938
|
__name: "TimelineItem",
|
|
6623
6939
|
props: {
|
|
@@ -6629,7 +6945,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6629
6945
|
},
|
|
6630
6946
|
setup(e) {
|
|
6631
6947
|
let t = e, n = o(() => !!t.icon);
|
|
6632
|
-
return (t, r) => (T(), l("li", { class: y(I(Y)("flex gap-3", e.className)) }, [u("div",
|
|
6948
|
+
return (t, r) => (T(), l("li", { class: y(I(Y)("flex gap-3", e.className)) }, [u("div", Mc, [n.value ? (T(), l("span", {
|
|
6633
6949
|
key: 0,
|
|
6634
6950
|
class: y(I(Y)("inline-flex size-7 shrink-0 items-center justify-center rounded-full", I(me)[e.color], I(ge)[e.color]))
|
|
6635
6951
|
}, [f(Q, {
|
|
@@ -6638,9 +6954,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6638
6954
|
}, null, 8, ["name"])], 2)) : (T(), l("span", {
|
|
6639
6955
|
key: 1,
|
|
6640
6956
|
class: y(I(Y)("mt-1.5 size-3 shrink-0 rounded-full", I(me)[e.color]))
|
|
6641
|
-
}, null, 2)), r[0] ||= u("span", { class: "kun-tl-line bg-default-200 my-1.5 w-px flex-1" }, null, -1)]), u("div", { class: y(["kun-tl-content min-w-0 flex-1 pb-6", n.value ? "pt-0.5" : ""]) }, [e.title || e.time || t.$slots.title || t.$slots.time ? (T(), l("div",
|
|
6957
|
+
}, null, 2)), r[0] ||= u("span", { class: "kun-tl-line bg-default-200 my-1.5 w-px flex-1" }, null, -1)]), u("div", { class: y(["kun-tl-content min-w-0 flex-1 pb-6", n.value ? "pt-0.5" : ""]) }, [e.title || e.time || t.$slots.title || t.$slots.time ? (T(), l("div", Nc, [e.title || t.$slots.title ? (T(), l("p", Pc, [A(t.$slots, "title", {}, () => [d(M(e.title), 1)])])) : c("", !0), e.time || t.$slots.time ? (T(), l("span", Fc, [A(t.$slots, "time", {}, () => [d(M(e.time), 1)])])) : c("", !0)])) : c("", !0), t.$slots.default ? (T(), l("div", Ic, [A(t.$slots, "default")])) : c("", !0)], 2)], 2));
|
|
6642
6958
|
}
|
|
6643
|
-
}),
|
|
6959
|
+
}), Rc = ["aria-describedby"], zc = ["id"], Bc = /* @__PURE__ */ p({
|
|
6644
6960
|
name: "KunTooltip",
|
|
6645
6961
|
__name: "Tooltip",
|
|
6646
6962
|
props: {
|
|
@@ -6704,15 +7020,15 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6704
7020
|
ref: x,
|
|
6705
7021
|
class: "bg-content1 absolute size-2 rotate-45",
|
|
6706
7022
|
style: b(I(S))
|
|
6707
|
-
}, null, 4)) : c("", !0)], 14,
|
|
7023
|
+
}, null, 4)) : c("", !0)], 14, zc)) : c("", !0)]),
|
|
6708
7024
|
_: 3
|
|
6709
|
-
})]))], 42,
|
|
7025
|
+
})]))], 42, Rc));
|
|
6710
7026
|
}
|
|
6711
|
-
}),
|
|
7027
|
+
}), Vc = (e) => [
|
|
6712
7028
|
"image/jpeg",
|
|
6713
7029
|
"image/png",
|
|
6714
7030
|
"image/webp"
|
|
6715
|
-
].includes(e.type) ? !0 : (console.error("Invalid file type"), !1),
|
|
7031
|
+
].includes(e.type) ? !0 : (console.error("Invalid file type"), !1), Hc = async (e, t, n) => new Promise((r) => {
|
|
6716
7032
|
let i = new FileReader();
|
|
6717
7033
|
i.onload = (e) => {
|
|
6718
7034
|
let i = new Image();
|
|
@@ -6723,13 +7039,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6723
7039
|
}, "image/webp", .77);
|
|
6724
7040
|
}, i.src = e.target?.result;
|
|
6725
7041
|
}, i.readAsDataURL(e);
|
|
6726
|
-
}),
|
|
7042
|
+
}), Uc = {
|
|
6727
7043
|
key: 0,
|
|
6728
7044
|
class: "absolute inset-0 flex flex-col items-center justify-center"
|
|
6729
|
-
},
|
|
7045
|
+
}, Wc = {
|
|
6730
7046
|
key: 0,
|
|
6731
7047
|
class: "text-default-500 mt-2 text-sm"
|
|
6732
|
-
},
|
|
7048
|
+
}, Gc = ["src"], Kc = { class: "max-w-xl" }, qc = { class: "mt-4 flex justify-end space-x-2" }, Jc = /* @__PURE__ */ p({
|
|
6733
7049
|
name: "KunUpload",
|
|
6734
7050
|
__name: "Upload",
|
|
6735
7051
|
props: {
|
|
@@ -6744,13 +7060,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6744
7060
|
emits: ["setImage"],
|
|
6745
7061
|
setup(e, { emit: t }) {
|
|
6746
7062
|
let n = e, r = Tt(() => n.rounded), i = o(() => Z[r.value]), a = o(() => n.description || n.hint), p = t, m = O(), h = O(), g = O(""), _ = O(!1), v = O(""), x = o(() => n.initialImage || ""), S = (e) => {
|
|
6747
|
-
|
|
7063
|
+
Vc(e) && (v.value = URL.createObjectURL(e), _.value = !0);
|
|
6748
7064
|
}, C = async (e) => {
|
|
6749
7065
|
let t = e.canvas, r = await new Promise((e) => {
|
|
6750
7066
|
t.toBlob((t) => {
|
|
6751
7067
|
t && e(t);
|
|
6752
7068
|
}, "image/webp", .77);
|
|
6753
|
-
}), i = await
|
|
7069
|
+
}), i = await Hc(new File([r], "cropped.webp", { type: "image/webp" }), n.size, n.size / n.aspect);
|
|
6754
7070
|
h.value = i, g.value = URL.createObjectURL(i);
|
|
6755
7071
|
}, w = (e) => {
|
|
6756
7072
|
let t = e.target;
|
|
@@ -6774,16 +7090,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6774
7090
|
onDragover: D,
|
|
6775
7091
|
onClick: k
|
|
6776
7092
|
}, [
|
|
6777
|
-
!g.value && !x.value ? (T(), l("div",
|
|
7093
|
+
!g.value && !x.value ? (T(), l("div", Uc, [f(Q, {
|
|
6778
7094
|
name: "lucide:plus",
|
|
6779
7095
|
class: "text-default-500 text-3xl"
|
|
6780
|
-
}), a.value ? (T(), l("span",
|
|
7096
|
+
}), a.value ? (T(), l("span", Wc, M(a.value), 1)) : c("", !0)])) : c("", !0),
|
|
6781
7097
|
g.value || x.value ? (T(), l("img", {
|
|
6782
7098
|
key: 1,
|
|
6783
7099
|
src: g.value || x.value,
|
|
6784
7100
|
alt: "上传图片",
|
|
6785
7101
|
class: y(I(Y)("h-full w-full object-cover", i.value))
|
|
6786
|
-
}, null, 10,
|
|
7102
|
+
}, null, 10, Gc)) : c("", !0),
|
|
6787
7103
|
u("input", {
|
|
6788
7104
|
ref_key: "input",
|
|
6789
7105
|
ref: m,
|
|
@@ -6797,7 +7113,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6797
7113
|
"is-dismissable": !1,
|
|
6798
7114
|
"onUpdate:modelValue": r[1] ||= (e) => _.value = e
|
|
6799
7115
|
}, {
|
|
6800
|
-
default: G(() => [u("div",
|
|
7116
|
+
default: G(() => [u("div", Kc, [
|
|
6801
7117
|
r[4] ||= u("div", { class: "mb-4" }, [u("h3", { class: "text-lg font-semibold" }, "裁剪图片")], -1),
|
|
6802
7118
|
v.value ? (T(), s(I(tt), {
|
|
6803
7119
|
key: 0,
|
|
@@ -6805,7 +7121,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6805
7121
|
"stencil-props": { aspectRatio: n.aspect },
|
|
6806
7122
|
onChange: C
|
|
6807
7123
|
}, null, 8, ["src", "stencil-props"])) : c("", !0),
|
|
6808
|
-
u("div",
|
|
7124
|
+
u("div", qc, [f($, {
|
|
6809
7125
|
variant: "light",
|
|
6810
7126
|
color: "danger",
|
|
6811
7127
|
onClick: r[0] ||= (e) => _.value = !1
|
|
@@ -6824,10 +7140,10 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6824
7140
|
_: 1
|
|
6825
7141
|
}, 8, ["model-value"])]));
|
|
6826
7142
|
}
|
|
6827
|
-
}),
|
|
7143
|
+
}), Yc = { class: "flex min-w-0 flex-col text-sm" }, Xc = { class: "truncate" }, Zc = {
|
|
6828
7144
|
key: 0,
|
|
6829
7145
|
class: "text-default-500 truncate"
|
|
6830
|
-
},
|
|
7146
|
+
}, Qc = /* @__PURE__ */ p({
|
|
6831
7147
|
name: "KunUserChip",
|
|
6832
7148
|
__name: "UserChip",
|
|
6833
7149
|
props: {
|
|
@@ -6863,14 +7179,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6863
7179
|
"disable-floating",
|
|
6864
7180
|
"user",
|
|
6865
7181
|
"size"
|
|
6866
|
-
]), u("div",
|
|
7182
|
+
]), u("div", Yc, [u("span", Xc, M(e.user?.name || "未知用户"), 1), e.description ? (T(), l("span", Zc, M(e.description), 1)) : c("", !0)])]),
|
|
6867
7183
|
_: 1
|
|
6868
7184
|
}, 16, ["class"]));
|
|
6869
7185
|
}
|
|
6870
7186
|
});
|
|
6871
7187
|
//#endregion
|
|
6872
7188
|
//#region src/resolver.ts
|
|
6873
|
-
function
|
|
7189
|
+
function $c(e = {}) {
|
|
6874
7190
|
let t = new Set(nt), n = e.importStyle ?? !0;
|
|
6875
7191
|
return {
|
|
6876
7192
|
type: "component",
|
|
@@ -6885,7 +7201,7 @@ function Qc(e = {}) {
|
|
|
6885
7201
|
}
|
|
6886
7202
|
//#endregion
|
|
6887
7203
|
//#region src/index.ts
|
|
6888
|
-
var
|
|
7204
|
+
var el = {
|
|
6889
7205
|
KunAccordion: it,
|
|
6890
7206
|
KunAccordionItem: bt,
|
|
6891
7207
|
KunAlertProvider: en,
|
|
@@ -6935,25 +7251,26 @@ var $c = {
|
|
|
6935
7251
|
KunRating: ps,
|
|
6936
7252
|
KunReaction: _s,
|
|
6937
7253
|
KunRipple: Ot,
|
|
6938
|
-
KunScrollShadow:
|
|
7254
|
+
KunScrollShadow: Ls,
|
|
6939
7255
|
KunSelect: Ns,
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
7256
|
+
KunShatter: Ps,
|
|
7257
|
+
KunSkeleton: Rs,
|
|
7258
|
+
KunSlider: qs,
|
|
7259
|
+
KunSteps: Xs,
|
|
7260
|
+
KunSwitch: tc,
|
|
7261
|
+
KunTab: sc,
|
|
7262
|
+
KunTabPanel: lc,
|
|
7263
|
+
KunTabPanels: uc,
|
|
7264
|
+
KunTagInput: bc,
|
|
7265
|
+
KunText: xc,
|
|
7266
|
+
KunTextarea: Ac,
|
|
7267
|
+
KunTimeline: jc,
|
|
7268
|
+
KunTimelineItem: Lc,
|
|
7269
|
+
KunTooltip: Bc,
|
|
7270
|
+
KunUpload: Jc,
|
|
7271
|
+
KunUserChip: Qc
|
|
7272
|
+
}, tl = { install(e) {
|
|
7273
|
+
for (let [t, n] of Object.entries(el)) e.component(t, n);
|
|
6957
7274
|
} };
|
|
6958
7275
|
//#endregion
|
|
6959
|
-
export { nt as KUN_COMPONENT_NAMES, st as KUN_UI_DEFAULT_CONFIG, it as KunAccordion, bt as KunAccordionItem, en as KunAlertProvider, gn as KunAutocomplete, bn as KunAvatar, Cn as KunAvatarGroup, On as KunBadge, jn as KunBrand, $ as KunButton, In as KunCard, Un as KunCarousel, Wn as KunCarouselItem, Zn as KunCheckBox, An as KunChip, $r as KunContent, ti as KunContextMenu, ki as KunCopy, xi as KunDatePicker, ji as KunDivider, Hi as KunDrawer, Fi as KunDropdown, Gi as KunFadeCard, Qi as KunFileInput, ia as KunHeader, Q as KunIcon, yn as KunImage, oa as KunImageNative, ua as KunInfo, xa as KunInput, Zr as KunLightbox, wa as KunLightboxGallery, Ta as KunLightboxGalleryItem, Ea as KunLink, qa as KunLoading, Pa as KunLoli, Ba as KunLoliProvider, Ja as KunMarkdown, no as KunMessageProvider, Jt as KunModal, oo as KunNull, _o as KunNumberInput, Do as KunPagination, jo as KunPinInput, Go as KunPopover, Qo as KunProgress, us as KunRadioGroup, ps as KunRating, _s as KunReaction, Ot as KunRipple,
|
|
7276
|
+
export { nt as KUN_COMPONENT_NAMES, st as KUN_UI_DEFAULT_CONFIG, it as KunAccordion, bt as KunAccordionItem, en as KunAlertProvider, gn as KunAutocomplete, bn as KunAvatar, Cn as KunAvatarGroup, On as KunBadge, jn as KunBrand, $ as KunButton, In as KunCard, Un as KunCarousel, Wn as KunCarouselItem, Zn as KunCheckBox, An as KunChip, $r as KunContent, ti as KunContextMenu, ki as KunCopy, xi as KunDatePicker, ji as KunDivider, Hi as KunDrawer, Fi as KunDropdown, Gi as KunFadeCard, Qi as KunFileInput, ia as KunHeader, Q as KunIcon, yn as KunImage, oa as KunImageNative, ua as KunInfo, xa as KunInput, Zr as KunLightbox, wa as KunLightboxGallery, Ta as KunLightboxGalleryItem, Ea as KunLink, qa as KunLoading, Pa as KunLoli, Ba as KunLoliProvider, Ja as KunMarkdown, no as KunMessageProvider, Jt as KunModal, oo as KunNull, _o as KunNumberInput, Do as KunPagination, jo as KunPinInput, Go as KunPopover, Qo as KunProgress, us as KunRadioGroup, ps as KunRating, _s as KunReaction, Ot as KunRipple, Ls as KunScrollShadow, Ns as KunSelect, Ps as KunShatter, Rs as KunSkeleton, qs as KunSlider, Xs as KunSteps, tc as KunSwitch, sc as KunTab, lc as KunTabPanel, uc as KunTabPanels, bc as KunTagInput, xc as KunText, Ac as KunTextarea, jc as KunTimeline, Lc as KunTimelineItem, Bc as KunTooltip, tl as KunUI, tl as default, $c as KunUIResolver, Jc as KunUpload, Qc as KunUserChip, Vc as checkImageValid, te as decodeIfEncoded, Oa as getRandomLoli, ie as getRandomSticker, lt as installKunUIConfig, ct as provideKunUIConfig, Hc as resizeImage, Ft as useBodyScrollLock, Nr as useContentLightbox, Ki as useFilePicker, wt as useKunAlert, Ct as useKunAlertState, Kt as useKunBackgroundInert, Di as useKunCopy, an as useKunFloating, za as useKunLoliInfo, Ra as useKunLoliState, Ei as useKunMessage, Ti as useKunMessageState, Vt as useKunOverlayZIndex, Vo as useKunPointerMenu, ut as useKunUIConfig, at as useKunUniqueId, Tt as useResolvedRounded, Et as useRipple, Mr as useSpoilerContent };
|