@kungal/ui-vue 1.9.4 → 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/CHANGELOG.md +41 -0
- package/dist/components/Carousel.vue.d.ts +1 -0
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/types.d.ts +6 -0
- package/dist/components/types.d.ts.map +1 -1
- package/dist/index.js +595 -554
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Comment as e, Fragment as t, Teleport as n, Text as r, Transition as i, TransitionGroup as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, isRef as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, onUnmounted as C, openBlock as w, provide as T, reactive as E, ref as D, renderList as O, renderSlot as k, resolveDynamicComponent as A, toDisplayString as j, toRefs as M, toValue as N, unref as P, useCssVars as F, useId as I, useModel as L, useSlots as R, vModelText as z, vShow as B, watch as V, watchEffect as H, withCtx as U, withDirectives as W, withKeys as G, withModifiers as K } from "vue";
|
|
2
|
-
import { KUN_DEFAULT_ROUNDED as
|
|
3
|
-
import { onClickOutside as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { arrow as
|
|
6
|
-
import { addMonths as
|
|
7
|
-
import { enUS as
|
|
8
|
-
import { Cropper as
|
|
2
|
+
import { KUN_DEFAULT_ROUNDED as q, cn as J, decodeIfEncoded as Y, decodeIfEncoded as ee, getKunIcon as te, getRandomSticker as ne, getRandomSticker as re, kunBgClasses as ie, kunBorderClasses as ae, kunChipSizeClasses as oe, kunControlSizeClasses as se, kunControlSquareClasses as ce, kunFocusRingClasses as X, kunFocusRingWithinClasses as le, kunRoundedClasses as Z, kunSelectionSizeClasses as ue, kunSoftBgClasses as de, kunSolidBgClasses as fe, kunSolidClasses as pe, kunSolidFgClasses as me, kunTextClasses as he, kunVariantClasses as ge, randomNum as _e, resolveRounded as ve } from "@kungal/ui-core";
|
|
3
|
+
import { onClickOutside as ye, onKeyStroke as be, useElementSize as xe, useEventListener as Se, useMediaQuery as Ce, useScroll as we } from "@vueuse/core";
|
|
4
|
+
import { useFocusTrap as Te } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
+
import { arrow as Ee, autoUpdate as De, flip as Oe, offset as ke, shift as Ae, size as je, useFloating as Me } from "@floating-ui/vue";
|
|
6
|
+
import { addMonths as Ne, addYears as Pe, eachDayOfInterval as Fe, endOfMonth as Ie, endOfWeek as Le, format as Re, isAfter as ze, isBefore as Be, isSameDay as Ve, isSameMonth as He, isToday as Ue, isValid as We, parseISO as Ge, startOfDay as Ke, startOfMonth as qe, startOfToday as Je, startOfWeek as Ye } from "date-fns";
|
|
7
|
+
import { enUS as Xe, ja as Ze, zhCN as Qe } from "date-fns/locale";
|
|
8
|
+
import { Cropper as $e } from "vue-advanced-cropper";
|
|
9
9
|
//#region src/composables/accordionContext.ts
|
|
10
|
-
var
|
|
10
|
+
var et = Symbol("kun-accordion"), tt = /* @__PURE__ */ p({
|
|
11
11
|
name: "KunAccordion",
|
|
12
12
|
__name: "Accordion",
|
|
13
13
|
props: /*@__PURE__*/ g({
|
|
@@ -27,7 +27,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
27
27
|
let t = e, n = L(e, "modelValue"), r = (e) => e == null ? [] : Array.isArray(e) ? e : e === "" ? [] : [e], i = D(r(t.defaultValue)), a = o(() => n.value !== void 0), s = o(() => a.value ? r(n.value) : i.value), c = (e) => {
|
|
28
28
|
a.value ? n.value = t.multiple ? e : e[0] ?? "" : i.value = e;
|
|
29
29
|
};
|
|
30
|
-
T(
|
|
30
|
+
T(et, {
|
|
31
31
|
isOpen: (e) => s.value.includes(e),
|
|
32
32
|
toggle: (e) => {
|
|
33
33
|
let n = new Set(s.value);
|
|
@@ -42,10 +42,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
42
42
|
default: return "divide-kun divide-y";
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
return (t, n) => (w(), l("div", { class: y(P(
|
|
45
|
+
return (t, n) => (w(), l("div", { class: y(P(J)(u.value, e.className)) }, [k(t.$slots, "default")], 2));
|
|
46
46
|
}
|
|
47
|
-
}),
|
|
48
|
-
rounded:
|
|
47
|
+
}), nt = (e) => D(`${e ?? ""}${I()}`), rt = Symbol("kun-ui-config"), it = {
|
|
48
|
+
rounded: q,
|
|
49
49
|
linkComponent: "a",
|
|
50
50
|
iconComponent: null,
|
|
51
51
|
navigate: (e) => {
|
|
@@ -53,17 +53,17 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
53
53
|
},
|
|
54
54
|
imageComponent: "img",
|
|
55
55
|
userLinkTemplate: "/user/{id}/info"
|
|
56
|
-
},
|
|
57
|
-
T(
|
|
58
|
-
...
|
|
56
|
+
}, at = (e = {}) => {
|
|
57
|
+
T(rt, {
|
|
58
|
+
...it,
|
|
59
59
|
...e
|
|
60
60
|
});
|
|
61
|
-
},
|
|
62
|
-
e.provide(
|
|
63
|
-
...
|
|
61
|
+
}, ot = (e, t = {}) => {
|
|
62
|
+
e.provide(rt, {
|
|
63
|
+
...it,
|
|
64
64
|
...t
|
|
65
65
|
});
|
|
66
|
-
},
|
|
66
|
+
}, st = () => m(rt, it), ct = ["viewBox", "innerHTML"], lt = /*@__PURE__*/ p({
|
|
67
67
|
name: "KunIcon",
|
|
68
68
|
__name: "Icon",
|
|
69
69
|
props: {
|
|
@@ -72,7 +72,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
72
72
|
className: { default: "" }
|
|
73
73
|
},
|
|
74
74
|
setup(e) {
|
|
75
|
-
let t = e, n =
|
|
75
|
+
let t = e, n = st(), r = o(() => J("inline-block size-[1em] shrink-0 align-[-0.125em] text-inherit", t.class, t.className)), i = o(() => t.name ? te(t.name) : void 0);
|
|
76
76
|
return (t, a) => i.value ? (w(), l("svg", {
|
|
77
77
|
key: 0,
|
|
78
78
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -80,29 +80,29 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
80
80
|
class: y(r.value),
|
|
81
81
|
"aria-hidden": "true",
|
|
82
82
|
innerHTML: i.value.body
|
|
83
|
-
}, null, 10,
|
|
83
|
+
}, null, 10, ct)) : e.name && P(n).iconComponent ? (w(), s(A(P(n).iconComponent), {
|
|
84
84
|
key: 1,
|
|
85
85
|
name: e.name,
|
|
86
86
|
class: y(r.value)
|
|
87
87
|
}, null, 8, ["name", "class"])) : c("", !0);
|
|
88
88
|
}
|
|
89
|
-
}),
|
|
89
|
+
}), ut = (e, t) => {
|
|
90
90
|
let n = e.__vccOpts || e;
|
|
91
91
|
for (let [e, r] of t) n[e] = r;
|
|
92
92
|
return n;
|
|
93
|
-
},
|
|
93
|
+
}, Q = /*#__PURE__*/ ut(lt, [["__scopeId", "data-v-44cd432d"]]), dt = [
|
|
94
94
|
"id",
|
|
95
95
|
"aria-expanded",
|
|
96
96
|
"aria-controls",
|
|
97
97
|
"disabled"
|
|
98
|
-
],
|
|
98
|
+
], ft = {
|
|
99
99
|
key: 0,
|
|
100
100
|
class: "text-default-500 inline-flex shrink-0"
|
|
101
|
-
},
|
|
101
|
+
}, pt = { class: "min-w-0 flex-1" }, mt = [
|
|
102
102
|
"id",
|
|
103
103
|
"aria-labelledby",
|
|
104
104
|
"inert"
|
|
105
|
-
],
|
|
105
|
+
], ht = { class: "overflow-hidden" }, gt = { class: "text-default-600 px-4 pb-4 text-sm" }, _t = /* @__PURE__ */ p({
|
|
106
106
|
name: "KunAccordionItem",
|
|
107
107
|
__name: "AccordionItem",
|
|
108
108
|
props: {
|
|
@@ -117,36 +117,36 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
117
117
|
className: { default: "" }
|
|
118
118
|
},
|
|
119
119
|
setup(e) {
|
|
120
|
-
let t = e, n = m(
|
|
120
|
+
let t = e, n = m(et, null), r = o(() => n?.isOpen(t.value) ?? !1), i = o(() => n?.variant.value === "splitted"), a = nt(t.name ? `${t.name}-acc-` : "kun-acc-"), s = o(() => `${a.value}-header`), p = o(() => `${a.value}-panel`), h = () => {
|
|
121
121
|
t.disabled || n?.toggle(t.value);
|
|
122
122
|
};
|
|
123
|
-
return (t, n) => (w(), l("div", { class: y(P(
|
|
123
|
+
return (t, n) => (w(), l("div", { class: y(P(J)(i.value && "border-kun rounded-kun-lg overflow-hidden border", e.className)) }, [u("h3", null, [u("button", {
|
|
124
124
|
id: s.value,
|
|
125
125
|
type: "button",
|
|
126
126
|
"aria-expanded": r.value,
|
|
127
127
|
"aria-controls": p.value,
|
|
128
128
|
disabled: e.disabled,
|
|
129
|
-
class: y(P(
|
|
129
|
+
class: y(P(J)("flex w-full items-center gap-3 px-4 py-4 text-left font-medium transition-colors", e.disabled ? "cursor-not-allowed opacity-50" : "hover:bg-default/5 cursor-pointer")),
|
|
130
130
|
onClick: h
|
|
131
131
|
}, [
|
|
132
|
-
e.icon ? (w(), l("span",
|
|
132
|
+
e.icon ? (w(), l("span", ft, [f(Q, {
|
|
133
133
|
name: e.icon,
|
|
134
134
|
class: "size-5"
|
|
135
135
|
}, null, 8, ["name"])])) : c("", !0),
|
|
136
|
-
u("span",
|
|
137
|
-
f(
|
|
136
|
+
u("span", pt, [k(t.$slots, "title", {}, () => [d(j(e.title), 1)])]),
|
|
137
|
+
f(Q, {
|
|
138
138
|
name: "lucide:chevron-down",
|
|
139
|
-
class: y(P(
|
|
139
|
+
class: y(P(J)("text-default-500 size-5 shrink-0 transition-transform duration-kun-base", r.value && "rotate-180"))
|
|
140
140
|
}, null, 8, ["class"])
|
|
141
|
-
], 10,
|
|
141
|
+
], 10, dt)]), u("div", {
|
|
142
142
|
id: p.value,
|
|
143
143
|
role: "region",
|
|
144
144
|
"aria-labelledby": s.value,
|
|
145
145
|
inert: !r.value,
|
|
146
|
-
class: y(P(
|
|
147
|
-
}, [u("div",
|
|
146
|
+
class: y(P(J)("grid transition-[grid-template-rows] duration-kun-base ease-kun-standard", r.value ? "grid-rows-[1fr]" : "grid-rows-[0fr]"))
|
|
147
|
+
}, [u("div", ht, [u("div", gt, [k(t.$slots, "default")])])], 10, mt)], 2));
|
|
148
148
|
}
|
|
149
|
-
}),
|
|
149
|
+
}), vt = D({
|
|
150
150
|
show: !1,
|
|
151
151
|
title: "",
|
|
152
152
|
message: "",
|
|
@@ -155,16 +155,16 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
155
155
|
cancelText: "取消",
|
|
156
156
|
type: "info",
|
|
157
157
|
confirmColor: void 0
|
|
158
|
-
}),
|
|
159
|
-
state:
|
|
158
|
+
}), yt = null, bt = () => ({
|
|
159
|
+
state: vt,
|
|
160
160
|
handleConfirm: () => {
|
|
161
|
-
|
|
161
|
+
vt.value.show = !1, yt?.(!0), yt = null;
|
|
162
162
|
},
|
|
163
163
|
handleCancel: () => {
|
|
164
|
-
|
|
164
|
+
vt.value.show = !1, yt?.(!1), yt = null;
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
167
|
-
|
|
166
|
+
}), xt = (e = {}) => (yt?.(!1), new Promise((t) => {
|
|
167
|
+
yt = t, vt.value = {
|
|
168
168
|
show: !0,
|
|
169
169
|
title: e.title ?? "",
|
|
170
170
|
message: e.message ?? "",
|
|
@@ -174,9 +174,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
174
174
|
type: e.type ?? "info",
|
|
175
175
|
confirmColor: e.confirmColor
|
|
176
176
|
};
|
|
177
|
-
})),
|
|
178
|
-
let n =
|
|
179
|
-
return o(() =>
|
|
177
|
+
})), St = (e, t) => {
|
|
178
|
+
let n = st();
|
|
179
|
+
return o(() => ve(e(), t, n.rounded));
|
|
180
180
|
}, Ct = () => {
|
|
181
181
|
let e = D([]), t = 0, n = /* @__PURE__ */ new Set();
|
|
182
182
|
return C(() => {
|
|
@@ -203,7 +203,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
203
203
|
else if (i.type === e) continue;
|
|
204
204
|
else Array.isArray(i.children) && (n += wt(i.children));
|
|
205
205
|
return n;
|
|
206
|
-
}, Tt = /*#__PURE__*/
|
|
206
|
+
}, Tt = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
207
207
|
name: "KunRipple",
|
|
208
208
|
__name: "Ripple",
|
|
209
209
|
props: { ripples: {} },
|
|
@@ -262,7 +262,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
262
262
|
},
|
|
263
263
|
emits: ["click"],
|
|
264
264
|
setup(e, { emit: t }) {
|
|
265
|
-
let n = e, r = t, i = R(), a =
|
|
265
|
+
let n = e, r = t, i = R(), a = st(), u = o(() => n.ariaLabel ? n.ariaLabel : n.isIconOnly ? "button" : i.default && wt(i.default()).trim() || ""), d = o(() => se[n.size]), p = o(() => ge(n.variant, n.color)), m = St(() => n.rounded), h = o(() => Z[m.value]), g = o(() => n.isIconOnly ? ce[n.size] : ""), { ripples: v, onClick: y } = Ct(), b = o(() => n.disabled || n.loading), x = o(() => n.href ? a.linkComponent : "button"), S = o(() => n.href ? {
|
|
266
266
|
...typeof a.linkComponent == "string" ? { href: n.href } : { to: n.href },
|
|
267
267
|
target: n.target,
|
|
268
268
|
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
@@ -281,11 +281,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
281
281
|
y(e), r("click", e);
|
|
282
282
|
};
|
|
283
283
|
return (t, n) => (w(), s(A(x.value), _(S.value, {
|
|
284
|
-
class: P(
|
|
284
|
+
class: P(J)("relative inline-flex cursor-pointer items-center justify-center gap-1 overflow-hidden font-medium whitespace-nowrap transition-all hover:opacity-80 active:scale-[0.97] [&_svg]:shrink-0", P(J)(P(X)[e.color], "focus-visible:ring-offset-2 focus-visible:ring-offset-background"), d.value, p.value, h.value, e.fullWidth ? "w-full" : "", g.value, b.value && "pointer-events-none cursor-not-allowed opacity-50 hover:bg-none", e.className),
|
|
285
285
|
onClick: C
|
|
286
286
|
}), {
|
|
287
287
|
default: U(() => [
|
|
288
|
-
e.loading ? (w(), s(
|
|
288
|
+
e.loading ? (w(), s(Q, {
|
|
289
289
|
key: 0,
|
|
290
290
|
class: "text-sm",
|
|
291
291
|
name: "svg-spinners:90-ring-with-bg"
|
|
@@ -338,7 +338,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
338
338
|
deactivate: () => {
|
|
339
339
|
zt--, zt <= 0 && (zt = 0, Ht());
|
|
340
340
|
}
|
|
341
|
-
}), Wt = ["role", "aria-label"], Gt = /*#__PURE__*/
|
|
341
|
+
}), Wt = ["role", "aria-label"], Gt = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
342
342
|
name: "KunModal",
|
|
343
343
|
__name: "Modal",
|
|
344
344
|
props: /*@__PURE__*/ g({
|
|
@@ -371,7 +371,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
371
371
|
}),
|
|
372
372
|
emits: /*@__PURE__*/ g(["close"], ["update:modelValue"]),
|
|
373
373
|
setup(e, { emit: t }) {
|
|
374
|
-
let r = e, a =
|
|
374
|
+
let r = e, a = St(() => r.rounded), u = o(() => Z[a.value]), d = {
|
|
375
375
|
sm: "max-w-sm",
|
|
376
376
|
md: "max-w-md",
|
|
377
377
|
lg: "max-w-lg",
|
|
@@ -383,43 +383,43 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
383
383
|
e && !F ? (j(), F = !0) : !e && F && (M(), F = !1);
|
|
384
384
|
}, { activate: R, deactivate: z } = Ut(), B = !1, H = (e) => {
|
|
385
385
|
e && !B ? (R(), B = !0) : !e && B && (z(), B = !1);
|
|
386
|
-
}, W = D(null), { activate: G, deactivate:
|
|
386
|
+
}, W = D(null), { activate: G, deactivate: q } = Te(W, {
|
|
387
387
|
immediate: !1,
|
|
388
388
|
escapeDeactivates: !1,
|
|
389
389
|
allowOutsideClick: !0,
|
|
390
390
|
returnFocusOnDeactivate: !0
|
|
391
|
-
}),
|
|
391
|
+
}), Y = () => {
|
|
392
392
|
r.isDismissable && (g.value = !1, _("close"));
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
e.target === e.currentTarget &&
|
|
393
|
+
}, ee = D(!1), te = (e) => {
|
|
394
|
+
ee.value = e.target === e.currentTarget;
|
|
395
|
+
}, ne = (e) => {
|
|
396
|
+
e.target === e.currentTarget && ee.value && Y();
|
|
397
397
|
};
|
|
398
|
-
return
|
|
399
|
-
e.key === "Escape" && g.value && N.value &&
|
|
398
|
+
return Se("keydown", (e) => {
|
|
399
|
+
e.key === "Escape" && g.value && N.value && Y();
|
|
400
400
|
}), V(g, async (e) => {
|
|
401
|
-
O(e), I(e), e ? (await v(), G(), H(!0)) : (H(!1),
|
|
401
|
+
O(e), I(e), e ? (await v(), G(), H(!0)) : (H(!1), q());
|
|
402
402
|
}), S(async () => {
|
|
403
403
|
g.value && (O(!0), I(!0), await v(), G(), H(!0));
|
|
404
404
|
}), C(() => {
|
|
405
|
-
O(!1), I(!1), H(!1),
|
|
405
|
+
O(!1), I(!1), H(!1), q();
|
|
406
406
|
}), (t, r) => (w(), s(n, { to: "body" }, [f(i, { name: "kun-modal" }, {
|
|
407
407
|
default: U(() => [g.value ? (w(), l("div", {
|
|
408
408
|
key: 0,
|
|
409
409
|
ref_key: "trapEl",
|
|
410
410
|
ref: W,
|
|
411
411
|
"data-kun-overlay": "",
|
|
412
|
-
class: y(P(
|
|
412
|
+
class: y(P(J)("bg-default-800/70 dark:bg-background/70 fixed top-0 left-0 z-kun-modal flex h-full w-full justify-center p-3", m.value, e.className)),
|
|
413
413
|
style: b({ zIndex: P(A) }),
|
|
414
|
-
onPointerdown:
|
|
415
|
-
onClick:
|
|
414
|
+
onPointerdown: te,
|
|
415
|
+
onClick: ne,
|
|
416
416
|
tabindex: "0"
|
|
417
417
|
}, [e.withContainer ? (w(), l("div", {
|
|
418
418
|
key: 0,
|
|
419
419
|
role: e.role,
|
|
420
420
|
"aria-modal": "true",
|
|
421
421
|
"aria-label": e.ariaLabel || "对话框",
|
|
422
|
-
class: y(P(
|
|
422
|
+
class: y(P(J)("kun-modal-panel bg-content1/85 scrollbar-hide shadow-kun-lg kun-backdrop relative mx-auto min-w-80 p-6", p.value, h.value, u.value, e.innerClassName)),
|
|
423
423
|
onClick: r[1] ||= K(() => {}, ["stop"])
|
|
424
424
|
}, [k(t.$slots, "default", {}, void 0, !0), e.isShowCloseButton ? (w(), s($, {
|
|
425
425
|
key: 0,
|
|
@@ -433,7 +433,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
433
433
|
g.value = !1, _("close");
|
|
434
434
|
}
|
|
435
435
|
}, {
|
|
436
|
-
default: U(() => [f(
|
|
436
|
+
default: U(() => [f(Q, {
|
|
437
437
|
class: "icon",
|
|
438
438
|
name: "lucide:x"
|
|
439
439
|
})]),
|
|
@@ -452,7 +452,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
452
452
|
name: "KunAlertProvider",
|
|
453
453
|
__name: "AlertProvider",
|
|
454
454
|
setup(e) {
|
|
455
|
-
let { state: t, handleConfirm: n, handleCancel: r } =
|
|
455
|
+
let { state: t, handleConfirm: n, handleCancel: r } = bt(), i = o(() => t.value.confirmColor ? t.value.confirmColor : t.value.type === "danger" ? "danger" : t.value.type === "warning" ? "warning" : "primary");
|
|
456
456
|
return (e, a) => (w(), s(Gt, {
|
|
457
457
|
"model-value": P(t).show,
|
|
458
458
|
role: "alertdialog",
|
|
@@ -498,17 +498,17 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
498
498
|
left: "right"
|
|
499
499
|
}, tn = (e, t, n = {}) => {
|
|
500
500
|
let r = D(null), i = n.constrain ?? !0, a = [
|
|
501
|
-
|
|
502
|
-
...i ? [
|
|
501
|
+
ke(n.offset ?? 8),
|
|
502
|
+
...i ? [Oe(), Ae({ padding: n.padding ?? 8 })] : [],
|
|
503
503
|
...n.middleware ?? [],
|
|
504
|
-
...n.arrow ? [
|
|
504
|
+
...n.arrow ? [Ee({
|
|
505
505
|
element: r,
|
|
506
506
|
padding: n.arrowPadding ?? 6
|
|
507
507
|
})] : []
|
|
508
|
-
], { floatingStyles: s, placement: c, middlewareData: l } =
|
|
508
|
+
], { floatingStyles: s, placement: c, middlewareData: l } = Me(e, t, {
|
|
509
509
|
placement: o(() => N(n.placement) ?? "bottom"),
|
|
510
510
|
open: n.open,
|
|
511
|
-
whileElementsMounted:
|
|
511
|
+
whileElementsMounted: De,
|
|
512
512
|
transform: n.transform ?? !1,
|
|
513
513
|
middleware: a
|
|
514
514
|
});
|
|
@@ -604,11 +604,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
604
604
|
}),
|
|
605
605
|
emits: /*@__PURE__*/ g(["select", "search"], ["update:modelValue"]),
|
|
606
606
|
setup(e, { expose: r, emit: a }) {
|
|
607
|
-
let d = e, p = L(e, "modelValue"), m = a, h =
|
|
607
|
+
let d = e, p = L(e, "modelValue"), m = a, h = St(() => d.rounded), g = o(() => Z[h.value]), x = nt("kun-autocomplete"), S = o(() => `${x.value}-listbox`), C = o(() => !!d.error || d.isInvalid), T = D(!1), E = D(-1), k = D(!1), A = D(null), M = D(null), N = D(null), F = D(null), { floatingStyles: I, transformOrigin: R } = tn(M, N, {
|
|
608
608
|
placement: "bottom-start",
|
|
609
609
|
open: T,
|
|
610
610
|
offset: 4,
|
|
611
|
-
middleware: [
|
|
611
|
+
middleware: [je({ apply({ rects: e, elements: t, availableHeight: n }) {
|
|
612
612
|
Object.assign(t.floating.style, {
|
|
613
613
|
width: `${e.reference.width}px`,
|
|
614
614
|
maxHeight: `${Math.min(280, n - 8)}px`
|
|
@@ -626,7 +626,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
626
626
|
v(() => {
|
|
627
627
|
nn(F.value, F.value?.querySelector(`[data-index="${E.value}"]`));
|
|
628
628
|
});
|
|
629
|
-
},
|
|
629
|
+
}, q = (e) => {
|
|
630
630
|
let t = z.value.length;
|
|
631
631
|
if (!t) return;
|
|
632
632
|
let n = E.value;
|
|
@@ -635,20 +635,20 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
635
635
|
break;
|
|
636
636
|
}
|
|
637
637
|
K();
|
|
638
|
-
},
|
|
638
|
+
}, Y = (e) => {
|
|
639
639
|
e.disabled || (p.value = e.label, k.value = !1, m("select", e), G(), v(() => A.value?.focus()));
|
|
640
|
-
},
|
|
640
|
+
}, ee = (e) => {
|
|
641
641
|
p.value = e.target.value, k.value = !0, m("search", p.value), W(), E.value = H();
|
|
642
|
-
},
|
|
642
|
+
}, te = (e) => {
|
|
643
643
|
if (!d.disabled) switch (e.key) {
|
|
644
644
|
case "ArrowDown":
|
|
645
|
-
e.preventDefault(), T.value ?
|
|
645
|
+
e.preventDefault(), T.value ? q(1) : W();
|
|
646
646
|
break;
|
|
647
647
|
case "ArrowUp":
|
|
648
|
-
e.preventDefault(), T.value &&
|
|
648
|
+
e.preventDefault(), T.value && q(-1);
|
|
649
649
|
break;
|
|
650
650
|
case "Enter":
|
|
651
|
-
T.value && z.value[E.value] && (e.preventDefault(),
|
|
651
|
+
T.value && z.value[E.value] && (e.preventDefault(), Y(z.value[E.value]));
|
|
652
652
|
break;
|
|
653
653
|
case "Escape":
|
|
654
654
|
T.value && (e.preventDefault(), G());
|
|
@@ -657,21 +657,21 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
657
657
|
G();
|
|
658
658
|
break;
|
|
659
659
|
}
|
|
660
|
-
},
|
|
660
|
+
}, ne = () => {
|
|
661
661
|
setTimeout(() => {
|
|
662
662
|
!d.allowCustomValue && p.value && !d.options.some((e) => e.label.toLowerCase() === p.value.toLowerCase()) && (p.value = "", m("search", ""));
|
|
663
663
|
}, 120);
|
|
664
|
-
},
|
|
664
|
+
}, re = () => {
|
|
665
665
|
p.value = "", k.value = !0, m("search", ""), v(() => A.value?.focus()), W();
|
|
666
666
|
};
|
|
667
|
-
return
|
|
667
|
+
return ye(M, (e) => {
|
|
668
668
|
N.value?.contains(e.target) || G();
|
|
669
669
|
}), V(z, () => {
|
|
670
670
|
T.value && (E.value < 0 || E.value >= z.value.length || z.value[E.value]?.disabled) && (E.value = H());
|
|
671
671
|
}), r({
|
|
672
672
|
focus: () => A.value?.focus(),
|
|
673
673
|
blur: () => A.value?.blur()
|
|
674
|
-
}), (r, a) => (w(), l("div", { class: y(P(
|
|
674
|
+
}), (r, a) => (w(), l("div", { class: y(P(J)("relative w-full")) }, [
|
|
675
675
|
e.label ? (w(), l("label", {
|
|
676
676
|
key: 0,
|
|
677
677
|
for: P(x),
|
|
@@ -699,19 +699,19 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
699
699
|
placeholder: e.placeholder,
|
|
700
700
|
disabled: e.disabled,
|
|
701
701
|
autocomplete: "off",
|
|
702
|
-
class: P(
|
|
703
|
-
onInput:
|
|
702
|
+
class: P(J)("block w-full bg-content1 shadow-kun-sm border transition-[color,box-shadow]", g.value, P(se)[e.size], e.clearable && p.value ? "pr-9" : "", C.value ? P(J)("border-danger-300", P(X).danger) : P(J)("border-kun", P(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60"),
|
|
703
|
+
onInput: ee,
|
|
704
704
|
onFocus: W,
|
|
705
|
-
onKeydown:
|
|
706
|
-
onBlur:
|
|
705
|
+
onKeydown: te,
|
|
706
|
+
onBlur: ne
|
|
707
707
|
}), null, 16, an), e.clearable && p.value && !e.disabled ? (w(), l("button", {
|
|
708
708
|
key: 0,
|
|
709
709
|
type: "button",
|
|
710
710
|
tabindex: "-1",
|
|
711
711
|
class: "text-default-400 hover:text-default-600 absolute inset-y-0 right-0 flex items-center pr-3",
|
|
712
712
|
"aria-label": "清除",
|
|
713
|
-
onClick:
|
|
714
|
-
}, [f(
|
|
713
|
+
onClick: re
|
|
714
|
+
}, [f(Q, {
|
|
715
715
|
name: "lucide:circle-x",
|
|
716
716
|
class: "size-4"
|
|
717
717
|
})])) : c("", !0)], 512),
|
|
@@ -734,7 +734,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
734
734
|
ref_key: "dropdownRef",
|
|
735
735
|
ref: N,
|
|
736
736
|
style: b([P(I), { transformOrigin: P(R) }]),
|
|
737
|
-
class: y(P(
|
|
737
|
+
class: y(P(J)("bg-content1 z-kun-popover flex flex-col overflow-hidden p-1 shadow-kun-md", g.value))
|
|
738
738
|
}, [u("ul", {
|
|
739
739
|
ref_key: "listRef",
|
|
740
740
|
ref: F,
|
|
@@ -749,7 +749,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
749
749
|
role: "option",
|
|
750
750
|
"aria-selected": t === E.value,
|
|
751
751
|
"aria-disabled": e.disabled || void 0,
|
|
752
|
-
onClick: (t) =>
|
|
752
|
+
onClick: (t) => Y(e),
|
|
753
753
|
onMousemove: (n) => !e.disabled && (E.value = t)
|
|
754
754
|
}, [u("span", ln, j(e.label), 1)], 42, cn))), 128)), z.value.length ? c("", !0) : (w(), l("li", un, j(e.noResultText), 1))], 8, sn)], 6)) : c("", !0)]),
|
|
755
755
|
_: 1
|
|
@@ -829,7 +829,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
829
829
|
sizes: { default: void 0 }
|
|
830
830
|
},
|
|
831
831
|
setup(e) {
|
|
832
|
-
let t = e, n =
|
|
832
|
+
let t = e, n = st(), r = o(() => n.imageComponent ?? "img"), i = o(() => typeof r.value == "string"), a = D(null), u = D(!1), d = o(() => u.value && t.fallbackSrc ? t.fallbackSrc : t.src);
|
|
833
833
|
V(() => t.src, () => u.value = !1);
|
|
834
834
|
let { status: f, onLoad: p, onError: m } = hn(a, o(() => d.value)), h = () => {
|
|
835
835
|
m(), !u.value && t.fallbackSrc && (u.value = !0);
|
|
@@ -866,7 +866,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
866
866
|
}), S = o(() => t.aspectRatio ? { aspectRatio: t.aspectRatio } : void 0), C = o(() => t.skeleton);
|
|
867
867
|
return (t, n) => C.value ? (w(), l("div", {
|
|
868
868
|
key: 1,
|
|
869
|
-
class: y(P(
|
|
869
|
+
class: y(P(J)("relative overflow-hidden", e.aspectRatio ? "block w-full" : "inline-block", e.className)),
|
|
870
870
|
style: b(S.value)
|
|
871
871
|
}, [P(f) === "loaded" ? c("", !0) : (w(), l("div", {
|
|
872
872
|
key: 0,
|
|
@@ -876,11 +876,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
876
876
|
ref_key: "imgEl",
|
|
877
877
|
ref: a
|
|
878
878
|
}, v.value, {
|
|
879
|
-
class: P(
|
|
879
|
+
class: P(J)("block size-full transition-opacity duration-kun-slow", e.aspectRatio ? "absolute inset-0" : "", x.value, P(f) === "loaded" ? "opacity-100" : "opacity-0", e.imageClassName),
|
|
880
880
|
onLoad: P(p),
|
|
881
881
|
onError: h
|
|
882
882
|
}), null, 16, ["class", "onLoad"]))], 6)) : (w(), s(A(r.value), _({ key: 0 }, v.value, {
|
|
883
|
-
class: P(
|
|
883
|
+
class: P(J)(e.className, e.imageClassName),
|
|
884
884
|
onError: h
|
|
885
885
|
}), null, 16, ["class"]));
|
|
886
886
|
}
|
|
@@ -900,7 +900,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
900
900
|
floatingPosition: {}
|
|
901
901
|
},
|
|
902
902
|
setup(e) {
|
|
903
|
-
let t = e, n =
|
|
903
|
+
let t = e, n = st(), r = o(() => t.isNavigation && !!t.user?.id), i = o(() => {
|
|
904
904
|
if (!r.value) return {};
|
|
905
905
|
let e = n.userLinkTemplate.replace("{id}", String(t.user?.id));
|
|
906
906
|
return typeof n.linkComponent == "string" ? { href: e } : { to: e };
|
|
@@ -914,12 +914,12 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
914
914
|
case "xl": return "size-12";
|
|
915
915
|
default: return "size-8";
|
|
916
916
|
}
|
|
917
|
-
}), c = o(() => t.user?.avatar ||
|
|
918
|
-
return (o, l) => (w(), s(A(r.value ? P(n).linkComponent : "div"), _(i.value, { class: P(
|
|
917
|
+
}), c = o(() => t.user?.avatar || re(t.user?.name ?? ""));
|
|
918
|
+
return (o, l) => (w(), s(A(r.value ? P(n).linkComponent : "div"), _(i.value, { class: P(J)("flex shrink-0 justify-center rounded-full transition duration-kun-fast ease-kun-standard", r.value && "cursor-pointer hover:scale-110", a.value, e.className) }), {
|
|
919
919
|
default: U(() => [f(gn, {
|
|
920
|
-
"class-name": P(
|
|
920
|
+
"class-name": P(J)("inline-block rounded-full", a.value, t.imageClassName),
|
|
921
921
|
src: c.value,
|
|
922
|
-
"fallback-src": P(
|
|
922
|
+
"fallback-src": P(re)(e.user?.name ?? ""),
|
|
923
923
|
alt: e.user?.name ?? "未知用户"
|
|
924
924
|
}, null, 8, [
|
|
925
925
|
"class-name",
|
|
@@ -1002,7 +1002,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1002
1002
|
"top-left": "-top-1 -left-1",
|
|
1003
1003
|
"bottom-right": "-bottom-1 -right-1",
|
|
1004
1004
|
"bottom-left": "-bottom-1 -left-1"
|
|
1005
|
-
}, u = R(), d = o(() => !u.default), f = o(() =>
|
|
1005
|
+
}, u = R(), d = o(() => !u.default), f = o(() => J("inline-flex items-center justify-center rounded-full font-medium whitespace-nowrap", pe[t.color], t.variant === "dot" ? i[t.size] : a[t.size], d.value ? "" : J("absolute z-10 ring-2 ring-background", s[t.placement]), t.className));
|
|
1006
1006
|
return (t, i) => d.value ? (w(), l("span", xn, [n.value ? (w(), l("span", {
|
|
1007
1007
|
key: 0,
|
|
1008
1008
|
class: y(f.value),
|
|
@@ -1035,7 +1035,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1035
1035
|
emits: ["close"],
|
|
1036
1036
|
setup(e, { emit: t }) {
|
|
1037
1037
|
let n = e, r = t;
|
|
1038
|
-
return (t, i) => (w(), l("span", { class: y(P(
|
|
1038
|
+
return (t, i) => (w(), l("span", { class: y(P(J)("inline-flex cursor-default items-center justify-center gap-1 rounded-full font-medium whitespace-nowrap", P(oe)[n.size], P(ge)(n.variant, n.color), e.disabled && "pointer-events-none opacity-50", e.className)) }, [
|
|
1039
1039
|
k(t.$slots, "start"),
|
|
1040
1040
|
k(t.$slots, "default"),
|
|
1041
1041
|
e.closable ? (w(), l("button", {
|
|
@@ -1045,7 +1045,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1045
1045
|
"aria-label": "移除",
|
|
1046
1046
|
disabled: e.disabled,
|
|
1047
1047
|
onClick: i[0] ||= K((e) => r("close"), ["stop"])
|
|
1048
|
-
}, [f(
|
|
1048
|
+
}, [f(Q, {
|
|
1049
1049
|
name: "lucide:x",
|
|
1050
1050
|
class: "size-3.5"
|
|
1051
1051
|
})], 8, En)) : c("", !0),
|
|
@@ -1066,7 +1066,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1066
1066
|
nameClass: { default: "text-xl" }
|
|
1067
1067
|
},
|
|
1068
1068
|
setup(e) {
|
|
1069
|
-
let t = e, n =
|
|
1069
|
+
let t = e, n = st(), r = o(() => typeof n.linkComponent == "string" ? { href: t.to } : { to: t.to });
|
|
1070
1070
|
return (t, i) => (w(), s(A(P(n).linkComponent), _(r.value, { class: "flex cursor-pointer items-center gap-3 text-inherit no-underline" }), {
|
|
1071
1071
|
default: U(() => [
|
|
1072
1072
|
f(gn, {
|
|
@@ -1127,7 +1127,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1127
1127
|
},
|
|
1128
1128
|
emits: ["click"],
|
|
1129
1129
|
setup(e, { emit: t }) {
|
|
1130
|
-
let n = e, r = t, i =
|
|
1130
|
+
let n = e, r = t, i = st(), { ripples: a, onClick: d } = Ct(), p = o(() => !!n.href || n.clickable), m = o(() => n.href ? i.linkComponent : n.clickable ? "button" : "div"), h = o(() => n.href ? typeof i.linkComponent == "string" ? { href: n.href } : { to: n.href } : n.clickable ? { type: "button" } : {}), g = (e) => {
|
|
1131
1131
|
p.value && d(e), r("click", e);
|
|
1132
1132
|
}, v = {
|
|
1133
1133
|
background: "bg-content1",
|
|
@@ -1138,20 +1138,20 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1138
1138
|
warning: "bg-warning-100/30 border-warning-300",
|
|
1139
1139
|
danger: "bg-danger-100/30 border-danger-300",
|
|
1140
1140
|
info: "bg-info-100/30 border-info-300"
|
|
1141
|
-
}, b =
|
|
1141
|
+
}, b = St(() => n.rounded), x = o(() => Z[b.value]), S = {
|
|
1142
1142
|
none: "p-0",
|
|
1143
1143
|
sm: "p-3",
|
|
1144
1144
|
md: "p-5",
|
|
1145
1145
|
lg: "p-6"
|
|
1146
1146
|
};
|
|
1147
1147
|
return (t, r) => (w(), s(A(m.value), _(h.value, {
|
|
1148
|
-
class: P(
|
|
1148
|
+
class: P(J)("relative flex flex-col gap-4 transition-all duration-kun-fast", S[e.padding], !e.isTransparent && "shadow-kun-sm kun-backdrop", (p.value || e.isHoverable) && Mn, e.bordered && "border-kun border", p.value && "cursor-pointer overflow-hidden active:scale-[0.97] text-left", !e.isTransparent && v[n.color], x.value, e.className),
|
|
1149
1149
|
onClick: g
|
|
1150
1150
|
}), {
|
|
1151
1151
|
default: U(() => [
|
|
1152
1152
|
t.$slots.header ? (w(), l("div", kn, [k(t.$slots, "header")])) : c("", !0),
|
|
1153
1153
|
t.$slots.cover ? (w(), l("div", An, [k(t.$slots, "cover")])) : c("", !0),
|
|
1154
|
-
u("div", { class: y(P(
|
|
1154
|
+
u("div", { class: y(P(J)("flex h-full flex-col justify-between gap-1", e.contentClass)) }, [k(t.$slots, "default")], 2),
|
|
1155
1155
|
t.$slots.footer ? (w(), l("div", jn, [k(t.$slots, "footer")])) : c("", !0),
|
|
1156
1156
|
f(Tt, { ripples: P(a) }, null, 8, ["ripples"])
|
|
1157
1157
|
]),
|
|
@@ -1182,6 +1182,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1182
1182
|
default: !0
|
|
1183
1183
|
},
|
|
1184
1184
|
autoplay: { default: 0 },
|
|
1185
|
+
loop: {
|
|
1186
|
+
type: Boolean,
|
|
1187
|
+
default: !0
|
|
1188
|
+
},
|
|
1185
1189
|
ariaLabel: { default: "轮播" },
|
|
1186
1190
|
className: { default: "" }
|
|
1187
1191
|
},
|
|
@@ -1191,85 +1195,122 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1191
1195
|
slidesPerView: o(() => Math.max(1, n.slidesPerView)),
|
|
1192
1196
|
gap: o(() => n.gap)
|
|
1193
1197
|
});
|
|
1194
|
-
let r = D(null), i = D(0), a = D(0), s = o(() => Math.max(0, i.value - n.slidesPerView)),
|
|
1198
|
+
let r = D(null), i = D(0), a = D(0), s = D(0), d = (e, t) => t <= 0 ? 0 : (e % t + t) % t, p = o(() => Math.max(0, i.value - n.slidesPerView)), m = o(() => n.loop && p.value >= 2), h = o(() => Math.min(Math.max(1, Math.floor(p.value / 2)), Math.max(1, p.value - 1))), g = o(() => n.showArrows && i.value > n.slidesPerView), _ = o(() => n.showIndicators && i.value > n.slidesPerView), v = o(() => m.value && n.slidesPerView <= 1), C = o(() => v.value ? i.value : p.value + 1), E = o(() => v.value ? d(s.value + (a.value - h.value), i.value) : a.value), A = !1, j = (e) => {
|
|
1195
1199
|
let t = e.children[0];
|
|
1196
1200
|
if (!t) return 0;
|
|
1197
1201
|
let n = parseFloat(getComputedStyle(e).columnGap || "0") || 0;
|
|
1198
1202
|
return t.getBoundingClientRect().width + n;
|
|
1199
|
-
},
|
|
1203
|
+
}, M = () => {
|
|
1204
|
+
let e = r.value;
|
|
1205
|
+
if (!e) return;
|
|
1206
|
+
let t = i.value;
|
|
1207
|
+
if (!m.value || t === 0) {
|
|
1208
|
+
for (let t of Array.from(e.children)) t.style.order = "";
|
|
1209
|
+
return;
|
|
1210
|
+
}
|
|
1211
|
+
let n = d(h.value - s.value, t);
|
|
1212
|
+
Array.from(e.children).forEach((e, r) => {
|
|
1213
|
+
e.style.order = String(d(r + n, t));
|
|
1214
|
+
});
|
|
1215
|
+
}, N = (e, t = !0) => {
|
|
1200
1216
|
let n = r.value;
|
|
1201
1217
|
if (!n) return;
|
|
1202
|
-
let a = Math.max(0, Math.min(e,
|
|
1218
|
+
let i = j(n), a = Math.max(0, Math.min(e, p.value));
|
|
1203
1219
|
n.scrollTo({
|
|
1204
|
-
left: a *
|
|
1205
|
-
behavior: t && !
|
|
1220
|
+
left: a * i,
|
|
1221
|
+
behavior: t && !A ? "smooth" : "auto"
|
|
1206
1222
|
});
|
|
1207
|
-
},
|
|
1208
|
-
|
|
1209
|
-
|
|
1223
|
+
}, F = () => N(a.value - 1), I = () => N(a.value + 1), L = (e) => {
|
|
1224
|
+
if (!v.value) return N(e);
|
|
1225
|
+
let t = i.value;
|
|
1226
|
+
N(d(e + d(h.value - s.value, t), t));
|
|
1227
|
+
}, R = () => {
|
|
1228
|
+
let e = r.value;
|
|
1229
|
+
if (!e || !m.value) return;
|
|
1230
|
+
let t = j(e);
|
|
1231
|
+
if (!t) return;
|
|
1232
|
+
let n = Math.round(e.scrollLeft / t) - h.value;
|
|
1233
|
+
n && (s.value = d(s.value + n, i.value), M(), e.scrollLeft = h.value * t, a.value = h.value);
|
|
1234
|
+
}, z, B = () => {
|
|
1235
|
+
m.value && (clearTimeout(z), z = setTimeout(R, 130));
|
|
1236
|
+
}, V = 0, H = () => {
|
|
1237
|
+
V ||= requestAnimationFrame(() => {
|
|
1238
|
+
V = 0;
|
|
1210
1239
|
let e = r.value;
|
|
1211
1240
|
if (!e) return;
|
|
1212
|
-
let t =
|
|
1213
|
-
t > 0 && (a.value = Math.round(e.scrollLeft / t));
|
|
1241
|
+
let t = j(e);
|
|
1242
|
+
t > 0 && (a.value = Math.round(e.scrollLeft / t)), B();
|
|
1214
1243
|
});
|
|
1215
|
-
},
|
|
1216
|
-
|
|
1217
|
-
|
|
1244
|
+
}, U, W = () => n.autoplay > 0 && !A && i.value > n.slidesPerView, G = () => {
|
|
1245
|
+
K(), W() && (U = setInterval(() => {
|
|
1246
|
+
m.value ? I() : N(a.value >= p.value ? 0 : a.value + 1);
|
|
1218
1247
|
}, n.autoplay));
|
|
1219
|
-
},
|
|
1220
|
-
|
|
1221
|
-
},
|
|
1222
|
-
|
|
1223
|
-
|
|
1248
|
+
}, K = () => {
|
|
1249
|
+
U && clearInterval(U), U = void 0;
|
|
1250
|
+
}, q = () => {
|
|
1251
|
+
let e = r.value;
|
|
1252
|
+
if (i.value = e?.children.length ?? 0, i.value > 0 && (s.value = d(s.value, i.value)), M(), e && m.value) {
|
|
1253
|
+
let t = j(e);
|
|
1254
|
+
t && (e.scrollLeft = h.value * t, a.value = h.value);
|
|
1255
|
+
}
|
|
1256
|
+
}, Y = () => {
|
|
1257
|
+
let e = r.value;
|
|
1258
|
+
if (e && m.value) {
|
|
1259
|
+
let t = j(e);
|
|
1260
|
+
t && (e.scrollLeft = h.value * t);
|
|
1261
|
+
}
|
|
1262
|
+
}, ee = null;
|
|
1224
1263
|
return S(() => {
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1264
|
+
A = typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches, q();
|
|
1265
|
+
let e = r.value;
|
|
1266
|
+
e && (e.addEventListener("scrollend", R), typeof MutationObserver < "u" && (ee = new MutationObserver(() => {
|
|
1267
|
+
q(), G();
|
|
1268
|
+
}), ee.observe(e, { childList: !0 }))), window.addEventListener("resize", Y), G();
|
|
1228
1269
|
}), x(() => {
|
|
1229
|
-
|
|
1270
|
+
K(), ee?.disconnect(), V && cancelAnimationFrame(V), clearTimeout(z), r.value?.removeEventListener("scrollend", R), window.removeEventListener("resize", Y);
|
|
1230
1271
|
}), (n, i) => (w(), l("div", {
|
|
1231
|
-
class: y(P(
|
|
1272
|
+
class: y(P(J)("group/carousel relative", e.className)),
|
|
1232
1273
|
role: "region",
|
|
1233
1274
|
"aria-roledescription": "carousel",
|
|
1234
1275
|
"aria-label": e.ariaLabel,
|
|
1235
|
-
onPointerenter:
|
|
1236
|
-
onPointerleave:
|
|
1237
|
-
onFocusin:
|
|
1238
|
-
onFocusout:
|
|
1276
|
+
onPointerenter: K,
|
|
1277
|
+
onPointerleave: G,
|
|
1278
|
+
onFocusin: K,
|
|
1279
|
+
onFocusout: G
|
|
1239
1280
|
}, [
|
|
1240
1281
|
u("ul", {
|
|
1241
1282
|
ref_key: "trackRef",
|
|
1242
1283
|
ref: r,
|
|
1243
1284
|
class: "scrollbar-hide flex snap-x snap-mandatory overflow-x-auto",
|
|
1244
1285
|
style: b({ gap: e.gap }),
|
|
1245
|
-
onScrollPassive:
|
|
1286
|
+
onScrollPassive: H
|
|
1246
1287
|
}, [k(n.$slots, "default")], 36),
|
|
1247
|
-
|
|
1288
|
+
g.value ? (w(), l(t, { key: 0 }, [u("button", {
|
|
1248
1289
|
type: "button",
|
|
1249
1290
|
"aria-label": "上一张",
|
|
1250
|
-
disabled:
|
|
1291
|
+
disabled: !m.value && E.value <= 0,
|
|
1251
1292
|
class: "border-kun bg-background/80 text-foreground absolute top-1/2 left-2 z-10 inline-flex size-9 -translate-y-1/2 items-center justify-center rounded-full border shadow-kun-sm backdrop-blur transition disabled:pointer-events-none disabled:opacity-0 hover:scale-105",
|
|
1252
|
-
onClick:
|
|
1253
|
-
}, [f(
|
|
1293
|
+
onClick: F
|
|
1294
|
+
}, [f(Q, {
|
|
1254
1295
|
name: "lucide:chevron-left",
|
|
1255
1296
|
class: "size-5"
|
|
1256
1297
|
})], 8, In), u("button", {
|
|
1257
1298
|
type: "button",
|
|
1258
1299
|
"aria-label": "下一张",
|
|
1259
|
-
disabled:
|
|
1300
|
+
disabled: !m.value && E.value >= p.value,
|
|
1260
1301
|
class: "border-kun bg-background/80 text-foreground absolute top-1/2 right-2 z-10 inline-flex size-9 -translate-y-1/2 items-center justify-center rounded-full border shadow-kun-sm backdrop-blur transition disabled:pointer-events-none disabled:opacity-0 hover:scale-105",
|
|
1261
|
-
onClick:
|
|
1262
|
-
}, [f(
|
|
1302
|
+
onClick: I
|
|
1303
|
+
}, [f(Q, {
|
|
1263
1304
|
name: "lucide:chevron-right",
|
|
1264
1305
|
class: "size-5"
|
|
1265
1306
|
})], 8, Ln)], 64)) : c("", !0),
|
|
1266
|
-
|
|
1307
|
+
_.value ? (w(), l("div", Rn, [(w(!0), l(t, null, O(C.value, (e) => (w(), l("button", {
|
|
1267
1308
|
key: e,
|
|
1268
1309
|
type: "button",
|
|
1269
1310
|
"aria-label": `跳到第 ${e} 张`,
|
|
1270
|
-
"aria-current":
|
|
1271
|
-
class: y(P(
|
|
1272
|
-
onClick: (t) =>
|
|
1311
|
+
"aria-current": E.value === e - 1 ? "true" : void 0,
|
|
1312
|
+
class: y(P(J)("h-2 rounded-full transition-all", E.value === e - 1 ? "bg-primary w-5" : "bg-default-300 hover:bg-default-400 w-2")),
|
|
1313
|
+
onClick: (t) => L(e - 1)
|
|
1273
1314
|
}, null, 10, zn))), 128))])) : c("", !0)
|
|
1274
1315
|
], 42, Fn));
|
|
1275
1316
|
}
|
|
@@ -1283,7 +1324,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1283
1324
|
return e <= 1 ? "100%" : `calc((100% - ${e - 1} * ${n}) / ${e})`;
|
|
1284
1325
|
});
|
|
1285
1326
|
return (t, r) => (w(), l("li", {
|
|
1286
|
-
class: y(P(
|
|
1327
|
+
class: y(P(J)("shrink-0 snap-start", e.className)),
|
|
1287
1328
|
style: b({ flexBasis: n.value }),
|
|
1288
1329
|
"aria-roledescription": "slide"
|
|
1289
1330
|
}, [k(t.$slots, "default")], 6));
|
|
@@ -1333,13 +1374,13 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1333
1374
|
}),
|
|
1334
1375
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
1335
1376
|
setup(e, { emit: t }) {
|
|
1336
|
-
let n = e, r = o(() =>
|
|
1377
|
+
let n = e, r = o(() => ue[n.size]), i = {
|
|
1337
1378
|
xs: "w-2",
|
|
1338
1379
|
sm: "w-2.5",
|
|
1339
1380
|
md: "w-2.5",
|
|
1340
1381
|
lg: "w-3",
|
|
1341
1382
|
xl: "w-3.5"
|
|
1342
|
-
}, a = L(e, "modelValue"), s = t, d =
|
|
1383
|
+
}, a = L(e, "modelValue"), s = t, d = nt("kun-checkbox"), p = D(null);
|
|
1343
1384
|
H(() => {
|
|
1344
1385
|
p.value && (p.value.indeterminate = n.indeterminate);
|
|
1345
1386
|
});
|
|
@@ -1362,8 +1403,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1362
1403
|
warning: "bg-warning border-warning",
|
|
1363
1404
|
danger: "bg-danger border-danger",
|
|
1364
1405
|
info: "bg-info border-info"
|
|
1365
|
-
}, _ = o(() =>
|
|
1366
|
-
return (t, o) => (w(), l("div", null, [u("div", { class: y(P(
|
|
1406
|
+
}, _ = o(() => me[n.color]);
|
|
1407
|
+
return (t, o) => (w(), l("div", null, [u("div", { class: y(P(J)("flex cursor-pointer items-center", r.value.gap, e.className)) }, [
|
|
1367
1408
|
u("div", Hn, [
|
|
1368
1409
|
u("input", {
|
|
1369
1410
|
id: P(d),
|
|
@@ -1375,10 +1416,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1375
1416
|
checked: a.value,
|
|
1376
1417
|
disabled: e.disabled,
|
|
1377
1418
|
"aria-describedby": e.error || e.description ? `${P(d)}-desc` : void 0,
|
|
1378
|
-
class: y(P(
|
|
1419
|
+
class: y(P(J)("peer cursor-pointer appearance-none border-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", P(X)[n.color], r.value.box, n.type === "single" ? "rounded-full" : "rounded-[35%]", e.indeterminate ? g[n.color] : h[n.color])),
|
|
1379
1420
|
onChange: m
|
|
1380
1421
|
}, null, 42, Un),
|
|
1381
|
-
W(u("div", { class: y(P(
|
|
1422
|
+
W(u("div", { class: y(P(J)("pointer-events-none absolute inset-0 flex scale-50 items-center justify-center opacity-0 transition-all duration-kun-fast ease-kun-emphasized peer-checked:scale-100 peer-checked:opacity-100", _.value)) }, [f(Q, {
|
|
1382
1423
|
name: "lucide:check",
|
|
1383
1424
|
class: y(r.value.check)
|
|
1384
1425
|
}, null, 8, ["class"])], 2), [[B, !e.indeterminate]]),
|
|
@@ -1388,7 +1429,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1388
1429
|
e.label ? (w(), l("label", {
|
|
1389
1430
|
key: 0,
|
|
1390
1431
|
for: P(d),
|
|
1391
|
-
class: y(P(
|
|
1432
|
+
class: y(P(J)("text-default-700 cursor-pointer select-none", r.value.text, e.disabled && "cursor-not-allowed opacity-50"))
|
|
1392
1433
|
}, j(e.label), 11, Gn)) : c("", !0)
|
|
1393
1434
|
], 2), e.error ? (w(), l("p", {
|
|
1394
1435
|
key: 0,
|
|
@@ -1649,7 +1690,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1649
1690
|
], zr = ["src", "alt"], Br = {
|
|
1650
1691
|
class: "min-w-[3.5rem] text-center text-sm font-medium tabular-nums text-white",
|
|
1651
1692
|
"aria-live": "polite"
|
|
1652
|
-
}, Vr = 1, Hr = 5, Ur = 50, Wr = .5, Gr = 6, Kr = 300, qr = 30, Jr = /*#__PURE__*/
|
|
1693
|
+
}, Vr = 1, Hr = 5, Ur = 50, Wr = .5, Gr = 6, Kr = 300, qr = 30, Jr = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
1653
1694
|
name: "KunLightbox",
|
|
1654
1695
|
__name: "Lightbox",
|
|
1655
1696
|
props: {
|
|
@@ -1680,39 +1721,39 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1680
1721
|
let e = Math.min(Hr, d.value + Wr);
|
|
1681
1722
|
if (e === d.value) return;
|
|
1682
1723
|
d.value = e;
|
|
1683
|
-
let t =
|
|
1724
|
+
let t = X(v.x, v.y);
|
|
1684
1725
|
v.x = t.x, v.y = t.y;
|
|
1685
1726
|
}, G = () => {
|
|
1686
1727
|
let e = Math.max(Vr, d.value - Wr);
|
|
1687
1728
|
if (e === d.value) return;
|
|
1688
1729
|
d.value = e;
|
|
1689
|
-
let t =
|
|
1730
|
+
let t = X(v.x, v.y);
|
|
1690
1731
|
v.x = t.x, v.y = t.y;
|
|
1691
|
-
}, ee = () => {
|
|
1692
|
-
_.value += 90;
|
|
1693
1732
|
}, q = () => {
|
|
1733
|
+
_.value += 90;
|
|
1734
|
+
}, J = () => {
|
|
1694
1735
|
_.value -= 90;
|
|
1695
|
-
},
|
|
1736
|
+
}, Y = (e) => {
|
|
1696
1737
|
let t = document;
|
|
1697
1738
|
typeof t.startViewTransition == "function" ? t.startViewTransition(e) : e();
|
|
1698
|
-
}, { lock:
|
|
1739
|
+
}, { lock: ee, unlock: te } = Mt(), ne = !1;
|
|
1699
1740
|
V(() => r.isOpen, (e) => {
|
|
1700
1741
|
let t = F.value;
|
|
1701
|
-
t && (e && !t.open ? (H(),
|
|
1742
|
+
t && (e && !t.open ? (H(), Y(() => t.showModal()), ne ||= (ee(), !0)) : !e && t.open && (Y(() => t.close()), ne &&= (te(), !1)));
|
|
1702
1743
|
}, { flush: "post" }), V(() => r.initialIndex, () => {
|
|
1703
1744
|
s.value = r.initialIndex || 0, H();
|
|
1704
1745
|
});
|
|
1705
|
-
let
|
|
1706
|
-
r.isOpen && (a("update:isOpen", !1), H()),
|
|
1707
|
-
},
|
|
1746
|
+
let re = () => {
|
|
1747
|
+
r.isOpen && (a("update:isOpen", !1), H()), ne &&= (te(), !1);
|
|
1748
|
+
}, ie = (e) => {
|
|
1708
1749
|
e.target === F.value && a("update:isOpen", !1);
|
|
1709
|
-
},
|
|
1750
|
+
}, ae = () => {
|
|
1710
1751
|
S.value || a("update:isOpen", !1);
|
|
1711
|
-
},
|
|
1752
|
+
}, oe = () => {
|
|
1712
1753
|
P.value = "slide-next", H(), s.value = (s.value + 1) % r.images.length;
|
|
1713
|
-
},
|
|
1754
|
+
}, se = () => {
|
|
1714
1755
|
P.value = "slide-prev", H(), s.value = (s.value - 1 + r.images.length) % r.images.length;
|
|
1715
|
-
},
|
|
1756
|
+
}, ce = () => {
|
|
1716
1757
|
if (!I.value || !L.value) return {
|
|
1717
1758
|
minX: 0,
|
|
1718
1759
|
maxX: 0,
|
|
@@ -1726,17 +1767,17 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1726
1767
|
minY: -a,
|
|
1727
1768
|
maxY: a
|
|
1728
1769
|
};
|
|
1729
|
-
},
|
|
1770
|
+
}, X = (e, t) => {
|
|
1730
1771
|
if (d.value <= 1) return {
|
|
1731
1772
|
x: 0,
|
|
1732
1773
|
y: 0
|
|
1733
1774
|
};
|
|
1734
|
-
let n =
|
|
1775
|
+
let n = ce();
|
|
1735
1776
|
return {
|
|
1736
1777
|
x: Math.min(Math.max(e, n.minX), n.maxX),
|
|
1737
1778
|
y: Math.min(Math.max(t, n.minY), n.maxY)
|
|
1738
1779
|
};
|
|
1739
|
-
},
|
|
1780
|
+
}, le = (e) => {
|
|
1740
1781
|
e.preventDefault();
|
|
1741
1782
|
let t = -e.deltaY, n = d.value + (t > 0 ? .2 : -.2), r = Math.max(Vr, Math.min(Hr, n));
|
|
1742
1783
|
if (r !== d.value) {
|
|
@@ -1745,14 +1786,14 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1745
1786
|
let n = e.clientX - t.left, i = e.clientY - t.top, a = r / d.value, o = {
|
|
1746
1787
|
x: n - (n - v.x) * a,
|
|
1747
1788
|
y: i - (i - v.y) * a
|
|
1748
|
-
}, s =
|
|
1789
|
+
}, s = X(o.x, o.y);
|
|
1749
1790
|
v.x = s.x, v.y = s.y, d.value = r;
|
|
1750
1791
|
}
|
|
1751
|
-
},
|
|
1792
|
+
}, Z = (e) => {
|
|
1752
1793
|
x.value = !0, S.value = !1, M.value = Date.now();
|
|
1753
1794
|
let t = "touches" in e ? e.touches[0] : e;
|
|
1754
1795
|
T.x = t.clientX - v.x, T.y = t.clientY - v.y, N.x = t.clientX, N.y = t.clientY;
|
|
1755
|
-
},
|
|
1796
|
+
}, ue = (e) => {
|
|
1756
1797
|
if (!x.value) return;
|
|
1757
1798
|
let t = "touches" in e ? e.touches[0] : e;
|
|
1758
1799
|
if ((Math.abs(t.clientX - N.x) > Gr || Math.abs(t.clientY - N.y) > Gr) && (S.value = !0), d.value <= 1) {
|
|
@@ -1762,13 +1803,13 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1762
1803
|
let n = {
|
|
1763
1804
|
x: t.clientX - T.x,
|
|
1764
1805
|
y: t.clientY - T.y
|
|
1765
|
-
}, r =
|
|
1806
|
+
}, r = X(n.x, n.y);
|
|
1766
1807
|
v.x = r.x, v.y = r.y;
|
|
1767
|
-
},
|
|
1808
|
+
}, de = (e) => {
|
|
1768
1809
|
if (!x.value) return;
|
|
1769
1810
|
let t = ("touches" in e ? e.changedTouches[0] : e).clientX - N.x, n = Date.now() - M.value, r = Math.abs(t) / n;
|
|
1770
|
-
d.value <= 1 && Math.abs(t) > Ur && r > .2 && (t > 0 ?
|
|
1771
|
-
},
|
|
1811
|
+
d.value <= 1 && Math.abs(t) > Ur && r > .2 && (t > 0 ? se() : oe(), v.x = 0, v.y = 0), x.value = !1;
|
|
1812
|
+
}, fe = (e, t) => {
|
|
1772
1813
|
let n = L.value?.getBoundingClientRect();
|
|
1773
1814
|
if (!n) return;
|
|
1774
1815
|
if (d.value > Vr) {
|
|
@@ -1777,24 +1818,24 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1777
1818
|
}
|
|
1778
1819
|
let r = e - n.left, i = t - n.top;
|
|
1779
1820
|
d.value = 2;
|
|
1780
|
-
let a =
|
|
1821
|
+
let a = X(r - n.width / 2, i - n.height / 2);
|
|
1781
1822
|
v.x = a.x, v.y = a.y;
|
|
1782
|
-
},
|
|
1823
|
+
}, pe = (e) => fe(e.clientX, e.clientY), me = (e) => {
|
|
1783
1824
|
if (e.touches.length >= 2) {
|
|
1784
1825
|
x.value = !1, p.value = !0;
|
|
1785
1826
|
let [t, n] = [e.touches[0], e.touches[1]];
|
|
1786
1827
|
A.value = Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), k.x = (t.clientX + n.clientX) / 2, k.y = (t.clientY + n.clientY) / 2;
|
|
1787
|
-
} else e.touches.length === 1 && !p.value &&
|
|
1788
|
-
},
|
|
1828
|
+
} else e.touches.length === 1 && !p.value && Z(e);
|
|
1829
|
+
}, he = (e) => {
|
|
1789
1830
|
if (e.touches.length >= 2 && p.value) {
|
|
1790
1831
|
let [t, n] = [e.touches[0], e.touches[1]], r = Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), i = (t.clientX + n.clientX) / 2, a = (t.clientY + n.clientY) / 2, o = r / (A.value || 1), s = Math.max(Vr, Math.min(Hr, d.value * o)), c = L.value?.getBoundingClientRect();
|
|
1791
1832
|
if (c) {
|
|
1792
|
-
let e = i - c.left - c.width / 2, t = a - c.top - c.height / 2, n = s / d.value, r = e - (e - v.x) * n, o = t - (t - v.y) * n, l = i - k.x, u = a - k.y, f =
|
|
1833
|
+
let e = i - c.left - c.width / 2, t = a - c.top - c.height / 2, n = s / d.value, r = e - (e - v.x) * n, o = t - (t - v.y) * n, l = i - k.x, u = a - k.y, f = X(r + l, o + u);
|
|
1793
1834
|
v.x = f.x, v.y = f.y;
|
|
1794
1835
|
}
|
|
1795
1836
|
d.value = s, A.value = r, k.x = i, k.y = a;
|
|
1796
|
-
} else e.touches.length === 1 && x.value &&
|
|
1797
|
-
},
|
|
1837
|
+
} else e.touches.length === 1 && x.value && ue(e);
|
|
1838
|
+
}, ge = (e) => {
|
|
1798
1839
|
if (p.value) {
|
|
1799
1840
|
if (e.touches.length >= 2) return;
|
|
1800
1841
|
if (p.value = !1, e.touches.length === 1) {
|
|
@@ -1803,7 +1844,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1803
1844
|
}
|
|
1804
1845
|
return;
|
|
1805
1846
|
}
|
|
1806
|
-
if (
|
|
1847
|
+
if (de(e), e.touches.length !== 0) return;
|
|
1807
1848
|
let t = e.changedTouches[0];
|
|
1808
1849
|
if (!t) return;
|
|
1809
1850
|
if (Math.abs(t.clientX - N.x) > qr || Math.abs(t.clientY - N.y) > qr) {
|
|
@@ -1811,8 +1852,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1811
1852
|
return;
|
|
1812
1853
|
}
|
|
1813
1854
|
let n = Date.now();
|
|
1814
|
-
n - m < Kr && Math.abs(t.clientX - h) < qr && Math.abs(t.clientY - g) < qr ? (
|
|
1815
|
-
},
|
|
1855
|
+
n - m < Kr && Math.abs(t.clientX - h) < qr && Math.abs(t.clientY - g) < qr ? (fe(t.clientX, t.clientY), m = 0) : (m = n, h = t.clientX, g = t.clientY);
|
|
1856
|
+
}, _e = async () => {
|
|
1816
1857
|
let e = R.value;
|
|
1817
1858
|
if (!e) return;
|
|
1818
1859
|
let t = e.split("/").pop() || "image";
|
|
@@ -1824,37 +1865,37 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1824
1865
|
} catch (t) {
|
|
1825
1866
|
console.warn("[KunLightbox] direct download blocked (likely CORS), opening in new tab", t), window.open(e, "_blank", "noopener,noreferrer");
|
|
1826
1867
|
}
|
|
1827
|
-
},
|
|
1868
|
+
}, ve = (e) => {
|
|
1828
1869
|
e === s.value || e < 0 || e >= r.images.length || (P.value = e > s.value ? "slide-next" : "slide-prev", H(), s.value = e);
|
|
1829
|
-
},
|
|
1830
|
-
e.key === "ArrowLeft" ? (e.preventDefault(),
|
|
1870
|
+
}, ye = o(() => Math.round(d.value * 100)), be = (e) => {
|
|
1871
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), se()) : e.key === "ArrowRight" && (e.preventDefault(), oe());
|
|
1831
1872
|
};
|
|
1832
1873
|
return C(() => {
|
|
1833
|
-
|
|
1874
|
+
ne && te();
|
|
1834
1875
|
}), (n, r) => (w(), l("dialog", {
|
|
1835
1876
|
ref_key: "dialogRef",
|
|
1836
1877
|
ref: F,
|
|
1837
1878
|
"aria-label": "图片查看器",
|
|
1838
1879
|
class: "kun-lightbox-dialog bg-transparent text-foreground p-0 m-0 max-w-none max-h-none w-screen h-screen overflow-hidden backdrop:bg-default-800/80",
|
|
1839
|
-
onClose:
|
|
1840
|
-
onClick:
|
|
1841
|
-
onKeydown:
|
|
1880
|
+
onClose: re,
|
|
1881
|
+
onClick: ie,
|
|
1882
|
+
onKeydown: be
|
|
1842
1883
|
}, [e.isOpen ? (w(), l("div", jr, [
|
|
1843
1884
|
u("div", {
|
|
1844
1885
|
ref_key: "containerRef",
|
|
1845
1886
|
ref: L,
|
|
1846
1887
|
class: "kun-lightbox-stage relative flex h-full w-full touch-none items-center justify-center overflow-hidden",
|
|
1847
|
-
onClick:
|
|
1848
|
-
onWheel: K(
|
|
1849
|
-
onMousedown:
|
|
1850
|
-
onMousemove:
|
|
1851
|
-
onMouseup:
|
|
1852
|
-
onMouseleave:
|
|
1853
|
-
onTouchstartPassive:
|
|
1854
|
-
onTouchmovePassive:
|
|
1855
|
-
onTouchend:
|
|
1856
|
-
onTouchcancel:
|
|
1857
|
-
onDblclick:
|
|
1888
|
+
onClick: ae,
|
|
1889
|
+
onWheel: K(le, ["prevent"]),
|
|
1890
|
+
onMousedown: Z,
|
|
1891
|
+
onMousemove: ue,
|
|
1892
|
+
onMouseup: de,
|
|
1893
|
+
onMouseleave: de,
|
|
1894
|
+
onTouchstartPassive: me,
|
|
1895
|
+
onTouchmovePassive: he,
|
|
1896
|
+
onTouchend: ge,
|
|
1897
|
+
onTouchcancel: ge,
|
|
1898
|
+
onDblclick: pe
|
|
1858
1899
|
}, [f(i, { name: P.value }, {
|
|
1859
1900
|
default: U(() => [(w(), l("div", {
|
|
1860
1901
|
key: s.value,
|
|
@@ -1882,7 +1923,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1882
1923
|
"class-name": "absolute top-4 right-4 z-50 bg-black/70 backdrop-blur-md border border-white/10 shadow-lg",
|
|
1883
1924
|
onClick: r[1] ||= K((e) => a("update:isOpen", !1), ["stop"])
|
|
1884
1925
|
}, {
|
|
1885
|
-
default: U(() => [f(
|
|
1926
|
+
default: U(() => [f(Q, {
|
|
1886
1927
|
name: "lucide:x",
|
|
1887
1928
|
class: "text-white"
|
|
1888
1929
|
})]),
|
|
@@ -1896,9 +1937,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1896
1937
|
rounded: "lg",
|
|
1897
1938
|
"aria-label": "上一张",
|
|
1898
1939
|
"class-name": "absolute left-4 top-1/2 z-50 hidden -translate-y-1/2 bg-black/70 backdrop-blur-md border border-white/10 shadow-lg md:flex",
|
|
1899
|
-
onClick: K(
|
|
1940
|
+
onClick: K(se, ["stop"])
|
|
1900
1941
|
}, {
|
|
1901
|
-
default: U(() => [f(
|
|
1942
|
+
default: U(() => [f(Q, {
|
|
1902
1943
|
name: "lucide:chevron-left",
|
|
1903
1944
|
class: "text-white"
|
|
1904
1945
|
})]),
|
|
@@ -1911,9 +1952,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1911
1952
|
rounded: "lg",
|
|
1912
1953
|
"aria-label": "下一张",
|
|
1913
1954
|
"class-name": "absolute right-4 top-1/2 z-50 hidden -translate-y-1/2 bg-black/70 backdrop-blur-md border border-white/10 shadow-lg md:flex",
|
|
1914
|
-
onClick: K(
|
|
1955
|
+
onClick: K(oe, ["stop"])
|
|
1915
1956
|
}, {
|
|
1916
|
-
default: U(() => [f(
|
|
1957
|
+
default: U(() => [f(Q, {
|
|
1917
1958
|
name: "lucide:chevron-right",
|
|
1918
1959
|
class: "text-white"
|
|
1919
1960
|
})]),
|
|
@@ -1926,7 +1967,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1926
1967
|
"aria-label": `跳转到第 ${t + 1} 张`,
|
|
1927
1968
|
"aria-current": t === s.value,
|
|
1928
1969
|
class: y(["size-2 rounded-full transition-colors", t === s.value ? "bg-primary-500" : "bg-default-400/60 hover:bg-default-300"]),
|
|
1929
|
-
onClick: K((e) =>
|
|
1970
|
+
onClick: K((e) => ve(t), ["stop"])
|
|
1930
1971
|
}, null, 10, Ir))), 128))])) : c("", !0),
|
|
1931
1972
|
e.images.length > 1 ? (w(), l("div", Lr, [(w(!0), l(t, null, O(e.images, (e, t) => (w(), l("button", {
|
|
1932
1973
|
key: `thumb-${t}`,
|
|
@@ -1934,7 +1975,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1934
1975
|
"aria-label": `跳转到第 ${t + 1} 张`,
|
|
1935
1976
|
"aria-current": t === s.value,
|
|
1936
1977
|
class: y(["shrink-0 overflow-hidden rounded-md border-2 transition-all", t === s.value ? "border-primary-500 opacity-100" : "border-transparent opacity-60 hover:opacity-100"]),
|
|
1937
|
-
onClick: K((e) =>
|
|
1978
|
+
onClick: K((e) => ve(t), ["stop"])
|
|
1938
1979
|
}, [u("img", {
|
|
1939
1980
|
src: e.src,
|
|
1940
1981
|
alt: e.alt ?? "",
|
|
@@ -1954,13 +1995,13 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1954
1995
|
"aria-label": "缩小",
|
|
1955
1996
|
onClick: G
|
|
1956
1997
|
}, {
|
|
1957
|
-
default: U(() => [f(
|
|
1998
|
+
default: U(() => [f(Q, {
|
|
1958
1999
|
name: "lucide:zoom-out",
|
|
1959
2000
|
class: "text-white"
|
|
1960
2001
|
})]),
|
|
1961
2002
|
_: 1
|
|
1962
2003
|
}),
|
|
1963
|
-
u("span", Br, j(
|
|
2004
|
+
u("span", Br, j(ye.value) + "% ", 1),
|
|
1964
2005
|
f($, {
|
|
1965
2006
|
"is-icon-only": !0,
|
|
1966
2007
|
color: "default",
|
|
@@ -1970,7 +2011,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1970
2011
|
"aria-label": "放大",
|
|
1971
2012
|
onClick: W
|
|
1972
2013
|
}, {
|
|
1973
|
-
default: U(() => [f(
|
|
2014
|
+
default: U(() => [f(Q, {
|
|
1974
2015
|
name: "lucide:zoom-in",
|
|
1975
2016
|
class: "text-white"
|
|
1976
2017
|
})]),
|
|
@@ -1987,9 +2028,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
1987
2028
|
size: "lg",
|
|
1988
2029
|
rounded: "full",
|
|
1989
2030
|
"aria-label": "向左旋转 90°",
|
|
1990
|
-
onClick:
|
|
2031
|
+
onClick: J
|
|
1991
2032
|
}, {
|
|
1992
|
-
default: U(() => [f(
|
|
2033
|
+
default: U(() => [f(Q, {
|
|
1993
2034
|
name: "lucide:rotate-ccw",
|
|
1994
2035
|
class: "text-white"
|
|
1995
2036
|
})]),
|
|
@@ -2002,9 +2043,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2002
2043
|
size: "lg",
|
|
2003
2044
|
rounded: "full",
|
|
2004
2045
|
"aria-label": "向右旋转 90°",
|
|
2005
|
-
onClick:
|
|
2046
|
+
onClick: q
|
|
2006
2047
|
}, {
|
|
2007
|
-
default: U(() => [f(
|
|
2048
|
+
default: U(() => [f(Q, {
|
|
2008
2049
|
name: "lucide:rotate-cw",
|
|
2009
2050
|
class: "text-white"
|
|
2010
2051
|
})]),
|
|
@@ -2023,7 +2064,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2023
2064
|
"aria-label": "重置缩放/旋转/位置",
|
|
2024
2065
|
onClick: H
|
|
2025
2066
|
}, {
|
|
2026
|
-
default: U(() => [f(
|
|
2067
|
+
default: U(() => [f(Q, {
|
|
2027
2068
|
name: "lucide:refresh-ccw",
|
|
2028
2069
|
class: "text-white"
|
|
2029
2070
|
})]),
|
|
@@ -2036,9 +2077,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2036
2077
|
size: "lg",
|
|
2037
2078
|
rounded: "full",
|
|
2038
2079
|
"aria-label": "下载",
|
|
2039
|
-
onClick:
|
|
2080
|
+
onClick: _e
|
|
2040
2081
|
}, {
|
|
2041
|
-
default: U(() => [f(
|
|
2082
|
+
default: U(() => [f(Q, {
|
|
2042
2083
|
name: "lucide:download",
|
|
2043
2084
|
class: "text-white"
|
|
2044
2085
|
})]),
|
|
@@ -2048,7 +2089,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2048
2089
|
])
|
|
2049
2090
|
])) : c("", !0)], 544));
|
|
2050
2091
|
}
|
|
2051
|
-
}), [["__scopeId", "data-v-81a536ec"]]), Yr = ["innerHTML"], Xr = /*#__PURE__*/
|
|
2092
|
+
}), [["__scopeId", "data-v-81a536ec"]]), Yr = ["innerHTML"], Xr = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
2052
2093
|
name: "KunContent",
|
|
2053
2094
|
__name: "Content",
|
|
2054
2095
|
props: {
|
|
@@ -2066,7 +2107,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2066
2107
|
return (a, o) => (w(), l("div", null, [u("article", {
|
|
2067
2108
|
ref_key: "articleRef",
|
|
2068
2109
|
ref: t,
|
|
2069
|
-
class: y(P(
|
|
2110
|
+
class: y(P(J)("kun-prose", e.compact && "kun-prose-compact", e.className)),
|
|
2070
2111
|
innerHTML: e.content
|
|
2071
2112
|
}, null, 10, Yr), f(Jr, {
|
|
2072
2113
|
"is-open": P(n),
|
|
@@ -2094,7 +2135,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2094
2135
|
},
|
|
2095
2136
|
emits: ["select", "close"],
|
|
2096
2137
|
setup(e, { emit: r }) {
|
|
2097
|
-
let a = e, d = r, p =
|
|
2138
|
+
let a = e, d = r, p = st(), m = D(null), h = D(-1), g = D({
|
|
2098
2139
|
x: a.position?.x ?? 0,
|
|
2099
2140
|
y: a.position?.y ?? 0
|
|
2100
2141
|
}), y = null, C = (e, t, n) => Math.min(Math.max(e, t), Math.max(n, t)), T = () => a.items.reduce((e, t, n) => (t.disabled || e.push(n), e), []), E = () => Array.from(m.value?.querySelectorAll("[role=\"menuitem\"]") ?? []), k = (e) => {
|
|
@@ -2188,7 +2229,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2188
2229
|
e.preventDefault(), F(!0);
|
|
2189
2230
|
break;
|
|
2190
2231
|
}
|
|
2191
|
-
},
|
|
2232
|
+
}, q = {
|
|
2192
2233
|
default: "focus:bg-default/20",
|
|
2193
2234
|
primary: "focus:bg-primary/20",
|
|
2194
2235
|
secondary: "focus:bg-secondary/20",
|
|
@@ -2196,7 +2237,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2196
2237
|
warning: "focus:bg-warning/20",
|
|
2197
2238
|
danger: "focus:bg-danger/20",
|
|
2198
2239
|
info: "focus:bg-info/20"
|
|
2199
|
-
},
|
|
2240
|
+
}, Y = (e) => J("relative flex w-full cursor-pointer items-center justify-start gap-2 overflow-hidden rounded-kun-md px-3 py-1.5 text-sm font-medium outline-none transition-colors", ge("light", e.color || "default"), q[e.color || "default"], e.disabled && "pointer-events-none cursor-not-allowed opacity-50");
|
|
2200
2241
|
return (r, a) => (w(), s(n, { to: "body" }, [f(i, {
|
|
2201
2242
|
"enter-active-class": "transition duration-kun-base ease-kun-out",
|
|
2202
2243
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -2220,11 +2261,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2220
2261
|
role: "menuitem",
|
|
2221
2262
|
tabindex: t === h.value ? 0 : -1,
|
|
2222
2263
|
"aria-disabled": e.disabled || void 0,
|
|
2223
|
-
class:
|
|
2264
|
+
class: Y(e),
|
|
2224
2265
|
onClick: (t) => W(t, e),
|
|
2225
2266
|
onMouseenter: (n) => !e.disabled && k(t)
|
|
2226
2267
|
}), {
|
|
2227
|
-
default: U(() => [e.icon ? (w(), s(
|
|
2268
|
+
default: U(() => [e.icon ? (w(), s(Q, {
|
|
2228
2269
|
key: 0,
|
|
2229
2270
|
name: e.icon,
|
|
2230
2271
|
class: "shrink-0 text-base"
|
|
@@ -2240,49 +2281,49 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2240
2281
|
_: 1
|
|
2241
2282
|
})]));
|
|
2242
2283
|
}
|
|
2243
|
-
}), $r = "yyyy-MM-dd", ei = (e, t = $r) =>
|
|
2284
|
+
}), $r = "yyyy-MM-dd", ei = (e, t = $r) => Re(e, t), ti = (e) => {
|
|
2244
2285
|
if (!e) return null;
|
|
2245
|
-
if (e instanceof Date) return
|
|
2246
|
-
let t =
|
|
2247
|
-
return
|
|
2286
|
+
if (e instanceof Date) return We(e) ? e : null;
|
|
2287
|
+
let t = Ge(e);
|
|
2288
|
+
return We(t) ? t : null;
|
|
2248
2289
|
}, ni = (e) => {
|
|
2249
2290
|
switch (e) {
|
|
2250
|
-
case "ja": return
|
|
2251
|
-
case "zh-CN": return
|
|
2252
|
-
default: return
|
|
2291
|
+
case "ja": return Ze;
|
|
2292
|
+
case "zh-CN": return Qe;
|
|
2293
|
+
default: return Xe;
|
|
2253
2294
|
}
|
|
2254
2295
|
}, ri = (e) => {
|
|
2255
|
-
let t = D(ti(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : e.modelValue.value) ||
|
|
2296
|
+
let t = D(ti(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : e.modelValue.value) || Je()), n = D(null), r = o(() => ni(typeof e.locale == "string" ? e.locale : e.locale?.value)), i = o(() => {
|
|
2256
2297
|
let t = r.value, n = e.weekdays && "value" in e.weekdays ? e.weekdays.value : e.weekdays, i = e.months && "value" in e.months ? e.months.value : e.months;
|
|
2257
2298
|
return {
|
|
2258
|
-
weekdays: n || [...Array(7)].map((e, n) =>
|
|
2259
|
-
months: i || [...Array(12)].map((e, n) =>
|
|
2299
|
+
weekdays: n || [...Array(7)].map((e, n) => Re(new Date(2023, 0, n + 1), "EEEEEE", { locale: t })),
|
|
2300
|
+
months: i || [...Array(12)].map((e, n) => Re(new Date(2023, n, 1), "LLLL", { locale: t }))
|
|
2260
2301
|
};
|
|
2261
2302
|
}), a = (e) => {
|
|
2262
|
-
t.value =
|
|
2303
|
+
t.value = Ne(t.value, e);
|
|
2263
2304
|
}, s = (e) => {
|
|
2264
|
-
t.value =
|
|
2305
|
+
t.value = Pe(t.value, e);
|
|
2265
2306
|
}, c = o(() => {
|
|
2266
|
-
let n =
|
|
2267
|
-
start:
|
|
2268
|
-
end:
|
|
2269
|
-
}), a = ti(e.minDate?.value), o = ti(e.maxDate?.value), s =
|
|
2307
|
+
let n = qe(t.value), r = Ie(t.value), i = Fe({
|
|
2308
|
+
start: Ye(n),
|
|
2309
|
+
end: Le(r)
|
|
2310
|
+
}), a = ti(e.minDate?.value), o = ti(e.maxDate?.value), s = Ke(a || /* @__PURE__ */ new Date(0)), c = Ke(o || /* @__PURE__ */ new Date(864e13)), l = Ke(ti(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : e.modelValue.value) || /* @__PURE__ */ new Date(0)), u = Ke(ti(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : null) || /* @__PURE__ */ new Date(0)), d = Ke(ti(Array.isArray(e.modelValue.value) ? e.modelValue.value[1] : null) || /* @__PURE__ */ new Date(0));
|
|
2270
2311
|
return i.map((n) => {
|
|
2271
|
-
let r = e.mode.value === "single" ?
|
|
2312
|
+
let r = e.mode.value === "single" ? Ve(n, l) : Ve(n, u) || Ve(n, d), i = u && d && ze(n, u) && Be(n, d), a = e.isDateDisabled?.value ? e.isDateDisabled.value(n) : !1, o = Be(n, s) || ze(n, c) || a;
|
|
2272
2313
|
return {
|
|
2273
2314
|
date: n,
|
|
2274
2315
|
key: ei(n),
|
|
2275
2316
|
dayOfMonth: n.getDate(),
|
|
2276
|
-
isCurrentMonth:
|
|
2277
|
-
isToday:
|
|
2317
|
+
isCurrentMonth: He(n, t.value),
|
|
2318
|
+
isToday: Ue(n),
|
|
2278
2319
|
isSelected: r,
|
|
2279
|
-
isRangeStart:
|
|
2280
|
-
isRangeEnd:
|
|
2320
|
+
isRangeStart: Ve(n, u),
|
|
2321
|
+
isRangeEnd: Ve(n, d),
|
|
2281
2322
|
isInRange: i,
|
|
2282
2323
|
isDisabled: o
|
|
2283
2324
|
};
|
|
2284
2325
|
});
|
|
2285
|
-
}), l = (t) =>
|
|
2326
|
+
}), l = (t) => Re(t, (e.valueFormat && "value" in e.valueFormat ? e.valueFormat.value : e.valueFormat) || $r);
|
|
2286
2327
|
return {
|
|
2287
2328
|
viewingDate: t,
|
|
2288
2329
|
i18n: i,
|
|
@@ -2293,7 +2334,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2293
2334
|
if (e.mode.value === "single") return l(t);
|
|
2294
2335
|
if (!n.value || Array.isArray(e.modelValue.value) && e.modelValue.value[1]) return n.value = t, [l(t), null];
|
|
2295
2336
|
let r = n.value;
|
|
2296
|
-
return n.value = null, r ?
|
|
2337
|
+
return n.value = null, r ? Be(t, r) ? [l(t), l(r)] : [l(r), l(t)] : [l(t), null];
|
|
2297
2338
|
},
|
|
2298
2339
|
formatDate: ei,
|
|
2299
2340
|
tempRangeStart: n
|
|
@@ -2301,7 +2342,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2301
2342
|
}, ii = {
|
|
2302
2343
|
key: 0,
|
|
2303
2344
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
2304
|
-
}, ai = { class: "relative" }, oi = ["disabled"], si = { class: "flex items-center" }, ci = { class: "flex items-center justify-between" }, li = { class: "flex items-center gap-2" }, ui = { class: "font-semibold" }, di = { class: "flex items-center gap-2" }, fi = { class: "text-default-600 mt-3 grid grid-cols-7 text-center text-xs" }, pi = {
|
|
2345
|
+
}, ai = { class: "relative" }, oi = ["disabled"], si = { class: "flex shrink-0 items-center" }, ci = { class: "flex items-center justify-between" }, li = { class: "flex items-center gap-2" }, ui = { class: "font-semibold" }, di = { class: "flex items-center gap-2" }, fi = { class: "text-default-600 mt-3 grid grid-cols-7 text-center text-xs" }, pi = {
|
|
2305
2346
|
class: "mt-1 grid grid-cols-7",
|
|
2306
2347
|
role: "grid"
|
|
2307
2348
|
}, mi = [
|
|
@@ -2349,21 +2390,21 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2349
2390
|
},
|
|
2350
2391
|
emits: ["update:modelValue"],
|
|
2351
2392
|
setup(e, { emit: r }) {
|
|
2352
|
-
let a = e, p =
|
|
2353
|
-
|
|
2393
|
+
let a = e, p = St(() => a.rounded), m = o(() => Z[p.value]), h = r, g = D(!1), _ = D(null), x = D(null), S = D(null);
|
|
2394
|
+
ye(_, (e) => {
|
|
2354
2395
|
x.value?.contains(e.target) || (g.value = !1);
|
|
2355
2396
|
});
|
|
2356
|
-
let { floatingStyles: C, placement: T } =
|
|
2397
|
+
let { floatingStyles: C, placement: T } = Me(_, x, {
|
|
2357
2398
|
placement: "bottom-start",
|
|
2358
2399
|
open: g,
|
|
2359
|
-
whileElementsMounted:
|
|
2400
|
+
whileElementsMounted: De,
|
|
2360
2401
|
transform: !1,
|
|
2361
2402
|
middleware: [
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2403
|
+
ke(4),
|
|
2404
|
+
Oe(),
|
|
2405
|
+
Ae({ padding: 8 })
|
|
2365
2406
|
]
|
|
2366
|
-
}), E = $t(T), { modelValue: k, mode: A, minDate: N, maxDate: F, isDateDisabled: I, locale: L, weekdays: R, months: z, valueFormat: B } = M(a), { viewingDate: H, i18n: W, calendarGrid: G, navigateMonth:
|
|
2407
|
+
}), E = $t(T), { modelValue: k, mode: A, minDate: N, maxDate: F, isDateDisabled: I, locale: L, weekdays: R, months: z, valueFormat: B } = M(a), { viewingDate: H, i18n: W, calendarGrid: G, navigateMonth: q, navigateYear: Y, selectDate: ee, formatDate: te, tempRangeStart: ne } = ri({
|
|
2367
2408
|
modelValue: k,
|
|
2368
2409
|
mode: A,
|
|
2369
2410
|
minDate: N,
|
|
@@ -2373,44 +2414,44 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2373
2414
|
weekdays: R,
|
|
2374
2415
|
months: z,
|
|
2375
2416
|
valueFormat: B
|
|
2376
|
-
}),
|
|
2417
|
+
}), re = D(new Date(H.value));
|
|
2377
2418
|
V(H, (e) => {
|
|
2378
|
-
|
|
2419
|
+
re.value = new Date(e);
|
|
2379
2420
|
});
|
|
2380
|
-
let
|
|
2381
|
-
let t = new Date(
|
|
2382
|
-
t.setDate(t.getDate() + e),
|
|
2383
|
-
},
|
|
2421
|
+
let ie = (e) => {
|
|
2422
|
+
let t = new Date(re.value);
|
|
2423
|
+
t.setDate(t.getDate() + e), re.value = t, (t.getMonth() !== H.value.getMonth() || t.getFullYear() !== H.value.getFullYear()) && (H.value = new Date(t));
|
|
2424
|
+
}, ae = (e) => {
|
|
2384
2425
|
if (g.value) switch (e.key) {
|
|
2385
2426
|
case "ArrowLeft":
|
|
2386
|
-
e.preventDefault(),
|
|
2427
|
+
e.preventDefault(), ie(-1);
|
|
2387
2428
|
break;
|
|
2388
2429
|
case "ArrowRight":
|
|
2389
|
-
e.preventDefault(),
|
|
2430
|
+
e.preventDefault(), ie(1);
|
|
2390
2431
|
break;
|
|
2391
2432
|
case "ArrowUp":
|
|
2392
|
-
e.preventDefault(),
|
|
2433
|
+
e.preventDefault(), ie(-7);
|
|
2393
2434
|
break;
|
|
2394
2435
|
case "ArrowDown":
|
|
2395
|
-
e.preventDefault(),
|
|
2436
|
+
e.preventDefault(), ie(7);
|
|
2396
2437
|
break;
|
|
2397
2438
|
case "Enter":
|
|
2398
|
-
e.preventDefault(),
|
|
2439
|
+
e.preventDefault(), le(re.value);
|
|
2399
2440
|
break;
|
|
2400
2441
|
case "Escape":
|
|
2401
2442
|
e.preventDefault(), g.value = !1;
|
|
2402
2443
|
break;
|
|
2403
2444
|
}
|
|
2404
|
-
},
|
|
2445
|
+
}, oe = o(() => a.mode === "single" ? a.modelValue ? te(new Date(a.modelValue), a.format) : "" : Array.isArray(a.modelValue) && a.modelValue.every((e) => e) ? `${te(new Date(a.modelValue[0]), a.format)} - ${te(new Date(a.modelValue[1]), a.format)}` : ""), ce = () => {
|
|
2405
2446
|
a.disabled || (g.value = !g.value, g.value && v(() => _.value?.focus()));
|
|
2406
|
-
},
|
|
2407
|
-
let t =
|
|
2447
|
+
}, le = (e) => {
|
|
2448
|
+
let t = ee(e);
|
|
2408
2449
|
h("update:modelValue", t), (a.mode === "single" || Array.isArray(t) && t[1]) && (g.value = !1);
|
|
2409
|
-
},
|
|
2450
|
+
}, ue = () => {
|
|
2410
2451
|
h("update:modelValue", a.mode === "single" ? null : [null, null]);
|
|
2411
|
-
},
|
|
2412
|
-
if (!
|
|
2413
|
-
let t =
|
|
2452
|
+
}, de = (e) => {
|
|
2453
|
+
if (!ne.value || !S.value) return !1;
|
|
2454
|
+
let t = ne.value, n = S.value;
|
|
2414
2455
|
return !t || !n ? !1 : e > t && e < n || e < t && e > n;
|
|
2415
2456
|
};
|
|
2416
2457
|
return (r, o) => (w(), l("div", {
|
|
@@ -2418,23 +2459,23 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2418
2459
|
ref: _,
|
|
2419
2460
|
class: "relative w-full",
|
|
2420
2461
|
tabindex: "0",
|
|
2421
|
-
onKeydownCapture: K(
|
|
2462
|
+
onKeydownCapture: K(ae, ["prevent"])
|
|
2422
2463
|
}, [
|
|
2423
2464
|
e.label ? (w(), l("label", ii, j(e.label), 1)) : c("", !0),
|
|
2424
2465
|
u("div", ai, [u("button", {
|
|
2425
2466
|
type: "button",
|
|
2426
2467
|
disabled: e.disabled,
|
|
2427
|
-
class: y(P(
|
|
2428
|
-
onClick:
|
|
2429
|
-
}, [u("span", { class: y(["block truncate", { "text-default-400": !
|
|
2468
|
+
class: y(P(J)("flex w-full cursor-pointer items-center justify-between gap-2 text-left transition-[color,box-shadow]", P(se)[a.size], m.value, "bg-content1 shadow-kun-sm border", e.error ? P(J)("border-danger-300", P(X).danger) : P(J)("border-kun", P(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60")),
|
|
2469
|
+
onClick: ce
|
|
2470
|
+
}, [u("span", { class: y(["block min-w-0 flex-1 truncate", { "text-default-400": !oe.value }]) }, j(oe.value || e.placeholder), 3), u("div", si, [e.clearable && oe.value ? (w(), l("button", {
|
|
2430
2471
|
key: 0,
|
|
2431
2472
|
class: "text-default-500 hover:text-default-800 mr-2 p-1",
|
|
2432
2473
|
"aria-label": "Clear date",
|
|
2433
|
-
onClick: K(
|
|
2434
|
-
}, [f(
|
|
2474
|
+
onClick: K(ue, ["stop"])
|
|
2475
|
+
}, [f(Q, {
|
|
2435
2476
|
name: "lucide:x",
|
|
2436
2477
|
class: "h-4 w-4"
|
|
2437
|
-
})])) : c("", !0), f(
|
|
2478
|
+
})])) : c("", !0), f(Q, {
|
|
2438
2479
|
name: "lucide:calendar",
|
|
2439
2480
|
class: "text-default-500"
|
|
2440
2481
|
})])], 10, oi)]),
|
|
@@ -2450,7 +2491,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2450
2491
|
key: 0,
|
|
2451
2492
|
ref_key: "dropdownRef",
|
|
2452
2493
|
ref: x,
|
|
2453
|
-
class: y(P(
|
|
2494
|
+
class: y(P(J)("bg-content1 z-kun-popover p-3 shadow-kun-md", m.value)),
|
|
2454
2495
|
style: b([P(C), {
|
|
2455
2496
|
minWidth: "260px",
|
|
2456
2497
|
transformOrigin: P(E)
|
|
@@ -2464,18 +2505,18 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2464
2505
|
"is-icon-only": !0,
|
|
2465
2506
|
size: "sm",
|
|
2466
2507
|
"aria-label": "Previous year",
|
|
2467
|
-
onClick: o[0] ||= (e) => P(
|
|
2508
|
+
onClick: o[0] ||= (e) => P(Y)(-1)
|
|
2468
2509
|
}, {
|
|
2469
|
-
default: U(() => [f(
|
|
2510
|
+
default: U(() => [f(Q, { name: "lucide:chevrons-left" })]),
|
|
2470
2511
|
_: 1
|
|
2471
2512
|
}), f($, {
|
|
2472
2513
|
variant: "light",
|
|
2473
2514
|
"is-icon-only": !0,
|
|
2474
2515
|
size: "sm",
|
|
2475
2516
|
"aria-label": "Previous month",
|
|
2476
|
-
onClick: o[1] ||= (e) => P(
|
|
2517
|
+
onClick: o[1] ||= (e) => P(q)(-1)
|
|
2477
2518
|
}, {
|
|
2478
|
-
default: U(() => [f(
|
|
2519
|
+
default: U(() => [f(Q, { name: "lucide:chevron-left" })]),
|
|
2479
2520
|
_: 1
|
|
2480
2521
|
})]),
|
|
2481
2522
|
u("div", ui, j(P(H).getFullYear()) + " / " + j(P(H).getMonth() + 1), 1),
|
|
@@ -2484,18 +2525,18 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2484
2525
|
"is-icon-only": !0,
|
|
2485
2526
|
size: "sm",
|
|
2486
2527
|
"aria-label": "Next month",
|
|
2487
|
-
onClick: o[2] ||= (e) => P(
|
|
2528
|
+
onClick: o[2] ||= (e) => P(q)(1)
|
|
2488
2529
|
}, {
|
|
2489
|
-
default: U(() => [f(
|
|
2530
|
+
default: U(() => [f(Q, { name: "lucide:chevron-right" })]),
|
|
2490
2531
|
_: 1
|
|
2491
2532
|
}), f($, {
|
|
2492
2533
|
variant: "light",
|
|
2493
2534
|
"is-icon-only": !0,
|
|
2494
2535
|
size: "sm",
|
|
2495
2536
|
"aria-label": "Next year",
|
|
2496
|
-
onClick: o[3] ||= (e) => P(
|
|
2537
|
+
onClick: o[3] ||= (e) => P(Y)(1)
|
|
2497
2538
|
}, {
|
|
2498
|
-
default: U(() => [f(
|
|
2539
|
+
default: U(() => [f(Q, { name: "lucide:chevrons-right" })]),
|
|
2499
2540
|
_: 1
|
|
2500
2541
|
})])
|
|
2501
2542
|
]),
|
|
@@ -2509,18 +2550,18 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2509
2550
|
role: "gridcell"
|
|
2510
2551
|
}, [u("button", {
|
|
2511
2552
|
disabled: t.isDisabled,
|
|
2512
|
-
class: y(P(
|
|
2553
|
+
class: y(P(J)(P(J)("flex h-8 w-8 items-center justify-center rounded-full text-sm transition-colors", P(X)[e.color]), !t.isCurrentMonth && "text-default-400", t.isToday && "border-primary bg-primary/20 border", !t.isSelected && !t.isDisabled && "hover:bg-default/20", t.isDisabled && "cursor-not-allowed opacity-50", t.isSelected && "bg-primary text-primary-foreground hover:bg-primary/90", (t.isInRange || de(t.date)) && !t.isSelected && "bg-primary/10 rounded-none", t.isRangeStart && "rounded-r-none", t.isRangeEnd && "rounded-l-none")),
|
|
2513
2554
|
"aria-label": t.date.toDateString(),
|
|
2514
2555
|
"aria-selected": t.isSelected,
|
|
2515
|
-
tabindex: t.date.toDateString() ===
|
|
2516
|
-
onClick: (e) =>
|
|
2556
|
+
tabindex: t.date.toDateString() === re.value.toDateString() ? 0 : -1,
|
|
2557
|
+
onClick: (e) => le(t.date),
|
|
2517
2558
|
onMouseenter: (e) => S.value = t.date,
|
|
2518
2559
|
onMouseleave: o[4] ||= (e) => S.value = null
|
|
2519
2560
|
}, j(t.dayOfMonth), 43, mi)]))), 128))]),
|
|
2520
2561
|
u("div", hi, [f($, {
|
|
2521
2562
|
size: "sm",
|
|
2522
2563
|
variant: "light",
|
|
2523
|
-
onClick: o[5] ||= (e) =>
|
|
2564
|
+
onClick: o[5] ||= (e) => le(/* @__PURE__ */ new Date())
|
|
2524
2565
|
}, {
|
|
2525
2566
|
default: U(() => [...o[7] ||= [d(" 今天 ", -1)]]),
|
|
2526
2567
|
_: 1
|
|
@@ -2528,7 +2569,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2528
2569
|
key: 0,
|
|
2529
2570
|
size: "sm",
|
|
2530
2571
|
variant: "light",
|
|
2531
|
-
onClick:
|
|
2572
|
+
onClick: ue
|
|
2532
2573
|
}, {
|
|
2533
2574
|
default: U(() => [...o[8] ||= [d(" 清空 ", -1)]]),
|
|
2534
2575
|
_: 1
|
|
@@ -2572,7 +2613,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2572
2613
|
}
|
|
2573
2614
|
return o;
|
|
2574
2615
|
}, wi = async (e) => {
|
|
2575
|
-
let t =
|
|
2616
|
+
let t = ee(e);
|
|
2576
2617
|
try {
|
|
2577
2618
|
if (!navigator.clipboard) throw Error("Clipboard API unavailable");
|
|
2578
2619
|
return await navigator.clipboard.writeText(t), Ci(`${t} 复制成功`, "success"), !0;
|
|
@@ -2603,10 +2644,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2603
2644
|
color: n.value ? "success" : e.color,
|
|
2604
2645
|
size: e.size,
|
|
2605
2646
|
rounded: e.rounded,
|
|
2606
|
-
"class-name": P(
|
|
2647
|
+
"class-name": P(J)("gap-2", e.className),
|
|
2607
2648
|
onClick: i
|
|
2608
2649
|
}, {
|
|
2609
|
-
default: U(() => [u("span", Ti, j(n.value ? e.copiedText : P(
|
|
2650
|
+
default: U(() => [u("span", Ti, j(n.value ? e.copiedText : P(ee)(e.name ? e.name : e.text)), 1), f(Q, { name: n.value ? "lucide:check" : "lucide:copy" }, null, 8, ["name"])]),
|
|
2610
2651
|
_: 1
|
|
2611
2652
|
}, 8, [
|
|
2612
2653
|
"variant",
|
|
@@ -2640,7 +2681,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2640
2681
|
info: "border-info/20"
|
|
2641
2682
|
};
|
|
2642
2683
|
return (n, r) => (w(), l("div", {
|
|
2643
|
-
class: y(P(
|
|
2684
|
+
class: y(P(J)("flex items-center", e.orientation === "horizontal" ? "w-full" : "h-full flex-col", e.className)),
|
|
2644
2685
|
role: "separator",
|
|
2645
2686
|
"aria-orientation": e.orientation === "vertical" ? "vertical" : void 0
|
|
2646
2687
|
}, [
|
|
@@ -2712,7 +2753,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2712
2753
|
t >= 0 && M(t);
|
|
2713
2754
|
}, H = (e) => {
|
|
2714
2755
|
e.disabled || (d("select", e), F(!0));
|
|
2715
|
-
}, W =
|
|
2756
|
+
}, W = st(), G = (e) => e.href ? typeof W.linkComponent == "string" ? { href: e.href } : { to: e.href } : {
|
|
2716
2757
|
type: "button",
|
|
2717
2758
|
disabled: e.disabled
|
|
2718
2759
|
}, K = (e, t) => {
|
|
@@ -2721,7 +2762,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2721
2762
|
return;
|
|
2722
2763
|
}
|
|
2723
2764
|
H(t);
|
|
2724
|
-
},
|
|
2765
|
+
}, q = (e) => {
|
|
2725
2766
|
if (!o.disabled) switch (e.key) {
|
|
2726
2767
|
case "ArrowDown":
|
|
2727
2768
|
case "Enter":
|
|
@@ -2732,7 +2773,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2732
2773
|
e.preventDefault(), N("last");
|
|
2733
2774
|
break;
|
|
2734
2775
|
}
|
|
2735
|
-
},
|
|
2776
|
+
}, Y = (e) => {
|
|
2736
2777
|
switch (e.key) {
|
|
2737
2778
|
case "ArrowDown":
|
|
2738
2779
|
e.preventDefault(), R(1);
|
|
@@ -2765,12 +2806,12 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2765
2806
|
default: e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && (e.preventDefault(), V(e.key));
|
|
2766
2807
|
}
|
|
2767
2808
|
};
|
|
2768
|
-
|
|
2809
|
+
ye(h, (e) => {
|
|
2769
2810
|
g.value?.contains(e.target) || F();
|
|
2770
|
-
}),
|
|
2811
|
+
}), Se("keydown", (e) => {
|
|
2771
2812
|
e.key === "Escape" && p.value && F(!0);
|
|
2772
2813
|
});
|
|
2773
|
-
let
|
|
2814
|
+
let ee = {
|
|
2774
2815
|
default: "focus:bg-default/20",
|
|
2775
2816
|
primary: "focus:bg-primary/20",
|
|
2776
2817
|
secondary: "focus:bg-secondary/20",
|
|
@@ -2778,7 +2819,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2778
2819
|
warning: "focus:bg-warning/20",
|
|
2779
2820
|
danger: "focus:bg-danger/20",
|
|
2780
2821
|
info: "focus:bg-info/20"
|
|
2781
|
-
},
|
|
2822
|
+
}, te = (e) => J("relative flex w-full cursor-pointer items-center justify-start gap-2 overflow-hidden rounded-kun-md px-3 py-1.5 text-sm font-medium outline-none transition-colors", ge("light", e.color || "default"), ee[e.color || "default"], e.disabled && "pointer-events-none cursor-not-allowed opacity-50");
|
|
2782
2823
|
return r({
|
|
2783
2824
|
open: () => N("none"),
|
|
2784
2825
|
close: () => F(),
|
|
@@ -2788,13 +2829,13 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2788
2829
|
ref: h,
|
|
2789
2830
|
role: "button",
|
|
2790
2831
|
tabindex: e.disabled ? -1 : 0,
|
|
2791
|
-
class: y(P(
|
|
2832
|
+
class: y(P(J)("inline-flex cursor-pointer items-center", e.disabled && "cursor-not-allowed opacity-50", e.triggerClass)),
|
|
2792
2833
|
"aria-haspopup": "menu",
|
|
2793
2834
|
"aria-expanded": p.value,
|
|
2794
2835
|
"aria-disabled": e.disabled || void 0,
|
|
2795
2836
|
"aria-controls": p.value ? x : void 0,
|
|
2796
2837
|
onClick: a[0] ||= (t) => e.disabled || L(),
|
|
2797
|
-
onKeydown:
|
|
2838
|
+
onKeydown: q
|
|
2798
2839
|
}, [k(r.$slots, "trigger")], 42, Ai), (w(), s(n, { to: "body" }, [f(i, {
|
|
2799
2840
|
"enter-active-class": "transition duration-kun-base ease-kun-out",
|
|
2800
2841
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -2811,21 +2852,21 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2811
2852
|
role: "menu",
|
|
2812
2853
|
"aria-orientation": "vertical",
|
|
2813
2854
|
tabindex: "-1",
|
|
2814
|
-
class: y(P(
|
|
2855
|
+
class: y(P(J)("bg-content1 z-kun-popover rounded-kun-lg p-1 text-sm shadow-kun-md outline-none", e.menuClass)),
|
|
2815
2856
|
style: b([P(S), {
|
|
2816
2857
|
minWidth: `${e.minWidth}px`,
|
|
2817
2858
|
transformOrigin: P(C)
|
|
2818
2859
|
}]),
|
|
2819
|
-
onKeydown:
|
|
2860
|
+
onKeydown: Y
|
|
2820
2861
|
}, [(w(!0), l(t, null, O(e.items, (e, t) => (w(), s(A(e.href ? P(W).linkComponent : "button"), _({ key: e.key }, { ref_for: !0 }, G(e), {
|
|
2821
2862
|
role: "menuitem",
|
|
2822
2863
|
tabindex: t === m.value ? 0 : -1,
|
|
2823
2864
|
"aria-disabled": e.disabled || void 0,
|
|
2824
|
-
class:
|
|
2865
|
+
class: te(e),
|
|
2825
2866
|
onClick: (t) => K(t, e),
|
|
2826
2867
|
onMouseenter: (n) => !e.disabled && M(t)
|
|
2827
2868
|
}), {
|
|
2828
|
-
default: U(() => [e.icon ? (w(), s(
|
|
2869
|
+
default: U(() => [e.icon ? (w(), s(Q, {
|
|
2829
2870
|
key: 0,
|
|
2830
2871
|
name: e.icon,
|
|
2831
2872
|
class: "shrink-0 text-base"
|
|
@@ -2850,7 +2891,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2850
2891
|
}, Ri = {
|
|
2851
2892
|
key: 3,
|
|
2852
2893
|
class: "border-kun border-t px-6 py-4"
|
|
2853
|
-
}, zi = /*#__PURE__*/
|
|
2894
|
+
}, zi = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
2854
2895
|
name: "KunDrawer",
|
|
2855
2896
|
__name: "Drawer",
|
|
2856
2897
|
props: /*@__PURE__*/ g({
|
|
@@ -2885,7 +2926,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2885
2926
|
}),
|
|
2886
2927
|
emits: /*@__PURE__*/ g(["close"], ["update:modelValue"]),
|
|
2887
2928
|
setup(e, { emit: t }) {
|
|
2888
|
-
let r = e, a =
|
|
2929
|
+
let r = e, a = Ce("(max-width: 47.99rem)"), d = o(() => r.responsive && a.value ? "bottom" : r.placement), p = St(() => r.rounded), m = o(() => Z[p.value]), h = L(e, "modelValue"), g = t, _ = nt("kun-drawer"), x = o(() => `${_.value}-title`), T = {
|
|
2889
2930
|
sm: "w-80",
|
|
2890
2931
|
md: "w-96",
|
|
2891
2932
|
lg: "w-[32rem]",
|
|
@@ -2917,35 +2958,35 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2917
2958
|
].filter(Boolean).join(" ");
|
|
2918
2959
|
}), N = o(() => `kun-drawer-${d.value}`), { lock: F, unlock: I } = Mt(), R = !1, z = (e) => {
|
|
2919
2960
|
e && !R ? (F(), R = !0) : !e && R && (I(), R = !1);
|
|
2920
|
-
}, { zIndex: B, claim: H, release: W, isTopmost: G } = Rt(),
|
|
2921
|
-
e && !
|
|
2922
|
-
}, { activate:
|
|
2923
|
-
e && !
|
|
2924
|
-
},
|
|
2961
|
+
}, { zIndex: B, claim: H, release: W, isTopmost: G } = Rt(), q = !1, Y = (e) => {
|
|
2962
|
+
e && !q ? (H(), q = !0) : !e && q && (W(), q = !1);
|
|
2963
|
+
}, { activate: ee, deactivate: te } = Ut(), ne = !1, re = (e) => {
|
|
2964
|
+
e && !ne ? (ee(), ne = !0) : !e && ne && (te(), ne = !1);
|
|
2965
|
+
}, ie = D(null), { activate: ae, deactivate: oe } = Te(ie, {
|
|
2925
2966
|
immediate: !1,
|
|
2926
2967
|
escapeDeactivates: !1,
|
|
2927
2968
|
allowOutsideClick: !0,
|
|
2928
2969
|
returnFocusOnDeactivate: !0
|
|
2929
|
-
}),
|
|
2970
|
+
}), se = () => {
|
|
2930
2971
|
r.isDismissable && (h.value = !1, g("close"));
|
|
2931
|
-
},
|
|
2972
|
+
}, ce = () => {
|
|
2932
2973
|
h.value = !1, g("close");
|
|
2933
2974
|
};
|
|
2934
|
-
return
|
|
2935
|
-
e.key === "Escape" && h.value && G.value &&
|
|
2975
|
+
return Se("keydown", (e) => {
|
|
2976
|
+
e.key === "Escape" && h.value && G.value && se();
|
|
2936
2977
|
}), V(h, async (e) => {
|
|
2937
|
-
z(e),
|
|
2978
|
+
z(e), Y(e), e ? (await v(), ae(), re(!0)) : (re(!1), oe());
|
|
2938
2979
|
}), S(async () => {
|
|
2939
|
-
h.value && (z(!0),
|
|
2980
|
+
h.value && (z(!0), Y(!0), await v(), ae(), re(!0));
|
|
2940
2981
|
}), C(() => {
|
|
2941
|
-
z(!1),
|
|
2982
|
+
z(!1), Y(!1), re(!1), oe();
|
|
2942
2983
|
}), (t, r) => (w(), s(n, { to: "body" }, [f(i, { name: N.value }, {
|
|
2943
2984
|
default: U(() => [h.value ? (w(), l("div", {
|
|
2944
2985
|
key: 0,
|
|
2945
2986
|
ref_key: "trapEl",
|
|
2946
|
-
ref:
|
|
2987
|
+
ref: ie,
|
|
2947
2988
|
"data-kun-overlay": "",
|
|
2948
|
-
class: y(P(
|
|
2989
|
+
class: y(P(J)("z-kun-modal fixed inset-0", e.className)),
|
|
2949
2990
|
style: b({ zIndex: P(B) }),
|
|
2950
2991
|
role: "dialog",
|
|
2951
2992
|
"aria-modal": "true",
|
|
@@ -2953,9 +2994,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2953
2994
|
tabindex: "0"
|
|
2954
2995
|
}, [u("div", {
|
|
2955
2996
|
class: "bg-default-800/70 dark:bg-background/70 absolute inset-0 transition-opacity",
|
|
2956
|
-
onClick:
|
|
2997
|
+
onClick: se
|
|
2957
2998
|
}), u("div", {
|
|
2958
|
-
class: y(P(
|
|
2999
|
+
class: y(P(J)("bg-content1 flex flex-col shadow-kun-lg", M.value, e.innerClassName, e.size === "full" ? m.value : "")),
|
|
2959
3000
|
onClick: r[0] ||= K(() => {}, ["stop"])
|
|
2960
3001
|
}, [
|
|
2961
3002
|
e.title || t.$slots.header || e.isShowCloseButton ? (w(), l("header", Pi, [u("div", Fi, [e.title ? (w(), l("h2", {
|
|
@@ -2971,9 +3012,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2971
3012
|
"is-icon-only": !0,
|
|
2972
3013
|
"aria-label": "关闭抽屉",
|
|
2973
3014
|
"class-name": "shrink-0",
|
|
2974
|
-
onClick:
|
|
3015
|
+
onClick: ce
|
|
2975
3016
|
}, {
|
|
2976
|
-
default: U(() => [f(
|
|
3017
|
+
default: U(() => [f(Q, { name: "lucide:x" })]),
|
|
2977
3018
|
_: 1
|
|
2978
3019
|
})) : c("", !0)])) : c("", !0),
|
|
2979
3020
|
e.withContainer ? (w(), l("div", Li, [k(t.$slots, "default", {}, void 0, !0)])) : k(t.$slots, "default", { key: 2 }, void 0, !0),
|
|
@@ -2985,7 +3026,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
2985
3026
|
}), [["__scopeId", "data-v-2c7f907c"]]), Bi = {
|
|
2986
3027
|
key: 0,
|
|
2987
3028
|
class: "grid grid-rows-[1fr] opacity-100"
|
|
2988
|
-
}, Vi = { class: "min-h-0 overflow-hidden" }, Hi = /*#__PURE__*/
|
|
3029
|
+
}, Vi = { class: "min-h-0 overflow-hidden" }, Hi = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
2989
3030
|
name: "KunFadeCard",
|
|
2990
3031
|
__name: "FadeCard",
|
|
2991
3032
|
setup(n) {
|
|
@@ -3091,7 +3132,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3091
3132
|
}), _ = () => {
|
|
3092
3133
|
n.disabled || m();
|
|
3093
3134
|
};
|
|
3094
|
-
return (t, n) => (w(), l("div", { class: y(P(
|
|
3135
|
+
return (t, n) => (w(), l("div", { class: y(P(J)("flex flex-col gap-1", e.className)) }, [
|
|
3095
3136
|
u("div", Gi, [k(t.$slots, "default", {
|
|
3096
3137
|
pick: _,
|
|
3097
3138
|
disabled: e.disabled,
|
|
@@ -3105,7 +3146,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3105
3146
|
type: "button",
|
|
3106
3147
|
onClick: _
|
|
3107
3148
|
}, {
|
|
3108
|
-
default: U(() => [e.triggerIcon ? (w(), s(
|
|
3149
|
+
default: U(() => [e.triggerIcon ? (w(), s(Q, {
|
|
3109
3150
|
key: 0,
|
|
3110
3151
|
name: e.triggerIcon,
|
|
3111
3152
|
class: "mr-1 size-4"
|
|
@@ -3134,7 +3175,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3134
3175
|
scale: { default: "h1" }
|
|
3135
3176
|
},
|
|
3136
3177
|
setup(e) {
|
|
3137
|
-
let t = e, n = o(() =>
|
|
3178
|
+
let t = e, n = o(() => J("font-medium", {
|
|
3138
3179
|
h1: "text-2xl sm:text-3xl",
|
|
3139
3180
|
h2: "text-xl sm:text-2xl",
|
|
3140
3181
|
h3: "text-lg sm:text-xl"
|
|
@@ -3172,7 +3213,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3172
3213
|
},
|
|
3173
3214
|
setup(e) {
|
|
3174
3215
|
return (t, n) => (w(), l("img", {
|
|
3175
|
-
class: y(P(
|
|
3216
|
+
class: y(P(J)(e.className)),
|
|
3176
3217
|
src: e.src,
|
|
3177
3218
|
alt: e.alt,
|
|
3178
3219
|
loading: e.loading,
|
|
@@ -3197,7 +3238,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3197
3238
|
rounded: { default: void 0 }
|
|
3198
3239
|
},
|
|
3199
3240
|
setup(e) {
|
|
3200
|
-
let t = e, n =
|
|
3241
|
+
let t = e, n = St(() => t.rounded), r = o(() => Z[n.value]), i = o(() => {
|
|
3201
3242
|
switch (t.variant) {
|
|
3202
3243
|
case "solid":
|
|
3203
3244
|
case "shadow": return "border-[1.5px] border-transparent";
|
|
@@ -3252,7 +3293,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3252
3293
|
warning: "shadow-lg shadow-warning/40",
|
|
3253
3294
|
danger: "shadow-lg shadow-danger/40",
|
|
3254
3295
|
info: "shadow-lg shadow-info/40"
|
|
3255
|
-
}, f = o(() => t.variant === "solid" ?
|
|
3296
|
+
}, f = o(() => t.variant === "solid" ? pe[t.color] : t.variant === "shadow" ? J(d[t.color], pe[t.color]) : a[t.variant]?.[t.color] || ""), p = o(() => {
|
|
3256
3297
|
if (t.variant === "solid" || t.variant === "shadow") return "";
|
|
3257
3298
|
switch (t.color) {
|
|
3258
3299
|
case "primary": return "text-primary-900";
|
|
@@ -3264,8 +3305,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3264
3305
|
default: return "text-default-900";
|
|
3265
3306
|
}
|
|
3266
3307
|
});
|
|
3267
|
-
return (t, n) => (w(), l("div", { class: y(P(
|
|
3268
|
-
e.icon ? (w(), s(
|
|
3308
|
+
return (t, n) => (w(), l("div", { class: y(P(J)("space-y-2 p-4", r.value, i.value, f.value, e.className)) }, [u("h3", { class: y(P(J)("flex items-center gap-2 font-medium", p.value)) }, [
|
|
3309
|
+
e.icon ? (w(), s(Q, {
|
|
3269
3310
|
key: 0,
|
|
3270
3311
|
name: e.icon,
|
|
3271
3312
|
"class-name": "h-5 w-5 flex-shrink-0"
|
|
@@ -3350,7 +3391,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3350
3391
|
"pr-10",
|
|
3351
3392
|
"pr-[4.5rem]",
|
|
3352
3393
|
"pr-28"
|
|
3353
|
-
][Math.min(x.value, 3)]), T =
|
|
3394
|
+
][Math.min(x.value, 3)]), T = St(() => r.rounded), E = o(() => Z[T.value]), O = L(e, "modelValue"), A = n, M = D(null), N = D(!1), F = nt("kun-input"), I = o(() => se[r.size]), z = (e) => {
|
|
3354
3395
|
O.value = e.target.value;
|
|
3355
3396
|
}, B = (e) => {
|
|
3356
3397
|
N.value = !1, A("blur", e);
|
|
@@ -3395,7 +3436,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3395
3436
|
required: e.required,
|
|
3396
3437
|
"aria-invalid": s.value || void 0,
|
|
3397
3438
|
"aria-describedby": a.value || e.error ? `${P(F)}-desc` : void 0,
|
|
3398
|
-
class: P(
|
|
3439
|
+
class: P(J)("block w-full bg-content1 shadow-kun-sm border transition-[color,box-shadow] duration-kun-fast ease-kun-standard", E.value, I.value, t.$slots.prefix && "pl-10", C.value, e.disabled && "cursor-not-allowed opacity-60", s.value ? P(J)("border-danger-300", P(X).danger) : P(J)("border-kun", P(X)[e.color]), e.className),
|
|
3399
3440
|
onInput: z,
|
|
3400
3441
|
onBlur: B,
|
|
3401
3442
|
onFocus: V
|
|
@@ -3410,7 +3451,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3410
3451
|
class: "text-default-400 hover:text-default-600 flex items-center",
|
|
3411
3452
|
"aria-label": "清除",
|
|
3412
3453
|
onClick: H
|
|
3413
|
-
}, [f(
|
|
3454
|
+
}, [f(Q, {
|
|
3414
3455
|
name: "lucide:circle-x",
|
|
3415
3456
|
class: "size-4"
|
|
3416
3457
|
})])) : c("", !0),
|
|
@@ -3422,7 +3463,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3422
3463
|
"aria-label": m.value ? "隐藏密码" : "显示密码",
|
|
3423
3464
|
"aria-pressed": m.value,
|
|
3424
3465
|
onClick: n[0] ||= (e) => m.value = !m.value
|
|
3425
|
-
}, [f(
|
|
3466
|
+
}, [f(Q, {
|
|
3426
3467
|
name: m.value ? "lucide:eye-off" : "lucide:eye",
|
|
3427
3468
|
class: "size-4"
|
|
3428
3469
|
}, null, 8, ["name"])], 8, ha)) : c("", !0)
|
|
@@ -3525,7 +3566,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3525
3566
|
}
|
|
3526
3567
|
},
|
|
3527
3568
|
setup(e) {
|
|
3528
|
-
let t = e, n =
|
|
3569
|
+
let t = e, n = st(), r = o(() => {
|
|
3529
3570
|
switch (t.underline) {
|
|
3530
3571
|
case "none": return "";
|
|
3531
3572
|
case "hover": return "hover:underline underline-offset-3";
|
|
@@ -3558,11 +3599,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3558
3599
|
return (t, a) => (w(), s(A(P(n).linkComponent), _({
|
|
3559
3600
|
...u.value,
|
|
3560
3601
|
...t.$attrs
|
|
3561
|
-
}, { class: P(
|
|
3602
|
+
}, { class: P(J)("inline-flex items-center gap-2 break-all", r.value, i.value, P(he)[e.color], e.className) }), {
|
|
3562
3603
|
default: U(() => [
|
|
3563
3604
|
k(t.$slots, "prefix"),
|
|
3564
3605
|
k(t.$slots, "default"),
|
|
3565
|
-
e.isShowAnchorIcon ? (w(), s(
|
|
3606
|
+
e.isShowAnchorIcon ? (w(), s(Q, {
|
|
3566
3607
|
key: 0,
|
|
3567
3608
|
name: "lucide:external-link"
|
|
3568
3609
|
})) : c("", !0),
|
|
@@ -3589,7 +3630,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3589
3630
|
image: "data:image/webp;base64,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"
|
|
3590
3631
|
}
|
|
3591
3632
|
], Ta = () => {
|
|
3592
|
-
let e = wa[
|
|
3633
|
+
let e = wa[_e(0, wa.length - 1)] ?? wa[0];
|
|
3593
3634
|
return {
|
|
3594
3635
|
name: e.name,
|
|
3595
3636
|
loli: e.image
|
|
@@ -3597,7 +3638,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3597
3638
|
}, Ea = {
|
|
3598
3639
|
key: 0,
|
|
3599
3640
|
class: "bg-background z-kun-message fixed right-0 bottom-0 left-0 min-h-30 w-full border-t"
|
|
3600
|
-
}, Da = { class: "loli absolute -top-10 pl-24 text-lg sm:pl-32" }, Oa = { class: "bg-background px-10 py-1 text-center text-lg sm:text-2xl" }, ka = { class: "pointer-events-none absolute mt-2 ml-6 select-none" }, Aa = { class: "info mt-4 mr-8 ml-24 text-base sm:ml-32 sm:text-lg" }, ja = /*#__PURE__*/
|
|
3641
|
+
}, Da = { class: "loli absolute -top-10 pl-24 text-lg sm:pl-32" }, Oa = { class: "bg-background px-10 py-1 text-center text-lg sm:text-2xl" }, ka = { class: "pointer-events-none absolute mt-2 ml-6 select-none" }, Aa = { class: "info mt-4 mr-8 ml-24 text-base sm:ml-32 sm:text-lg" }, ja = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
3601
3642
|
name: "KunLoli",
|
|
3602
3643
|
__name: "Loli",
|
|
3603
3644
|
props: {
|
|
@@ -3645,7 +3686,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3645
3686
|
"aria-label": "关闭",
|
|
3646
3687
|
class: "hover:bg-default/40 absolute top-1 right-1 inline-flex cursor-pointer overflow-hidden rounded-full border-transparent bg-transparent p-2 text-sm font-medium transition-all hover:opacity-80 active:scale-[0.97]",
|
|
3647
3688
|
onClick: p
|
|
3648
|
-
}, [f(
|
|
3689
|
+
}, [f(Q, {
|
|
3649
3690
|
name: "lucide:x",
|
|
3650
3691
|
class: "h-4 w-4"
|
|
3651
3692
|
})]),
|
|
@@ -3691,7 +3732,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3691
3732
|
role: "status",
|
|
3692
3733
|
"aria-live": "polite",
|
|
3693
3734
|
"aria-busy": !0
|
|
3694
|
-
}, Wa = /*#__PURE__*/
|
|
3735
|
+
}, Wa = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
3695
3736
|
name: "KunLoading",
|
|
3696
3737
|
__name: "Loading",
|
|
3697
3738
|
props: {
|
|
@@ -3715,7 +3756,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3715
3756
|
lg: "size-10",
|
|
3716
3757
|
xl: "size-12"
|
|
3717
3758
|
};
|
|
3718
|
-
return (t, a) => (w(), l("div", za, [n.value ? (w(), l("div", Ba, [u("div", { class: y(P(
|
|
3759
|
+
return (t, a) => (w(), l("div", za, [n.value ? (w(), l("div", Ba, [u("div", { class: y(P(J)("transition-opacity", e.loading && "opacity-50")) }, [k(t.$slots, "default", {}, void 0, !0)], 2), f(i, {
|
|
3719
3760
|
"enter-active-class": "transition-opacity duration-kun-slow",
|
|
3720
3761
|
"enter-from-class": "opacity-0",
|
|
3721
3762
|
"leave-active-class": "transition-opacity duration-kun-slow",
|
|
@@ -3727,10 +3768,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3727
3768
|
role: "status",
|
|
3728
3769
|
"aria-live": "polite",
|
|
3729
3770
|
"aria-busy": e.loading
|
|
3730
|
-
}, [u("div", Ha, [e.spinner ? (w(), s(
|
|
3771
|
+
}, [u("div", Ha, [e.spinner ? (w(), s(Q, {
|
|
3731
3772
|
key: 0,
|
|
3732
3773
|
name: "svg-spinners:90-ring-with-bg",
|
|
3733
|
-
class: y(P(
|
|
3774
|
+
class: y(P(J)("text-primary", r[e.size])),
|
|
3734
3775
|
"aria-hidden": "true"
|
|
3735
3776
|
}, null, 8, ["class"])) : (w(), s(ra, {
|
|
3736
3777
|
key: 1,
|
|
@@ -3740,10 +3781,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3740
3781
|
"class-name": "w-80 h-auto rounded-kun-md"
|
|
3741
3782
|
}, null, 8, ["src"])), u("span", { class: y(e.spinner ? "text-default-600 text-sm" : "info text-xl") }, j(e.description), 3)])], 8, Va)) : c("", !0)]),
|
|
3742
3783
|
_: 1
|
|
3743
|
-
})])) : (w(), l("div", Ua, [e.spinner ? (w(), s(
|
|
3784
|
+
})])) : (w(), l("div", Ua, [e.spinner ? (w(), s(Q, {
|
|
3744
3785
|
key: 0,
|
|
3745
3786
|
name: "svg-spinners:90-ring-with-bg",
|
|
3746
|
-
class: y(P(
|
|
3787
|
+
class: y(P(J)("text-primary", r[e.size])),
|
|
3747
3788
|
"aria-hidden": "true"
|
|
3748
3789
|
}, null, 8, ["class"])) : (w(), s(ra, {
|
|
3749
3790
|
key: 1,
|
|
@@ -3774,7 +3815,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3774
3815
|
}), Ka = ["role", "aria-live"], qa = { class: "flex-1 text-sm font-medium" }, Ja = { key: 0 }, Ya = ["innerHTML"], Xa = {
|
|
3775
3816
|
key: 0,
|
|
3776
3817
|
class: "ml-3 flex h-6 w-6 items-center justify-center rounded-full bg-black/10 text-xs font-bold dark:bg-white/10"
|
|
3777
|
-
}, Za = 80, Qa = /*#__PURE__*/
|
|
3818
|
+
}, Za = 80, Qa = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
3778
3819
|
name: "KunMessageItem",
|
|
3779
3820
|
__name: "MessageItem",
|
|
3780
3821
|
props: {
|
|
@@ -3846,7 +3887,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3846
3887
|
role: d.value ? "alert" : "status",
|
|
3847
3888
|
"aria-live": d.value ? "assertive" : "polite",
|
|
3848
3889
|
"aria-atomic": "true",
|
|
3849
|
-
class: y(P(
|
|
3890
|
+
class: y(P(J)("group relative mb-3 flex w-full touch-pan-y items-center overflow-hidden rounded-kun-lg p-4 shadow-kun-md ring-1 ring-black/5 transition-all duration-kun-slow dark:ring-white/10", M.value.bg, M.value.text)),
|
|
3850
3891
|
style: b(g.value),
|
|
3851
3892
|
onMouseenter: k,
|
|
3852
3893
|
onMouseleave: A,
|
|
@@ -3855,9 +3896,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3855
3896
|
onPointerup: x,
|
|
3856
3897
|
onPointercancel: x
|
|
3857
3898
|
}, [
|
|
3858
|
-
f(
|
|
3899
|
+
f(Q, {
|
|
3859
3900
|
name: M.value.iconName,
|
|
3860
|
-
class: y(P(
|
|
3901
|
+
class: y(P(J)("mt-0.5 mr-3 h-6 w-6 flex-shrink-0", M.value.icon))
|
|
3861
3902
|
}, null, 8, ["name", "class"]),
|
|
3862
3903
|
u("div", qa, [i.value ? (w(), l("div", {
|
|
3863
3904
|
key: 1,
|
|
@@ -3870,7 +3911,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3870
3911
|
"aria-label": "关闭",
|
|
3871
3912
|
class: "ml-2 flex size-6 shrink-0 items-center justify-center rounded-full opacity-0 transition hover:bg-black/10 focus-visible:opacity-100 group-hover:opacity-100 dark:hover:bg-white/10",
|
|
3872
3913
|
onClick: n[0] ||= (t) => r("remove", e.id)
|
|
3873
|
-
}, [f(
|
|
3914
|
+
}, [f(Q, {
|
|
3874
3915
|
name: "lucide:x",
|
|
3875
3916
|
class: "size-4"
|
|
3876
3917
|
})]),
|
|
@@ -3882,7 +3923,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
3882
3923
|
}, null, 2))
|
|
3883
3924
|
], 46, Ka));
|
|
3884
3925
|
}
|
|
3885
|
-
}), [["__scopeId", "data-v-a80e8a61"]]), $a = /*#__PURE__*/
|
|
3926
|
+
}), [["__scopeId", "data-v-a80e8a61"]]), $a = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
3886
3927
|
name: "KunMessageProvider",
|
|
3887
3928
|
__name: "MessageProvider",
|
|
3888
3929
|
setup(e) {
|
|
@@ -4010,7 +4051,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4010
4051
|
}),
|
|
4011
4052
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
4012
4053
|
setup(e, { expose: t, emit: n }) {
|
|
4013
|
-
let r = e, i = L(e, "modelValue"), a = n, s =
|
|
4054
|
+
let r = e, i = L(e, "modelValue"), a = n, s = St(() => r.rounded), p = o(() => Z[s.value]), m = nt("kun-number"), h = o(() => !!r.error || r.isInvalid), g = {
|
|
4014
4055
|
xs: {
|
|
4015
4056
|
text: "text-xs",
|
|
4016
4057
|
py: "py-1",
|
|
@@ -4086,16 +4127,16 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4086
4127
|
for: P(m),
|
|
4087
4128
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
4088
4129
|
}, [d(j(e.label) + " ", 1), e.required ? (w(), l("span", oo, "*")) : c("", !0)], 8, ao)) : c("", !0),
|
|
4089
|
-
u("div", { class: y(P(
|
|
4130
|
+
u("div", { class: y(P(J)("bg-content1 shadow-kun-sm border flex w-full items-stretch overflow-hidden transition-[color,box-shadow]", p.value, v.value.text, h.value ? P(J)("border-danger-300", P(le).danger) : P(J)("border-kun", P(le)[e.color]), e.disabled && "cursor-not-allowed opacity-60")) }, [
|
|
4090
4131
|
e.controls ? (w(), l("button", {
|
|
4091
4132
|
key: 0,
|
|
4092
4133
|
type: "button",
|
|
4093
4134
|
tabindex: "-1",
|
|
4094
4135
|
disabled: !N.value,
|
|
4095
|
-
class: y(P(
|
|
4136
|
+
class: y(P(J)("text-default-600 hover:bg-foreground/8 flex items-center disabled:cursor-not-allowed disabled:opacity-50", v.value.btn)),
|
|
4096
4137
|
"aria-label": "减少",
|
|
4097
4138
|
onClick: n[0] ||= (e) => M(-1)
|
|
4098
|
-
}, [f(
|
|
4139
|
+
}, [f(Q, {
|
|
4099
4140
|
name: "lucide:minus",
|
|
4100
4141
|
class: "size-4"
|
|
4101
4142
|
})], 10, so)) : c("", !0),
|
|
@@ -4117,7 +4158,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4117
4158
|
disabled: e.disabled,
|
|
4118
4159
|
readonly: e.readonly,
|
|
4119
4160
|
required: e.required,
|
|
4120
|
-
class: P(
|
|
4161
|
+
class: P(J)("min-w-0 flex-1 bg-transparent tabular-nums outline-none disabled:cursor-not-allowed", v.value.py, e.controls ? "px-2 text-center" : "px-3.5"),
|
|
4121
4162
|
onInput: k,
|
|
4122
4163
|
onFocus: n[1] ||= (e) => x.value = !0,
|
|
4123
4164
|
onBlur: A,
|
|
@@ -4128,10 +4169,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4128
4169
|
type: "button",
|
|
4129
4170
|
tabindex: "-1",
|
|
4130
4171
|
disabled: !F.value,
|
|
4131
|
-
class: y(P(
|
|
4172
|
+
class: y(P(J)("text-default-600 hover:bg-foreground/8 flex items-center disabled:cursor-not-allowed disabled:opacity-50", v.value.btn)),
|
|
4132
4173
|
"aria-label": "增加",
|
|
4133
4174
|
onClick: n[2] ||= (e) => M(1)
|
|
4134
|
-
}, [f(
|
|
4175
|
+
}, [f(Q, {
|
|
4135
4176
|
name: "lucide:plus",
|
|
4136
4177
|
class: "size-4"
|
|
4137
4178
|
})], 10, lo)) : c("", !0)
|
|
@@ -4166,7 +4207,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4166
4207
|
},
|
|
4167
4208
|
emits: ["update:currentPage"],
|
|
4168
4209
|
setup(e, { emit: n }) {
|
|
4169
|
-
let r = e, i = n, a = D(""), c =
|
|
4210
|
+
let r = e, i = n, a = D(""), c = nt("kun-pagination"), p = o(() => {
|
|
4170
4211
|
let e = [];
|
|
4171
4212
|
if (r.totalPage <= 7) return Array.from({ length: r.totalPage }, (e, t) => t + 1);
|
|
4172
4213
|
e.push(1), r.currentPage > 3 && e.push("...");
|
|
@@ -4200,9 +4241,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4200
4241
|
let r = t.getAttribute("role");
|
|
4201
4242
|
return !!r && g.has(r);
|
|
4202
4243
|
};
|
|
4203
|
-
return
|
|
4244
|
+
return be("ArrowLeft", (e) => {
|
|
4204
4245
|
_(e) || r.currentPage > 1 && m(r.currentPage - 1);
|
|
4205
|
-
}),
|
|
4246
|
+
}), be("ArrowRight", (e) => {
|
|
4206
4247
|
_(e) || r.currentPage < r.totalPage && m(r.currentPage + 1);
|
|
4207
4248
|
}), (n, r) => (w(), l("nav", ho, [u("div", go, [u("div", _o, [
|
|
4208
4249
|
f($, {
|
|
@@ -4215,7 +4256,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4215
4256
|
class: y({ "cursor-not-allowed opacity-50": e.isLoading || e.currentPage === 1 }),
|
|
4216
4257
|
onClick: r[0] ||= (t) => m(e.currentPage - 1)
|
|
4217
4258
|
}, {
|
|
4218
|
-
default: U(() => [f(
|
|
4259
|
+
default: U(() => [f(Q, { name: "lucide:chevron-left" })]),
|
|
4219
4260
|
_: 1
|
|
4220
4261
|
}, 8, [
|
|
4221
4262
|
"href",
|
|
@@ -4252,7 +4293,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4252
4293
|
class: y({ "cursor-not-allowed opacity-50": e.isLoading || e.currentPage === e.totalPage }),
|
|
4253
4294
|
onClick: r[1] ||= (t) => m(e.currentPage + 1)
|
|
4254
4295
|
}, {
|
|
4255
|
-
default: U(() => [f(
|
|
4296
|
+
default: U(() => [f(Q, { name: "lucide:chevron-right" })]),
|
|
4256
4297
|
_: 1
|
|
4257
4298
|
}, 8, [
|
|
4258
4299
|
"href",
|
|
@@ -4261,8 +4302,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4261
4302
|
])
|
|
4262
4303
|
]), u("div", bo, [
|
|
4263
4304
|
r[3] ||= d(" 您可以使用 ", -1),
|
|
4264
|
-
f(
|
|
4265
|
-
f(
|
|
4305
|
+
f(Q, { name: "lucide:arrow-left" }),
|
|
4306
|
+
f(Q, { name: "lucide:arrow-right" }),
|
|
4266
4307
|
r[4] ||= d(" 来进行快速翻页 ", -1)
|
|
4267
4308
|
])]), u("div", xo, [
|
|
4268
4309
|
u("label", {
|
|
@@ -4277,7 +4318,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4277
4318
|
disabled: e.isLoading,
|
|
4278
4319
|
min: "1",
|
|
4279
4320
|
max: e.totalPage,
|
|
4280
|
-
class: y(P(
|
|
4321
|
+
class: y(P(J)(P(J)("bg-content1 shadow-kun-sm border-kun w-24 rounded-kun-md border px-2 py-1 text-sm transition-[color,box-shadow]", P(X).default), e.isLoading && "cursor-not-allowed opacity-50")),
|
|
4281
4322
|
onKeyup: G(h, ["enter"])
|
|
4282
4323
|
}, null, 42, Co), [[z, a.value]]),
|
|
4283
4324
|
f($, {
|
|
@@ -4335,7 +4376,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4335
4376
|
}),
|
|
4336
4377
|
emits: /*@__PURE__*/ g(["complete"], ["update:modelValue"]),
|
|
4337
4378
|
setup(e, { emit: n }) {
|
|
4338
|
-
let r = e, i = L(e, "modelValue"), a = n, s =
|
|
4379
|
+
let r = e, i = L(e, "modelValue"), a = n, s = St(() => r.rounded), u = o(() => Z[s.value]), d = D(Array.from({ length: r.length }, () => "")), f = (e) => {
|
|
4339
4380
|
let t = Array.from({ length: r.length }, (t, n) => e[n] ?? "");
|
|
4340
4381
|
t.join("\0") !== d.value.join("\0") && (d.value = t);
|
|
4341
4382
|
};
|
|
@@ -4390,7 +4431,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4390
4431
|
placeholder: e.placeholder,
|
|
4391
4432
|
"aria-label": `${e.ariaLabel} 第 ${n + 1} 位`,
|
|
4392
4433
|
"aria-invalid": e.isInvalid || void 0,
|
|
4393
|
-
class: y(P(
|
|
4434
|
+
class: y(P(J)("bg-content1 shadow-kun-sm border text-foreground text-center font-medium tabular-nums transition-[color,box-shadow] outline-none", u.value, p[e.size], e.isInvalid ? P(J)("border-danger-300", P(X).danger) : P(J)("border-kun", P(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60")),
|
|
4394
4435
|
onInput: (e) => x(n, e),
|
|
4395
4436
|
onKeydown: (e) => C(n, e),
|
|
4396
4437
|
onPaste: (e) => T(n, e),
|
|
@@ -4420,7 +4461,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4420
4461
|
}
|
|
4421
4462
|
},
|
|
4422
4463
|
setup(e, { expose: t }) {
|
|
4423
|
-
let r = e, a =
|
|
4464
|
+
let r = e, a = St(() => r.rounded), d = o(() => Z[a.value]), p = D(!1), m = D(null), h = D(null), g = nt("kun-popover"), { floatingStyles: _, transformOrigin: x, arrowRef: S, arrowStyles: C } = tn(m, h, {
|
|
4424
4465
|
placement: () => r.position,
|
|
4425
4466
|
open: p,
|
|
4426
4467
|
offset: 8,
|
|
@@ -4434,9 +4475,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4434
4475
|
}, A = (e = !0) => {
|
|
4435
4476
|
p.value && (p.value = !1, e && v(() => T?.focus({ preventScroll: !0 })));
|
|
4436
4477
|
}, j = () => p.value ? A() : O();
|
|
4437
|
-
return
|
|
4478
|
+
return ye(m, (e) => {
|
|
4438
4479
|
h.value?.contains(e.target) || A(!1);
|
|
4439
|
-
}),
|
|
4480
|
+
}), Se("keydown", (e) => {
|
|
4440
4481
|
e.key === "Escape" && p.value && A();
|
|
4441
4482
|
}), t({
|
|
4442
4483
|
open: O,
|
|
@@ -4466,7 +4507,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4466
4507
|
role: "dialog",
|
|
4467
4508
|
tabindex: "-1",
|
|
4468
4509
|
"aria-label": e.ariaLabel || "popover",
|
|
4469
|
-
class: y(P(
|
|
4510
|
+
class: y(P(J)("bg-content1 z-kun-popover shadow-kun-md focus:outline-none", d.value, e.innerClass)),
|
|
4470
4511
|
style: b([P(_), { transformOrigin: P(x) }]),
|
|
4471
4512
|
onKeydown: r[0] ||= G((e) => A(), ["escape"])
|
|
4472
4513
|
}, [k(t.$slots, "default"), e.showArrow ? (w(), l("div", {
|
|
@@ -4490,7 +4531,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4490
4531
|
"aria-label",
|
|
4491
4532
|
"aria-valuenow",
|
|
4492
4533
|
"aria-valuemax"
|
|
4493
|
-
], Ro = 45, zo = /*#__PURE__*/
|
|
4534
|
+
], Ro = 45, zo = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
4494
4535
|
name: "KunProgress",
|
|
4495
4536
|
__name: "Progress",
|
|
4496
4537
|
props: {
|
|
@@ -4523,7 +4564,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4523
4564
|
case "xl": return "h-5";
|
|
4524
4565
|
default: return "h-3";
|
|
4525
4566
|
}
|
|
4526
|
-
}), i =
|
|
4567
|
+
}), i = St(() => t.rounded), a = o(() => Z[i.value]), s = {
|
|
4527
4568
|
default: "text-default",
|
|
4528
4569
|
primary: "text-primary",
|
|
4529
4570
|
secondary: "text-secondary",
|
|
@@ -4539,8 +4580,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4539
4580
|
warning: "bg-gradient-to-r from-warning-400 to-warning-600",
|
|
4540
4581
|
danger: "bg-gradient-to-r from-danger-400 to-danger-600",
|
|
4541
4582
|
info: "bg-gradient-to-r from-info-400 to-info-600"
|
|
4542
|
-
}, f = o(() =>
|
|
4543
|
-
let e =
|
|
4583
|
+
}, f = o(() => me[t.color]), p = o(() => {
|
|
4584
|
+
let e = fe[t.color];
|
|
4544
4585
|
switch (t.variant) {
|
|
4545
4586
|
case "gradient": return d[t.color];
|
|
4546
4587
|
case "striped": return `${e} bg-[length:1rem_1rem] bg-gradient-to-r from-white/20 to-transparent animate-[progress-stripes_1s_linear_infinite]`;
|
|
@@ -4592,14 +4633,14 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4592
4633
|
"aria-valuemax": e.max
|
|
4593
4634
|
}, [e.indeterminate ? (w(), l("div", {
|
|
4594
4635
|
key: 0,
|
|
4595
|
-
class: y(P(
|
|
4636
|
+
class: y(P(J)("absolute inset-y-0 w-2/5 animate-[kun-progress-indeterminate_1.5s_ease-in-out_infinite]", a.value, p.value))
|
|
4596
4637
|
}, null, 2)) : (w(), l("div", {
|
|
4597
4638
|
key: 1,
|
|
4598
|
-
class: y(P(
|
|
4639
|
+
class: y(P(J)("flex h-full items-center transition-all duration-kun-slow ease-kun-out", p.value)),
|
|
4599
4640
|
style: b(`width:${n.value}%`)
|
|
4600
4641
|
}, [e.showLabel ? (w(), l("span", {
|
|
4601
4642
|
key: 0,
|
|
4602
|
-
class: y(P(
|
|
4643
|
+
class: y(P(J)("px-2 text-xs font-medium", f.value))
|
|
4603
4644
|
}, j(n.value) + "% ", 3)) : c("", !0)], 6))], 10, Lo))]));
|
|
4604
4645
|
}
|
|
4605
4646
|
}), [["__scopeId", "data-v-698d88e3"]]), Bo = ["id"], Vo = [
|
|
@@ -4651,11 +4692,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4651
4692
|
}),
|
|
4652
4693
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
4653
4694
|
setup(e, { emit: n }) {
|
|
4654
|
-
let r = e, i = L(e, "modelValue"), a = n, s =
|
|
4695
|
+
let r = e, i = L(e, "modelValue"), a = n, s = St(() => r.rounded), d = o(() => Z[s.value]), f = nt("kun-radio-group"), p = o(() => `${f.value}-label`), m = D([]), h = (e) => r.disabled || e.disabled === !0, g = o(() => {
|
|
4655
4696
|
let e = r.options.findIndex((e) => e.value === i.value);
|
|
4656
4697
|
return e >= 0 && !h(r.options[e]) ? e : r.options.findIndex((e) => !h(e));
|
|
4657
4698
|
}), _ = o(() => {
|
|
4658
|
-
let e =
|
|
4699
|
+
let e = ue[r.size];
|
|
4659
4700
|
return {
|
|
4660
4701
|
indicator: e.box,
|
|
4661
4702
|
dot: e.dot,
|
|
@@ -4695,7 +4736,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4695
4736
|
}
|
|
4696
4737
|
}
|
|
4697
4738
|
};
|
|
4698
|
-
return (n, r) => (w(), l("div", { class: y(P(
|
|
4739
|
+
return (n, r) => (w(), l("div", { class: y(P(J)("w-full", e.className)) }, [
|
|
4699
4740
|
e.label ? (w(), l("div", {
|
|
4700
4741
|
key: 0,
|
|
4701
4742
|
id: p.value,
|
|
@@ -4706,7 +4747,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4706
4747
|
"aria-label": e.label ? void 0 : e.ariaLabel || "radio group",
|
|
4707
4748
|
"aria-labelledby": e.label ? p.value : void 0,
|
|
4708
4749
|
"aria-disabled": e.disabled || void 0,
|
|
4709
|
-
class: y(P(
|
|
4750
|
+
class: y(P(J)("flex", e.orientation === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-3"))
|
|
4710
4751
|
}, [e.variant === "classic" ? (w(!0), l(t, { key: 0 }, O(e.options, (t, n) => (w(), l("label", {
|
|
4711
4752
|
key: String(t.value),
|
|
4712
4753
|
ref_for: !0,
|
|
@@ -4715,12 +4756,12 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4715
4756
|
"aria-checked": i.value === t.value,
|
|
4716
4757
|
"aria-disabled": h(t) || void 0,
|
|
4717
4758
|
tabindex: g.value === n && !h(t) ? 0 : -1,
|
|
4718
|
-
class: y(P(
|
|
4759
|
+
class: y(P(J)("group inline-flex cursor-pointer items-center rounded-kun-md p-1 transition-colors", P(X)[e.color], _.value.gap, _.value.text, h(t) && "cursor-not-allowed opacity-50")),
|
|
4719
4760
|
onClick: (e) => b(t, n),
|
|
4720
4761
|
onKeydown: (e) => S(e, n)
|
|
4721
|
-
}, [u("span", { class: y(P(
|
|
4762
|
+
}, [u("span", { class: y(P(J)("inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-colors", _.value.indicator, i.value === t.value ? P(ae)[e.color] : "border-default-300 group-hover:border-default-400")) }, [i.value === t.value ? (w(), l("span", {
|
|
4722
4763
|
key: 0,
|
|
4723
|
-
class: y(P(
|
|
4764
|
+
class: y(P(J)("block rounded-full", _.value.dot, P(ie)[e.color]))
|
|
4724
4765
|
}, null, 2)) : c("", !0)], 2), u("span", Uo, [u("span", Wo, j(t.label), 1), t.description ? (w(), l("span", Go, j(t.description), 1)) : c("", !0)])], 42, Ho))), 128)) : (w(!0), l(t, { key: 1 }, O(e.options, (t, n) => (w(), l("div", {
|
|
4725
4766
|
key: String(t.value),
|
|
4726
4767
|
ref_for: !0,
|
|
@@ -4729,12 +4770,12 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4729
4770
|
"aria-checked": i.value === t.value,
|
|
4730
4771
|
"aria-disabled": h(t) || void 0,
|
|
4731
4772
|
tabindex: g.value === n && !h(t) ? 0 : -1,
|
|
4732
|
-
class: y(P(
|
|
4773
|
+
class: y(P(J)("relative flex cursor-pointer items-start border-2 p-3 transition-all", P(X)[e.color], _.value.gap, _.value.text, d.value, e.orientation === "horizontal" && "flex-1 min-w-[8rem]", i.value === t.value ? P(J)(P(ae)[e.color], P(de)[e.color]) : "border-kun hover:border-default-300 bg-content1", h(t) && "cursor-not-allowed opacity-50")),
|
|
4733
4774
|
onClick: (e) => b(t, n),
|
|
4734
4775
|
onKeydown: (e) => S(e, n)
|
|
4735
|
-
}, [u("span", { class: y(P(
|
|
4776
|
+
}, [u("span", { class: y(P(J)("mt-0.5 inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-colors", _.value.indicator, i.value === t.value ? P(ae)[e.color] : "border-default-300")) }, [i.value === t.value ? (w(), l("span", {
|
|
4736
4777
|
key: 0,
|
|
4737
|
-
class: y(P(
|
|
4778
|
+
class: y(P(J)("block rounded-full", _.value.dot, P(ie)[e.color]))
|
|
4738
4779
|
}, null, 2)) : c("", !0)], 2), u("div", qo, [u("span", Jo, j(t.label), 1), t.description ? (w(), l("span", Yo, j(t.description), 1)) : c("", !0)])], 42, Ko))), 128))], 10, Vo),
|
|
4739
4780
|
e.error ? (w(), l("p", Xo, j(e.error), 1)) : c("", !0)
|
|
4740
4781
|
], 2));
|
|
@@ -4789,16 +4830,16 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4789
4830
|
type: "button",
|
|
4790
4831
|
role: "radio",
|
|
4791
4832
|
"aria-checked": d.value >= t,
|
|
4792
|
-
class: y(P(
|
|
4833
|
+
class: y(P(J)("disabled:text-default-200 cursor-pointer hover:scale-110 focus:outline-none disabled:cursor-not-allowed", d.value >= t ? "text-secondary" : "text-default-300")),
|
|
4793
4834
|
disabled: e.disabled,
|
|
4794
4835
|
title: `${t}/${e.max}`,
|
|
4795
4836
|
"aria-label": `${t} / ${e.max}`,
|
|
4796
4837
|
onMouseenter: (e) => m(t),
|
|
4797
4838
|
onMouseleave: h,
|
|
4798
4839
|
onClick: (e) => p(t)
|
|
4799
|
-
}, [f(
|
|
4840
|
+
}, [f(Q, {
|
|
4800
4841
|
name: "lucide:lollipop",
|
|
4801
|
-
class: y(P(
|
|
4842
|
+
class: y(P(J)("transition-colors", c.value))
|
|
4802
4843
|
}, null, 8, ["class"])], 42, $o))), 128))], 8, Qo));
|
|
4803
4844
|
}
|
|
4804
4845
|
}), ts = ["id", "for"], ns = [
|
|
@@ -4880,11 +4921,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4880
4921
|
}),
|
|
4881
4922
|
emits: /*@__PURE__*/ g(["set"], ["update:modelValue"]),
|
|
4882
4923
|
setup(e, { emit: r }) {
|
|
4883
|
-
let a = e, d =
|
|
4924
|
+
let a = e, d = St(() => a.rounded), p = o(() => Z[d.value]), m = L(e, "modelValue"), h = r, g = nt("kun-select"), _ = o(() => `${g.value}-listbox`), x = D(!1), S = D(""), C = D(-1), T = D(null), E = D(null), k = D(null), A = D(null), { floatingStyles: M, transformOrigin: N } = tn(T, E, {
|
|
4884
4925
|
placement: "bottom-start",
|
|
4885
4926
|
open: x,
|
|
4886
4927
|
offset: 4,
|
|
4887
|
-
middleware: [
|
|
4928
|
+
middleware: [je({ apply({ rects: e, elements: t, availableHeight: n }) {
|
|
4888
4929
|
Object.assign(t.floating.style, {
|
|
4889
4930
|
width: `${e.reference.width}px`,
|
|
4890
4931
|
maxHeight: `${Math.min(280, n - 8)}px`
|
|
@@ -4897,43 +4938,43 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4897
4938
|
if (!a.searchable || !S.value.trim()) return a.options;
|
|
4898
4939
|
let e = S.value.trim().toLowerCase();
|
|
4899
4940
|
return a.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
4900
|
-
}),
|
|
4941
|
+
}), q = o(() => C.value >= 0 && G.value[C.value] ? `${g.value}-opt-${C.value}` : void 0), Y = (e = 0, t = 1) => {
|
|
4901
4942
|
let n = G.value;
|
|
4902
4943
|
for (let r = e; r >= 0 && r < n.length; r += t) if (!n[r].disabled) return r;
|
|
4903
4944
|
return -1;
|
|
4904
|
-
},
|
|
4945
|
+
}, ee = () => {
|
|
4905
4946
|
if (a.disabled || x.value) return;
|
|
4906
4947
|
x.value = !0, S.value = "";
|
|
4907
4948
|
let e = G.value.findIndex((e) => I.value.has(e.value));
|
|
4908
|
-
C.value = e >= 0 ? e :
|
|
4909
|
-
a.searchable && A.value?.focus({ preventScroll: !0 }),
|
|
4949
|
+
C.value = e >= 0 ? e : Y(), v(() => {
|
|
4950
|
+
a.searchable && A.value?.focus({ preventScroll: !0 }), ce();
|
|
4910
4951
|
});
|
|
4911
|
-
},
|
|
4952
|
+
}, te = (e = !0) => {
|
|
4912
4953
|
x.value && (x.value = !1, S.value = "", e && v(() => T.value?.focus({ preventScroll: !0 })));
|
|
4913
|
-
},
|
|
4914
|
-
|
|
4915
|
-
E.value?.contains(e.target) ||
|
|
4954
|
+
}, ne = () => x.value ? te() : ee();
|
|
4955
|
+
ye(T, (e) => {
|
|
4956
|
+
E.value?.contains(e.target) || te(!1);
|
|
4916
4957
|
});
|
|
4917
|
-
let
|
|
4958
|
+
let re = (e) => {
|
|
4918
4959
|
if (e.disabled) return;
|
|
4919
4960
|
let t = a.options.findIndex((t) => t.value === e.value);
|
|
4920
4961
|
if (a.multiple) {
|
|
4921
4962
|
let t = Array.isArray(m.value) ? [...m.value] : [], n = t.indexOf(e.value);
|
|
4922
4963
|
n >= 0 ? t.splice(n, 1) : t.push(e.value), m.value = t, a.searchable && v(() => A.value?.focus({ preventScroll: !0 }));
|
|
4923
|
-
} else m.value = e.value,
|
|
4964
|
+
} else m.value = e.value, te();
|
|
4924
4965
|
h("set", e.value, t);
|
|
4925
|
-
},
|
|
4966
|
+
}, ie = () => {
|
|
4926
4967
|
let e = G.value[C.value];
|
|
4927
|
-
e &&
|
|
4928
|
-
},
|
|
4968
|
+
e && re(e);
|
|
4969
|
+
}, ae = (e) => {
|
|
4929
4970
|
a.disabled || (m.value = (Array.isArray(m.value) ? [...m.value] : []).filter((t) => t !== e));
|
|
4930
|
-
},
|
|
4971
|
+
}, oe = () => {
|
|
4931
4972
|
a.disabled || (m.value = a.multiple ? [] : null);
|
|
4932
|
-
},
|
|
4973
|
+
}, ce = () => {
|
|
4933
4974
|
v(() => {
|
|
4934
4975
|
nn(k.value, k.value?.querySelector(`[data-index="${C.value}"]`));
|
|
4935
4976
|
});
|
|
4936
|
-
},
|
|
4977
|
+
}, le = (e) => {
|
|
4937
4978
|
let t = G.value.length;
|
|
4938
4979
|
if (!t) return;
|
|
4939
4980
|
let n = C.value;
|
|
@@ -4941,14 +4982,14 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4941
4982
|
C.value = n;
|
|
4942
4983
|
break;
|
|
4943
4984
|
}
|
|
4944
|
-
|
|
4945
|
-
},
|
|
4946
|
-
C.value = e === 1 ?
|
|
4947
|
-
},
|
|
4948
|
-
|
|
4949
|
-
let t = a.options.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(
|
|
4950
|
-
t >= 0 && (C.value = t,
|
|
4951
|
-
},
|
|
4985
|
+
ce();
|
|
4986
|
+
}, ue = (e) => {
|
|
4987
|
+
C.value = e === 1 ? Y(0, 1) : Y(G.value.length - 1, -1), ce();
|
|
4988
|
+
}, de = "", fe = null, pe = (e) => {
|
|
4989
|
+
de += e.toLowerCase(), fe && clearTimeout(fe), fe = setTimeout(() => de = "", 600);
|
|
4990
|
+
let t = a.options.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(de));
|
|
4991
|
+
t >= 0 && (C.value = t, ce());
|
|
4992
|
+
}, me = (e) => {
|
|
4952
4993
|
if (a.disabled) return;
|
|
4953
4994
|
let t = e.key;
|
|
4954
4995
|
if (!x.value) {
|
|
@@ -4957,40 +4998,40 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
4957
4998
|
"ArrowUp",
|
|
4958
4999
|
"Enter",
|
|
4959
5000
|
" "
|
|
4960
|
-
].includes(t) && (e.preventDefault(),
|
|
5001
|
+
].includes(t) && (e.preventDefault(), ee());
|
|
4961
5002
|
return;
|
|
4962
5003
|
}
|
|
4963
5004
|
switch (t) {
|
|
4964
5005
|
case "ArrowDown":
|
|
4965
|
-
e.preventDefault(),
|
|
5006
|
+
e.preventDefault(), le(1);
|
|
4966
5007
|
break;
|
|
4967
5008
|
case "ArrowUp":
|
|
4968
|
-
e.preventDefault(),
|
|
5009
|
+
e.preventDefault(), le(-1);
|
|
4969
5010
|
break;
|
|
4970
5011
|
case "Home":
|
|
4971
|
-
e.preventDefault(),
|
|
5012
|
+
e.preventDefault(), ue(1);
|
|
4972
5013
|
break;
|
|
4973
5014
|
case "End":
|
|
4974
|
-
e.preventDefault(),
|
|
5015
|
+
e.preventDefault(), ue(-1);
|
|
4975
5016
|
break;
|
|
4976
5017
|
case "Enter":
|
|
4977
|
-
e.preventDefault(),
|
|
5018
|
+
e.preventDefault(), ie();
|
|
4978
5019
|
break;
|
|
4979
5020
|
case " ":
|
|
4980
|
-
a.searchable || (e.preventDefault(),
|
|
5021
|
+
a.searchable || (e.preventDefault(), ie());
|
|
4981
5022
|
break;
|
|
4982
5023
|
case "Escape":
|
|
4983
|
-
e.preventDefault(),
|
|
5024
|
+
e.preventDefault(), te();
|
|
4984
5025
|
break;
|
|
4985
5026
|
case "Tab":
|
|
4986
|
-
|
|
5027
|
+
te(!1);
|
|
4987
5028
|
break;
|
|
4988
|
-
default: !a.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey &&
|
|
5029
|
+
default: !a.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && pe(t);
|
|
4989
5030
|
}
|
|
4990
5031
|
};
|
|
4991
5032
|
return V(G, () => {
|
|
4992
|
-
x.value && (C.value < 0 || C.value >= G.value.length || G.value[C.value]?.disabled) && (C.value =
|
|
4993
|
-
}), (r, o) => (w(), l("div", { class: y(P(
|
|
5033
|
+
x.value && (C.value < 0 || C.value >= G.value.length || G.value[C.value]?.disabled) && (C.value = Y());
|
|
5034
|
+
}), (r, o) => (w(), l("div", { class: y(P(J)("relative w-full", a.className)) }, [
|
|
4994
5035
|
e.label ? (w(), l("label", {
|
|
4995
5036
|
key: 0,
|
|
4996
5037
|
id: `${P(g)}-label`,
|
|
@@ -5008,11 +5049,11 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5008
5049
|
"aria-expanded": x.value,
|
|
5009
5050
|
"aria-haspopup": "listbox",
|
|
5010
5051
|
"aria-controls": _.value,
|
|
5011
|
-
"aria-activedescendant": x.value ?
|
|
5052
|
+
"aria-activedescendant": x.value ? q.value : void 0,
|
|
5012
5053
|
"aria-disabled": e.disabled || void 0,
|
|
5013
|
-
class: y(P(
|
|
5014
|
-
onClick:
|
|
5015
|
-
onKeydown:
|
|
5054
|
+
class: y(P(J)("flex w-full cursor-pointer items-center justify-between gap-2 text-left transition-[color,box-shadow]", P(se)[a.size], p.value, "bg-content1 shadow-kun-sm border", e.error ? P(J)("border-danger-300", P(X).danger) : P(J)("border-kun", P(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60")),
|
|
5055
|
+
onClick: ne,
|
|
5056
|
+
onKeydown: me
|
|
5016
5057
|
}, [
|
|
5017
5058
|
e.multiple && H.value ? (w(), l("span", rs, [(w(!0), l(t, null, O(R.value, (t) => (w(), l("span", {
|
|
5018
5059
|
key: String(t.value),
|
|
@@ -5022,9 +5063,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5022
5063
|
type: "button",
|
|
5023
5064
|
class: "hover:text-danger shrink-0",
|
|
5024
5065
|
"aria-label": `移除 ${t.label}`,
|
|
5025
|
-
onClick: K((e) =>
|
|
5066
|
+
onClick: K((e) => ae(t.value), ["stop"]),
|
|
5026
5067
|
onMousedown: o[0] ||= K(() => {}, ["stop", "prevent"])
|
|
5027
|
-
}, [f(
|
|
5068
|
+
}, [f(Q, {
|
|
5028
5069
|
name: "lucide:x",
|
|
5029
5070
|
class: "size-3"
|
|
5030
5071
|
})], 40, as))]))), 128))])) : (w(), l("span", {
|
|
@@ -5036,13 +5077,13 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5036
5077
|
type: "button",
|
|
5037
5078
|
class: "text-default-400 hover:text-default-600 shrink-0",
|
|
5038
5079
|
"aria-label": "清除",
|
|
5039
|
-
onClick: K(
|
|
5080
|
+
onClick: K(oe, ["stop"]),
|
|
5040
5081
|
onMousedown: o[1] ||= K(() => {}, ["stop", "prevent"])
|
|
5041
|
-
}, [f(
|
|
5082
|
+
}, [f(Q, {
|
|
5042
5083
|
name: "lucide:circle-x",
|
|
5043
5084
|
class: "size-4"
|
|
5044
5085
|
})], 32)) : c("", !0),
|
|
5045
|
-
f(
|
|
5086
|
+
f(Q, {
|
|
5046
5087
|
name: "lucide:chevron-down",
|
|
5047
5088
|
class: y(["pointer-events-none shrink-0 transition-transform", x.value ? "rotate-180" : ""])
|
|
5048
5089
|
}, null, 8, ["class"])
|
|
@@ -5071,7 +5112,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5071
5112
|
ref_key: "dropdownRef",
|
|
5072
5113
|
ref: E,
|
|
5073
5114
|
style: b([P(M), { transformOrigin: P(N) }]),
|
|
5074
|
-
class: y(P(
|
|
5115
|
+
class: y(P(J)("bg-content1 z-kun-popover flex flex-col overflow-hidden p-1 shadow-kun-md", p.value))
|
|
5075
5116
|
}, [e.searchable ? (w(), l("div", cs, [W(u("input", {
|
|
5076
5117
|
ref_key: "searchRef",
|
|
5077
5118
|
ref: A,
|
|
@@ -5082,9 +5123,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5082
5123
|
role: "combobox",
|
|
5083
5124
|
"aria-controls": _.value,
|
|
5084
5125
|
"aria-expanded": x.value,
|
|
5085
|
-
"aria-activedescendant":
|
|
5086
|
-
class: y(P(
|
|
5087
|
-
onKeydown:
|
|
5126
|
+
"aria-activedescendant": q.value,
|
|
5127
|
+
class: y(P(J)("bg-content1 shadow-kun-sm border-kun w-full rounded-kun-sm border px-2.5 py-1.5 text-sm", P(X)[e.color])),
|
|
5128
|
+
onKeydown: me
|
|
5088
5129
|
}, null, 42, ls), [[z, S.value]])])) : c("", !0), u("ul", {
|
|
5089
5130
|
ref_key: "listRef",
|
|
5090
5131
|
ref: k,
|
|
@@ -5101,9 +5142,9 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5101
5142
|
role: "option",
|
|
5102
5143
|
"aria-selected": I.value.has(e.value),
|
|
5103
5144
|
"aria-disabled": e.disabled || void 0,
|
|
5104
|
-
onClick: (t) =>
|
|
5145
|
+
onClick: (t) => re(e),
|
|
5105
5146
|
onMousemove: (n) => !e.disabled && (C.value = t)
|
|
5106
|
-
}, [u("span", fs, j(e.label), 1), I.value.has(e.value) ? (w(), s(
|
|
5147
|
+
}, [u("span", fs, j(e.label), 1), I.value.has(e.value) ? (w(), s(Q, {
|
|
5107
5148
|
key: 0,
|
|
5108
5149
|
name: "lucide:check",
|
|
5109
5150
|
class: "text-primary ml-2 shrink-0"
|
|
@@ -5125,7 +5166,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5125
5166
|
ariaLabel: { default: "scrollable content" }
|
|
5126
5167
|
},
|
|
5127
5168
|
setup(e) {
|
|
5128
|
-
let t = e, n = D(null), r = D(null), { x: i, y: a } =
|
|
5169
|
+
let t = e, n = D(null), r = D(null), { x: i, y: a } = we(n, { throttle: 50 }), { width: s, height: c } = xe(r), { width: d, height: f } = xe(n), p = D(!1), m = D(!1);
|
|
5129
5170
|
H(() => {
|
|
5130
5171
|
n.value && (t.axis === "horizontal" ? (p.value = i.value > 1, m.value = s.value - d.value - i.value > 1) : (p.value = a.value > 1, m.value = c.value - f.value - a.value > 1));
|
|
5131
5172
|
});
|
|
@@ -5145,7 +5186,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5145
5186
|
return (i, a) => (w(), l("div", _s, [
|
|
5146
5187
|
u("div", {
|
|
5147
5188
|
"aria-hidden": "true",
|
|
5148
|
-
class: y(P(
|
|
5189
|
+
class: y(P(J)("pointer-events-none absolute z-10 transition-opacity", h.value, p.value ? "opacity-100" : "opacity-0")),
|
|
5149
5190
|
style: b(_.value.start)
|
|
5150
5191
|
}, null, 6),
|
|
5151
5192
|
u("div", {
|
|
@@ -5154,15 +5195,15 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5154
5195
|
tabindex: "0",
|
|
5155
5196
|
role: "region",
|
|
5156
5197
|
"aria-label": e.ariaLabel,
|
|
5157
|
-
class: y(P(
|
|
5198
|
+
class: y(P(J)("scrollbar-hide", e.axis === "horizontal" ? "overflow-x-auto" : "overflow-y-auto", t.className))
|
|
5158
5199
|
}, [u("div", {
|
|
5159
5200
|
ref_key: "contentWrapper",
|
|
5160
5201
|
ref: r,
|
|
5161
|
-
class: y(P(
|
|
5202
|
+
class: y(P(J)(e.axis === "horizontal" ? "flex w-max gap-3" : "flex w-full flex-col gap-3", t.contentClass))
|
|
5162
5203
|
}, [k(i.$slots, "default")], 2)], 10, vs),
|
|
5163
5204
|
u("div", {
|
|
5164
5205
|
"aria-hidden": "true",
|
|
5165
|
-
class: y(P(
|
|
5206
|
+
class: y(P(J)("pointer-events-none absolute z-10 transition-opacity", g.value, m.value ? "opacity-100" : "opacity-0")),
|
|
5166
5207
|
style: b(_.value.end)
|
|
5167
5208
|
}, null, 6)
|
|
5168
5209
|
]));
|
|
@@ -5183,7 +5224,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5183
5224
|
className: { default: "" }
|
|
5184
5225
|
},
|
|
5185
5226
|
setup(e) {
|
|
5186
|
-
let t = e, n =
|
|
5227
|
+
let t = e, n = St(() => t.rounded), r = o(() => t.variant === "circle" ? "rounded-full" : t.variant === "text" ? "rounded-md" : Z[n.value]), i = o(() => {
|
|
5187
5228
|
let e = t.height || (t.variant === "text" ? "1em" : t.variant === "circle" ? "2.5rem" : "1.25rem");
|
|
5188
5229
|
return {
|
|
5189
5230
|
width: t.width || (t.variant === "circle" ? e : "100%"),
|
|
@@ -5193,7 +5234,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5193
5234
|
return (t, n) => e.loaded ? k(t.$slots, "default", { key: 0 }) : (w(), l("span", {
|
|
5194
5235
|
key: 1,
|
|
5195
5236
|
"aria-hidden": "true",
|
|
5196
|
-
class: y(P(
|
|
5237
|
+
class: y(P(J)("bg-default-200 dark:bg-default-100 block shrink-0", e.animation === "pulse" && "motion-safe:animate-pulse", r.value, e.className)),
|
|
5197
5238
|
style: b(i.value)
|
|
5198
5239
|
}, null, 6));
|
|
5199
5240
|
}
|
|
@@ -5257,7 +5298,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5257
5298
|
}),
|
|
5258
5299
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
5259
5300
|
setup(e, { emit: n }) {
|
|
5260
|
-
let r = L(e, "modelValue"), a = e, s = n, d =
|
|
5301
|
+
let r = L(e, "modelValue"), a = e, s = n, d = nt("kun-slider"), p = {
|
|
5261
5302
|
xs: {
|
|
5262
5303
|
track: "h-1",
|
|
5263
5304
|
thumb: "size-3.5"
|
|
@@ -5373,7 +5414,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5373
5414
|
}, H = o(() => a.showTooltip && x.value && !a.disabled);
|
|
5374
5415
|
return C(() => {
|
|
5375
5416
|
z();
|
|
5376
|
-
}), (n, a) => (w(), l("div", { class: y(P(
|
|
5417
|
+
}), (n, a) => (w(), l("div", { class: y(P(J)("w-full", e.disabled && "opacity-50")) }, [
|
|
5377
5418
|
e.label || e.showValue ? (w(), l("div", xs, [e.label ? (w(), l("label", {
|
|
5378
5419
|
key: 0,
|
|
5379
5420
|
id: `${P(d)}-label`,
|
|
@@ -5484,25 +5525,25 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5484
5525
|
}, p = (e) => e < n.current ? "done" : e === n.current ? "active" : "pending", m = (e) => {
|
|
5485
5526
|
let t = p(e);
|
|
5486
5527
|
if (t === "pending") return "border-2 border-default-200 text-default-400 bg-transparent";
|
|
5487
|
-
let r =
|
|
5488
|
-
return t === "active" ?
|
|
5489
|
-
}, h = (e) => e < n.current ?
|
|
5490
|
-
return (n, i) => (w(), l("ol", { class: y(P(
|
|
5528
|
+
let r = J(fe[n.color], me[n.color]);
|
|
5529
|
+
return t === "active" ? J(r, "ring-4", f[n.color]) : r;
|
|
5530
|
+
}, h = (e) => e < n.current ? fe[n.color] : "bg-default-200";
|
|
5531
|
+
return (n, i) => (w(), l("ol", { class: y(P(J)(r.value ? "flex flex-col" : "flex w-full items-start", e.className)) }, [(w(!0), l(t, null, O(e.items, (n, i) => (w(), l("li", {
|
|
5491
5532
|
key: i,
|
|
5492
|
-
class: y(r.value ? P(
|
|
5533
|
+
class: y(r.value ? P(J)("flex", a.value.gap) : P(J)("relative flex-1 last:flex-none", i < e.items.length - 1 && "pr-2")),
|
|
5493
5534
|
"aria-current": p(i) === "active" ? "step" : void 0
|
|
5494
|
-
}, [u("div", { class: y(r.value ? "flex flex-col items-center" : "flex w-full items-center") }, [u("span", { class: y(P(
|
|
5535
|
+
}, [u("div", { class: y(r.value ? "flex flex-col items-center" : "flex w-full items-center") }, [u("span", { class: y(P(J)("relative z-10 inline-flex shrink-0 items-center justify-center rounded-full font-medium transition-colors", a.value.circle, m(i))) }, [p(i) === "done" ? (w(), s(Q, {
|
|
5495
5536
|
key: 0,
|
|
5496
5537
|
name: "lucide:check",
|
|
5497
5538
|
class: y(a.value.icon)
|
|
5498
|
-
}, null, 8, ["class"])) : n.icon ? (w(), s(
|
|
5539
|
+
}, null, 8, ["class"])) : n.icon ? (w(), s(Q, {
|
|
5499
5540
|
key: 1,
|
|
5500
5541
|
name: n.icon,
|
|
5501
5542
|
class: y(a.value.icon)
|
|
5502
5543
|
}, null, 8, ["name", "class"])) : (w(), l(t, { key: 2 }, [d(j(i + 1), 1)], 64))], 2), i < e.items.length - 1 ? (w(), l("span", {
|
|
5503
5544
|
key: 0,
|
|
5504
|
-
class: y(P(
|
|
5505
|
-
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : P(
|
|
5545
|
+
class: y(P(J)("transition-colors", r.value ? "mt-1 w-0.5 flex-1" : "mx-2 h-0.5 flex-1", h(i)))
|
|
5546
|
+
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : P(J)("mt-2", i < e.items.length - 1 ? "pr-2" : "")) }, [u("p", { class: y(P(J)("font-medium", a.value.title, p(i) === "pending" ? "text-default-400" : p(i) === "active" ? P(he)[e.color] : "text-foreground")) }, j(n.title), 3), n.description ? (w(), l("p", js, j(n.description), 1)) : c("", !0)], 2)], 10, As))), 128))], 2));
|
|
5506
5547
|
}
|
|
5507
5548
|
}), Ns = [
|
|
5508
5549
|
"id",
|
|
@@ -5532,7 +5573,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5532
5573
|
}),
|
|
5533
5574
|
emits: ["update:modelValue"],
|
|
5534
5575
|
setup(e) {
|
|
5535
|
-
let t = e, n = L(e, "modelValue"), r =
|
|
5576
|
+
let t = e, n = L(e, "modelValue"), r = nt("kun-switch"), i = {
|
|
5536
5577
|
xs: {
|
|
5537
5578
|
track: "h-4 w-7",
|
|
5538
5579
|
thumb: "size-3",
|
|
@@ -5569,7 +5610,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5569
5610
|
gap: "ml-3.5"
|
|
5570
5611
|
}
|
|
5571
5612
|
}, a = o(() => i[t.size]);
|
|
5572
|
-
return (t, i) => (w(), l("div", null, [u("label", { class: y(P(
|
|
5613
|
+
return (t, i) => (w(), l("div", null, [u("label", { class: y(P(J)("inline-flex cursor-pointer items-center", e.disabled ? "cursor-not-allowed" : "", e.className)) }, [
|
|
5573
5614
|
u("input", {
|
|
5574
5615
|
id: P(r),
|
|
5575
5616
|
type: "checkbox",
|
|
@@ -5584,10 +5625,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5584
5625
|
n.value ? "bg-primary" : "bg-default-500",
|
|
5585
5626
|
e.disabled ? "opacity-50" : "",
|
|
5586
5627
|
n.value && e.disabled ? "bg-primary-300" : ""
|
|
5587
|
-
]]) }, null, 2), u("div", { class: y(P(
|
|
5628
|
+
]]) }, null, 2), u("div", { class: y(P(J)("absolute top-0.5 left-0.5 transform rounded-full bg-white transition-transform duration-kun-fast ease-kun-emphasized", a.value.thumb, n.value ? a.value.translate : "translate-x-0")) }, null, 2)]),
|
|
5588
5629
|
e.label ? (w(), l("span", {
|
|
5589
5630
|
key: 0,
|
|
5590
|
-
class: y(P(
|
|
5631
|
+
class: y(P(J)("font-medium", a.value.gap, a.value.text, e.disabled ? "text-default-400" : "", e.labelClassName))
|
|
5591
5632
|
}, j(e.label), 3)) : c("", !0)
|
|
5592
5633
|
], 2), e.error ? (w(), l("p", {
|
|
5593
5634
|
key: 0,
|
|
@@ -5635,7 +5676,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5635
5676
|
}),
|
|
5636
5677
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
5637
5678
|
setup(e, { emit: n }) {
|
|
5638
|
-
let r = e, i = L(e, "modelValue"), a = n, d =
|
|
5679
|
+
let r = e, i = L(e, "modelValue"), a = n, d = st(), p = o(() => r.orientation === "vertical"), m = {
|
|
5639
5680
|
sm: "text-sm px-2.5 py-1.5",
|
|
5640
5681
|
md: "text-sm px-3 py-2",
|
|
5641
5682
|
lg: "text-base px-4 py-2.5"
|
|
@@ -5735,31 +5776,31 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5735
5776
|
disabled: e.disabled || r.disabled
|
|
5736
5777
|
}, H = (e, t, n) => {
|
|
5737
5778
|
t.href && e.preventDefault(), R(t, n);
|
|
5738
|
-
}, W = (e) => zs(r.name, e), G = (e) => Bs(r.name, e), K = (e) => i.value === e.value,
|
|
5739
|
-
let e = p.value ?
|
|
5779
|
+
}, W = (e) => zs(r.name, e), G = (e) => Bs(r.name, e), K = (e) => i.value === e.value, q = o(() => J("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)), Y = o(() => {
|
|
5780
|
+
let e = p.value ? J("relative flex flex-col items-stretch", h[r.size]) : J("relative flex items-center", h[r.size]);
|
|
5740
5781
|
switch (r.variant) {
|
|
5741
|
-
case "underlined": return
|
|
5782
|
+
case "underlined": return J(e, r.innerClassName);
|
|
5742
5783
|
case "solid":
|
|
5743
|
-
case "light": return
|
|
5744
|
-
case "bordered": return
|
|
5745
|
-
case "pills": return
|
|
5746
|
-
default: return
|
|
5784
|
+
case "light": return J(e, "border border-kun rounded-kun-lg p-1 bg-content2/30", r.innerClassName);
|
|
5785
|
+
case "bordered": return J(e, "border border-kun rounded-kun-lg p-1", r.innerClassName);
|
|
5786
|
+
case "pills": return J(e, r.innerClassName);
|
|
5787
|
+
default: return J(e, r.innerClassName);
|
|
5747
5788
|
}
|
|
5748
|
-
}),
|
|
5789
|
+
}), ee = {
|
|
5749
5790
|
start: "justify-start",
|
|
5750
5791
|
center: "justify-center",
|
|
5751
5792
|
end: "justify-end"
|
|
5752
|
-
},
|
|
5753
|
-
let t = K(e), n =
|
|
5793
|
+
}, te = (e) => {
|
|
5794
|
+
let t = K(e), n = J("relative z-10 inline-flex items-center cursor-pointer select-none whitespace-nowrap transition-colors", ee[r.align], m[r.size], h[r.size], e.disabled && "opacity-50 cursor-not-allowed", p.value && r.fullWidth && "w-full"), i = !se.value;
|
|
5754
5795
|
switch (r.variant) {
|
|
5755
|
-
case "underlined": return
|
|
5756
|
-
case "solid": return
|
|
5757
|
-
case "light": return
|
|
5758
|
-
case "bordered": return
|
|
5759
|
-
case "pills": return
|
|
5796
|
+
case "underlined": return J(n, t ? he[r.color] : "text-default-500 hover:text-foreground");
|
|
5797
|
+
case "solid": return J(n, "rounded-kun-md", t ? J(me[r.color], i && fe[r.color]) : "text-default-500 hover:text-foreground");
|
|
5798
|
+
case "light": return J(n, "rounded-kun-md", t ? J(he[r.color], i && re[r.color]) : "text-default-500 hover:text-foreground");
|
|
5799
|
+
case "bordered": return J(n, "rounded-kun-md border", t ? J(ae[r.color], he[r.color]) : "border-transparent text-default-500 hover:text-foreground");
|
|
5800
|
+
case "pills": return J(n, "rounded-full", t ? pe[r.color] : "text-default-500 hover:text-foreground");
|
|
5760
5801
|
default: return n;
|
|
5761
5802
|
}
|
|
5762
|
-
},
|
|
5803
|
+
}, ne = (e) => r.variant === "underlined" && K(e) && !se.value ? { boxShadow: "inset 0 -2px 0 0 currentColor" } : void 0, re = {
|
|
5763
5804
|
default: "bg-default/15",
|
|
5764
5805
|
primary: "bg-primary/15",
|
|
5765
5806
|
secondary: "bg-secondary/15",
|
|
@@ -5767,28 +5808,28 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5767
5808
|
warning: "bg-warning/15",
|
|
5768
5809
|
danger: "bg-danger/15",
|
|
5769
5810
|
info: "bg-info/15"
|
|
5770
|
-
},
|
|
5811
|
+
}, oe = o(() => {
|
|
5771
5812
|
switch (r.variant) {
|
|
5772
|
-
case "underlined": return
|
|
5773
|
-
case "solid": return
|
|
5774
|
-
case "light": return
|
|
5813
|
+
case "underlined": return J("absolute rounded-full", ie[r.color], p.value ? "left-0 top-0" : "bottom-0 left-0");
|
|
5814
|
+
case "solid": return J("absolute top-0 left-0 rounded-kun-md", fe[r.color]);
|
|
5815
|
+
case "light": return J("absolute top-0 left-0 rounded-kun-md", re[r.color]);
|
|
5775
5816
|
default: return null;
|
|
5776
5817
|
}
|
|
5777
|
-
}),
|
|
5818
|
+
}), se = o(() => !!oe.value && T.value >= 0 && Object.keys(E.value).length > 0), ce = o(() => {
|
|
5778
5819
|
let e = { ...E.value };
|
|
5779
5820
|
return r.disableAnimation || (e.transition = "transform var(--kun-dur-base) var(--ease-kun-standard), width var(--kun-dur-base) var(--ease-kun-standard)"), e;
|
|
5780
5821
|
});
|
|
5781
|
-
return (n, r) => (w(), l("div", { class: y(
|
|
5822
|
+
return (n, r) => (w(), l("div", { class: y(q.value) }, [u("div", {
|
|
5782
5823
|
ref_key: "listRef",
|
|
5783
5824
|
ref: M,
|
|
5784
|
-
class: y(
|
|
5825
|
+
class: y(Y.value),
|
|
5785
5826
|
role: "tablist",
|
|
5786
5827
|
"aria-orientation": e.orientation
|
|
5787
|
-
}, [
|
|
5828
|
+
}, [se.value ? (w(), l("div", {
|
|
5788
5829
|
key: 0,
|
|
5789
5830
|
"aria-hidden": "true",
|
|
5790
|
-
class: y(
|
|
5791
|
-
style: b(
|
|
5831
|
+
class: y(oe.value),
|
|
5832
|
+
style: b(ce.value)
|
|
5792
5833
|
}, null, 6)) : c("", !0), (w(!0), l(t, null, O(e.items, (t, n) => (w(), s(A(z(t)), _({
|
|
5793
5834
|
key: t.value,
|
|
5794
5835
|
ref_for: !0,
|
|
@@ -5800,8 +5841,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5800
5841
|
"aria-selected": K(t),
|
|
5801
5842
|
"aria-disabled": t.disabled || e.disabled,
|
|
5802
5843
|
tabindex: K(t) && !t.disabled && !e.disabled ? 0 : -1,
|
|
5803
|
-
class:
|
|
5804
|
-
style:
|
|
5844
|
+
class: te(t),
|
|
5845
|
+
style: ne(t),
|
|
5805
5846
|
onClick: (e) => H(e, t, n),
|
|
5806
5847
|
onKeydown: (e) => I(e, n)
|
|
5807
5848
|
}), {
|
|
@@ -5809,7 +5850,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5809
5850
|
key: 0,
|
|
5810
5851
|
class: "inline-flex shrink-0",
|
|
5811
5852
|
style: b({ fontSize: e.iconSize })
|
|
5812
|
-
}, [f(
|
|
5853
|
+
}, [f(Q, { name: t.icon }, null, 8, ["name"])], 4)) : c("", !0), t.textValue ? (w(), l("span", Hs, j(t.textValue), 1)) : c("", !0)]),
|
|
5813
5854
|
_: 2
|
|
5814
5855
|
}, 1040, [
|
|
5815
5856
|
"id",
|
|
@@ -5828,7 +5869,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5828
5869
|
"aria-labelledby",
|
|
5829
5870
|
"tabindex",
|
|
5830
5871
|
"data-kun-tab-hidden"
|
|
5831
|
-
], Gs = /*#__PURE__*/
|
|
5872
|
+
], Gs = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
5832
5873
|
name: "KunTabPanel",
|
|
5833
5874
|
__name: "TabPanel",
|
|
5834
5875
|
props: {
|
|
@@ -5878,7 +5919,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
5878
5919
|
"aria-labelledby": h.value,
|
|
5879
5920
|
tabindex: s.value ? 0 : -1,
|
|
5880
5921
|
"data-kun-tab-hidden": !b.value && x.value ? "" : void 0,
|
|
5881
|
-
class: y(P(
|
|
5922
|
+
class: y(P(J)("focus:outline-none", e.className)),
|
|
5882
5923
|
onBeforematch: T
|
|
5883
5924
|
}, [k(t.$slots, "default", {}, void 0, !0)], 42, Ws)) : c("", !0);
|
|
5884
5925
|
}
|
|
@@ -6000,10 +6041,10 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6000
6041
|
"invalid"
|
|
6001
6042
|
], ["update:modelValue"]),
|
|
6002
6043
|
setup(e, { emit: n }) {
|
|
6003
|
-
let r = e, i =
|
|
6044
|
+
let r = e, i = St(() => r.rounded), a = o(() => Z[i.value]), s = o(() => r.description || r.helperText), d = L(e, "modelValue"), p = n, m = D(null), h = D([]), g = D(""), _ = D(!1), b = (e, t) => {
|
|
6004
6045
|
let n = e && typeof e == "object" && "$el" in e ? e.$el ?? null : e;
|
|
6005
6046
|
n instanceof HTMLElement && (h.value[t] = n);
|
|
6006
|
-
}, x = D(!1), S =
|
|
6047
|
+
}, x = D(!1), S = nt("kun-tag-input"), C = (e) => {
|
|
6007
6048
|
let t = e;
|
|
6008
6049
|
return r.trim && (t = t.trim()), r.transform && (t = r.transform(t)), t;
|
|
6009
6050
|
}, T = (e, t) => {
|
|
@@ -6090,19 +6131,19 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6090
6131
|
md: "min-h-[38px]",
|
|
6091
6132
|
lg: "min-h-[46px]",
|
|
6092
6133
|
xl: "min-h-[54px]"
|
|
6093
|
-
},
|
|
6134
|
+
}, q = {
|
|
6094
6135
|
xs: "px-2.5 py-1 gap-1",
|
|
6095
6136
|
sm: "px-3.5 py-1.5 gap-1.5",
|
|
6096
6137
|
md: "px-4 py-2 gap-2",
|
|
6097
6138
|
lg: "px-5 py-2.5 gap-2",
|
|
6098
6139
|
xl: "px-6 py-3 gap-2.5"
|
|
6099
|
-
},
|
|
6140
|
+
}, Y = {
|
|
6100
6141
|
xs: "text-xs",
|
|
6101
6142
|
sm: "text-sm",
|
|
6102
6143
|
md: "text-sm",
|
|
6103
6144
|
lg: "text-base",
|
|
6104
6145
|
xl: "text-lg"
|
|
6105
|
-
},
|
|
6146
|
+
}, ee = o(() => J("flex flex-wrap items-center transition-shadow", a.value, G[r.size], q[r.size], Y[r.size], "border border-transparent", !r.error && "border-kun", r.variant === "flat" && "bg-content1 shadow-kun-sm", r.error ? le.danger : le[r.color], r.error && "border-danger", r.disabled && "opacity-50 cursor-not-allowed bg-default-100", r.readonly && "cursor-default", r.className)), te = o(() => J("inline-flex items-center gap-1 rounded-full font-medium whitespace-nowrap select-none", ge("flat", r.color), oe[r.size], X[r.color])), ne = o(() => d.value.length >= r.maxTags);
|
|
6106
6147
|
return (n, r) => (w(), l("div", qs, [
|
|
6107
6148
|
e.label ? (w(), l("label", {
|
|
6108
6149
|
key: 0,
|
|
@@ -6114,14 +6155,14 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6114
6155
|
"aria-label": e.label || "tag input",
|
|
6115
6156
|
"aria-invalid": !!e.error,
|
|
6116
6157
|
"aria-disabled": e.disabled,
|
|
6117
|
-
class: y(
|
|
6158
|
+
class: y(ee.value),
|
|
6118
6159
|
onClick: U
|
|
6119
6160
|
}, [
|
|
6120
6161
|
(w(!0), l(t, null, O(d.value, (t, i) => (w(), l("span", {
|
|
6121
6162
|
key: `${i}-${t}`,
|
|
6122
6163
|
ref_for: !0,
|
|
6123
6164
|
ref: (e) => b(e, i),
|
|
6124
|
-
class: y(
|
|
6165
|
+
class: y(te.value),
|
|
6125
6166
|
tabindex: e.disabled || e.readonly ? -1 : 0,
|
|
6126
6167
|
"aria-label": `标签 ${t}`,
|
|
6127
6168
|
onKeydown: (e) => I(e, i),
|
|
@@ -6137,7 +6178,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6137
6178
|
"aria-label": `移除标签 ${t}`,
|
|
6138
6179
|
class: "hover:text-danger -mr-0.5 ml-1 inline-flex cursor-pointer rounded-full p-0.5 transition-colors focus:outline-none",
|
|
6139
6180
|
onClick: K((e) => M(i), ["stop"])
|
|
6140
|
-
}, [f(
|
|
6181
|
+
}, [f(Q, {
|
|
6141
6182
|
name: "lucide:x",
|
|
6142
6183
|
class: "size-3.5"
|
|
6143
6184
|
})], 8, Zs)) : c("", !0)])], 42, Xs))), 128)),
|
|
@@ -6151,7 +6192,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6151
6192
|
enterkeyhint: "enter",
|
|
6152
6193
|
placeholder: d.value.length === 0 ? e.placeholder : "",
|
|
6153
6194
|
disabled: e.disabled,
|
|
6154
|
-
readonly:
|
|
6195
|
+
readonly: ne.value,
|
|
6155
6196
|
"aria-describedby": e.error || s.value ? `${P(S)}-msg` : void 0,
|
|
6156
6197
|
class: "placeholder-default-400 min-w-[80px] flex-1 bg-transparent outline-none disabled:cursor-not-allowed read-only:cursor-not-allowed",
|
|
6157
6198
|
onKeydown: F,
|
|
@@ -6173,7 +6214,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6173
6214
|
}, j(s.value), 9, tc)) : c("", !0)
|
|
6174
6215
|
]));
|
|
6175
6216
|
}
|
|
6176
|
-
}), rc = /*#__PURE__*/
|
|
6217
|
+
}), rc = /*#__PURE__*/ ut(/* @__PURE__ */ p({
|
|
6177
6218
|
name: "KunText",
|
|
6178
6219
|
__name: "Text",
|
|
6179
6220
|
props: {
|
|
@@ -6182,7 +6223,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6182
6223
|
},
|
|
6183
6224
|
setup(e) {
|
|
6184
6225
|
let t = e, n = o(() => t.content.replace(/([_/])/g, "$1"));
|
|
6185
|
-
return (e, r) => (w(), l("span", { class: y(P(
|
|
6226
|
+
return (e, r) => (w(), l("span", { class: y(P(J)("kun-text-block", t.className)) }, j(n.value), 3));
|
|
6186
6227
|
}
|
|
6187
6228
|
}), [["__scopeId", "data-v-e9ad81ae"]]), ic = { class: "w-full" }, ac = ["for"], oc = {
|
|
6188
6229
|
key: 0,
|
|
@@ -6263,7 +6304,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6263
6304
|
"input"
|
|
6264
6305
|
], ["update:modelValue"]),
|
|
6265
6306
|
setup(e, { expose: t, emit: n }) {
|
|
6266
|
-
let r = e, i =
|
|
6307
|
+
let r = e, i = St(() => r.rounded), a = o(() => Z[i.value]), s = o(() => r.description || r.hint), f = L(e, "modelValue"), p = nt("kun-textarea"), m = D(null), h = n;
|
|
6267
6308
|
V(f, () => {
|
|
6268
6309
|
r.autoGrow && v(() => _());
|
|
6269
6310
|
});
|
|
@@ -6312,7 +6353,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6312
6353
|
minlength: e.minlength,
|
|
6313
6354
|
rows: e.rows,
|
|
6314
6355
|
autofocus: e.autofocus,
|
|
6315
|
-
class: y(P(
|
|
6356
|
+
class: y(P(J)("scrollbar-hide w-full bg-content1 shadow-kun-sm border transition-[color,box-shadow] duration-kun-fast ease-kun-standard", P(se)[r.size], a.value, e.error ? P(J)("border-danger-300", P(X).danger) : P(J)("border-kun", P(X)[e.color]), e.disabled ? "text-default-500 cursor-not-allowed opacity-60 shadow-none" : "", e.resize === "none" ? "resize-none" : e.resize === "vertical" ? "resize-y" : e.resize === "horizontal" ? "resize-x" : "resize")),
|
|
6316
6357
|
onInput: g,
|
|
6317
6358
|
onBlur: n[1] ||= (e) => h("blur", e),
|
|
6318
6359
|
onFocus: n[2] ||= (e) => h("focus", e)
|
|
@@ -6325,7 +6366,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6325
6366
|
__name: "Timeline",
|
|
6326
6367
|
props: { className: { default: "" } },
|
|
6327
6368
|
setup(e) {
|
|
6328
|
-
return (t, n) => (w(), l("ol", { class: y(P(
|
|
6369
|
+
return (t, n) => (w(), l("ol", { class: y(P(J)("kun-timeline relative", e.className)) }, [k(t.$slots, "default")], 2));
|
|
6329
6370
|
}
|
|
6330
6371
|
}), mc = { class: "flex flex-col items-center self-stretch" }, hc = {
|
|
6331
6372
|
key: 0,
|
|
@@ -6351,15 +6392,15 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6351
6392
|
},
|
|
6352
6393
|
setup(e) {
|
|
6353
6394
|
let t = e, n = o(() => !!t.icon);
|
|
6354
|
-
return (t, r) => (w(), l("li", { class: y(P(
|
|
6395
|
+
return (t, r) => (w(), l("li", { class: y(P(J)("flex gap-3", e.className)) }, [u("div", mc, [n.value ? (w(), l("span", {
|
|
6355
6396
|
key: 0,
|
|
6356
|
-
class: y(P(
|
|
6357
|
-
}, [f(
|
|
6397
|
+
class: y(P(J)("inline-flex size-7 shrink-0 items-center justify-center rounded-full", P(fe)[e.color], P(me)[e.color]))
|
|
6398
|
+
}, [f(Q, {
|
|
6358
6399
|
name: e.icon,
|
|
6359
6400
|
class: "size-4"
|
|
6360
6401
|
}, null, 8, ["name"])], 2)) : (w(), l("span", {
|
|
6361
6402
|
key: 1,
|
|
6362
|
-
class: y(P(
|
|
6403
|
+
class: y(P(J)("mt-1.5 size-3 shrink-0 rounded-full", P(fe)[e.color]))
|
|
6363
6404
|
}, 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 ? (w(), l("div", hc, [e.title || t.$slots.title ? (w(), l("p", gc, [k(t.$slots, "title", {}, () => [d(j(e.title), 1)])])) : c("", !0), e.time || t.$slots.time ? (w(), l("span", _c, [k(t.$slots, "time", {}, () => [d(j(e.time), 1)])])) : c("", !0)])) : c("", !0), t.$slots.default ? (w(), l("div", vc, [k(t.$slots, "default")])) : c("", !0)], 2)], 2));
|
|
6364
6405
|
}
|
|
6365
6406
|
}), bc = ["aria-describedby"], xc = ["id"], Sc = /* @__PURE__ */ p({
|
|
@@ -6382,7 +6423,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6382
6423
|
}
|
|
6383
6424
|
},
|
|
6384
6425
|
setup(e) {
|
|
6385
|
-
let t = e, r =
|
|
6426
|
+
let t = e, r = St(() => t.rounded), a = o(() => Z[r.value]), u = D(null), p = D(null), m = D(!1), h = nt("kun-tooltip"), g = null, _ = null, { floatingStyles: v, arrowRef: x, arrowStyles: S } = tn(u, p, {
|
|
6386
6427
|
placement: () => t.position,
|
|
6387
6428
|
open: m,
|
|
6388
6429
|
offset: 8,
|
|
@@ -6397,7 +6438,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6397
6438
|
return (t, r) => (w(), l("div", {
|
|
6398
6439
|
ref_key: "triggerRef",
|
|
6399
6440
|
ref: u,
|
|
6400
|
-
class: y(P(
|
|
6441
|
+
class: y(P(J)("relative inline-block", e.className)),
|
|
6401
6442
|
"aria-describedby": m.value ? P(h) : void 0,
|
|
6402
6443
|
onMouseenter: T,
|
|
6403
6444
|
onMouseleave: E,
|
|
@@ -6418,7 +6459,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6418
6459
|
ref: p,
|
|
6419
6460
|
id: P(h),
|
|
6420
6461
|
role: "tooltip",
|
|
6421
|
-
class: y(P(
|
|
6462
|
+
class: y(P(J)("bg-content1 z-kun-popover max-w-xs px-3 py-2 text-sm font-medium shadow-kun-md", a.value, e.hideOnMobile && "hidden sm:block")),
|
|
6422
6463
|
style: b(P(v))
|
|
6423
6464
|
}, [k(t.$slots, "content", {}, () => [d(j(e.text), 1)]), e.showArrow ? (w(), l("div", {
|
|
6424
6465
|
key: 0,
|
|
@@ -6465,7 +6506,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6465
6506
|
},
|
|
6466
6507
|
emits: ["setImage"],
|
|
6467
6508
|
setup(e, { emit: t }) {
|
|
6468
|
-
let n = e, r =
|
|
6509
|
+
let n = e, r = St(() => n.rounded), i = o(() => Z[r.value]), a = o(() => n.description || n.hint), p = t, m = D(), h = D(), g = D(""), _ = D(!1), v = D(""), x = o(() => n.initialImage || ""), S = (e) => {
|
|
6469
6510
|
Cc(e) && (v.value = URL.createObjectURL(e), _.value = !0);
|
|
6470
6511
|
}, C = async (e) => {
|
|
6471
6512
|
let t = e.canvas, r = await new Promise((e) => {
|
|
@@ -6490,13 +6531,13 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6490
6531
|
};
|
|
6491
6532
|
return (t, r) => (w(), l("div", null, [u("div", {
|
|
6492
6533
|
tabindex: "0",
|
|
6493
|
-
class: y(P(
|
|
6534
|
+
class: y(P(J)("border-default-500 hover:border-default-700 relative cursor-pointer border-2 border-dashed transition-colors", i.value, e.className)),
|
|
6494
6535
|
style: b({ "aspect-ratio": n.aspect }),
|
|
6495
6536
|
onDrop: E,
|
|
6496
6537
|
onDragover: O,
|
|
6497
6538
|
onClick: k
|
|
6498
6539
|
}, [
|
|
6499
|
-
!g.value && !x.value ? (w(), l("div", Tc, [f(
|
|
6540
|
+
!g.value && !x.value ? (w(), l("div", Tc, [f(Q, {
|
|
6500
6541
|
name: "lucide:plus",
|
|
6501
6542
|
class: "text-default-500 text-3xl"
|
|
6502
6543
|
}), a.value ? (w(), l("span", Ec, j(a.value), 1)) : c("", !0)])) : c("", !0),
|
|
@@ -6504,7 +6545,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6504
6545
|
key: 1,
|
|
6505
6546
|
src: g.value || x.value,
|
|
6506
6547
|
alt: "上传图片",
|
|
6507
|
-
class: y(P(
|
|
6548
|
+
class: y(P(J)("h-full w-full object-cover", i.value))
|
|
6508
6549
|
}, null, 10, Dc)) : c("", !0),
|
|
6509
6550
|
u("input", {
|
|
6510
6551
|
ref_key: "input",
|
|
@@ -6521,7 +6562,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6521
6562
|
}, {
|
|
6522
6563
|
default: U(() => [u("div", Oc, [
|
|
6523
6564
|
r[4] ||= u("div", { class: "mb-4" }, [u("h3", { class: "text-lg font-semibold" }, "裁剪图片")], -1),
|
|
6524
|
-
v.value ? (w(), s(P(
|
|
6565
|
+
v.value ? (w(), s(P($e), {
|
|
6525
6566
|
key: 0,
|
|
6526
6567
|
src: v.value,
|
|
6527
6568
|
"stencil-props": { aspectRatio: n.aspect },
|
|
@@ -6568,12 +6609,12 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6568
6609
|
floatingPosition: { default: "top" }
|
|
6569
6610
|
},
|
|
6570
6611
|
setup(e) {
|
|
6571
|
-
let t = e, n =
|
|
6612
|
+
let t = e, n = st(), r = o(() => t.isNavigation && !!t.user?.id), i = o(() => {
|
|
6572
6613
|
if (!r.value) return {};
|
|
6573
6614
|
let e = n.userLinkTemplate.replace("{id}", String(t.user?.id));
|
|
6574
6615
|
return typeof n.linkComponent == "string" ? { href: e } : { to: e };
|
|
6575
6616
|
});
|
|
6576
|
-
return (a, o) => (w(), s(A(r.value ? P(n).linkComponent : "div"), _(i.value, { class: P(
|
|
6617
|
+
return (a, o) => (w(), s(A(r.value ? P(n).linkComponent : "div"), _(i.value, { class: P(J)("flex items-center gap-2 text-inherit no-underline", r.value && "cursor-pointer", t.className) }), {
|
|
6577
6618
|
default: U(() => [f(_n, {
|
|
6578
6619
|
"floating-position": t.floatingPosition,
|
|
6579
6620
|
"disable-floating": t.disableFloating,
|
|
@@ -6590,8 +6631,8 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6590
6631
|
}, 16, ["class"]));
|
|
6591
6632
|
}
|
|
6592
6633
|
}), Fc = {
|
|
6593
|
-
KunAccordion:
|
|
6594
|
-
KunAccordionItem:
|
|
6634
|
+
KunAccordion: tt,
|
|
6635
|
+
KunAccordionItem: _t,
|
|
6595
6636
|
KunAlertProvider: Zt,
|
|
6596
6637
|
KunAutocomplete: pn,
|
|
6597
6638
|
KunAvatar: _n,
|
|
@@ -6614,7 +6655,7 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6614
6655
|
KunFadeCard: Hi,
|
|
6615
6656
|
KunFileInput: Yi,
|
|
6616
6657
|
KunHeader: ta,
|
|
6617
|
-
KunIcon:
|
|
6658
|
+
KunIcon: Q,
|
|
6618
6659
|
KunImage: gn,
|
|
6619
6660
|
KunImageNative: ra,
|
|
6620
6661
|
KunInfo: sa,
|
|
@@ -6659,4 +6700,4 @@ var tt = Symbol("kun-accordion"), nt = /* @__PURE__ */ p({
|
|
|
6659
6700
|
for (let [t, n] of Object.entries(Fc)) e.component(t, n);
|
|
6660
6701
|
} };
|
|
6661
6702
|
//#endregion
|
|
6662
|
-
export {
|
|
6703
|
+
export { it as KUN_UI_DEFAULT_CONFIG, tt as KunAccordion, _t as KunAccordionItem, Zt as KunAlertProvider, pn as KunAutocomplete, _n as KunAvatar, bn as KunAvatarGroup, Tn as KunBadge, On as KunBrand, $ as KunButton, Nn as KunCard, Bn as KunCarousel, Vn as KunCarouselItem, Jn as KunCheckBox, Dn as KunChip, Xr as KunContent, Qr as KunContextMenu, Ei as KunCopy, vi as KunDatePicker, Oi as KunDivider, zi as KunDrawer, Mi as KunDropdown, Hi as KunFadeCard, Yi as KunFileInput, ta as KunHeader, Q as KunIcon, gn as KunImage, ra as KunImageNative, sa as KunInfo, va as KunInput, Jr as KunLightbox, xa as KunLightboxGallery, Sa as KunLightboxGalleryItem, Ca as KunLink, Wa as KunLoading, ja as KunLoli, La as KunLoliProvider, Ga as KunMarkdown, $a as KunMessageProvider, Gt as KunModal, ro as KunNull, mo as KunNumberInput, wo as KunPagination, Oo as KunPinInput, Mo as KunPopover, zo as KunProgress, Zo as KunRadioGroup, es as KunRating, Tt as KunRipple, ys as KunScrollShadow, gs as KunSelect, bs as KunSkeleton, ks as KunSlider, Ms as KunSteps, Ls as KunSwitch, Us as KunTab, Gs as KunTabPanel, Ks as KunTabPanels, nc as KunTagInput, rc as KunText, fc as KunTextarea, pc as KunTimeline, yc as KunTimelineItem, Sc as KunTooltip, Ic as KunUI, Ic as default, Ac as KunUpload, Pc as KunUserChip, Cc as checkImageValid, Y as decodeIfEncoded, Ta as getRandomLoli, ne as getRandomSticker, ot as installKunUIConfig, at as provideKunUIConfig, wc as resizeImage, Mt as useBodyScrollLock, Ar as useContentLightbox, Ui as useFilePicker, xt as useKunAlert, bt as useKunAlertState, Ut as useKunBackgroundInert, wi as useKunCopy, tn as useKunFloating, Ia as useKunLoliInfo, Fa as useKunLoliState, Ci as useKunMessage, Si as useKunMessageState, Rt as useKunOverlayZIndex, st as useKunUIConfig, nt as useKunUniqueId, St as useResolvedRounded, Ct as useRipple, kr as useSpoilerContent };
|