@kungal/ui-vue 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -0
- package/dist/componentNames.d.ts +1 -1
- package/dist/componentNames.d.ts.map +1 -1
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/Shatter.vue.d.ts +52 -0
- package/dist/components/Shatter.vue.d.ts.map +1 -0
- package/dist/components/types.d.ts +55 -0
- package/dist/components/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1094 -763
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
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, onScopeDispose as C, onUnmounted as w, openBlock as T, provide as E, reactive as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, toHandlers as N, toRefs as P, toValue as F, unref as I, useCssVars as L, useId as R, useModel as z, useSlots as B, vModelText as V, vShow as H, watch as U, watchEffect as
|
|
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
|
|
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, onScopeDispose as C, onUnmounted as w, openBlock as T, provide as E, reactive as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, toHandlers as N, toRefs as P, toValue as F, unref as I, useCssVars as L, useId as R, useModel as z, useSlots as B, vModelText as V, vShow as H, watch as U, watchEffect as W, withCtx as G, withDirectives as K, withKeys as q, withModifiers as J } from "vue";
|
|
2
|
+
import { KUN_DEFAULT_ROUNDED as ee, cn as Y, decodeIfEncoded as te, decodeIfEncoded as ne, getKunIcon as re, getRandomSticker as ie, getRandomSticker as ae, kunBgClasses as oe, kunBorderClasses as se, kunChipSizeClasses as ce, kunControlSizeClasses as le, kunControlSquareClasses as ue, kunFocusRingClasses as X, kunFocusRingWithinClasses as de, kunRoundedClasses as Z, kunSelectionSizeClasses as fe, kunSoftBgClasses as pe, kunSolidBgClasses as me, kunSolidClasses as he, kunSolidFgClasses as ge, kunTextClasses as _e, kunVariantClasses as ve, randomNum as ye, resolveRounded as be } from "@kungal/ui-core";
|
|
3
|
+
import { onClickOutside as xe, onKeyStroke as Se, useElementSize as Ce, useEventListener as we, useMediaQuery as Te, useScroll as Ee } from "@vueuse/core";
|
|
4
|
+
import { useFocusTrap as De } from "@vueuse/integrations/useFocusTrap";
|
|
5
|
+
import { arrow as Oe, autoUpdate as ke, flip as Ae, offset as je, shift as Me, size as Ne, useFloating as Pe } from "@floating-ui/vue";
|
|
6
|
+
import { addMonths as Fe, addYears as Ie, eachDayOfInterval as Le, endOfMonth as Re, endOfWeek as ze, format as Be, isAfter as Ve, isBefore as He, isSameDay as Ue, isSameMonth as We, isToday as Ge, isValid as Ke, parseISO as qe, startOfDay as Je, startOfMonth as Ye, startOfToday as Xe, startOfWeek as Ze } from "date-fns";
|
|
7
|
+
import { enUS as Qe, ja as $e, zhCN as et } from "date-fns/locale";
|
|
8
|
+
import { Cropper as tt } from "vue-advanced-cropper";
|
|
9
9
|
//#region src/componentNames.ts
|
|
10
|
-
var
|
|
10
|
+
var nt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAutocomplete.KunAvatar.KunAvatarGroup.KunBadge.KunBrand.KunButton.KunCard.KunCarousel.KunCarouselItem.KunCheckBox.KunChip.KunContent.KunContextMenu.KunCopy.KunDatePicker.KunDivider.KunDrawer.KunDropdown.KunFadeCard.KunFileInput.KunHeader.KunIcon.KunImage.KunImageNative.KunInfo.KunInput.KunLightbox.KunLightboxGallery.KunLightboxGalleryItem.KunLink.KunLoading.KunLoli.KunLoliProvider.KunMarkdown.KunMessageProvider.KunModal.KunNull.KunNumberInput.KunPagination.KunPinInput.KunPopover.KunProgress.KunRadioGroup.KunRating.KunReaction.KunRipple.KunScrollShadow.KunSelect.KunShatter.KunSkeleton.KunSlider.KunSteps.KunSwitch.KunTab.KunTabPanel.KunTabPanels.KunTagInput.KunText.KunTextarea.KunTimeline.KunTimelineItem.KunTooltip.KunUpload.KunUserChip".split("."), rt = Symbol("kun-accordion"), it = /* @__PURE__ */ p({
|
|
11
11
|
name: "KunAccordion",
|
|
12
12
|
__name: "Accordion",
|
|
13
13
|
props: /*@__PURE__*/ g({
|
|
@@ -27,7 +27,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
27
27
|
let t = e, n = z(e, "modelValue"), r = (e) => e == null ? [] : Array.isArray(e) ? e : e === "" ? [] : [e], i = O(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
|
-
E(
|
|
30
|
+
E(rt, {
|
|
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 rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
42
42
|
default: return "divide-kun divide-y";
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
return (t, n) => (T(), l("div", { class: y(I(
|
|
45
|
+
return (t, n) => (T(), l("div", { class: y(I(Y)(u.value, e.className)) }, [A(t.$slots, "default")], 2));
|
|
46
46
|
}
|
|
47
|
-
}),
|
|
48
|
-
rounded:
|
|
47
|
+
}), at = (e) => O(`${e ?? ""}${R()}`), ot = Symbol("kun-ui-config"), st = {
|
|
48
|
+
rounded: ee,
|
|
49
49
|
linkComponent: "a",
|
|
50
50
|
iconComponent: null,
|
|
51
51
|
navigate: (e) => {
|
|
@@ -53,17 +53,17 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
53
53
|
},
|
|
54
54
|
imageComponent: "img",
|
|
55
55
|
userLinkTemplate: "/user/{id}/info"
|
|
56
|
-
},
|
|
57
|
-
E(
|
|
58
|
-
...
|
|
56
|
+
}, ct = (e = {}) => {
|
|
57
|
+
E(ot, {
|
|
58
|
+
...st,
|
|
59
59
|
...e
|
|
60
60
|
});
|
|
61
|
-
},
|
|
62
|
-
e.provide(
|
|
63
|
-
...
|
|
61
|
+
}, lt = (e, t = {}) => {
|
|
62
|
+
e.provide(ot, {
|
|
63
|
+
...st,
|
|
64
64
|
...t
|
|
65
65
|
});
|
|
66
|
-
},
|
|
66
|
+
}, ut = () => m(ot, st), dt = ["viewBox", "innerHTML"], ft = /*@__PURE__*/ p({
|
|
67
67
|
name: "KunIcon",
|
|
68
68
|
__name: "Icon",
|
|
69
69
|
props: {
|
|
@@ -72,7 +72,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
72
72
|
className: { default: "" }
|
|
73
73
|
},
|
|
74
74
|
setup(e) {
|
|
75
|
-
let t = e, n =
|
|
75
|
+
let t = e, n = ut(), r = o(() => Y("inline-block size-[1em] shrink-0 align-[-0.125em] text-inherit", t.class, t.className)), i = o(() => t.name ? re(t.name) : void 0);
|
|
76
76
|
return (t, a) => i.value ? (T(), l("svg", {
|
|
77
77
|
key: 0,
|
|
78
78
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -80,29 +80,29 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
80
80
|
class: y(r.value),
|
|
81
81
|
"aria-hidden": "true",
|
|
82
82
|
innerHTML: i.value.body
|
|
83
|
-
}, null, 10,
|
|
83
|
+
}, null, 10, dt)) : e.name && I(n).iconComponent ? (T(), s(j(I(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
|
+
}), pt = (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__*/ pt(ft, [["__scopeId", "data-v-44cd432d"]]), mt = [
|
|
94
94
|
"id",
|
|
95
95
|
"aria-expanded",
|
|
96
96
|
"aria-controls",
|
|
97
97
|
"disabled"
|
|
98
|
-
],
|
|
98
|
+
], ht = {
|
|
99
99
|
key: 0,
|
|
100
100
|
class: "text-default-500 inline-flex shrink-0"
|
|
101
|
-
},
|
|
101
|
+
}, gt = { class: "min-w-0 flex-1" }, _t = [
|
|
102
102
|
"id",
|
|
103
103
|
"aria-labelledby",
|
|
104
104
|
"inert"
|
|
105
|
-
],
|
|
105
|
+
], vt = { class: "overflow-hidden" }, yt = { class: "text-default-600 px-4 pb-4 text-sm" }, bt = /* @__PURE__ */ p({
|
|
106
106
|
name: "KunAccordionItem",
|
|
107
107
|
__name: "AccordionItem",
|
|
108
108
|
props: {
|
|
@@ -117,36 +117,36 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
117
117
|
className: { default: "" }
|
|
118
118
|
},
|
|
119
119
|
setup(e) {
|
|
120
|
-
let t = e, n = m(
|
|
120
|
+
let t = e, n = m(rt, null), r = o(() => n?.isOpen(t.value) ?? !1), i = o(() => n?.variant.value === "splitted"), a = at(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) => (T(), l("div", { class: y(I(
|
|
123
|
+
return (t, n) => (T(), l("div", { class: y(I(Y)(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(I(
|
|
129
|
+
class: y(I(Y)("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 ? (T(), l("span",
|
|
132
|
+
e.icon ? (T(), l("span", ht, [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", gt, [A(t.$slots, "title", {}, () => [d(M(e.title), 1)])]),
|
|
137
|
+
f(Q, {
|
|
138
138
|
name: "lucide:chevron-down",
|
|
139
|
-
class: y(I(
|
|
139
|
+
class: y(I(Y)("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, mt)]), 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(I(
|
|
147
|
-
}, [u("div",
|
|
146
|
+
class: y(I(Y)("grid transition-[grid-template-rows] duration-kun-base ease-kun-standard", r.value ? "grid-rows-[1fr]" : "grid-rows-[0fr]"))
|
|
147
|
+
}, [u("div", vt, [u("div", yt, [A(t.$slots, "default")])])], 10, _t)], 2));
|
|
148
148
|
}
|
|
149
|
-
}),
|
|
149
|
+
}), xt = O({
|
|
150
150
|
show: !1,
|
|
151
151
|
title: "",
|
|
152
152
|
message: "",
|
|
@@ -155,16 +155,16 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
155
155
|
cancelText: "取消",
|
|
156
156
|
type: "info",
|
|
157
157
|
confirmColor: void 0
|
|
158
|
-
}),
|
|
159
|
-
state:
|
|
158
|
+
}), St = null, Ct = () => ({
|
|
159
|
+
state: xt,
|
|
160
160
|
handleConfirm: () => {
|
|
161
|
-
|
|
161
|
+
xt.value.show = !1, St?.(!0), St = null;
|
|
162
162
|
},
|
|
163
163
|
handleCancel: () => {
|
|
164
|
-
|
|
164
|
+
xt.value.show = !1, St?.(!1), St = null;
|
|
165
165
|
}
|
|
166
|
-
}),
|
|
167
|
-
|
|
166
|
+
}), wt = (e = {}) => (St?.(!1), new Promise((t) => {
|
|
167
|
+
St = t, xt.value = {
|
|
168
168
|
show: !0,
|
|
169
169
|
title: e.title ?? "",
|
|
170
170
|
message: e.message ?? "",
|
|
@@ -174,9 +174,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
174
174
|
type: e.type ?? "info",
|
|
175
175
|
confirmColor: e.confirmColor
|
|
176
176
|
};
|
|
177
|
-
})),
|
|
178
|
-
let n =
|
|
179
|
-
return o(() =>
|
|
177
|
+
})), Tt = (e, t) => {
|
|
178
|
+
let n = ut();
|
|
179
|
+
return o(() => be(e(), t, n.rounded));
|
|
180
180
|
}, Et = () => {
|
|
181
181
|
let e = O([]), t = 0, n = /* @__PURE__ */ new Set();
|
|
182
182
|
return w(() => {
|
|
@@ -203,7 +203,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
203
203
|
else if (i.type === e) continue;
|
|
204
204
|
else Array.isArray(i.children) && (n += Dt(i.children));
|
|
205
205
|
return n;
|
|
206
|
-
}, Ot = /*#__PURE__*/
|
|
206
|
+
}, Ot = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
207
207
|
name: "KunRipple",
|
|
208
208
|
__name: "Ripple",
|
|
209
209
|
props: { ripples: {} },
|
|
@@ -262,7 +262,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
262
262
|
},
|
|
263
263
|
emits: ["click"],
|
|
264
264
|
setup(e, { emit: t }) {
|
|
265
|
-
let n = e, r = t, i = B(), a =
|
|
265
|
+
let n = e, r = t, i = B(), a = ut(), u = o(() => n.ariaLabel ? n.ariaLabel : n.isIconOnly ? "button" : i.default && Dt(i.default()).trim() || ""), d = o(() => le[n.size]), p = o(() => ve(n.variant, n.color)), m = Tt(() => n.rounded), h = o(() => Z[m.value]), g = o(() => n.isIconOnly ? ue[n.size] : ""), { ripples: v, onClick: y } = Et(), 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 rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
281
281
|
y(e), r("click", e);
|
|
282
282
|
};
|
|
283
283
|
return (t, n) => (T(), s(j(x.value), _(S.value, {
|
|
284
|
-
class: I(
|
|
284
|
+
class: I(Y)("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", I(Y)(I(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
|
-
default:
|
|
288
|
-
e.loading ? (T(), s(
|
|
287
|
+
default: G(() => [
|
|
288
|
+
e.loading ? (T(), 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 rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
338
338
|
deactivate: () => {
|
|
339
339
|
Ht--, Ht <= 0 && (Ht = 0, Gt());
|
|
340
340
|
}
|
|
341
|
-
}), qt = ["role", "aria-label"], Jt = /*#__PURE__*/
|
|
341
|
+
}), qt = ["role", "aria-label"], Jt = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
342
342
|
name: "KunModal",
|
|
343
343
|
__name: "Modal",
|
|
344
344
|
props: /*@__PURE__*/ g({
|
|
@@ -371,7 +371,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
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 = Tt(() => 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,44 +383,44 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
383
383
|
e && !P ? (j(), P = !0) : !e && P && (M(), P = !1);
|
|
384
384
|
}, { activate: L, deactivate: R } = Kt(), B = !1, V = (e) => {
|
|
385
385
|
e && !B ? (L(), B = !0) : !e && B && (R(), B = !1);
|
|
386
|
-
}, H = O(null), { activate:
|
|
386
|
+
}, H = O(null), { activate: W, deactivate: K } = De(H, {
|
|
387
387
|
immediate: !1,
|
|
388
388
|
escapeDeactivates: !1,
|
|
389
389
|
allowOutsideClick: !0,
|
|
390
390
|
returnFocusOnDeactivate: !0
|
|
391
|
-
}),
|
|
391
|
+
}), q = () => {
|
|
392
392
|
r.isDismissable && (g.value = !1, _("close"));
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
e.target === e.currentTarget &&
|
|
393
|
+
}, ee = O(!1), te = (e) => {
|
|
394
|
+
ee.value = e.target === e.currentTarget;
|
|
395
|
+
}, ne = (e) => {
|
|
396
|
+
e.target === e.currentTarget && ee.value && q();
|
|
397
397
|
};
|
|
398
|
-
return
|
|
399
|
-
e.key === "Escape" && g.value && N.value &&
|
|
398
|
+
return we("keydown", (e) => {
|
|
399
|
+
e.key === "Escape" && g.value && N.value && q();
|
|
400
400
|
}), U(g, async (e) => {
|
|
401
|
-
D(e), F(e), e ? (await v(),
|
|
401
|
+
D(e), F(e), e ? (await v(), W(), V(!0)) : (V(!1), K());
|
|
402
402
|
}), S(async () => {
|
|
403
|
-
g.value && (D(!0), F(!0), await v(),
|
|
403
|
+
g.value && (D(!0), F(!0), await v(), W(), V(!0));
|
|
404
404
|
}), w(() => {
|
|
405
|
-
D(!1), F(!1), V(!1),
|
|
405
|
+
D(!1), F(!1), V(!1), K();
|
|
406
406
|
}), (t, r) => (T(), s(n, { to: "body" }, [f(i, { name: "kun-modal" }, {
|
|
407
|
-
default:
|
|
407
|
+
default: G(() => [g.value ? (T(), l("div", {
|
|
408
408
|
key: 0,
|
|
409
409
|
ref_key: "trapEl",
|
|
410
410
|
ref: H,
|
|
411
411
|
"data-kun-overlay": "",
|
|
412
|
-
class: y(I(
|
|
412
|
+
class: y(I(Y)("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: I(k) }),
|
|
414
|
-
onPointerdown:
|
|
415
|
-
onClick:
|
|
414
|
+
onPointerdown: te,
|
|
415
|
+
onClick: ne,
|
|
416
416
|
tabindex: "0"
|
|
417
417
|
}, [e.withContainer ? (T(), 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(I(
|
|
423
|
-
onClick: r[1] ||=
|
|
422
|
+
class: y(I(Y)("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
|
+
onClick: r[1] ||= J(() => {}, ["stop"])
|
|
424
424
|
}, [A(t.$slots, "default", {}, void 0, !0), e.isShowCloseButton ? (T(), s($, {
|
|
425
425
|
key: 0,
|
|
426
426
|
color: "default",
|
|
@@ -433,7 +433,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
433
433
|
g.value = !1, _("close");
|
|
434
434
|
}
|
|
435
435
|
}, {
|
|
436
|
-
default:
|
|
436
|
+
default: G(() => [f(Q, {
|
|
437
437
|
class: "icon",
|
|
438
438
|
name: "lucide:x"
|
|
439
439
|
})]),
|
|
@@ -452,7 +452,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
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 } = Ct(), i = o(() => t.value.confirmColor ? t.value.confirmColor : t.value.type === "danger" ? "danger" : t.value.type === "warning" ? "warning" : "primary");
|
|
456
456
|
return (e, a) => (T(), s(Jt, {
|
|
457
457
|
"model-value": I(t).show,
|
|
458
458
|
role: "alertdialog",
|
|
@@ -460,19 +460,19 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
460
460
|
"class-name": "z-kun-alert fixed",
|
|
461
461
|
"onUpdate:modelValue": a[0] ||= (e) => !e && I(r)()
|
|
462
462
|
}, {
|
|
463
|
-
default:
|
|
463
|
+
default: G(() => [u("div", Yt, [u("div", Xt, [I(t).title ? (T(), l("h3", Zt, M(I(t).title), 1)) : c("", !0), I(t).message ? (T(), l("p", Qt, M(I(t).message), 1)) : c("", !0)]), u("div", $t, [I(t).showCancel ? (T(), s($, {
|
|
464
464
|
key: 0,
|
|
465
465
|
variant: "light",
|
|
466
466
|
color: "default",
|
|
467
467
|
onClick: I(r)
|
|
468
468
|
}, {
|
|
469
|
-
default:
|
|
469
|
+
default: G(() => [d(M(I(t).cancelText), 1)]),
|
|
470
470
|
_: 1
|
|
471
471
|
}, 8, ["onClick"])) : c("", !0), f($, {
|
|
472
472
|
color: i.value,
|
|
473
473
|
onClick: I(n)
|
|
474
474
|
}, {
|
|
475
|
-
default:
|
|
475
|
+
default: G(() => [d(M(I(t).confirmText), 1)]),
|
|
476
476
|
_: 1
|
|
477
477
|
}, 8, ["color", "onClick"])])])]),
|
|
478
478
|
_: 1
|
|
@@ -498,9 +498,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
498
498
|
left: "right"
|
|
499
499
|
}, an = (e, t, n = {}) => {
|
|
500
500
|
let r = O(null), i = n.constrain ?? !0, a = n.padding ?? 8, s = [
|
|
501
|
-
|
|
502
|
-
...i ? [
|
|
503
|
-
...n.maxSize ? [
|
|
501
|
+
je(n.offset ?? 8),
|
|
502
|
+
...i ? [Ae(), Me({ padding: a })] : [],
|
|
503
|
+
...n.maxSize ? [Ne({
|
|
504
504
|
padding: a,
|
|
505
505
|
apply({ availableWidth: e, availableHeight: t, elements: n }) {
|
|
506
506
|
Object.assign(n.floating.style, {
|
|
@@ -511,14 +511,14 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
511
511
|
}
|
|
512
512
|
})] : [],
|
|
513
513
|
...n.middleware ?? [],
|
|
514
|
-
...n.arrow ? [
|
|
514
|
+
...n.arrow ? [Oe({
|
|
515
515
|
element: r,
|
|
516
516
|
padding: n.arrowPadding ?? 6
|
|
517
517
|
})] : []
|
|
518
|
-
], { floatingStyles: c, placement: l, middlewareData: u } =
|
|
518
|
+
], { floatingStyles: c, placement: l, middlewareData: u } = Pe(e, t, {
|
|
519
519
|
placement: o(() => F(n.placement) ?? "bottom"),
|
|
520
520
|
open: n.open,
|
|
521
|
-
whileElementsMounted:
|
|
521
|
+
whileElementsMounted: ke,
|
|
522
522
|
transform: n.transform ?? !1,
|
|
523
523
|
middleware: s
|
|
524
524
|
});
|
|
@@ -614,11 +614,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
614
614
|
}),
|
|
615
615
|
emits: /*@__PURE__*/ g(["select", "search"], ["update:modelValue"]),
|
|
616
616
|
setup(e, { expose: r, emit: a }) {
|
|
617
|
-
let d = e, p = z(e, "modelValue"), m = a, h =
|
|
617
|
+
let d = e, p = z(e, "modelValue"), m = a, h = Tt(() => d.rounded), g = o(() => Z[h.value]), x = at("kun-autocomplete"), S = o(() => `${x.value}-listbox`), C = o(() => !!d.error || d.isInvalid), w = O(!1), E = O(-1), D = O(!1), A = O(null), j = O(null), N = O(null), P = O(null), { floatingStyles: F, transformOrigin: L } = an(j, N, {
|
|
618
618
|
placement: "bottom-start",
|
|
619
619
|
open: w,
|
|
620
620
|
offset: 4,
|
|
621
|
-
middleware: [
|
|
621
|
+
middleware: [Ne({ apply({ rects: e, elements: t, availableHeight: n }) {
|
|
622
622
|
Object.assign(t.floating.style, {
|
|
623
623
|
width: `${e.reference.width}px`,
|
|
624
624
|
maxHeight: `${Math.min(280, n - 8)}px`
|
|
@@ -630,13 +630,13 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
630
630
|
return d.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
631
631
|
}), B = o(() => E.value >= 0 && R.value[E.value] ? `${x.value}-opt-${E.value}` : void 0), V = () => R.value.findIndex((e) => !e.disabled), H = () => {
|
|
632
632
|
d.disabled || w.value || (w.value = !0, E.value = V());
|
|
633
|
-
},
|
|
633
|
+
}, W = () => {
|
|
634
634
|
w.value = !1;
|
|
635
|
-
},
|
|
635
|
+
}, K = () => {
|
|
636
636
|
v(() => {
|
|
637
637
|
on(P.value, P.value?.querySelector(`[data-index="${E.value}"]`));
|
|
638
638
|
});
|
|
639
|
-
},
|
|
639
|
+
}, q = (e) => {
|
|
640
640
|
let t = R.value.length;
|
|
641
641
|
if (!t) return;
|
|
642
642
|
let n = E.value;
|
|
@@ -644,44 +644,44 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
644
644
|
E.value = n;
|
|
645
645
|
break;
|
|
646
646
|
}
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
e.disabled || (p.value = e.label, D.value = !1, m("select", e),
|
|
650
|
-
},
|
|
647
|
+
K();
|
|
648
|
+
}, J = (e) => {
|
|
649
|
+
e.disabled || (p.value = e.label, D.value = !1, m("select", e), W(), v(() => A.value?.focus({ preventScroll: !0 })));
|
|
650
|
+
}, ee = (e) => {
|
|
651
651
|
p.value = e.target.value, D.value = !0, m("search", p.value), H(), E.value = V();
|
|
652
|
-
},
|
|
652
|
+
}, te = (e) => {
|
|
653
653
|
if (!d.disabled) switch (e.key) {
|
|
654
654
|
case "ArrowDown":
|
|
655
|
-
e.preventDefault(), w.value ?
|
|
655
|
+
e.preventDefault(), w.value ? q(1) : H();
|
|
656
656
|
break;
|
|
657
657
|
case "ArrowUp":
|
|
658
|
-
e.preventDefault(), w.value &&
|
|
658
|
+
e.preventDefault(), w.value && q(-1);
|
|
659
659
|
break;
|
|
660
660
|
case "Enter":
|
|
661
|
-
w.value && R.value[E.value] && (e.preventDefault(),
|
|
661
|
+
w.value && R.value[E.value] && (e.preventDefault(), J(R.value[E.value]));
|
|
662
662
|
break;
|
|
663
663
|
case "Escape":
|
|
664
|
-
w.value && (e.preventDefault(),
|
|
664
|
+
w.value && (e.preventDefault(), W());
|
|
665
665
|
break;
|
|
666
666
|
case "Tab":
|
|
667
|
-
|
|
667
|
+
W();
|
|
668
668
|
break;
|
|
669
669
|
}
|
|
670
|
-
},
|
|
670
|
+
}, ne = () => {
|
|
671
671
|
setTimeout(() => {
|
|
672
672
|
!d.allowCustomValue && p.value && !d.options.some((e) => e.label.toLowerCase() === p.value.toLowerCase()) && (p.value = "", m("search", ""));
|
|
673
673
|
}, 120);
|
|
674
|
-
},
|
|
674
|
+
}, re = () => {
|
|
675
675
|
p.value = "", D.value = !0, m("search", ""), v(() => A.value?.focus({ preventScroll: !0 })), H();
|
|
676
676
|
};
|
|
677
|
-
return
|
|
678
|
-
N.value?.contains(e.target) ||
|
|
677
|
+
return xe(j, (e) => {
|
|
678
|
+
N.value?.contains(e.target) || W();
|
|
679
679
|
}), U(R, () => {
|
|
680
680
|
w.value && (E.value < 0 || E.value >= R.value.length || R.value[E.value]?.disabled) && (E.value = V());
|
|
681
681
|
}), r({
|
|
682
682
|
focus: () => A.value?.focus(),
|
|
683
683
|
blur: () => A.value?.blur()
|
|
684
|
-
}), (r, a) => (T(), l("div", { class: y(I(
|
|
684
|
+
}), (r, a) => (T(), l("div", { class: y(I(Y)("relative w-full")) }, [
|
|
685
685
|
e.label ? (T(), l("label", {
|
|
686
686
|
key: 0,
|
|
687
687
|
for: I(x),
|
|
@@ -709,19 +709,19 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
709
709
|
placeholder: e.placeholder,
|
|
710
710
|
disabled: e.disabled,
|
|
711
711
|
autocomplete: "off",
|
|
712
|
-
class: I(
|
|
713
|
-
onInput:
|
|
712
|
+
class: I(Y)("block w-full bg-content1 shadow-kun-sm border transition-[color,box-shadow]", g.value, I(le)[e.size], e.clearable && p.value ? "pr-9" : "", C.value ? I(Y)("border-danger-300", I(X).danger) : I(Y)("border-kun", I(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60"),
|
|
713
|
+
onInput: ee,
|
|
714
714
|
onFocus: H,
|
|
715
|
-
onKeydown:
|
|
716
|
-
onBlur:
|
|
715
|
+
onKeydown: te,
|
|
716
|
+
onBlur: ne
|
|
717
717
|
}), null, 16, cn), e.clearable && p.value && !e.disabled ? (T(), l("button", {
|
|
718
718
|
key: 0,
|
|
719
719
|
type: "button",
|
|
720
720
|
tabindex: "-1",
|
|
721
721
|
class: "text-default-400 hover:text-default-600 absolute inset-y-0 right-0 flex items-center pr-3",
|
|
722
722
|
"aria-label": "清除",
|
|
723
|
-
onClick:
|
|
724
|
-
}, [f(
|
|
723
|
+
onClick: re
|
|
724
|
+
}, [f(Q, {
|
|
725
725
|
name: "lucide:circle-x",
|
|
726
726
|
class: "size-4"
|
|
727
727
|
})])) : c("", !0)], 512),
|
|
@@ -739,12 +739,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
739
739
|
"leave-from-class": "opacity-100 scale-100",
|
|
740
740
|
"leave-to-class": "opacity-0 scale-95"
|
|
741
741
|
}, {
|
|
742
|
-
default:
|
|
742
|
+
default: G(() => [w.value && (R.value.length || D.value) ? (T(), l("div", {
|
|
743
743
|
key: 0,
|
|
744
744
|
ref_key: "dropdownRef",
|
|
745
745
|
ref: N,
|
|
746
746
|
style: b([I(F), { transformOrigin: I(L) }]),
|
|
747
|
-
class: y(I(
|
|
747
|
+
class: y(I(Y)("bg-content1 z-kun-popover flex flex-col overflow-hidden p-1 shadow-kun-md", g.value))
|
|
748
748
|
}, [u("ul", {
|
|
749
749
|
ref_key: "listRef",
|
|
750
750
|
ref: P,
|
|
@@ -759,7 +759,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
759
759
|
role: "option",
|
|
760
760
|
"aria-selected": t === E.value,
|
|
761
761
|
"aria-disabled": e.disabled || void 0,
|
|
762
|
-
onClick: (t) =>
|
|
762
|
+
onClick: (t) => J(e),
|
|
763
763
|
onMousemove: (n) => !e.disabled && (E.value = t)
|
|
764
764
|
}, [u("span", fn, M(e.label), 1)], 42, dn))), 128)), R.value.length ? c("", !0) : (T(), l("li", pn, M(e.noResultText), 1))], 8, un)], 6)) : c("", !0)]),
|
|
765
765
|
_: 1
|
|
@@ -839,7 +839,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
839
839
|
sizes: { default: void 0 }
|
|
840
840
|
},
|
|
841
841
|
setup(e) {
|
|
842
|
-
let t = e, n =
|
|
842
|
+
let t = e, n = ut(), r = o(() => n.imageComponent ?? "img"), i = o(() => typeof r.value == "string"), a = O(null), u = O(!1), d = o(() => u.value && t.fallbackSrc ? t.fallbackSrc : t.src);
|
|
843
843
|
U(() => t.src, () => u.value = !1);
|
|
844
844
|
let { status: f, onLoad: p, onError: m } = vn(a, o(() => d.value)), h = () => {
|
|
845
845
|
m(), !u.value && t.fallbackSrc && (u.value = !0);
|
|
@@ -876,7 +876,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
876
876
|
}), S = o(() => t.aspectRatio ? { aspectRatio: t.aspectRatio } : void 0), C = o(() => t.skeleton);
|
|
877
877
|
return (t, n) => C.value ? (T(), l("div", {
|
|
878
878
|
key: 1,
|
|
879
|
-
class: y(I(
|
|
879
|
+
class: y(I(Y)("relative overflow-hidden", e.aspectRatio ? "block w-full" : "inline-block", e.className)),
|
|
880
880
|
style: b(S.value)
|
|
881
881
|
}, [I(f) === "loaded" ? c("", !0) : (T(), l("div", {
|
|
882
882
|
key: 0,
|
|
@@ -886,11 +886,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
886
886
|
ref_key: "imgEl",
|
|
887
887
|
ref: a
|
|
888
888
|
}, v.value, {
|
|
889
|
-
class: I(
|
|
889
|
+
class: I(Y)("block size-full transition-opacity duration-kun-slow", e.aspectRatio ? "absolute inset-0" : "", x.value, I(f) === "loaded" ? "opacity-100" : "opacity-0", e.imageClassName),
|
|
890
890
|
onLoad: I(p),
|
|
891
891
|
onError: h
|
|
892
892
|
}), null, 16, ["class", "onLoad"]))], 6)) : (T(), s(j(r.value), _({ key: 0 }, v.value, {
|
|
893
|
-
class: I(
|
|
893
|
+
class: I(Y)(e.className, e.imageClassName),
|
|
894
894
|
onError: h
|
|
895
895
|
}), null, 16, ["class"]));
|
|
896
896
|
}
|
|
@@ -910,7 +910,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
910
910
|
floatingPosition: {}
|
|
911
911
|
},
|
|
912
912
|
setup(e) {
|
|
913
|
-
let t = e, n =
|
|
913
|
+
let t = e, n = ut(), r = o(() => t.isNavigation && !!t.user?.id), i = o(() => {
|
|
914
914
|
if (!r.value) return {};
|
|
915
915
|
let e = n.userLinkTemplate.replace("{id}", String(t.user?.id));
|
|
916
916
|
return typeof n.linkComponent == "string" ? { href: e } : { to: e };
|
|
@@ -924,12 +924,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
924
924
|
case "xl": return "size-12";
|
|
925
925
|
default: return "size-8";
|
|
926
926
|
}
|
|
927
|
-
}), c = o(() => t.user?.avatar ||
|
|
928
|
-
return (o, l) => (T(), s(j(r.value ? I(n).linkComponent : "div"), _(i.value, { class: I(
|
|
929
|
-
default:
|
|
930
|
-
"class-name": I(
|
|
927
|
+
}), c = o(() => t.user?.avatar || ae(t.user?.name ?? ""));
|
|
928
|
+
return (o, l) => (T(), s(j(r.value ? I(n).linkComponent : "div"), _(i.value, { class: I(Y)("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) }), {
|
|
929
|
+
default: G(() => [f(yn, {
|
|
930
|
+
"class-name": I(Y)("inline-block rounded-full", a.value, t.imageClassName),
|
|
931
931
|
src: c.value,
|
|
932
|
-
"fallback-src": I(
|
|
932
|
+
"fallback-src": I(ae)(e.user?.name ?? ""),
|
|
933
933
|
alt: e.user?.name ?? "未知用户"
|
|
934
934
|
}, null, 8, [
|
|
935
935
|
"class-name",
|
|
@@ -1012,7 +1012,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1012
1012
|
"top-left": "-top-1 -left-1",
|
|
1013
1013
|
"bottom-right": "-bottom-1 -right-1",
|
|
1014
1014
|
"bottom-left": "-bottom-1 -left-1"
|
|
1015
|
-
}, u = B(), d = o(() => !u.default), f = o(() =>
|
|
1015
|
+
}, u = B(), d = o(() => !u.default), f = o(() => Y("inline-flex items-center justify-center rounded-full font-medium whitespace-nowrap", he[t.color], t.variant === "dot" ? i[t.size] : a[t.size], d.value ? "" : Y("absolute z-10 ring-2 ring-background", s[t.placement]), t.className));
|
|
1016
1016
|
return (t, i) => d.value ? (T(), l("span", wn, [n.value ? (T(), l("span", {
|
|
1017
1017
|
key: 0,
|
|
1018
1018
|
class: y(f.value),
|
|
@@ -1045,7 +1045,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1045
1045
|
emits: ["close"],
|
|
1046
1046
|
setup(e, { emit: t }) {
|
|
1047
1047
|
let n = e, r = t;
|
|
1048
|
-
return (t, i) => (T(), l("span", { class: y(I(
|
|
1048
|
+
return (t, i) => (T(), l("span", { class: y(I(Y)("inline-flex cursor-default items-center justify-center gap-1 rounded-full font-medium whitespace-nowrap", I(ce)[n.size], I(ve)(n.variant, n.color), e.disabled && "pointer-events-none opacity-50", e.className)) }, [
|
|
1049
1049
|
A(t.$slots, "start"),
|
|
1050
1050
|
A(t.$slots, "default"),
|
|
1051
1051
|
e.closable ? (T(), l("button", {
|
|
@@ -1054,8 +1054,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1054
1054
|
class: "-mr-0.5 ml-0.5 inline-flex shrink-0 items-center rounded-full opacity-70 transition hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none",
|
|
1055
1055
|
"aria-label": "移除",
|
|
1056
1056
|
disabled: e.disabled,
|
|
1057
|
-
onClick: i[0] ||=
|
|
1058
|
-
}, [f(
|
|
1057
|
+
onClick: i[0] ||= J((e) => r("close"), ["stop"])
|
|
1058
|
+
}, [f(Q, {
|
|
1059
1059
|
name: "lucide:x",
|
|
1060
1060
|
class: "size-3.5"
|
|
1061
1061
|
})], 8, kn)) : c("", !0),
|
|
@@ -1076,9 +1076,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1076
1076
|
nameClass: { default: "text-xl" }
|
|
1077
1077
|
},
|
|
1078
1078
|
setup(e) {
|
|
1079
|
-
let t = e, n =
|
|
1079
|
+
let t = e, n = ut(), r = o(() => typeof n.linkComponent == "string" ? { href: t.to } : { to: t.to });
|
|
1080
1080
|
return (t, i) => (T(), s(j(I(n).linkComponent), _(r.value, { class: "flex cursor-pointer items-center gap-3 text-inherit no-underline" }), {
|
|
1081
|
-
default:
|
|
1081
|
+
default: G(() => [
|
|
1082
1082
|
f(yn, {
|
|
1083
1083
|
"class-name": e.iconClass,
|
|
1084
1084
|
src: e.iconSrc,
|
|
@@ -1094,7 +1094,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1094
1094
|
size: "md",
|
|
1095
1095
|
color: e.badgeColor
|
|
1096
1096
|
}, {
|
|
1097
|
-
default:
|
|
1097
|
+
default: G(() => [d(M(e.badge), 1)]),
|
|
1098
1098
|
_: 1
|
|
1099
1099
|
}, 8, ["color"])) : c("", !0)
|
|
1100
1100
|
]),
|
|
@@ -1137,7 +1137,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1137
1137
|
},
|
|
1138
1138
|
emits: ["click"],
|
|
1139
1139
|
setup(e, { emit: t }) {
|
|
1140
|
-
let n = e, r = t, i =
|
|
1140
|
+
let n = e, r = t, i = ut(), { ripples: a, onClick: d } = Et(), 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) => {
|
|
1141
1141
|
p.value && d(e), r("click", e);
|
|
1142
1142
|
}, v = {
|
|
1143
1143
|
background: "bg-content1",
|
|
@@ -1148,20 +1148,20 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1148
1148
|
warning: "bg-warning-100/30 border-warning-300",
|
|
1149
1149
|
danger: "bg-danger-100/30 border-danger-300",
|
|
1150
1150
|
info: "bg-info-100/30 border-info-300"
|
|
1151
|
-
}, b =
|
|
1151
|
+
}, b = Tt(() => n.rounded), x = o(() => Z[b.value]), S = {
|
|
1152
1152
|
none: "p-0",
|
|
1153
1153
|
sm: "p-3",
|
|
1154
1154
|
md: "p-5",
|
|
1155
1155
|
lg: "p-6"
|
|
1156
1156
|
};
|
|
1157
1157
|
return (t, r) => (T(), s(j(m.value), _(h.value, {
|
|
1158
|
-
class: I(
|
|
1158
|
+
class: I(Y)("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) && Fn, 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),
|
|
1159
1159
|
onClick: g
|
|
1160
1160
|
}), {
|
|
1161
|
-
default:
|
|
1161
|
+
default: G(() => [
|
|
1162
1162
|
t.$slots.header ? (T(), l("div", Mn, [A(t.$slots, "header")])) : c("", !0),
|
|
1163
1163
|
t.$slots.cover ? (T(), l("div", Nn, [A(t.$slots, "cover")])) : c("", !0),
|
|
1164
|
-
u("div", { class: y(I(
|
|
1164
|
+
u("div", { class: y(I(Y)("flex h-full flex-col justify-between gap-1", e.contentClass)) }, [A(t.$slots, "default")], 2),
|
|
1165
1165
|
t.$slots.footer ? (T(), l("div", Pn, [A(t.$slots, "footer")])) : c("", !0),
|
|
1166
1166
|
f(Ot, { ripples: I(a) }, null, 8, ["ripples"])
|
|
1167
1167
|
]),
|
|
@@ -1205,122 +1205,136 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1205
1205
|
slidesPerView: o(() => Math.max(1, n.slidesPerView)),
|
|
1206
1206
|
gap: o(() => n.gap)
|
|
1207
1207
|
});
|
|
1208
|
-
let r = O(null), i = O(0), a = O(0), s = O(0), d = (e, t) => t <= 0 ? 0 : (e % t + t) % t, p =
|
|
1208
|
+
let r = O(null), i = O(0), a = O(0), s = O(0), d = (e, t) => t <= 0 ? 0 : (e % t + t) % t, p = () => typeof performance < "u" ? performance.now() : 0, m = 0, h = () => {
|
|
1209
|
+
m = p() + 250;
|
|
1210
|
+
}, g = () => p() < m, _ = [], v = O(!1), C = o(() => Math.max(0, i.value - n.slidesPerView)), w = o(() => n.loop && C.value >= 2 && !v.value), D = o(() => Math.min(Math.max(1, Math.floor(C.value / 2)), Math.max(1, C.value - 1))), j = o(() => n.showArrows && i.value > n.slidesPerView), M = o(() => n.showIndicators && i.value > n.slidesPerView), N = o(() => w.value && n.slidesPerView <= 1), P = o(() => N.value ? i.value : C.value + 1), F = o(() => N.value ? d(s.value + (a.value - D.value), i.value) : a.value), L = !1, R = (e) => {
|
|
1209
1211
|
let t = e.children[0];
|
|
1210
1212
|
if (!t) return 0;
|
|
1211
1213
|
let n = parseFloat(getComputedStyle(e).columnGap || "0") || 0;
|
|
1212
1214
|
return t.getBoundingClientRect().width + n;
|
|
1213
|
-
},
|
|
1215
|
+
}, z = () => {
|
|
1214
1216
|
let e = r.value;
|
|
1215
1217
|
if (!e) return;
|
|
1216
1218
|
let t = i.value;
|
|
1217
|
-
if (!
|
|
1219
|
+
if (!w.value || t === 0) {
|
|
1218
1220
|
for (let t of Array.from(e.children)) t.style.order = "";
|
|
1219
1221
|
return;
|
|
1220
1222
|
}
|
|
1221
|
-
let n = d(
|
|
1223
|
+
let n = d(D.value - s.value, t);
|
|
1222
1224
|
Array.from(e.children).forEach((e, r) => {
|
|
1223
1225
|
e.style.order = String(d(r + n, t));
|
|
1224
1226
|
});
|
|
1225
|
-
},
|
|
1227
|
+
}, B = (e, t = !0) => {
|
|
1226
1228
|
let n = r.value;
|
|
1227
1229
|
if (!n) return;
|
|
1228
|
-
let i =
|
|
1230
|
+
let i = R(n), a = Math.max(0, Math.min(e, C.value));
|
|
1229
1231
|
n.scrollTo({
|
|
1230
1232
|
left: a * i,
|
|
1231
|
-
behavior: t && !
|
|
1233
|
+
behavior: t && !L ? "smooth" : "auto"
|
|
1232
1234
|
});
|
|
1233
|
-
},
|
|
1234
|
-
if (!
|
|
1235
|
+
}, V = () => B(a.value - 1), H = () => B(a.value + 1), U = (e) => {
|
|
1236
|
+
if (!N.value) return B(e);
|
|
1235
1237
|
let t = i.value;
|
|
1236
|
-
|
|
1237
|
-
},
|
|
1238
|
+
B(d(e + d(D.value - s.value, t), t));
|
|
1239
|
+
}, W = () => {
|
|
1238
1240
|
let e = r.value;
|
|
1239
|
-
if (!e || !
|
|
1240
|
-
let t =
|
|
1241
|
+
if (!e || !w.value || g()) return;
|
|
1242
|
+
let t = R(e);
|
|
1241
1243
|
if (!t) return;
|
|
1242
|
-
let n = Math.round(e.scrollLeft / t) -
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1244
|
+
let n = Math.round(e.scrollLeft / t) - D.value;
|
|
1245
|
+
if (n) {
|
|
1246
|
+
if (_ = _.filter((e) => p() - e < 1e3), _.push(p()), _.length > 12) {
|
|
1247
|
+
v.value = !0, re(), z(), typeof console < "u" && console.warn("[KunCarousel] runaway re-homing detected (browser scroll feedback); falling back to a non-looping slider.");
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
s.value = d(s.value + n, i.value), z(), h(), e.scrollLeft = D.value * t, a.value = D.value;
|
|
1251
|
+
}
|
|
1252
|
+
}, G, K = () => {
|
|
1253
|
+
!w.value || g() || (clearTimeout(G), G = setTimeout(W, 130));
|
|
1254
|
+
}, q = 0, J = () => {
|
|
1255
|
+
q ||= requestAnimationFrame(() => {
|
|
1256
|
+
if (q = 0, g()) return;
|
|
1249
1257
|
let e = r.value;
|
|
1250
1258
|
if (!e) return;
|
|
1251
|
-
let t =
|
|
1252
|
-
t > 0 && (a.value = Math.round(e.scrollLeft / t)),
|
|
1259
|
+
let t = R(e);
|
|
1260
|
+
t > 0 && (a.value = Math.round(e.scrollLeft / t)), K();
|
|
1253
1261
|
});
|
|
1254
|
-
},
|
|
1255
|
-
|
|
1256
|
-
|
|
1262
|
+
}, ee, te = () => n.autoplay > 0 && !L && i.value > n.slidesPerView, ne = () => {
|
|
1263
|
+
re(), te() && (ee = setInterval(() => {
|
|
1264
|
+
if (w.value) {
|
|
1265
|
+
let e = r.value, t = e ? R(e) : 0;
|
|
1266
|
+
e && t && Math.round(e.scrollLeft / t) !== D.value && W(), H();
|
|
1267
|
+
} else B(a.value >= C.value ? 0 : a.value + 1);
|
|
1257
1268
|
}, n.autoplay));
|
|
1258
|
-
},
|
|
1259
|
-
|
|
1260
|
-
},
|
|
1269
|
+
}, re = () => {
|
|
1270
|
+
ee && clearInterval(ee), ee = void 0;
|
|
1271
|
+
}, ie = () => {
|
|
1261
1272
|
let e = r.value;
|
|
1262
|
-
if (i.value = e?.children.length ?? 0, i.value > 0 && (s.value = d(s.value, i.value)),
|
|
1263
|
-
let t =
|
|
1264
|
-
t && (e.scrollLeft =
|
|
1273
|
+
if (i.value = e?.children.length ?? 0, i.value > 0 && (s.value = d(s.value, i.value)), z(), e && w.value) {
|
|
1274
|
+
let t = R(e);
|
|
1275
|
+
t && (h(), e.scrollLeft = D.value * t, a.value = D.value);
|
|
1265
1276
|
}
|
|
1266
|
-
},
|
|
1277
|
+
}, ae = () => {
|
|
1267
1278
|
let e = r.value;
|
|
1268
|
-
if (e &&
|
|
1269
|
-
let t =
|
|
1270
|
-
t && (e.scrollLeft =
|
|
1279
|
+
if (e && w.value) {
|
|
1280
|
+
let t = R(e);
|
|
1281
|
+
t && (h(), e.scrollLeft = D.value * t);
|
|
1271
1282
|
}
|
|
1272
|
-
},
|
|
1283
|
+
}, oe = null;
|
|
1273
1284
|
return S(() => {
|
|
1274
|
-
|
|
1285
|
+
L = typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches, ie();
|
|
1275
1286
|
let e = r.value;
|
|
1276
|
-
e && (e.addEventListener("scrollend",
|
|
1277
|
-
|
|
1278
|
-
}),
|
|
1287
|
+
e && (e.addEventListener("scrollend", W), typeof MutationObserver < "u" && (oe = new MutationObserver(() => {
|
|
1288
|
+
ie(), ne();
|
|
1289
|
+
}), oe.observe(e, { childList: !0 }))), window.addEventListener("resize", ae), ne();
|
|
1279
1290
|
}), x(() => {
|
|
1280
|
-
|
|
1291
|
+
re(), oe?.disconnect(), q && cancelAnimationFrame(q), clearTimeout(G), r.value?.removeEventListener("scrollend", W), window.removeEventListener("resize", ae);
|
|
1281
1292
|
}), (n, i) => (T(), l("div", {
|
|
1282
|
-
class: y(I(
|
|
1293
|
+
class: y(I(Y)("group/carousel relative", e.className)),
|
|
1283
1294
|
role: "region",
|
|
1284
1295
|
"aria-roledescription": "carousel",
|
|
1285
1296
|
"aria-label": e.ariaLabel,
|
|
1286
|
-
onPointerenter:
|
|
1287
|
-
onPointerleave:
|
|
1288
|
-
onFocusin:
|
|
1289
|
-
onFocusout:
|
|
1297
|
+
onPointerenter: re,
|
|
1298
|
+
onPointerleave: ne,
|
|
1299
|
+
onFocusin: re,
|
|
1300
|
+
onFocusout: ne
|
|
1290
1301
|
}, [
|
|
1291
1302
|
u("ul", {
|
|
1292
1303
|
ref_key: "trackRef",
|
|
1293
1304
|
ref: r,
|
|
1294
|
-
class: "scrollbar-hide flex snap-x snap-mandatory overflow-x-auto
|
|
1295
|
-
style: b({
|
|
1296
|
-
|
|
1305
|
+
class: "scrollbar-hide flex snap-x snap-mandatory overflow-x-auto",
|
|
1306
|
+
style: b({
|
|
1307
|
+
gap: e.gap,
|
|
1308
|
+
overflowAnchor: "none"
|
|
1309
|
+
}),
|
|
1310
|
+
onScrollPassive: J
|
|
1297
1311
|
}, [A(n.$slots, "default")], 36),
|
|
1298
|
-
|
|
1312
|
+
j.value ? (T(), l(t, { key: 0 }, [u("button", {
|
|
1299
1313
|
type: "button",
|
|
1300
1314
|
"aria-label": "上一张",
|
|
1301
|
-
disabled: !
|
|
1315
|
+
disabled: !w.value && F.value <= 0,
|
|
1302
1316
|
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",
|
|
1303
|
-
onClick:
|
|
1304
|
-
}, [f(
|
|
1317
|
+
onClick: V
|
|
1318
|
+
}, [f(Q, {
|
|
1305
1319
|
name: "lucide:chevron-left",
|
|
1306
1320
|
class: "size-5"
|
|
1307
1321
|
})], 8, zn), u("button", {
|
|
1308
1322
|
type: "button",
|
|
1309
1323
|
"aria-label": "下一张",
|
|
1310
|
-
disabled: !
|
|
1324
|
+
disabled: !w.value && F.value >= C.value,
|
|
1311
1325
|
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",
|
|
1312
|
-
onClick:
|
|
1313
|
-
}, [f(
|
|
1326
|
+
onClick: H
|
|
1327
|
+
}, [f(Q, {
|
|
1314
1328
|
name: "lucide:chevron-right",
|
|
1315
1329
|
class: "size-5"
|
|
1316
1330
|
})], 8, Bn)], 64)) : c("", !0),
|
|
1317
|
-
|
|
1331
|
+
M.value ? (T(), l("div", Vn, [(T(!0), l(t, null, k(P.value, (e) => (T(), l("button", {
|
|
1318
1332
|
key: e,
|
|
1319
1333
|
type: "button",
|
|
1320
1334
|
"aria-label": `跳到第 ${e} 张`,
|
|
1321
|
-
"aria-current":
|
|
1322
|
-
class: y(I(
|
|
1323
|
-
onClick: (t) =>
|
|
1335
|
+
"aria-current": F.value === e - 1 ? "true" : void 0,
|
|
1336
|
+
class: y(I(Y)("h-2 rounded-full transition-all", F.value === e - 1 ? "bg-primary w-5" : "bg-default-300 hover:bg-default-400 w-2")),
|
|
1337
|
+
onClick: (t) => U(e - 1)
|
|
1324
1338
|
}, null, 10, Hn))), 128))])) : c("", !0)
|
|
1325
1339
|
], 42, Rn));
|
|
1326
1340
|
}
|
|
@@ -1334,7 +1348,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1334
1348
|
return e <= 1 ? "100%" : `calc((100% - ${e - 1} * ${n}) / ${e})`;
|
|
1335
1349
|
});
|
|
1336
1350
|
return (t, r) => (T(), l("li", {
|
|
1337
|
-
class: y(I(
|
|
1351
|
+
class: y(I(Y)("shrink-0 snap-start", e.className)),
|
|
1338
1352
|
style: b({ flexBasis: n.value }),
|
|
1339
1353
|
"aria-roledescription": "slide"
|
|
1340
1354
|
}, [A(t.$slots, "default")], 6));
|
|
@@ -1384,14 +1398,14 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1384
1398
|
}),
|
|
1385
1399
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
1386
1400
|
setup(e, { emit: t }) {
|
|
1387
|
-
let n = e, r = o(() =>
|
|
1401
|
+
let n = e, r = o(() => fe[n.size]), i = {
|
|
1388
1402
|
xs: "w-2",
|
|
1389
1403
|
sm: "w-2.5",
|
|
1390
1404
|
md: "w-2.5",
|
|
1391
1405
|
lg: "w-3",
|
|
1392
1406
|
xl: "w-3.5"
|
|
1393
|
-
}, a = z(e, "modelValue"), s = t, d =
|
|
1394
|
-
|
|
1407
|
+
}, a = z(e, "modelValue"), s = t, d = at("kun-checkbox"), p = O(null);
|
|
1408
|
+
W(() => {
|
|
1395
1409
|
p.value && (p.value.indeterminate = n.indeterminate);
|
|
1396
1410
|
});
|
|
1397
1411
|
let m = (e) => {
|
|
@@ -1413,8 +1427,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1413
1427
|
warning: "bg-warning border-warning",
|
|
1414
1428
|
danger: "bg-danger border-danger",
|
|
1415
1429
|
info: "bg-info border-info"
|
|
1416
|
-
}, _ = o(() =>
|
|
1417
|
-
return (t, o) => (T(), l("div", null, [u("div", { class: y(I(
|
|
1430
|
+
}, _ = o(() => ge[n.color]);
|
|
1431
|
+
return (t, o) => (T(), l("div", null, [u("div", { class: y(I(Y)("flex cursor-pointer items-center", r.value.gap, e.className)) }, [
|
|
1418
1432
|
u("div", Gn, [
|
|
1419
1433
|
u("input", {
|
|
1420
1434
|
id: I(d),
|
|
@@ -1426,20 +1440,20 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1426
1440
|
checked: a.value,
|
|
1427
1441
|
disabled: e.disabled,
|
|
1428
1442
|
"aria-describedby": e.error || e.description ? `${I(d)}-desc` : void 0,
|
|
1429
|
-
class: y(I(
|
|
1443
|
+
class: y(I(Y)("peer cursor-pointer appearance-none border-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", I(X)[n.color], r.value.box, n.type === "single" ? "rounded-full" : "rounded-[35%]", e.indeterminate ? g[n.color] : h[n.color])),
|
|
1430
1444
|
onChange: m
|
|
1431
1445
|
}, null, 42, Kn),
|
|
1432
|
-
|
|
1446
|
+
K(u("div", { class: y(I(Y)("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, {
|
|
1433
1447
|
name: "lucide:check",
|
|
1434
1448
|
class: y(r.value.check)
|
|
1435
1449
|
}, null, 8, ["class"])], 2), [[H, !e.indeterminate]]),
|
|
1436
|
-
|
|
1450
|
+
K(u("div", qn, [u("span", { class: y(["h-0.5 rounded-full bg-current", [i[n.size], _.value]]) }, null, 2)], 512), [[H, e.indeterminate]])
|
|
1437
1451
|
]),
|
|
1438
1452
|
A(t.$slots, "default"),
|
|
1439
1453
|
e.label ? (T(), l("label", {
|
|
1440
1454
|
key: 0,
|
|
1441
1455
|
for: I(d),
|
|
1442
|
-
class: y(I(
|
|
1456
|
+
class: y(I(Y)("text-default-700 cursor-pointer select-none", r.value.text, e.disabled && "cursor-not-allowed opacity-50"))
|
|
1443
1457
|
}, M(e.label), 11, Jn)) : c("", !0)
|
|
1444
1458
|
], 2), e.error ? (T(), l("p", {
|
|
1445
1459
|
key: 0,
|
|
@@ -1700,7 +1714,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1700
1714
|
], Hr = ["src", "alt"], Ur = {
|
|
1701
1715
|
class: "min-w-[3.5rem] text-center text-sm font-medium tabular-nums text-white",
|
|
1702
1716
|
"aria-live": "polite"
|
|
1703
|
-
}, Wr = 1, Gr = 5, Kr = 50, qr = .5, Jr = 6, Yr = 300, Xr = 30, Zr = /*#__PURE__*/
|
|
1717
|
+
}, Wr = 1, Gr = 5, Kr = 50, qr = .5, Jr = 6, Yr = 300, Xr = 30, Zr = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
1704
1718
|
name: "KunLightbox",
|
|
1705
1719
|
__name: "Lightbox",
|
|
1706
1720
|
props: {
|
|
@@ -1731,39 +1745,39 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1731
1745
|
let e = Math.min(Gr, d.value + qr);
|
|
1732
1746
|
if (e === d.value) return;
|
|
1733
1747
|
d.value = e;
|
|
1734
|
-
let t =
|
|
1748
|
+
let t = le(v.x, v.y);
|
|
1735
1749
|
v.x = t.x, v.y = t.y;
|
|
1736
|
-
},
|
|
1750
|
+
}, W = () => {
|
|
1737
1751
|
let e = Math.max(Wr, d.value - qr);
|
|
1738
1752
|
if (e === d.value) return;
|
|
1739
1753
|
d.value = e;
|
|
1740
|
-
let t =
|
|
1754
|
+
let t = le(v.x, v.y);
|
|
1741
1755
|
v.x = t.x, v.y = t.y;
|
|
1742
|
-
}, G = () => {
|
|
1743
|
-
_.value += 90;
|
|
1744
1756
|
}, K = () => {
|
|
1757
|
+
_.value += 90;
|
|
1758
|
+
}, q = () => {
|
|
1745
1759
|
_.value -= 90;
|
|
1746
|
-
},
|
|
1760
|
+
}, ee = (e) => {
|
|
1747
1761
|
let t = document;
|
|
1748
1762
|
typeof t.startViewTransition == "function" ? t.startViewTransition(e) : e();
|
|
1749
|
-
}, { lock:
|
|
1763
|
+
}, { lock: Y, unlock: te } = Ft(), ne = !1;
|
|
1750
1764
|
U(() => r.isOpen, (e) => {
|
|
1751
1765
|
let t = F.value;
|
|
1752
|
-
t && (e && !t.open ? (V(),
|
|
1766
|
+
t && (e && !t.open ? (V(), ee(() => t.showModal()), ne ||= (Y(), !0)) : !e && t.open && (ee(() => t.close()), ne &&= (te(), !1)));
|
|
1753
1767
|
}, { flush: "post" }), U(() => r.initialIndex, () => {
|
|
1754
1768
|
s.value = r.initialIndex || 0, V();
|
|
1755
1769
|
});
|
|
1756
|
-
let
|
|
1757
|
-
r.isOpen && (a("update:isOpen", !1), V()),
|
|
1758
|
-
},
|
|
1770
|
+
let re = () => {
|
|
1771
|
+
r.isOpen && (a("update:isOpen", !1), V()), ne &&= (te(), !1);
|
|
1772
|
+
}, ie = (e) => {
|
|
1759
1773
|
e.target === F.value && a("update:isOpen", !1);
|
|
1760
|
-
},
|
|
1774
|
+
}, ae = () => {
|
|
1761
1775
|
S.value || a("update:isOpen", !1);
|
|
1762
|
-
},
|
|
1776
|
+
}, oe = () => {
|
|
1763
1777
|
P.value = "slide-next", V(), s.value = (s.value + 1) % r.images.length;
|
|
1764
|
-
},
|
|
1778
|
+
}, se = () => {
|
|
1765
1779
|
P.value = "slide-prev", V(), s.value = (s.value - 1 + r.images.length) % r.images.length;
|
|
1766
|
-
},
|
|
1780
|
+
}, ce = () => {
|
|
1767
1781
|
if (!I.value || !L.value) return {
|
|
1768
1782
|
minX: 0,
|
|
1769
1783
|
maxX: 0,
|
|
@@ -1777,17 +1791,17 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1777
1791
|
minY: -a,
|
|
1778
1792
|
maxY: a
|
|
1779
1793
|
};
|
|
1780
|
-
},
|
|
1794
|
+
}, le = (e, t) => {
|
|
1781
1795
|
if (d.value <= 1) return {
|
|
1782
1796
|
x: 0,
|
|
1783
1797
|
y: 0
|
|
1784
1798
|
};
|
|
1785
|
-
let n =
|
|
1799
|
+
let n = ce();
|
|
1786
1800
|
return {
|
|
1787
1801
|
x: Math.min(Math.max(e, n.minX), n.maxX),
|
|
1788
1802
|
y: Math.min(Math.max(t, n.minY), n.maxY)
|
|
1789
1803
|
};
|
|
1790
|
-
},
|
|
1804
|
+
}, ue = (e) => {
|
|
1791
1805
|
e.preventDefault();
|
|
1792
1806
|
let t = -e.deltaY, n = d.value + (t > 0 ? .2 : -.2), r = Math.max(Wr, Math.min(Gr, n));
|
|
1793
1807
|
if (r !== d.value) {
|
|
@@ -1796,14 +1810,14 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1796
1810
|
let n = e.clientX - t.left, i = e.clientY - t.top, a = r / d.value, o = {
|
|
1797
1811
|
x: n - (n - v.x) * a,
|
|
1798
1812
|
y: i - (i - v.y) * a
|
|
1799
|
-
}, s =
|
|
1813
|
+
}, s = le(o.x, o.y);
|
|
1800
1814
|
v.x = s.x, v.y = s.y, d.value = r;
|
|
1801
1815
|
}
|
|
1802
|
-
},
|
|
1816
|
+
}, X = (e) => {
|
|
1803
1817
|
x.value = !0, S.value = !1, j.value = Date.now();
|
|
1804
1818
|
let t = "touches" in e ? e.touches[0] : e;
|
|
1805
1819
|
C.x = t.clientX - v.x, C.y = t.clientY - v.y, N.x = t.clientX, N.y = t.clientY;
|
|
1806
|
-
},
|
|
1820
|
+
}, de = (e) => {
|
|
1807
1821
|
if (!x.value) return;
|
|
1808
1822
|
let t = "touches" in e ? e.touches[0] : e;
|
|
1809
1823
|
if ((Math.abs(t.clientX - N.x) > Jr || Math.abs(t.clientY - N.y) > Jr) && (S.value = !0), d.value <= 1) {
|
|
@@ -1813,13 +1827,13 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1813
1827
|
let n = {
|
|
1814
1828
|
x: t.clientX - C.x,
|
|
1815
1829
|
y: t.clientY - C.y
|
|
1816
|
-
}, r =
|
|
1830
|
+
}, r = le(n.x, n.y);
|
|
1817
1831
|
v.x = r.x, v.y = r.y;
|
|
1818
|
-
},
|
|
1832
|
+
}, Z = (e) => {
|
|
1819
1833
|
if (!x.value) return;
|
|
1820
1834
|
let t = ("touches" in e ? e.changedTouches[0] : e).clientX - N.x, n = Date.now() - j.value, r = Math.abs(t) / n;
|
|
1821
|
-
d.value <= 1 && Math.abs(t) > Kr && r > .2 && (t > 0 ?
|
|
1822
|
-
},
|
|
1835
|
+
d.value <= 1 && Math.abs(t) > Kr && r > .2 && (t > 0 ? se() : oe(), v.x = 0, v.y = 0), x.value = !1;
|
|
1836
|
+
}, fe = (e, t) => {
|
|
1823
1837
|
let n = L.value?.getBoundingClientRect();
|
|
1824
1838
|
if (!n) return;
|
|
1825
1839
|
if (d.value > Wr) {
|
|
@@ -1828,24 +1842,24 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1828
1842
|
}
|
|
1829
1843
|
let r = e - n.left, i = t - n.top;
|
|
1830
1844
|
d.value = 2;
|
|
1831
|
-
let a =
|
|
1845
|
+
let a = le(r - n.width / 2, i - n.height / 2);
|
|
1832
1846
|
v.x = a.x, v.y = a.y;
|
|
1833
|
-
},
|
|
1847
|
+
}, pe = (e) => fe(e.clientX, e.clientY), me = (e) => {
|
|
1834
1848
|
if (e.touches.length >= 2) {
|
|
1835
1849
|
x.value = !1, p.value = !0;
|
|
1836
1850
|
let [t, n] = [e.touches[0], e.touches[1]];
|
|
1837
1851
|
A.value = Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), E.x = (t.clientX + n.clientX) / 2, E.y = (t.clientY + n.clientY) / 2;
|
|
1838
|
-
} else e.touches.length === 1 && !p.value &&
|
|
1839
|
-
},
|
|
1852
|
+
} else e.touches.length === 1 && !p.value && X(e);
|
|
1853
|
+
}, he = (e) => {
|
|
1840
1854
|
if (e.touches.length >= 2 && p.value) {
|
|
1841
1855
|
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(Wr, Math.min(Gr, d.value * o)), c = L.value?.getBoundingClientRect();
|
|
1842
1856
|
if (c) {
|
|
1843
|
-
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 - E.x, u = a - E.y, f =
|
|
1857
|
+
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 - E.x, u = a - E.y, f = le(r + l, o + u);
|
|
1844
1858
|
v.x = f.x, v.y = f.y;
|
|
1845
1859
|
}
|
|
1846
1860
|
d.value = s, A.value = r, E.x = i, E.y = a;
|
|
1847
|
-
} else e.touches.length === 1 && x.value &&
|
|
1848
|
-
},
|
|
1861
|
+
} else e.touches.length === 1 && x.value && de(e);
|
|
1862
|
+
}, ge = (e) => {
|
|
1849
1863
|
if (p.value) {
|
|
1850
1864
|
if (e.touches.length >= 2) return;
|
|
1851
1865
|
if (p.value = !1, e.touches.length === 1) {
|
|
@@ -1854,7 +1868,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1854
1868
|
}
|
|
1855
1869
|
return;
|
|
1856
1870
|
}
|
|
1857
|
-
if (
|
|
1871
|
+
if (Z(e), e.touches.length !== 0) return;
|
|
1858
1872
|
let t = e.changedTouches[0];
|
|
1859
1873
|
if (!t) return;
|
|
1860
1874
|
if (Math.abs(t.clientX - N.x) > Xr || Math.abs(t.clientY - N.y) > Xr) {
|
|
@@ -1862,8 +1876,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1862
1876
|
return;
|
|
1863
1877
|
}
|
|
1864
1878
|
let n = Date.now();
|
|
1865
|
-
n - m < Yr && Math.abs(t.clientX - h) < Xr && Math.abs(t.clientY - g) < Xr ? (
|
|
1866
|
-
},
|
|
1879
|
+
n - m < Yr && Math.abs(t.clientX - h) < Xr && Math.abs(t.clientY - g) < Xr ? (fe(t.clientX, t.clientY), m = 0) : (m = n, h = t.clientX, g = t.clientY);
|
|
1880
|
+
}, _e = async () => {
|
|
1867
1881
|
let e = R.value;
|
|
1868
1882
|
if (!e) return;
|
|
1869
1883
|
let t = e.split("/").pop() || "image";
|
|
@@ -1875,39 +1889,39 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1875
1889
|
} catch (t) {
|
|
1876
1890
|
console.warn("[KunLightbox] direct download blocked (likely CORS), opening in new tab", t), window.open(e, "_blank", "noopener,noreferrer");
|
|
1877
1891
|
}
|
|
1878
|
-
},
|
|
1892
|
+
}, ve = (e) => {
|
|
1879
1893
|
e === s.value || e < 0 || e >= r.images.length || (P.value = e > s.value ? "slide-next" : "slide-prev", V(), s.value = e);
|
|
1880
|
-
},
|
|
1881
|
-
e.key === "ArrowLeft" ? (e.preventDefault(),
|
|
1894
|
+
}, ye = o(() => Math.round(d.value * 100)), be = (e) => {
|
|
1895
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), se()) : e.key === "ArrowRight" && (e.preventDefault(), oe());
|
|
1882
1896
|
};
|
|
1883
1897
|
return w(() => {
|
|
1884
|
-
|
|
1898
|
+
ne && te();
|
|
1885
1899
|
}), (n, r) => (T(), l("dialog", {
|
|
1886
1900
|
ref_key: "dialogRef",
|
|
1887
1901
|
ref: F,
|
|
1888
1902
|
"aria-label": "图片查看器",
|
|
1889
1903
|
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",
|
|
1890
|
-
onClose:
|
|
1891
|
-
onClick:
|
|
1892
|
-
onKeydown:
|
|
1904
|
+
onClose: re,
|
|
1905
|
+
onClick: ie,
|
|
1906
|
+
onKeydown: be
|
|
1893
1907
|
}, [e.isOpen ? (T(), l("div", Pr, [
|
|
1894
1908
|
u("div", {
|
|
1895
1909
|
ref_key: "containerRef",
|
|
1896
1910
|
ref: L,
|
|
1897
1911
|
class: "kun-lightbox-stage relative flex h-full w-full touch-none items-center justify-center overflow-hidden",
|
|
1898
|
-
onClick:
|
|
1899
|
-
onWheel:
|
|
1900
|
-
onMousedown:
|
|
1901
|
-
onMousemove:
|
|
1902
|
-
onMouseup:
|
|
1903
|
-
onMouseleave:
|
|
1904
|
-
onTouchstartPassive:
|
|
1905
|
-
onTouchmovePassive:
|
|
1906
|
-
onTouchend:
|
|
1907
|
-
onTouchcancel:
|
|
1908
|
-
onDblclick:
|
|
1912
|
+
onClick: ae,
|
|
1913
|
+
onWheel: J(ue, ["prevent"]),
|
|
1914
|
+
onMousedown: X,
|
|
1915
|
+
onMousemove: de,
|
|
1916
|
+
onMouseup: Z,
|
|
1917
|
+
onMouseleave: Z,
|
|
1918
|
+
onTouchstartPassive: me,
|
|
1919
|
+
onTouchmovePassive: he,
|
|
1920
|
+
onTouchend: ge,
|
|
1921
|
+
onTouchcancel: ge,
|
|
1922
|
+
onDblclick: pe
|
|
1909
1923
|
}, [f(i, { name: P.value }, {
|
|
1910
|
-
default:
|
|
1924
|
+
default: G(() => [(T(), l("div", {
|
|
1911
1925
|
key: s.value,
|
|
1912
1926
|
class: "kun-lightbox-slide absolute inset-0 flex items-center justify-center"
|
|
1913
1927
|
}, [u("img", {
|
|
@@ -1918,7 +1932,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1918
1932
|
class: "kun-lightbox-image max-h-full max-w-full will-change-transform",
|
|
1919
1933
|
style: b(B.value),
|
|
1920
1934
|
draggable: "false",
|
|
1921
|
-
onClick: r[0] ||=
|
|
1935
|
+
onClick: r[0] ||= J(() => {}, ["stop"])
|
|
1922
1936
|
}, null, 12, Fr)]))]),
|
|
1923
1937
|
_: 1
|
|
1924
1938
|
}, 8, ["name"])], 544),
|
|
@@ -1931,9 +1945,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1931
1945
|
rounded: "lg",
|
|
1932
1946
|
"aria-label": "关闭",
|
|
1933
1947
|
"class-name": "absolute top-4 right-4 z-50 bg-black/70 backdrop-blur-md border border-white/10 shadow-lg",
|
|
1934
|
-
onClick: r[1] ||=
|
|
1948
|
+
onClick: r[1] ||= J((e) => a("update:isOpen", !1), ["stop"])
|
|
1935
1949
|
}, {
|
|
1936
|
-
default:
|
|
1950
|
+
default: G(() => [f(Q, {
|
|
1937
1951
|
name: "lucide:x",
|
|
1938
1952
|
class: "text-white"
|
|
1939
1953
|
})]),
|
|
@@ -1947,9 +1961,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1947
1961
|
rounded: "lg",
|
|
1948
1962
|
"aria-label": "上一张",
|
|
1949
1963
|
"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",
|
|
1950
|
-
onClick:
|
|
1964
|
+
onClick: J(se, ["stop"])
|
|
1951
1965
|
}, {
|
|
1952
|
-
default:
|
|
1966
|
+
default: G(() => [f(Q, {
|
|
1953
1967
|
name: "lucide:chevron-left",
|
|
1954
1968
|
class: "text-white"
|
|
1955
1969
|
})]),
|
|
@@ -1962,9 +1976,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1962
1976
|
rounded: "lg",
|
|
1963
1977
|
"aria-label": "下一张",
|
|
1964
1978
|
"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",
|
|
1965
|
-
onClick:
|
|
1979
|
+
onClick: J(oe, ["stop"])
|
|
1966
1980
|
}, {
|
|
1967
|
-
default:
|
|
1981
|
+
default: G(() => [f(Q, {
|
|
1968
1982
|
name: "lucide:chevron-right",
|
|
1969
1983
|
class: "text-white"
|
|
1970
1984
|
})]),
|
|
@@ -1977,7 +1991,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1977
1991
|
"aria-label": `跳转到第 ${t + 1} 张`,
|
|
1978
1992
|
"aria-current": t === s.value,
|
|
1979
1993
|
class: y(["size-2 rounded-full transition-colors", t === s.value ? "bg-primary-500" : "bg-default-400/60 hover:bg-default-300"]),
|
|
1980
|
-
onClick:
|
|
1994
|
+
onClick: J((e) => ve(t), ["stop"])
|
|
1981
1995
|
}, null, 10, zr))), 128))])) : c("", !0),
|
|
1982
1996
|
e.images.length > 1 ? (T(), l("div", Br, [(T(!0), l(t, null, k(e.images, (e, t) => (T(), l("button", {
|
|
1983
1997
|
key: `thumb-${t}`,
|
|
@@ -1985,7 +1999,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1985
1999
|
"aria-label": `跳转到第 ${t + 1} 张`,
|
|
1986
2000
|
"aria-current": t === s.value,
|
|
1987
2001
|
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"]),
|
|
1988
|
-
onClick:
|
|
2002
|
+
onClick: J((e) => ve(t), ["stop"])
|
|
1989
2003
|
}, [u("img", {
|
|
1990
2004
|
src: e.src,
|
|
1991
2005
|
alt: e.alt ?? "",
|
|
@@ -1994,7 +2008,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1994
2008
|
}, null, 8, Hr)], 10, Vr))), 128))])) : c("", !0),
|
|
1995
2009
|
u("div", {
|
|
1996
2010
|
class: "kun-lightbox-toolbar pointer-events-auto flex items-center gap-1 rounded-full border border-white/10 bg-black/70 px-2 py-1.5 shadow-lg backdrop-blur-md",
|
|
1997
|
-
onClick: r[2] ||=
|
|
2011
|
+
onClick: r[2] ||= J(() => {}, ["stop"])
|
|
1998
2012
|
}, [
|
|
1999
2013
|
f($, {
|
|
2000
2014
|
"is-icon-only": !0,
|
|
@@ -2003,15 +2017,15 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2003
2017
|
size: "lg",
|
|
2004
2018
|
rounded: "full",
|
|
2005
2019
|
"aria-label": "缩小",
|
|
2006
|
-
onClick:
|
|
2020
|
+
onClick: W
|
|
2007
2021
|
}, {
|
|
2008
|
-
default:
|
|
2022
|
+
default: G(() => [f(Q, {
|
|
2009
2023
|
name: "lucide:zoom-out",
|
|
2010
2024
|
class: "text-white"
|
|
2011
2025
|
})]),
|
|
2012
2026
|
_: 1
|
|
2013
2027
|
}),
|
|
2014
|
-
u("span", Ur, M(
|
|
2028
|
+
u("span", Ur, M(ye.value) + "% ", 1),
|
|
2015
2029
|
f($, {
|
|
2016
2030
|
"is-icon-only": !0,
|
|
2017
2031
|
color: "default",
|
|
@@ -2021,7 +2035,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2021
2035
|
"aria-label": "放大",
|
|
2022
2036
|
onClick: H
|
|
2023
2037
|
}, {
|
|
2024
|
-
default:
|
|
2038
|
+
default: G(() => [f(Q, {
|
|
2025
2039
|
name: "lucide:zoom-in",
|
|
2026
2040
|
class: "text-white"
|
|
2027
2041
|
})]),
|
|
@@ -2038,9 +2052,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2038
2052
|
size: "lg",
|
|
2039
2053
|
rounded: "full",
|
|
2040
2054
|
"aria-label": "向左旋转 90°",
|
|
2041
|
-
onClick:
|
|
2055
|
+
onClick: q
|
|
2042
2056
|
}, {
|
|
2043
|
-
default:
|
|
2057
|
+
default: G(() => [f(Q, {
|
|
2044
2058
|
name: "lucide:rotate-ccw",
|
|
2045
2059
|
class: "text-white"
|
|
2046
2060
|
})]),
|
|
@@ -2053,9 +2067,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2053
2067
|
size: "lg",
|
|
2054
2068
|
rounded: "full",
|
|
2055
2069
|
"aria-label": "向右旋转 90°",
|
|
2056
|
-
onClick:
|
|
2070
|
+
onClick: K
|
|
2057
2071
|
}, {
|
|
2058
|
-
default:
|
|
2072
|
+
default: G(() => [f(Q, {
|
|
2059
2073
|
name: "lucide:rotate-cw",
|
|
2060
2074
|
class: "text-white"
|
|
2061
2075
|
})]),
|
|
@@ -2074,7 +2088,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2074
2088
|
"aria-label": "重置缩放/旋转/位置",
|
|
2075
2089
|
onClick: V
|
|
2076
2090
|
}, {
|
|
2077
|
-
default:
|
|
2091
|
+
default: G(() => [f(Q, {
|
|
2078
2092
|
name: "lucide:refresh-ccw",
|
|
2079
2093
|
class: "text-white"
|
|
2080
2094
|
})]),
|
|
@@ -2087,9 +2101,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2087
2101
|
size: "lg",
|
|
2088
2102
|
rounded: "full",
|
|
2089
2103
|
"aria-label": "下载",
|
|
2090
|
-
onClick:
|
|
2104
|
+
onClick: _e
|
|
2091
2105
|
}, {
|
|
2092
|
-
default:
|
|
2106
|
+
default: G(() => [f(Q, {
|
|
2093
2107
|
name: "lucide:download",
|
|
2094
2108
|
class: "text-white"
|
|
2095
2109
|
})]),
|
|
@@ -2099,7 +2113,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2099
2113
|
])
|
|
2100
2114
|
])) : c("", !0)], 544));
|
|
2101
2115
|
}
|
|
2102
|
-
}), [["__scopeId", "data-v-81a536ec"]]), Qr = ["innerHTML"], $r = /*#__PURE__*/
|
|
2116
|
+
}), [["__scopeId", "data-v-81a536ec"]]), Qr = ["innerHTML"], $r = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
2103
2117
|
name: "KunContent",
|
|
2104
2118
|
__name: "Content",
|
|
2105
2119
|
props: {
|
|
@@ -2117,7 +2131,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2117
2131
|
return (a, o) => (T(), l("div", null, [u("article", {
|
|
2118
2132
|
ref_key: "articleRef",
|
|
2119
2133
|
ref: t,
|
|
2120
|
-
class: y(I(
|
|
2134
|
+
class: y(I(Y)("kun-prose", e.compact && "kun-prose-compact", e.className)),
|
|
2121
2135
|
innerHTML: e.content
|
|
2122
2136
|
}, null, 10, Qr), f(Zr, {
|
|
2123
2137
|
"is-open": I(n),
|
|
@@ -2145,7 +2159,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2145
2159
|
},
|
|
2146
2160
|
emits: ["select", "close"],
|
|
2147
2161
|
setup(e, { emit: r }) {
|
|
2148
|
-
let a = e, d = r, p =
|
|
2162
|
+
let a = e, d = r, p = ut(), m = O(null), h = O(-1), g = O({
|
|
2149
2163
|
x: a.position?.x ?? 0,
|
|
2150
2164
|
y: a.position?.y ?? 0
|
|
2151
2165
|
}), y = null, C = (e, t, n) => Math.min(Math.max(e, t), Math.max(n, t)), w = () => a.items.reduce((e, t, n) => (t.disabled || e.push(n), e), []), E = () => Array.from(m.value?.querySelectorAll("[role=\"menuitem\"]") ?? []), D = (e) => {
|
|
@@ -2208,7 +2222,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2208
2222
|
return;
|
|
2209
2223
|
}
|
|
2210
2224
|
B(t);
|
|
2211
|
-
},
|
|
2225
|
+
}, W = (e) => {
|
|
2212
2226
|
switch (e.key) {
|
|
2213
2227
|
case "ArrowDown":
|
|
2214
2228
|
e.preventDefault(), A(1);
|
|
@@ -2239,7 +2253,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2239
2253
|
e.preventDefault(), P(!0);
|
|
2240
2254
|
break;
|
|
2241
2255
|
}
|
|
2242
|
-
},
|
|
2256
|
+
}, K = {
|
|
2243
2257
|
default: "focus:bg-default/20",
|
|
2244
2258
|
primary: "focus:bg-primary/20",
|
|
2245
2259
|
secondary: "focus:bg-secondary/20",
|
|
@@ -2247,7 +2261,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2247
2261
|
warning: "focus:bg-warning/20",
|
|
2248
2262
|
danger: "focus:bg-danger/20",
|
|
2249
2263
|
info: "focus:bg-info/20"
|
|
2250
|
-
},
|
|
2264
|
+
}, q = (e) => Y("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", ve("light", e.color || "default"), K[e.color || "default"], e.disabled && "pointer-events-none cursor-not-allowed opacity-50");
|
|
2251
2265
|
return (r, a) => (T(), s(n, { to: "body" }, [f(i, {
|
|
2252
2266
|
"enter-active-class": "transition duration-kun-base ease-kun-out",
|
|
2253
2267
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -2256,7 +2270,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2256
2270
|
"leave-from-class": "opacity-100 scale-100",
|
|
2257
2271
|
"leave-to-class": "opacity-0 scale-95"
|
|
2258
2272
|
}, {
|
|
2259
|
-
default:
|
|
2273
|
+
default: G(() => [e.visible && e.items.length ? (T(), l("div", {
|
|
2260
2274
|
key: 0,
|
|
2261
2275
|
ref_key: "menuRef",
|
|
2262
2276
|
ref: m,
|
|
@@ -2265,17 +2279,17 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2265
2279
|
tabindex: "-1",
|
|
2266
2280
|
class: "bg-content1 fixed z-kun-popover rounded-kun-lg p-1 text-sm shadow-kun-md outline-none",
|
|
2267
2281
|
style: b(z.value),
|
|
2268
|
-
onClick: a[0] ||=
|
|
2269
|
-
onKeydown:
|
|
2282
|
+
onClick: a[0] ||= J(() => {}, ["stop"]),
|
|
2283
|
+
onKeydown: W
|
|
2270
2284
|
}, [(T(!0), l(t, null, k(e.items, (e, t) => (T(), s(j(e.href ? I(p).linkComponent : "button"), _({ key: e.key }, { ref_for: !0 }, V(e), {
|
|
2271
2285
|
role: "menuitem",
|
|
2272
2286
|
tabindex: t === h.value ? 0 : -1,
|
|
2273
2287
|
"aria-disabled": e.disabled || void 0,
|
|
2274
|
-
class:
|
|
2288
|
+
class: q(e),
|
|
2275
2289
|
onClick: (t) => H(t, e),
|
|
2276
2290
|
onMouseenter: (n) => !e.disabled && D(t)
|
|
2277
2291
|
}), {
|
|
2278
|
-
default:
|
|
2292
|
+
default: G(() => [e.icon ? (T(), s(Q, {
|
|
2279
2293
|
key: 0,
|
|
2280
2294
|
name: e.icon,
|
|
2281
2295
|
class: "shrink-0 text-base"
|
|
@@ -2291,49 +2305,49 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2291
2305
|
_: 1
|
|
2292
2306
|
})]));
|
|
2293
2307
|
}
|
|
2294
|
-
}), ni = "yyyy-MM-dd", ri = (e, t = ni) =>
|
|
2308
|
+
}), ni = "yyyy-MM-dd", ri = (e, t = ni) => Be(e, t), ii = (e) => {
|
|
2295
2309
|
if (!e) return null;
|
|
2296
|
-
if (e instanceof Date) return
|
|
2297
|
-
let t =
|
|
2298
|
-
return
|
|
2310
|
+
if (e instanceof Date) return Ke(e) ? e : null;
|
|
2311
|
+
let t = qe(e);
|
|
2312
|
+
return Ke(t) ? t : null;
|
|
2299
2313
|
}, ai = (e) => {
|
|
2300
2314
|
switch (e) {
|
|
2301
|
-
case "ja": return
|
|
2302
|
-
case "zh-CN": return
|
|
2303
|
-
default: return
|
|
2315
|
+
case "ja": return $e;
|
|
2316
|
+
case "zh-CN": return et;
|
|
2317
|
+
default: return Qe;
|
|
2304
2318
|
}
|
|
2305
2319
|
}, oi = (e) => {
|
|
2306
|
-
let t = O(ii(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : e.modelValue.value) ||
|
|
2320
|
+
let t = O(ii(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : e.modelValue.value) || Xe()), n = O(null), r = o(() => ai(typeof e.locale == "string" ? e.locale : e.locale?.value)), i = o(() => {
|
|
2307
2321
|
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;
|
|
2308
2322
|
return {
|
|
2309
|
-
weekdays: n || [...Array(7)].map((e, n) =>
|
|
2310
|
-
months: i || [...Array(12)].map((e, n) =>
|
|
2323
|
+
weekdays: n || [...Array(7)].map((e, n) => Be(new Date(2023, 0, n + 1), "EEEEEE", { locale: t })),
|
|
2324
|
+
months: i || [...Array(12)].map((e, n) => Be(new Date(2023, n, 1), "LLLL", { locale: t }))
|
|
2311
2325
|
};
|
|
2312
2326
|
}), a = (e) => {
|
|
2313
|
-
t.value =
|
|
2327
|
+
t.value = Fe(t.value, e);
|
|
2314
2328
|
}, s = (e) => {
|
|
2315
|
-
t.value =
|
|
2329
|
+
t.value = Ie(t.value, e);
|
|
2316
2330
|
}, c = o(() => {
|
|
2317
|
-
let n =
|
|
2318
|
-
start:
|
|
2319
|
-
end:
|
|
2320
|
-
}), a = ii(e.minDate?.value), o = ii(e.maxDate?.value), s =
|
|
2331
|
+
let n = Ye(t.value), r = Re(t.value), i = Le({
|
|
2332
|
+
start: Ze(n),
|
|
2333
|
+
end: ze(r)
|
|
2334
|
+
}), a = ii(e.minDate?.value), o = ii(e.maxDate?.value), s = Je(a || /* @__PURE__ */ new Date(0)), c = Je(o || /* @__PURE__ */ new Date(864e13)), l = Je(ii(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : e.modelValue.value) || /* @__PURE__ */ new Date(0)), u = Je(ii(Array.isArray(e.modelValue.value) ? e.modelValue.value[0] : null) || /* @__PURE__ */ new Date(0)), d = Je(ii(Array.isArray(e.modelValue.value) ? e.modelValue.value[1] : null) || /* @__PURE__ */ new Date(0));
|
|
2321
2335
|
return i.map((n) => {
|
|
2322
|
-
let r = e.mode.value === "single" ?
|
|
2336
|
+
let r = e.mode.value === "single" ? Ue(n, l) : Ue(n, u) || Ue(n, d), i = u && d && Ve(n, u) && He(n, d), a = e.isDateDisabled?.value ? e.isDateDisabled.value(n) : !1, o = He(n, s) || Ve(n, c) || a;
|
|
2323
2337
|
return {
|
|
2324
2338
|
date: n,
|
|
2325
2339
|
key: ri(n),
|
|
2326
2340
|
dayOfMonth: n.getDate(),
|
|
2327
|
-
isCurrentMonth:
|
|
2328
|
-
isToday:
|
|
2341
|
+
isCurrentMonth: We(n, t.value),
|
|
2342
|
+
isToday: Ge(n),
|
|
2329
2343
|
isSelected: r,
|
|
2330
|
-
isRangeStart:
|
|
2331
|
-
isRangeEnd:
|
|
2344
|
+
isRangeStart: Ue(n, u),
|
|
2345
|
+
isRangeEnd: Ue(n, d),
|
|
2332
2346
|
isInRange: i,
|
|
2333
2347
|
isDisabled: o
|
|
2334
2348
|
};
|
|
2335
2349
|
});
|
|
2336
|
-
}), l = (t) =>
|
|
2350
|
+
}), l = (t) => Be(t, (e.valueFormat && "value" in e.valueFormat ? e.valueFormat.value : e.valueFormat) || ni);
|
|
2337
2351
|
return {
|
|
2338
2352
|
viewingDate: t,
|
|
2339
2353
|
i18n: i,
|
|
@@ -2344,7 +2358,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2344
2358
|
if (e.mode.value === "single") return l(t);
|
|
2345
2359
|
if (!n.value || Array.isArray(e.modelValue.value) && e.modelValue.value[1]) return n.value = t, [l(t), null];
|
|
2346
2360
|
let r = n.value;
|
|
2347
|
-
return n.value = null, r ?
|
|
2361
|
+
return n.value = null, r ? He(t, r) ? [l(t), l(r)] : [l(r), l(t)] : [l(t), null];
|
|
2348
2362
|
},
|
|
2349
2363
|
formatDate: ri,
|
|
2350
2364
|
tempRangeStart: n
|
|
@@ -2400,20 +2414,20 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2400
2414
|
},
|
|
2401
2415
|
emits: ["update:modelValue"],
|
|
2402
2416
|
setup(e, { emit: r }) {
|
|
2403
|
-
let a = e, p =
|
|
2404
|
-
|
|
2417
|
+
let a = e, p = Tt(() => a.rounded), m = o(() => Z[p.value]), h = r, g = O(!1), _ = O(null), x = O(null), S = O(null);
|
|
2418
|
+
xe(_, (e) => {
|
|
2405
2419
|
x.value?.contains(e.target) || (g.value = !1);
|
|
2406
2420
|
});
|
|
2407
|
-
let { floatingStyles: C, placement: w } =
|
|
2421
|
+
let { floatingStyles: C, placement: w } = Pe(_, x, {
|
|
2408
2422
|
placement: "bottom-start",
|
|
2409
2423
|
open: g,
|
|
2410
|
-
whileElementsMounted:
|
|
2424
|
+
whileElementsMounted: ke,
|
|
2411
2425
|
transform: !1,
|
|
2412
2426
|
middleware: [
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2427
|
+
je(4),
|
|
2428
|
+
Ae(),
|
|
2429
|
+
Me({ padding: 8 }),
|
|
2430
|
+
Ne({
|
|
2417
2431
|
padding: 8,
|
|
2418
2432
|
apply({ availableHeight: e, elements: t }) {
|
|
2419
2433
|
Object.assign(t.floating.style, {
|
|
@@ -2423,7 +2437,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2423
2437
|
}
|
|
2424
2438
|
})
|
|
2425
2439
|
]
|
|
2426
|
-
}), E = nn(w), { modelValue: D, mode: A, minDate: j, maxDate: N, isDateDisabled: F, locale: L, weekdays: R, months: z, valueFormat: B } = P(a), { viewingDate: V, i18n: H, calendarGrid:
|
|
2440
|
+
}), E = nn(w), { modelValue: D, mode: A, minDate: j, maxDate: N, isDateDisabled: F, locale: L, weekdays: R, months: z, valueFormat: B } = P(a), { viewingDate: V, i18n: H, calendarGrid: W, navigateMonth: K, navigateYear: q, selectDate: ee, formatDate: te, tempRangeStart: ne } = oi({
|
|
2427
2441
|
modelValue: D,
|
|
2428
2442
|
mode: A,
|
|
2429
2443
|
minDate: j,
|
|
@@ -2433,44 +2447,44 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2433
2447
|
weekdays: R,
|
|
2434
2448
|
months: z,
|
|
2435
2449
|
valueFormat: B
|
|
2436
|
-
}),
|
|
2450
|
+
}), re = O(new Date(V.value));
|
|
2437
2451
|
U(V, (e) => {
|
|
2438
|
-
|
|
2452
|
+
re.value = new Date(e);
|
|
2439
2453
|
});
|
|
2440
|
-
let
|
|
2441
|
-
let t = new Date(
|
|
2442
|
-
t.setDate(t.getDate() + e),
|
|
2443
|
-
},
|
|
2454
|
+
let ie = (e) => {
|
|
2455
|
+
let t = new Date(re.value);
|
|
2456
|
+
t.setDate(t.getDate() + e), re.value = t, (t.getMonth() !== V.value.getMonth() || t.getFullYear() !== V.value.getFullYear()) && (V.value = new Date(t));
|
|
2457
|
+
}, ae = (e) => {
|
|
2444
2458
|
if (g.value) switch (e.key) {
|
|
2445
2459
|
case "ArrowLeft":
|
|
2446
|
-
e.preventDefault(),
|
|
2460
|
+
e.preventDefault(), ie(-1);
|
|
2447
2461
|
break;
|
|
2448
2462
|
case "ArrowRight":
|
|
2449
|
-
e.preventDefault(),
|
|
2463
|
+
e.preventDefault(), ie(1);
|
|
2450
2464
|
break;
|
|
2451
2465
|
case "ArrowUp":
|
|
2452
|
-
e.preventDefault(),
|
|
2466
|
+
e.preventDefault(), ie(-7);
|
|
2453
2467
|
break;
|
|
2454
2468
|
case "ArrowDown":
|
|
2455
|
-
e.preventDefault(),
|
|
2469
|
+
e.preventDefault(), ie(7);
|
|
2456
2470
|
break;
|
|
2457
2471
|
case "Enter":
|
|
2458
|
-
e.preventDefault(),
|
|
2472
|
+
e.preventDefault(), ce(re.value);
|
|
2459
2473
|
break;
|
|
2460
2474
|
case "Escape":
|
|
2461
2475
|
e.preventDefault(), g.value = !1;
|
|
2462
2476
|
break;
|
|
2463
2477
|
}
|
|
2464
|
-
},
|
|
2478
|
+
}, 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)}` : ""), se = () => {
|
|
2465
2479
|
a.disabled || (g.value = !g.value, g.value && v(() => _.value?.focus({ preventScroll: !0 })));
|
|
2466
|
-
},
|
|
2467
|
-
let t =
|
|
2480
|
+
}, ce = (e) => {
|
|
2481
|
+
let t = ee(e);
|
|
2468
2482
|
h("update:modelValue", t), (a.mode === "single" || Array.isArray(t) && t[1]) && (g.value = !1);
|
|
2469
|
-
},
|
|
2483
|
+
}, ue = () => {
|
|
2470
2484
|
h("update:modelValue", a.mode === "single" ? null : [null, null]);
|
|
2471
|
-
},
|
|
2472
|
-
if (!
|
|
2473
|
-
let t =
|
|
2485
|
+
}, de = (e) => {
|
|
2486
|
+
if (!ne.value || !S.value) return !1;
|
|
2487
|
+
let t = ne.value, n = S.value;
|
|
2474
2488
|
return !t || !n ? !1 : e > t && e < n || e < t && e > n;
|
|
2475
2489
|
};
|
|
2476
2490
|
return (r, o) => (T(), l("div", {
|
|
@@ -2478,23 +2492,23 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2478
2492
|
ref: _,
|
|
2479
2493
|
class: "relative w-full",
|
|
2480
2494
|
tabindex: "0",
|
|
2481
|
-
onKeydownCapture:
|
|
2495
|
+
onKeydownCapture: J(ae, ["prevent"])
|
|
2482
2496
|
}, [
|
|
2483
2497
|
e.label ? (T(), l("label", si, M(e.label), 1)) : c("", !0),
|
|
2484
2498
|
u("div", ci, [u("button", {
|
|
2485
2499
|
type: "button",
|
|
2486
2500
|
disabled: e.disabled,
|
|
2487
|
-
class: y(I(
|
|
2488
|
-
onClick:
|
|
2489
|
-
}, [u("span", { class: y(["block min-w-0 flex-1 truncate", { "text-default-400": !
|
|
2501
|
+
class: y(I(Y)("flex w-full cursor-pointer items-center justify-between gap-2 text-left transition-[color,box-shadow]", I(le)[a.size], m.value, "bg-content1 shadow-kun-sm border", e.error ? I(Y)("border-danger-300", I(X).danger) : I(Y)("border-kun", I(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60")),
|
|
2502
|
+
onClick: se
|
|
2503
|
+
}, [u("span", { class: y(["block min-w-0 flex-1 truncate", { "text-default-400": !oe.value }]) }, M(oe.value || e.placeholder), 3), u("div", ui, [e.clearable && oe.value ? (T(), l("button", {
|
|
2490
2504
|
key: 0,
|
|
2491
2505
|
class: "text-default-500 hover:text-default-800 mr-2 p-1",
|
|
2492
2506
|
"aria-label": "Clear date",
|
|
2493
|
-
onClick:
|
|
2494
|
-
}, [f(
|
|
2507
|
+
onClick: J(ue, ["stop"])
|
|
2508
|
+
}, [f(Q, {
|
|
2495
2509
|
name: "lucide:x",
|
|
2496
2510
|
class: "h-4 w-4"
|
|
2497
|
-
})])) : c("", !0), f(
|
|
2511
|
+
})])) : c("", !0), f(Q, {
|
|
2498
2512
|
name: "lucide:calendar",
|
|
2499
2513
|
class: "text-default-500"
|
|
2500
2514
|
})])], 10, li)]),
|
|
@@ -2506,11 +2520,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2506
2520
|
"leave-from-class": "opacity-100 scale-100",
|
|
2507
2521
|
"leave-to-class": "opacity-0 scale-95"
|
|
2508
2522
|
}, {
|
|
2509
|
-
default:
|
|
2523
|
+
default: G(() => [g.value ? (T(), l("div", {
|
|
2510
2524
|
key: 0,
|
|
2511
2525
|
ref_key: "dropdownRef",
|
|
2512
2526
|
ref: x,
|
|
2513
|
-
class: y(I(
|
|
2527
|
+
class: y(I(Y)("bg-content1 z-kun-popover p-3 shadow-kun-md", m.value)),
|
|
2514
2528
|
style: b([I(C), {
|
|
2515
2529
|
minWidth: "260px",
|
|
2516
2530
|
transformOrigin: I(E)
|
|
@@ -2524,18 +2538,18 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2524
2538
|
"is-icon-only": !0,
|
|
2525
2539
|
size: "sm",
|
|
2526
2540
|
"aria-label": "Previous year",
|
|
2527
|
-
onClick: o[0] ||= (e) => I(
|
|
2541
|
+
onClick: o[0] ||= (e) => I(q)(-1)
|
|
2528
2542
|
}, {
|
|
2529
|
-
default:
|
|
2543
|
+
default: G(() => [f(Q, { name: "lucide:chevrons-left" })]),
|
|
2530
2544
|
_: 1
|
|
2531
2545
|
}), f($, {
|
|
2532
2546
|
variant: "light",
|
|
2533
2547
|
"is-icon-only": !0,
|
|
2534
2548
|
size: "sm",
|
|
2535
2549
|
"aria-label": "Previous month",
|
|
2536
|
-
onClick: o[1] ||= (e) => I(
|
|
2550
|
+
onClick: o[1] ||= (e) => I(K)(-1)
|
|
2537
2551
|
}, {
|
|
2538
|
-
default:
|
|
2552
|
+
default: G(() => [f(Q, { name: "lucide:chevron-left" })]),
|
|
2539
2553
|
_: 1
|
|
2540
2554
|
})]),
|
|
2541
2555
|
u("div", pi, M(I(V).getFullYear()) + " / " + M(I(V).getMonth() + 1), 1),
|
|
@@ -2544,18 +2558,18 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2544
2558
|
"is-icon-only": !0,
|
|
2545
2559
|
size: "sm",
|
|
2546
2560
|
"aria-label": "Next month",
|
|
2547
|
-
onClick: o[2] ||= (e) => I(
|
|
2561
|
+
onClick: o[2] ||= (e) => I(K)(1)
|
|
2548
2562
|
}, {
|
|
2549
|
-
default:
|
|
2563
|
+
default: G(() => [f(Q, { name: "lucide:chevron-right" })]),
|
|
2550
2564
|
_: 1
|
|
2551
2565
|
}), f($, {
|
|
2552
2566
|
variant: "light",
|
|
2553
2567
|
"is-icon-only": !0,
|
|
2554
2568
|
size: "sm",
|
|
2555
2569
|
"aria-label": "Next year",
|
|
2556
|
-
onClick: o[3] ||= (e) => I(
|
|
2570
|
+
onClick: o[3] ||= (e) => I(q)(1)
|
|
2557
2571
|
}, {
|
|
2558
|
-
default:
|
|
2572
|
+
default: G(() => [f(Q, { name: "lucide:chevrons-right" })]),
|
|
2559
2573
|
_: 1
|
|
2560
2574
|
})])
|
|
2561
2575
|
]),
|
|
@@ -2563,41 +2577,41 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2563
2577
|
key: e,
|
|
2564
2578
|
class: "p-1 font-medium"
|
|
2565
2579
|
}, M(e), 1))), 128))]),
|
|
2566
|
-
u("div", gi, [(T(!0), l(t, null, k(I(
|
|
2580
|
+
u("div", gi, [(T(!0), l(t, null, k(I(W), (t) => (T(), l("div", {
|
|
2567
2581
|
key: t.key,
|
|
2568
2582
|
class: "p-0.5",
|
|
2569
2583
|
role: "gridcell"
|
|
2570
2584
|
}, [u("button", {
|
|
2571
2585
|
disabled: t.isDisabled,
|
|
2572
|
-
class: y(I(
|
|
2586
|
+
class: y(I(Y)(I(Y)("flex h-8 w-8 items-center justify-center rounded-full text-sm transition-colors", I(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")),
|
|
2573
2587
|
"aria-label": t.date.toDateString(),
|
|
2574
2588
|
"aria-selected": t.isSelected,
|
|
2575
|
-
tabindex: t.date.toDateString() ===
|
|
2576
|
-
onClick: (e) =>
|
|
2589
|
+
tabindex: t.date.toDateString() === re.value.toDateString() ? 0 : -1,
|
|
2590
|
+
onClick: (e) => ce(t.date),
|
|
2577
2591
|
onMouseenter: (e) => S.value = t.date,
|
|
2578
2592
|
onMouseleave: o[4] ||= (e) => S.value = null
|
|
2579
2593
|
}, M(t.dayOfMonth), 43, _i)]))), 128))]),
|
|
2580
2594
|
u("div", vi, [f($, {
|
|
2581
2595
|
size: "sm",
|
|
2582
2596
|
variant: "light",
|
|
2583
|
-
onClick: o[5] ||= (e) =>
|
|
2597
|
+
onClick: o[5] ||= (e) => ce(/* @__PURE__ */ new Date())
|
|
2584
2598
|
}, {
|
|
2585
|
-
default:
|
|
2599
|
+
default: G(() => [...o[7] ||= [d(" 今天 ", -1)]]),
|
|
2586
2600
|
_: 1
|
|
2587
2601
|
}), u("div", yi, [e.clearable ? (T(), s($, {
|
|
2588
2602
|
key: 0,
|
|
2589
2603
|
size: "sm",
|
|
2590
2604
|
variant: "light",
|
|
2591
|
-
onClick:
|
|
2605
|
+
onClick: ue
|
|
2592
2606
|
}, {
|
|
2593
|
-
default:
|
|
2607
|
+
default: G(() => [...o[8] ||= [d(" 清空 ", -1)]]),
|
|
2594
2608
|
_: 1
|
|
2595
2609
|
})) : c("", !0), f($, {
|
|
2596
2610
|
size: "sm",
|
|
2597
2611
|
variant: "light",
|
|
2598
2612
|
onClick: o[6] ||= (e) => g.value = !1
|
|
2599
2613
|
}, {
|
|
2600
|
-
default:
|
|
2614
|
+
default: G(() => [...o[9] ||= [d(" 关闭 ", -1)]]),
|
|
2601
2615
|
_: 1
|
|
2602
2616
|
})])])
|
|
2603
2617
|
], 6)) : c("", !0)]),
|
|
@@ -2632,7 +2646,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2632
2646
|
}
|
|
2633
2647
|
return o;
|
|
2634
2648
|
}, Di = async (e) => {
|
|
2635
|
-
let t =
|
|
2649
|
+
let t = ne(e);
|
|
2636
2650
|
try {
|
|
2637
2651
|
if (!navigator.clipboard) throw Error("Clipboard API unavailable");
|
|
2638
2652
|
return await navigator.clipboard.writeText(t), Ei(`${t} 复制成功`, "success"), !0;
|
|
@@ -2663,10 +2677,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2663
2677
|
color: n.value ? "success" : e.color,
|
|
2664
2678
|
size: e.size,
|
|
2665
2679
|
rounded: e.rounded,
|
|
2666
|
-
"class-name": I(
|
|
2680
|
+
"class-name": I(Y)("gap-2", e.className),
|
|
2667
2681
|
onClick: i
|
|
2668
2682
|
}, {
|
|
2669
|
-
default:
|
|
2683
|
+
default: G(() => [u("span", Oi, M(n.value ? e.copiedText : I(ne)(e.name ? e.name : e.text)), 1), f(Q, { name: n.value ? "lucide:check" : "lucide:copy" }, null, 8, ["name"])]),
|
|
2670
2684
|
_: 1
|
|
2671
2685
|
}, 8, [
|
|
2672
2686
|
"variant",
|
|
@@ -2700,7 +2714,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2700
2714
|
info: "border-info/20"
|
|
2701
2715
|
};
|
|
2702
2716
|
return (n, r) => (T(), l("div", {
|
|
2703
|
-
class: y(I(
|
|
2717
|
+
class: y(I(Y)("flex items-center", e.orientation === "horizontal" ? "w-full" : "h-full flex-col", e.className)),
|
|
2704
2718
|
role: "separator",
|
|
2705
2719
|
"aria-orientation": e.orientation === "vertical" ? "vertical" : void 0
|
|
2706
2720
|
}, [
|
|
@@ -2773,16 +2787,16 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2773
2787
|
t >= 0 && D(t);
|
|
2774
2788
|
}, H = (e) => {
|
|
2775
2789
|
e.disabled || (d("select", e), P(!0));
|
|
2776
|
-
}, U =
|
|
2790
|
+
}, U = ut(), W = (e) => e.href ? typeof U.linkComponent == "string" ? { href: e.href } : { to: e.href } : {
|
|
2777
2791
|
type: "button",
|
|
2778
2792
|
disabled: e.disabled
|
|
2779
|
-
},
|
|
2793
|
+
}, K = (e, t) => {
|
|
2780
2794
|
if (t.disabled) {
|
|
2781
2795
|
e.preventDefault();
|
|
2782
2796
|
return;
|
|
2783
2797
|
}
|
|
2784
2798
|
H(t);
|
|
2785
|
-
},
|
|
2799
|
+
}, q = (e) => {
|
|
2786
2800
|
if (!o.disabled) switch (e.key) {
|
|
2787
2801
|
case "ArrowDown":
|
|
2788
2802
|
case "Enter":
|
|
@@ -2793,7 +2807,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2793
2807
|
e.preventDefault(), N("last");
|
|
2794
2808
|
break;
|
|
2795
2809
|
}
|
|
2796
|
-
},
|
|
2810
|
+
}, J = (e) => {
|
|
2797
2811
|
switch (e.key) {
|
|
2798
2812
|
case "ArrowDown":
|
|
2799
2813
|
e.preventDefault(), L(1);
|
|
@@ -2826,12 +2840,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2826
2840
|
default: e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && (e.preventDefault(), V(e.key));
|
|
2827
2841
|
}
|
|
2828
2842
|
};
|
|
2829
|
-
|
|
2843
|
+
xe(h, (e) => {
|
|
2830
2844
|
g.value?.contains(e.target) || P();
|
|
2831
|
-
}),
|
|
2845
|
+
}), we("keydown", (e) => {
|
|
2832
2846
|
e.key === "Escape" && p.value && P(!0);
|
|
2833
2847
|
});
|
|
2834
|
-
let
|
|
2848
|
+
let ee = {
|
|
2835
2849
|
default: "focus:bg-default/20",
|
|
2836
2850
|
primary: "focus:bg-primary/20",
|
|
2837
2851
|
secondary: "focus:bg-secondary/20",
|
|
@@ -2839,7 +2853,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2839
2853
|
warning: "focus:bg-warning/20",
|
|
2840
2854
|
danger: "focus:bg-danger/20",
|
|
2841
2855
|
info: "focus:bg-info/20"
|
|
2842
|
-
},
|
|
2856
|
+
}, te = (e) => Y("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", ve("light", e.color || "default"), ee[e.color || "default"], e.disabled && "pointer-events-none cursor-not-allowed opacity-50");
|
|
2843
2857
|
return r({
|
|
2844
2858
|
open: () => N("none"),
|
|
2845
2859
|
close: () => P(),
|
|
@@ -2849,13 +2863,13 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2849
2863
|
ref: h,
|
|
2850
2864
|
role: "button",
|
|
2851
2865
|
tabindex: e.disabled ? -1 : 0,
|
|
2852
|
-
class: y(I(
|
|
2866
|
+
class: y(I(Y)("inline-flex cursor-pointer items-center", e.disabled && "cursor-not-allowed opacity-50", e.triggerClass)),
|
|
2853
2867
|
"aria-haspopup": "menu",
|
|
2854
2868
|
"aria-expanded": p.value,
|
|
2855
2869
|
"aria-disabled": e.disabled || void 0,
|
|
2856
2870
|
"aria-controls": p.value ? x : void 0,
|
|
2857
2871
|
onClick: a[0] ||= (t) => e.disabled || F(),
|
|
2858
|
-
onKeydown:
|
|
2872
|
+
onKeydown: q
|
|
2859
2873
|
}, [A(r.$slots, "trigger")], 42, Ni), (T(), s(n, { to: "body" }, [f(i, {
|
|
2860
2874
|
"enter-active-class": "transition duration-kun-base ease-kun-out",
|
|
2861
2875
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -2864,7 +2878,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2864
2878
|
"leave-from-class": "opacity-100 scale-100",
|
|
2865
2879
|
"leave-to-class": "opacity-0 scale-95"
|
|
2866
2880
|
}, {
|
|
2867
|
-
default:
|
|
2881
|
+
default: G(() => [p.value && e.items.length ? (T(), l("div", {
|
|
2868
2882
|
key: 0,
|
|
2869
2883
|
ref_key: "menuRef",
|
|
2870
2884
|
ref: g,
|
|
@@ -2872,21 +2886,21 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2872
2886
|
role: "menu",
|
|
2873
2887
|
"aria-orientation": "vertical",
|
|
2874
2888
|
tabindex: "-1",
|
|
2875
|
-
class: y(I(
|
|
2889
|
+
class: y(I(Y)("bg-content1 z-kun-popover rounded-kun-lg p-1 text-sm shadow-kun-md outline-none", e.menuClass)),
|
|
2876
2890
|
style: b([I(S), {
|
|
2877
2891
|
minWidth: `${e.minWidth}px`,
|
|
2878
2892
|
transformOrigin: I(C)
|
|
2879
2893
|
}]),
|
|
2880
|
-
onKeydown:
|
|
2881
|
-
}, [(T(!0), l(t, null, k(e.items, (e, t) => (T(), s(j(e.href ? I(U).linkComponent : "button"), _({ key: e.key }, { ref_for: !0 },
|
|
2894
|
+
onKeydown: J
|
|
2895
|
+
}, [(T(!0), l(t, null, k(e.items, (e, t) => (T(), s(j(e.href ? I(U).linkComponent : "button"), _({ key: e.key }, { ref_for: !0 }, W(e), {
|
|
2882
2896
|
role: "menuitem",
|
|
2883
2897
|
tabindex: t === m.value ? 0 : -1,
|
|
2884
2898
|
"aria-disabled": e.disabled || void 0,
|
|
2885
|
-
class:
|
|
2886
|
-
onClick: (t) =>
|
|
2899
|
+
class: te(e),
|
|
2900
|
+
onClick: (t) => K(t, e),
|
|
2887
2901
|
onMouseenter: (n) => !e.disabled && D(t)
|
|
2888
2902
|
}), {
|
|
2889
|
-
default:
|
|
2903
|
+
default: G(() => [e.icon ? (T(), s(Q, {
|
|
2890
2904
|
key: 0,
|
|
2891
2905
|
name: e.icon,
|
|
2892
2906
|
class: "shrink-0 text-base"
|
|
@@ -2911,7 +2925,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2911
2925
|
}, Vi = {
|
|
2912
2926
|
key: 3,
|
|
2913
2927
|
class: "border-kun border-t px-6 py-4"
|
|
2914
|
-
}, Hi = /*#__PURE__*/
|
|
2928
|
+
}, Hi = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
2915
2929
|
name: "KunDrawer",
|
|
2916
2930
|
__name: "Drawer",
|
|
2917
2931
|
props: /*@__PURE__*/ g({
|
|
@@ -2946,7 +2960,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2946
2960
|
}),
|
|
2947
2961
|
emits: /*@__PURE__*/ g(["close"], ["update:modelValue"]),
|
|
2948
2962
|
setup(e, { emit: t }) {
|
|
2949
|
-
let r = e, a =
|
|
2963
|
+
let r = e, a = Te("(max-width: 47.99rem)"), d = o(() => r.responsive && a.value ? "bottom" : r.placement), p = Tt(() => r.rounded), m = o(() => Z[p.value]), h = z(e, "modelValue"), g = t, _ = at("kun-drawer"), x = o(() => `${_.value}-title`), C = {
|
|
2950
2964
|
sm: "w-80",
|
|
2951
2965
|
md: "w-96",
|
|
2952
2966
|
lg: "w-[32rem]",
|
|
@@ -2978,35 +2992,35 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2978
2992
|
].filter(Boolean).join(" ");
|
|
2979
2993
|
}), N = o(() => `kun-drawer-${d.value}`), { lock: P, unlock: F } = Ft(), L = !1, R = (e) => {
|
|
2980
2994
|
e && !L ? (P(), L = !0) : !e && L && (F(), L = !1);
|
|
2981
|
-
}, { zIndex: B, claim: V, release: H, isTopmost:
|
|
2982
|
-
e && !
|
|
2983
|
-
}, { activate:
|
|
2984
|
-
e && !
|
|
2985
|
-
},
|
|
2995
|
+
}, { zIndex: B, claim: V, release: H, isTopmost: W } = Vt(), K = !1, q = (e) => {
|
|
2996
|
+
e && !K ? (V(), K = !0) : !e && K && (H(), K = !1);
|
|
2997
|
+
}, { activate: ee, deactivate: te } = Kt(), ne = !1, re = (e) => {
|
|
2998
|
+
e && !ne ? (ee(), ne = !0) : !e && ne && (te(), ne = !1);
|
|
2999
|
+
}, ie = O(null), { activate: ae, deactivate: oe } = De(ie, {
|
|
2986
3000
|
immediate: !1,
|
|
2987
3001
|
escapeDeactivates: !1,
|
|
2988
3002
|
allowOutsideClick: !0,
|
|
2989
3003
|
returnFocusOnDeactivate: !0
|
|
2990
|
-
}),
|
|
3004
|
+
}), se = () => {
|
|
2991
3005
|
r.isDismissable && (h.value = !1, g("close"));
|
|
2992
|
-
},
|
|
3006
|
+
}, ce = () => {
|
|
2993
3007
|
h.value = !1, g("close");
|
|
2994
3008
|
};
|
|
2995
|
-
return
|
|
2996
|
-
e.key === "Escape" && h.value &&
|
|
3009
|
+
return we("keydown", (e) => {
|
|
3010
|
+
e.key === "Escape" && h.value && W.value && se();
|
|
2997
3011
|
}), U(h, async (e) => {
|
|
2998
|
-
R(e),
|
|
3012
|
+
R(e), q(e), e ? (await v(), ae(), re(!0)) : (re(!1), oe());
|
|
2999
3013
|
}), S(async () => {
|
|
3000
|
-
h.value && (R(!0),
|
|
3014
|
+
h.value && (R(!0), q(!0), await v(), ae(), re(!0));
|
|
3001
3015
|
}), w(() => {
|
|
3002
|
-
R(!1),
|
|
3016
|
+
R(!1), q(!1), re(!1), oe();
|
|
3003
3017
|
}), (t, r) => (T(), s(n, { to: "body" }, [f(i, { name: N.value }, {
|
|
3004
|
-
default:
|
|
3018
|
+
default: G(() => [h.value ? (T(), l("div", {
|
|
3005
3019
|
key: 0,
|
|
3006
3020
|
ref_key: "trapEl",
|
|
3007
|
-
ref:
|
|
3021
|
+
ref: ie,
|
|
3008
3022
|
"data-kun-overlay": "",
|
|
3009
|
-
class: y(I(
|
|
3023
|
+
class: y(I(Y)("z-kun-modal fixed inset-0", e.className)),
|
|
3010
3024
|
style: b({ zIndex: I(B) }),
|
|
3011
3025
|
role: "dialog",
|
|
3012
3026
|
"aria-modal": "true",
|
|
@@ -3014,10 +3028,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3014
3028
|
tabindex: "0"
|
|
3015
3029
|
}, [u("div", {
|
|
3016
3030
|
class: "bg-default-800/70 dark:bg-background/70 absolute inset-0 transition-opacity",
|
|
3017
|
-
onClick:
|
|
3031
|
+
onClick: se
|
|
3018
3032
|
}), u("div", {
|
|
3019
|
-
class: y(I(
|
|
3020
|
-
onClick: r[0] ||=
|
|
3033
|
+
class: y(I(Y)("bg-content1 flex flex-col shadow-kun-lg", j.value, e.innerClassName, e.size === "full" ? m.value : "")),
|
|
3034
|
+
onClick: r[0] ||= J(() => {}, ["stop"])
|
|
3021
3035
|
}, [
|
|
3022
3036
|
e.title || t.$slots.header || e.isShowCloseButton ? (T(), l("header", Li, [u("div", Ri, [e.title ? (T(), l("h2", {
|
|
3023
3037
|
key: 0,
|
|
@@ -3032,9 +3046,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3032
3046
|
"is-icon-only": !0,
|
|
3033
3047
|
"aria-label": "关闭抽屉",
|
|
3034
3048
|
"class-name": "shrink-0",
|
|
3035
|
-
onClick:
|
|
3049
|
+
onClick: ce
|
|
3036
3050
|
}, {
|
|
3037
|
-
default:
|
|
3051
|
+
default: G(() => [f(Q, { name: "lucide:x" })]),
|
|
3038
3052
|
_: 1
|
|
3039
3053
|
})) : c("", !0)])) : c("", !0),
|
|
3040
3054
|
e.withContainer ? (T(), l("div", Bi, [A(t.$slots, "default", {}, void 0, !0)])) : A(t.$slots, "default", { key: 2 }, void 0, !0),
|
|
@@ -3046,7 +3060,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3046
3060
|
}), [["__scopeId", "data-v-2c7f907c"]]), Ui = {
|
|
3047
3061
|
key: 0,
|
|
3048
3062
|
class: "grid grid-rows-[1fr] opacity-100"
|
|
3049
|
-
}, Wi = { class: "min-h-0 overflow-hidden" }, Gi = /*#__PURE__*/
|
|
3063
|
+
}, Wi = { class: "min-h-0 overflow-hidden" }, Gi = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3050
3064
|
name: "KunFadeCard",
|
|
3051
3065
|
__name: "FadeCard",
|
|
3052
3066
|
setup(n) {
|
|
@@ -3059,7 +3073,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3059
3073
|
"enter-from-class": "kun-fade-collapsed",
|
|
3060
3074
|
"leave-to-class": "kun-fade-collapsed"
|
|
3061
3075
|
}, {
|
|
3062
|
-
default:
|
|
3076
|
+
default: G(() => [p.value && f.value ? (T(), l("div", Ui, [u("div", Wi, [A(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
|
|
3063
3077
|
_: 3
|
|
3064
3078
|
}));
|
|
3065
3079
|
}
|
|
@@ -3152,7 +3166,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3152
3166
|
}), _ = () => {
|
|
3153
3167
|
n.disabled || m();
|
|
3154
3168
|
};
|
|
3155
|
-
return (t, n) => (T(), l("div", { class: y(I(
|
|
3169
|
+
return (t, n) => (T(), l("div", { class: y(I(Y)("flex flex-col gap-1", e.className)) }, [
|
|
3156
3170
|
u("div", Ji, [A(t.$slots, "default", {
|
|
3157
3171
|
pick: _,
|
|
3158
3172
|
disabled: e.disabled,
|
|
@@ -3166,7 +3180,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3166
3180
|
type: "button",
|
|
3167
3181
|
onClick: _
|
|
3168
3182
|
}, {
|
|
3169
|
-
default:
|
|
3183
|
+
default: G(() => [e.triggerIcon ? (T(), s(Q, {
|
|
3170
3184
|
key: 0,
|
|
3171
3185
|
name: e.triggerIcon,
|
|
3172
3186
|
class: "mr-1 size-4"
|
|
@@ -3195,7 +3209,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3195
3209
|
scale: { default: "h1" }
|
|
3196
3210
|
},
|
|
3197
3211
|
setup(e) {
|
|
3198
|
-
let t = e, n = o(() =>
|
|
3212
|
+
let t = e, n = o(() => Y("font-medium", {
|
|
3199
3213
|
h1: "text-2xl sm:text-3xl",
|
|
3200
3214
|
h2: "text-xl sm:text-2xl",
|
|
3201
3215
|
h3: "text-lg sm:text-xl"
|
|
@@ -3205,7 +3219,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3205
3219
|
title: e.name,
|
|
3206
3220
|
class: y(n.value)
|
|
3207
3221
|
}, {
|
|
3208
|
-
default:
|
|
3222
|
+
default: G(() => [e.name ? (T(), l("span", na, M(e.name), 1)) : c("", !0), A(t.$slots, "title")]),
|
|
3209
3223
|
_: 3
|
|
3210
3224
|
}, 8, ["title", "class"])),
|
|
3211
3225
|
e.description ? (T(), l("p", ra, M(e.description), 1)) : c("", !0),
|
|
@@ -3233,7 +3247,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3233
3247
|
},
|
|
3234
3248
|
setup(e) {
|
|
3235
3249
|
return (t, n) => (T(), l("img", {
|
|
3236
|
-
class: y(I(
|
|
3250
|
+
class: y(I(Y)(e.className)),
|
|
3237
3251
|
src: e.src,
|
|
3238
3252
|
alt: e.alt,
|
|
3239
3253
|
loading: e.loading,
|
|
@@ -3258,7 +3272,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3258
3272
|
rounded: { default: void 0 }
|
|
3259
3273
|
},
|
|
3260
3274
|
setup(e) {
|
|
3261
|
-
let t = e, n =
|
|
3275
|
+
let t = e, n = Tt(() => t.rounded), r = o(() => Z[n.value]), i = o(() => {
|
|
3262
3276
|
switch (t.variant) {
|
|
3263
3277
|
case "solid":
|
|
3264
3278
|
case "shadow": return "border-[1.5px] border-transparent";
|
|
@@ -3303,7 +3317,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3303
3317
|
warning: "shadow-lg shadow-warning/40",
|
|
3304
3318
|
danger: "shadow-lg shadow-danger/40",
|
|
3305
3319
|
info: "shadow-lg shadow-info/40"
|
|
3306
|
-
}, f = o(() => t.variant === "solid" ?
|
|
3320
|
+
}, f = o(() => t.variant === "solid" ? he[t.color] : t.variant === "shadow" ? Y(d[t.color], he[t.color]) : a[t.variant]?.[t.color] || ""), p = o(() => {
|
|
3307
3321
|
if (t.variant === "solid" || t.variant === "shadow") return "";
|
|
3308
3322
|
switch (t.color) {
|
|
3309
3323
|
case "primary": return "text-primary-900";
|
|
@@ -3315,8 +3329,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3315
3329
|
default: return "text-default-900";
|
|
3316
3330
|
}
|
|
3317
3331
|
});
|
|
3318
|
-
return (t, n) => (T(), l("div", { class: y(I(
|
|
3319
|
-
e.icon ? (T(), s(
|
|
3332
|
+
return (t, n) => (T(), l("div", { class: y(I(Y)("space-y-2 p-4", r.value, i.value, f.value, e.className)) }, [u("h3", { class: y(I(Y)("flex items-center gap-2 font-medium", p.value)) }, [
|
|
3333
|
+
e.icon ? (T(), s(Q, {
|
|
3320
3334
|
key: 0,
|
|
3321
3335
|
name: e.icon,
|
|
3322
3336
|
"class-name": "h-5 w-5 flex-shrink-0"
|
|
@@ -3401,7 +3415,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3401
3415
|
"pr-10",
|
|
3402
3416
|
"pr-[4.5rem]",
|
|
3403
3417
|
"pr-28"
|
|
3404
|
-
][Math.min(x.value, 3)]), w =
|
|
3418
|
+
][Math.min(x.value, 3)]), w = Tt(() => r.rounded), E = o(() => Z[w.value]), D = z(e, "modelValue"), k = n, j = O(null), N = O(!1), P = at("kun-input"), F = o(() => le[r.size]), L = (e) => {
|
|
3405
3419
|
D.value = e.target.value;
|
|
3406
3420
|
}, R = (e) => {
|
|
3407
3421
|
N.value = !1, k("blur", e);
|
|
@@ -3446,7 +3460,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3446
3460
|
required: e.required,
|
|
3447
3461
|
"aria-invalid": s.value || void 0,
|
|
3448
3462
|
"aria-describedby": a.value || e.error ? `${I(P)}-desc` : void 0,
|
|
3449
|
-
class: I(
|
|
3463
|
+
class: I(Y)("block w-full bg-content1 shadow-kun-sm border transition-[color,box-shadow] duration-kun-fast ease-kun-standard", E.value, F.value, t.$slots.prefix && "pl-10", C.value, e.disabled && "cursor-not-allowed opacity-60", s.value ? I(Y)("border-danger-300", I(X).danger) : I(Y)("border-kun", I(X)[e.color]), e.className),
|
|
3450
3464
|
onInput: L,
|
|
3451
3465
|
onBlur: R,
|
|
3452
3466
|
onFocus: V
|
|
@@ -3461,7 +3475,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3461
3475
|
class: "text-default-400 hover:text-default-600 flex items-center",
|
|
3462
3476
|
"aria-label": "清除",
|
|
3463
3477
|
onClick: H
|
|
3464
|
-
}, [f(
|
|
3478
|
+
}, [f(Q, {
|
|
3465
3479
|
name: "lucide:circle-x",
|
|
3466
3480
|
class: "size-4"
|
|
3467
3481
|
})])) : c("", !0),
|
|
@@ -3473,7 +3487,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3473
3487
|
"aria-label": m.value ? "隐藏密码" : "显示密码",
|
|
3474
3488
|
"aria-pressed": m.value,
|
|
3475
3489
|
onClick: n[0] ||= (e) => m.value = !m.value
|
|
3476
|
-
}, [f(
|
|
3490
|
+
}, [f(Q, {
|
|
3477
3491
|
name: m.value ? "lucide:eye-off" : "lucide:eye",
|
|
3478
3492
|
class: "size-4"
|
|
3479
3493
|
}, null, 8, ["name"])], 8, va)) : c("", !0)
|
|
@@ -3535,7 +3549,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3535
3549
|
src: t.src,
|
|
3536
3550
|
alt: t.alt
|
|
3537
3551
|
});
|
|
3538
|
-
|
|
3552
|
+
W(() => {
|
|
3539
3553
|
r.src = t.src, r.alt = t.alt;
|
|
3540
3554
|
}), w(n.register(r));
|
|
3541
3555
|
let i = () => n.open(r), a = (e) => {
|
|
@@ -3550,7 +3564,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3550
3564
|
onClick: i,
|
|
3551
3565
|
onKeydown: a
|
|
3552
3566
|
}, {
|
|
3553
|
-
default:
|
|
3567
|
+
default: G(() => [A(t.$slots, "default", { open: i })]),
|
|
3554
3568
|
_: 3
|
|
3555
3569
|
}, 40, ["aria-label"])) : A(t.$slots, "default", {
|
|
3556
3570
|
key: 1,
|
|
@@ -3576,7 +3590,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3576
3590
|
}
|
|
3577
3591
|
},
|
|
3578
3592
|
setup(e) {
|
|
3579
|
-
let t = e, n =
|
|
3593
|
+
let t = e, n = ut(), r = o(() => {
|
|
3580
3594
|
switch (t.underline) {
|
|
3581
3595
|
case "none": return "";
|
|
3582
3596
|
case "hover": return "hover:underline underline-offset-3";
|
|
@@ -3609,11 +3623,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3609
3623
|
return (t, a) => (T(), s(j(I(n).linkComponent), _({
|
|
3610
3624
|
...u.value,
|
|
3611
3625
|
...t.$attrs
|
|
3612
|
-
}, { class: I(
|
|
3613
|
-
default:
|
|
3626
|
+
}, { class: I(Y)("inline-flex items-center gap-2 break-all", r.value, i.value, I(_e)[e.color], e.className) }), {
|
|
3627
|
+
default: G(() => [
|
|
3614
3628
|
A(t.$slots, "prefix"),
|
|
3615
3629
|
A(t.$slots, "default"),
|
|
3616
|
-
e.isShowAnchorIcon ? (T(), s(
|
|
3630
|
+
e.isShowAnchorIcon ? (T(), s(Q, {
|
|
3617
3631
|
key: 0,
|
|
3618
3632
|
name: "lucide:external-link"
|
|
3619
3633
|
})) : c("", !0),
|
|
@@ -3640,7 +3654,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3640
3654
|
image: "data:image/webp;base64,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"
|
|
3641
3655
|
}
|
|
3642
3656
|
], Oa = () => {
|
|
3643
|
-
let e = Da[
|
|
3657
|
+
let e = Da[ye(0, Da.length - 1)] ?? Da[0];
|
|
3644
3658
|
return {
|
|
3645
3659
|
name: e.name,
|
|
3646
3660
|
loli: e.image
|
|
@@ -3648,7 +3662,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3648
3662
|
}, ka = {
|
|
3649
3663
|
key: 0,
|
|
3650
3664
|
class: "bg-background z-kun-message fixed right-0 bottom-0 left-0 min-h-30 w-full border-t"
|
|
3651
|
-
}, Aa = { class: "loli absolute -top-10 pl-24 text-lg sm:pl-32" }, ja = { class: "bg-background px-10 py-1 text-center text-lg sm:text-2xl" }, Ma = { class: "pointer-events-none absolute mt-2 ml-6 select-none" }, Na = { class: "info mt-4 mr-8 ml-24 text-base sm:ml-32 sm:text-lg" }, Pa = /*#__PURE__*/
|
|
3665
|
+
}, Aa = { class: "loli absolute -top-10 pl-24 text-lg sm:pl-32" }, ja = { class: "bg-background px-10 py-1 text-center text-lg sm:text-2xl" }, Ma = { class: "pointer-events-none absolute mt-2 ml-6 select-none" }, Na = { class: "info mt-4 mr-8 ml-24 text-base sm:ml-32 sm:text-lg" }, Pa = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3652
3666
|
name: "KunLoli",
|
|
3653
3667
|
__name: "Loli",
|
|
3654
3668
|
props: {
|
|
@@ -3672,12 +3686,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3672
3686
|
"enter-active-class": "animate-fadeInUp",
|
|
3673
3687
|
"leave-active-class": "animate-fadeOutDown"
|
|
3674
3688
|
}, {
|
|
3675
|
-
default:
|
|
3689
|
+
default: G(() => [a.value ? (T(), l("div", ka, [
|
|
3676
3690
|
f(i, {
|
|
3677
3691
|
"enter-active-class": "animate-swing",
|
|
3678
3692
|
appear: ""
|
|
3679
3693
|
}, {
|
|
3680
|
-
default:
|
|
3694
|
+
default: G(() => [u("div", Aa, [u("span", ja, M(I(r)), 1)])]),
|
|
3681
3695
|
_: 1
|
|
3682
3696
|
}),
|
|
3683
3697
|
u("div", Ma, [f(yn, {
|
|
@@ -3688,7 +3702,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3688
3702
|
"enter-active-class": "animate-bounceInRight",
|
|
3689
3703
|
appear: ""
|
|
3690
3704
|
}, {
|
|
3691
|
-
default:
|
|
3705
|
+
default: G(() => [u("div", Na, M(`「 ${e.message} 」`), 1)]),
|
|
3692
3706
|
_: 1
|
|
3693
3707
|
}),
|
|
3694
3708
|
u("button", {
|
|
@@ -3696,7 +3710,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3696
3710
|
"aria-label": "关闭",
|
|
3697
3711
|
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]",
|
|
3698
3712
|
onClick: p
|
|
3699
|
-
}, [f(
|
|
3713
|
+
}, [f(Q, {
|
|
3700
3714
|
name: "lucide:x",
|
|
3701
3715
|
class: "h-4 w-4"
|
|
3702
3716
|
})]),
|
|
@@ -3742,7 +3756,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3742
3756
|
role: "status",
|
|
3743
3757
|
"aria-live": "polite",
|
|
3744
3758
|
"aria-busy": !0
|
|
3745
|
-
}, qa = /*#__PURE__*/
|
|
3759
|
+
}, qa = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3746
3760
|
name: "KunLoading",
|
|
3747
3761
|
__name: "Loading",
|
|
3748
3762
|
props: {
|
|
@@ -3766,22 +3780,22 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3766
3780
|
lg: "size-10",
|
|
3767
3781
|
xl: "size-12"
|
|
3768
3782
|
};
|
|
3769
|
-
return (t, a) => (T(), l("div", Ha, [n.value ? (T(), l("div", Ua, [u("div", { class: y(I(
|
|
3783
|
+
return (t, a) => (T(), l("div", Ha, [n.value ? (T(), l("div", Ua, [u("div", { class: y(I(Y)("transition-opacity", e.loading && "opacity-50")) }, [A(t.$slots, "default", {}, void 0, !0)], 2), f(i, {
|
|
3770
3784
|
"enter-active-class": "transition-opacity duration-kun-slow",
|
|
3771
3785
|
"enter-from-class": "opacity-0",
|
|
3772
3786
|
"leave-active-class": "transition-opacity duration-kun-slow",
|
|
3773
3787
|
"leave-from-class": "opacity-0"
|
|
3774
3788
|
}, {
|
|
3775
|
-
default:
|
|
3789
|
+
default: G(() => [e.loading ? (T(), l("div", {
|
|
3776
3790
|
key: 0,
|
|
3777
3791
|
class: "bg-background/50 absolute inset-0 z-50 flex items-center justify-center rounded-kun-md",
|
|
3778
3792
|
role: "status",
|
|
3779
3793
|
"aria-live": "polite",
|
|
3780
3794
|
"aria-busy": e.loading
|
|
3781
|
-
}, [u("div", Ga, [e.spinner ? (T(), s(
|
|
3795
|
+
}, [u("div", Ga, [e.spinner ? (T(), s(Q, {
|
|
3782
3796
|
key: 0,
|
|
3783
3797
|
name: "svg-spinners:90-ring-with-bg",
|
|
3784
|
-
class: y(I(
|
|
3798
|
+
class: y(I(Y)("text-primary", r[e.size])),
|
|
3785
3799
|
"aria-hidden": "true"
|
|
3786
3800
|
}, null, 8, ["class"])) : (T(), s(oa, {
|
|
3787
3801
|
key: 1,
|
|
@@ -3791,10 +3805,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3791
3805
|
"class-name": "w-80 h-auto rounded-kun-md"
|
|
3792
3806
|
}, null, 8, ["src"])), u("span", { class: y(e.spinner ? "text-default-600 text-sm" : "info text-xl") }, M(e.description), 3)])], 8, Wa)) : c("", !0)]),
|
|
3793
3807
|
_: 1
|
|
3794
|
-
})])) : (T(), l("div", Ka, [e.spinner ? (T(), s(
|
|
3808
|
+
})])) : (T(), l("div", Ka, [e.spinner ? (T(), s(Q, {
|
|
3795
3809
|
key: 0,
|
|
3796
3810
|
name: "svg-spinners:90-ring-with-bg",
|
|
3797
|
-
class: y(I(
|
|
3811
|
+
class: y(I(Y)("text-primary", r[e.size])),
|
|
3798
3812
|
"aria-hidden": "true"
|
|
3799
3813
|
}, null, 8, ["class"])) : (T(), s(oa, {
|
|
3800
3814
|
key: 1,
|
|
@@ -3825,7 +3839,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3825
3839
|
}), Ya = ["role", "aria-live"], Xa = { class: "flex-1 text-sm font-medium" }, Za = { key: 0 }, Qa = ["innerHTML"], $a = {
|
|
3826
3840
|
key: 0,
|
|
3827
3841
|
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"
|
|
3828
|
-
}, eo = 80, to = /*#__PURE__*/
|
|
3842
|
+
}, eo = 80, to = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3829
3843
|
name: "KunMessageItem",
|
|
3830
3844
|
__name: "MessageItem",
|
|
3831
3845
|
props: {
|
|
@@ -3897,7 +3911,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3897
3911
|
role: d.value ? "alert" : "status",
|
|
3898
3912
|
"aria-live": d.value ? "assertive" : "polite",
|
|
3899
3913
|
"aria-atomic": "true",
|
|
3900
|
-
class: y(I(
|
|
3914
|
+
class: y(I(Y)("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", j.value.bg, j.value.text)),
|
|
3901
3915
|
style: b(g.value),
|
|
3902
3916
|
onMouseenter: k,
|
|
3903
3917
|
onMouseleave: A,
|
|
@@ -3906,9 +3920,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3906
3920
|
onPointerup: x,
|
|
3907
3921
|
onPointercancel: x
|
|
3908
3922
|
}, [
|
|
3909
|
-
f(
|
|
3923
|
+
f(Q, {
|
|
3910
3924
|
name: j.value.iconName,
|
|
3911
|
-
class: y(I(
|
|
3925
|
+
class: y(I(Y)("mt-0.5 mr-3 h-6 w-6 flex-shrink-0", j.value.icon))
|
|
3912
3926
|
}, null, 8, ["name", "class"]),
|
|
3913
3927
|
u("div", Xa, [i.value ? (T(), l("div", {
|
|
3914
3928
|
key: 1,
|
|
@@ -3921,7 +3935,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3921
3935
|
"aria-label": "关闭",
|
|
3922
3936
|
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",
|
|
3923
3937
|
onClick: n[0] ||= (t) => r("remove", e.id)
|
|
3924
|
-
}, [f(
|
|
3938
|
+
}, [f(Q, {
|
|
3925
3939
|
name: "lucide:x",
|
|
3926
3940
|
class: "size-4"
|
|
3927
3941
|
})]),
|
|
@@ -3933,7 +3947,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3933
3947
|
}, null, 2))
|
|
3934
3948
|
], 46, Ya));
|
|
3935
3949
|
}
|
|
3936
|
-
}), [["__scopeId", "data-v-a80e8a61"]]), no = /*#__PURE__*/
|
|
3950
|
+
}), [["__scopeId", "data-v-a80e8a61"]]), no = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3937
3951
|
name: "KunMessageProvider",
|
|
3938
3952
|
__name: "MessageProvider",
|
|
3939
3953
|
setup(e) {
|
|
@@ -3966,7 +3980,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3966
3980
|
tag: "div",
|
|
3967
3981
|
class: "w-full"
|
|
3968
3982
|
}, {
|
|
3969
|
-
default:
|
|
3983
|
+
default: G(() => [(T(!0), l(t, null, k(e, (e) => (T(), s(to, _({ key: e.id }, { ref_for: !0 }, e, {
|
|
3970
3984
|
class: "pointer-events-auto",
|
|
3971
3985
|
onRemove: I(i)
|
|
3972
3986
|
}), null, 16, ["onRemove"]))), 128))]),
|
|
@@ -4061,7 +4075,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4061
4075
|
}),
|
|
4062
4076
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
4063
4077
|
setup(e, { expose: t, emit: n }) {
|
|
4064
|
-
let r = e, i = z(e, "modelValue"), a = n, s =
|
|
4078
|
+
let r = e, i = z(e, "modelValue"), a = n, s = Tt(() => r.rounded), p = o(() => Z[s.value]), m = at("kun-number"), h = o(() => !!r.error || r.isInvalid), g = {
|
|
4065
4079
|
xs: {
|
|
4066
4080
|
text: "text-xs",
|
|
4067
4081
|
py: "py-1",
|
|
@@ -4137,16 +4151,16 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4137
4151
|
for: I(m),
|
|
4138
4152
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
4139
4153
|
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span", lo, "*")) : c("", !0)], 8, co)) : c("", !0),
|
|
4140
|
-
u("div", { class: y(I(
|
|
4154
|
+
u("div", { class: y(I(Y)("bg-content1 shadow-kun-sm border flex w-full items-stretch overflow-hidden transition-[color,box-shadow]", p.value, v.value.text, h.value ? I(Y)("border-danger-300", I(de).danger) : I(Y)("border-kun", I(de)[e.color]), e.disabled && "cursor-not-allowed opacity-60")) }, [
|
|
4141
4155
|
e.controls ? (T(), l("button", {
|
|
4142
4156
|
key: 0,
|
|
4143
4157
|
type: "button",
|
|
4144
4158
|
tabindex: "-1",
|
|
4145
4159
|
disabled: !N.value,
|
|
4146
|
-
class: y(I(
|
|
4160
|
+
class: y(I(Y)("text-default-600 hover:bg-foreground/8 flex items-center disabled:cursor-not-allowed disabled:opacity-50", v.value.btn)),
|
|
4147
4161
|
"aria-label": "减少",
|
|
4148
4162
|
onClick: n[0] ||= (e) => j(-1)
|
|
4149
|
-
}, [f(
|
|
4163
|
+
}, [f(Q, {
|
|
4150
4164
|
name: "lucide:minus",
|
|
4151
4165
|
class: "size-4"
|
|
4152
4166
|
})], 10, uo)) : c("", !0),
|
|
@@ -4168,7 +4182,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4168
4182
|
disabled: e.disabled,
|
|
4169
4183
|
readonly: e.readonly,
|
|
4170
4184
|
required: e.required,
|
|
4171
|
-
class: I(
|
|
4185
|
+
class: I(Y)("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"),
|
|
4172
4186
|
onInput: k,
|
|
4173
4187
|
onFocus: n[1] ||= (e) => x.value = !0,
|
|
4174
4188
|
onBlur: A,
|
|
@@ -4179,10 +4193,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4179
4193
|
type: "button",
|
|
4180
4194
|
tabindex: "-1",
|
|
4181
4195
|
disabled: !P.value,
|
|
4182
|
-
class: y(I(
|
|
4196
|
+
class: y(I(Y)("text-default-600 hover:bg-foreground/8 flex items-center disabled:cursor-not-allowed disabled:opacity-50", v.value.btn)),
|
|
4183
4197
|
"aria-label": "增加",
|
|
4184
4198
|
onClick: n[2] ||= (e) => j(1)
|
|
4185
|
-
}, [f(
|
|
4199
|
+
}, [f(Q, {
|
|
4186
4200
|
name: "lucide:plus",
|
|
4187
4201
|
class: "size-4"
|
|
4188
4202
|
})], 10, po)) : c("", !0)
|
|
@@ -4217,7 +4231,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4217
4231
|
},
|
|
4218
4232
|
emits: ["update:currentPage"],
|
|
4219
4233
|
setup(e, { emit: n }) {
|
|
4220
|
-
let r = e, i = n, a = O(""), c =
|
|
4234
|
+
let r = e, i = n, a = O(""), c = at("kun-pagination"), p = o(() => {
|
|
4221
4235
|
let e = [];
|
|
4222
4236
|
if (r.totalPage <= 7) return Array.from({ length: r.totalPage }, (e, t) => t + 1);
|
|
4223
4237
|
e.push(1), r.currentPage > 3 && e.push("...");
|
|
@@ -4251,9 +4265,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4251
4265
|
let r = t.getAttribute("role");
|
|
4252
4266
|
return !!r && g.has(r);
|
|
4253
4267
|
};
|
|
4254
|
-
return
|
|
4268
|
+
return Se("ArrowLeft", (e) => {
|
|
4255
4269
|
_(e) || r.currentPage > 1 && m(r.currentPage - 1);
|
|
4256
|
-
}),
|
|
4270
|
+
}), Se("ArrowRight", (e) => {
|
|
4257
4271
|
_(e) || r.currentPage < r.totalPage && m(r.currentPage + 1);
|
|
4258
4272
|
}), (n, r) => (T(), l("nav", vo, [u("div", yo, [u("div", bo, [
|
|
4259
4273
|
f($, {
|
|
@@ -4266,7 +4280,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4266
4280
|
class: y({ "cursor-not-allowed opacity-50": e.isLoading || e.currentPage === 1 }),
|
|
4267
4281
|
onClick: r[0] ||= (t) => m(e.currentPage - 1)
|
|
4268
4282
|
}, {
|
|
4269
|
-
default:
|
|
4283
|
+
default: G(() => [f(Q, { name: "lucide:chevron-left" })]),
|
|
4270
4284
|
_: 1
|
|
4271
4285
|
}, 8, [
|
|
4272
4286
|
"href",
|
|
@@ -4283,7 +4297,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4283
4297
|
"aria-current": e.currentPage === n ? "page" : void 0,
|
|
4284
4298
|
onClick: (e) => m(Number(n))
|
|
4285
4299
|
}, {
|
|
4286
|
-
default:
|
|
4300
|
+
default: G(() => [d(M(n), 1)]),
|
|
4287
4301
|
_: 2
|
|
4288
4302
|
}, 1032, [
|
|
4289
4303
|
"variant",
|
|
@@ -4303,7 +4317,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4303
4317
|
class: y({ "cursor-not-allowed opacity-50": e.isLoading || e.currentPage === e.totalPage }),
|
|
4304
4318
|
onClick: r[1] ||= (t) => m(e.currentPage + 1)
|
|
4305
4319
|
}, {
|
|
4306
|
-
default:
|
|
4320
|
+
default: G(() => [f(Q, { name: "lucide:chevron-right" })]),
|
|
4307
4321
|
_: 1
|
|
4308
4322
|
}, 8, [
|
|
4309
4323
|
"href",
|
|
@@ -4312,15 +4326,15 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4312
4326
|
])
|
|
4313
4327
|
]), u("div", Co, [
|
|
4314
4328
|
r[3] ||= d(" 您可以使用 ", -1),
|
|
4315
|
-
f(
|
|
4316
|
-
f(
|
|
4329
|
+
f(Q, { name: "lucide:arrow-left" }),
|
|
4330
|
+
f(Q, { name: "lucide:arrow-right" }),
|
|
4317
4331
|
r[4] ||= d(" 来进行快速翻页 ", -1)
|
|
4318
4332
|
])]), u("div", wo, [
|
|
4319
4333
|
u("label", {
|
|
4320
4334
|
for: I(c),
|
|
4321
4335
|
class: "text-sm"
|
|
4322
4336
|
}, "跳转到页数", 8, To),
|
|
4323
|
-
|
|
4337
|
+
K(u("input", {
|
|
4324
4338
|
id: I(c),
|
|
4325
4339
|
"onUpdate:modelValue": r[2] ||= (e) => a.value = e,
|
|
4326
4340
|
type: "number",
|
|
@@ -4328,15 +4342,15 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4328
4342
|
disabled: e.isLoading,
|
|
4329
4343
|
min: "1",
|
|
4330
4344
|
max: e.totalPage,
|
|
4331
|
-
class: y(I(
|
|
4332
|
-
onKeyup:
|
|
4345
|
+
class: y(I(Y)(I(Y)("bg-content1 shadow-kun-sm border-kun w-24 rounded-kun-md border px-2 py-1 text-sm transition-[color,box-shadow]", I(X).default), e.isLoading && "cursor-not-allowed opacity-50")),
|
|
4346
|
+
onKeyup: q(h, ["enter"])
|
|
4333
4347
|
}, null, 42, Eo), [[V, a.value]]),
|
|
4334
4348
|
f($, {
|
|
4335
4349
|
size: "sm",
|
|
4336
4350
|
disabled: e.isLoading,
|
|
4337
4351
|
onClick: h
|
|
4338
4352
|
}, {
|
|
4339
|
-
default:
|
|
4353
|
+
default: G(() => [...r[5] ||= [d(" 跳转 ", -1)]]),
|
|
4340
4354
|
_: 1
|
|
4341
4355
|
}, 8, ["disabled"])
|
|
4342
4356
|
])]));
|
|
@@ -4386,7 +4400,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4386
4400
|
}),
|
|
4387
4401
|
emits: /*@__PURE__*/ g(["complete"], ["update:modelValue"]),
|
|
4388
4402
|
setup(e, { emit: n }) {
|
|
4389
|
-
let r = e, i = z(e, "modelValue"), a = n, s =
|
|
4403
|
+
let r = e, i = z(e, "modelValue"), a = n, s = Tt(() => r.rounded), u = o(() => Z[s.value]), d = O(Array.from({ length: r.length }, () => "")), f = (e) => {
|
|
4390
4404
|
let t = Array.from({ length: r.length }, (t, n) => e[n] ?? "");
|
|
4391
4405
|
t.join("\0") !== d.value.join("\0") && (d.value = t);
|
|
4392
4406
|
};
|
|
@@ -4441,7 +4455,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4441
4455
|
placeholder: e.placeholder,
|
|
4442
4456
|
"aria-label": `${e.ariaLabel} 第 ${n + 1} 位`,
|
|
4443
4457
|
"aria-invalid": e.isInvalid || void 0,
|
|
4444
|
-
class: y(I(
|
|
4458
|
+
class: y(I(Y)("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 ? I(Y)("border-danger-300", I(X).danger) : I(Y)("border-kun", I(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60")),
|
|
4445
4459
|
onInput: (e) => x(n, e),
|
|
4446
4460
|
onKeydown: (e) => C(n, e),
|
|
4447
4461
|
onPaste: (e) => w(n, e),
|
|
@@ -4556,7 +4570,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4556
4570
|
group: { default: void 0 }
|
|
4557
4571
|
},
|
|
4558
4572
|
setup(e, { expose: t }) {
|
|
4559
|
-
let r = e, a =
|
|
4573
|
+
let r = e, a = Tt(() => r.rounded), d = o(() => Z[a.value]), p = O(!1), m = O(null), h = O(null), g = at("kun-popover"), { floatingStyles: y, transformOrigin: x, arrowRef: S, arrowStyles: C } = an(m, h, {
|
|
4560
4574
|
placement: () => r.position,
|
|
4561
4575
|
open: p,
|
|
4562
4576
|
offset: 8,
|
|
@@ -4581,9 +4595,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4581
4595
|
if (e) return;
|
|
4582
4596
|
let t = h.value;
|
|
4583
4597
|
!t || !t.contains(document.activeElement) || m.value?.querySelector("button,a[href],input:not([disabled]),select,textarea,[tabindex]:not([tabindex=\"-1\"])")?.focus({ preventScroll: !0 });
|
|
4584
|
-
}),
|
|
4598
|
+
}), xe(m, (e) => {
|
|
4585
4599
|
h.value?.contains(e.target) || k(!1);
|
|
4586
|
-
}),
|
|
4600
|
+
}), we("keydown", (e) => {
|
|
4587
4601
|
e.key === "Escape" && p.value && k();
|
|
4588
4602
|
}), t({
|
|
4589
4603
|
open: D,
|
|
@@ -4605,7 +4619,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4605
4619
|
"leave-from-class": "transform scale-100 opacity-100",
|
|
4606
4620
|
"leave-to-class": "transform scale-95 opacity-0"
|
|
4607
4621
|
}, {
|
|
4608
|
-
default:
|
|
4622
|
+
default: G(() => [p.value ? (T(), l("div", _({
|
|
4609
4623
|
key: 0,
|
|
4610
4624
|
ref_key: "popoverRef",
|
|
4611
4625
|
ref: h,
|
|
@@ -4613,9 +4627,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4613
4627
|
role: "dialog",
|
|
4614
4628
|
tabindex: "-1",
|
|
4615
4629
|
"aria-label": e.ariaLabel || "popover",
|
|
4616
|
-
class: I(
|
|
4630
|
+
class: I(Y)(e.opaque ? "bg-[oklch(var(--content1))]" : "bg-content1", "z-kun-popover shadow-kun-md focus:outline-none", d.value, e.innerClass),
|
|
4617
4631
|
style: [I(y), { transformOrigin: I(x) }],
|
|
4618
|
-
onKeydown: r[0] ||=
|
|
4632
|
+
onKeydown: r[0] ||= q((e) => k(), ["escape"])
|
|
4619
4633
|
}, N(I(P), !0)), [A(t.$slots, "default"), e.showArrow ? (T(), l("div", {
|
|
4620
4634
|
key: 0,
|
|
4621
4635
|
ref_key: "arrowRef",
|
|
@@ -4637,7 +4651,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4637
4651
|
"aria-label",
|
|
4638
4652
|
"aria-valuenow",
|
|
4639
4653
|
"aria-valuemax"
|
|
4640
|
-
], Zo = 45, Qo = /*#__PURE__*/
|
|
4654
|
+
], Zo = 45, Qo = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
4641
4655
|
name: "KunProgress",
|
|
4642
4656
|
__name: "Progress",
|
|
4643
4657
|
props: {
|
|
@@ -4670,7 +4684,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4670
4684
|
case "xl": return "h-5";
|
|
4671
4685
|
default: return "h-3";
|
|
4672
4686
|
}
|
|
4673
|
-
}), i =
|
|
4687
|
+
}), i = Tt(() => t.rounded), a = o(() => Z[i.value]), s = {
|
|
4674
4688
|
default: "text-default",
|
|
4675
4689
|
primary: "text-primary",
|
|
4676
4690
|
secondary: "text-secondary",
|
|
@@ -4686,8 +4700,8 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4686
4700
|
warning: "bg-gradient-to-r from-warning-400 to-warning-600",
|
|
4687
4701
|
danger: "bg-gradient-to-r from-danger-400 to-danger-600",
|
|
4688
4702
|
info: "bg-gradient-to-r from-info-400 to-info-600"
|
|
4689
|
-
}, f = o(() =>
|
|
4690
|
-
let e =
|
|
4703
|
+
}, f = o(() => ge[t.color]), p = o(() => {
|
|
4704
|
+
let e = me[t.color];
|
|
4691
4705
|
switch (t.variant) {
|
|
4692
4706
|
case "gradient": return d[t.color];
|
|
4693
4707
|
case "striped": return `${e} bg-[length:1rem_1rem] bg-gradient-to-r from-white/20 to-transparent animate-[progress-stripes_1s_linear_infinite]`;
|
|
@@ -4739,14 +4753,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4739
4753
|
"aria-valuemax": e.max
|
|
4740
4754
|
}, [e.indeterminate ? (T(), l("div", {
|
|
4741
4755
|
key: 0,
|
|
4742
|
-
class: y(I(
|
|
4756
|
+
class: y(I(Y)("absolute inset-y-0 w-2/5 animate-[kun-progress-indeterminate_1.5s_ease-in-out_infinite]", a.value, p.value))
|
|
4743
4757
|
}, null, 2)) : (T(), l("div", {
|
|
4744
4758
|
key: 1,
|
|
4745
|
-
class: y(I(
|
|
4759
|
+
class: y(I(Y)("flex h-full items-center transition-all duration-kun-slow ease-kun-out", p.value)),
|
|
4746
4760
|
style: b(`width:${n.value}%`)
|
|
4747
4761
|
}, [e.showLabel ? (T(), l("span", {
|
|
4748
4762
|
key: 0,
|
|
4749
|
-
class: y(I(
|
|
4763
|
+
class: y(I(Y)("px-2 text-xs font-medium", f.value))
|
|
4750
4764
|
}, M(n.value) + "% ", 3)) : c("", !0)], 6))], 10, Xo))]));
|
|
4751
4765
|
}
|
|
4752
4766
|
}), [["__scopeId", "data-v-698d88e3"]]), $o = ["id"], es = [
|
|
@@ -4798,11 +4812,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4798
4812
|
}),
|
|
4799
4813
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
4800
4814
|
setup(e, { emit: n }) {
|
|
4801
|
-
let r = e, i = z(e, "modelValue"), a = n, s =
|
|
4815
|
+
let r = e, i = z(e, "modelValue"), a = n, s = Tt(() => r.rounded), d = o(() => Z[s.value]), f = at("kun-radio-group"), p = o(() => `${f.value}-label`), m = O([]), h = (e) => r.disabled || e.disabled === !0, g = o(() => {
|
|
4802
4816
|
let e = r.options.findIndex((e) => e.value === i.value);
|
|
4803
4817
|
return e >= 0 && !h(r.options[e]) ? e : r.options.findIndex((e) => !h(e));
|
|
4804
4818
|
}), _ = o(() => {
|
|
4805
|
-
let e =
|
|
4819
|
+
let e = fe[r.size];
|
|
4806
4820
|
return {
|
|
4807
4821
|
indicator: e.box,
|
|
4808
4822
|
dot: e.dot,
|
|
@@ -4842,7 +4856,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4842
4856
|
}
|
|
4843
4857
|
}
|
|
4844
4858
|
};
|
|
4845
|
-
return (n, r) => (T(), l("div", { class: y(I(
|
|
4859
|
+
return (n, r) => (T(), l("div", { class: y(I(Y)("w-full", e.className)) }, [
|
|
4846
4860
|
e.label ? (T(), l("div", {
|
|
4847
4861
|
key: 0,
|
|
4848
4862
|
id: p.value,
|
|
@@ -4853,7 +4867,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4853
4867
|
"aria-label": e.label ? void 0 : e.ariaLabel || "radio group",
|
|
4854
4868
|
"aria-labelledby": e.label ? p.value : void 0,
|
|
4855
4869
|
"aria-disabled": e.disabled || void 0,
|
|
4856
|
-
class: y(I(
|
|
4870
|
+
class: y(I(Y)("flex", e.orientation === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-3"))
|
|
4857
4871
|
}, [e.variant === "classic" ? (T(!0), l(t, { key: 0 }, k(e.options, (t, n) => (T(), l("label", {
|
|
4858
4872
|
key: String(t.value),
|
|
4859
4873
|
ref_for: !0,
|
|
@@ -4862,12 +4876,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4862
4876
|
"aria-checked": i.value === t.value,
|
|
4863
4877
|
"aria-disabled": h(t) || void 0,
|
|
4864
4878
|
tabindex: g.value === n && !h(t) ? 0 : -1,
|
|
4865
|
-
class: y(I(
|
|
4879
|
+
class: y(I(Y)("group inline-flex cursor-pointer items-center rounded-kun-md p-1 transition-colors", I(X)[e.color], _.value.gap, _.value.text, h(t) && "cursor-not-allowed opacity-50")),
|
|
4866
4880
|
onClick: (e) => b(t, n),
|
|
4867
4881
|
onKeydown: (e) => S(e, n)
|
|
4868
|
-
}, [u("span", { class: y(I(
|
|
4882
|
+
}, [u("span", { class: y(I(Y)("inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-colors", _.value.indicator, i.value === t.value ? I(se)[e.color] : "border-default-300 group-hover:border-default-400")) }, [i.value === t.value ? (T(), l("span", {
|
|
4869
4883
|
key: 0,
|
|
4870
|
-
class: y(I(
|
|
4884
|
+
class: y(I(Y)("block rounded-full", _.value.dot, I(oe)[e.color]))
|
|
4871
4885
|
}, null, 2)) : c("", !0)], 2), u("span", ns, [u("span", rs, M(t.label), 1), t.description ? (T(), l("span", is, M(t.description), 1)) : c("", !0)])], 42, ts))), 128)) : (T(!0), l(t, { key: 1 }, k(e.options, (t, n) => (T(), l("div", {
|
|
4872
4886
|
key: String(t.value),
|
|
4873
4887
|
ref_for: !0,
|
|
@@ -4876,12 +4890,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4876
4890
|
"aria-checked": i.value === t.value,
|
|
4877
4891
|
"aria-disabled": h(t) || void 0,
|
|
4878
4892
|
tabindex: g.value === n && !h(t) ? 0 : -1,
|
|
4879
|
-
class: y(I(
|
|
4893
|
+
class: y(I(Y)("relative flex cursor-pointer items-start border-2 p-3 transition-all", I(X)[e.color], _.value.gap, _.value.text, d.value, e.orientation === "horizontal" && "flex-1 min-w-[8rem]", i.value === t.value ? I(Y)(I(se)[e.color], I(pe)[e.color]) : "border-kun hover:border-default-300 bg-content1", h(t) && "cursor-not-allowed opacity-50")),
|
|
4880
4894
|
onClick: (e) => b(t, n),
|
|
4881
4895
|
onKeydown: (e) => S(e, n)
|
|
4882
|
-
}, [u("span", { class: y(I(
|
|
4896
|
+
}, [u("span", { class: y(I(Y)("mt-0.5 inline-flex shrink-0 items-center justify-center rounded-full border-2 transition-colors", _.value.indicator, i.value === t.value ? I(se)[e.color] : "border-default-300")) }, [i.value === t.value ? (T(), l("span", {
|
|
4883
4897
|
key: 0,
|
|
4884
|
-
class: y(I(
|
|
4898
|
+
class: y(I(Y)("block rounded-full", _.value.dot, I(oe)[e.color]))
|
|
4885
4899
|
}, null, 2)) : c("", !0)], 2), u("div", os, [u("span", ss, M(t.label), 1), t.description ? (T(), l("span", cs, M(t.description), 1)) : c("", !0)])], 42, as))), 128))], 10, es),
|
|
4886
4900
|
e.error ? (T(), l("p", ls, M(e.error), 1)) : c("", !0)
|
|
4887
4901
|
], 2));
|
|
@@ -4936,16 +4950,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4936
4950
|
type: "button",
|
|
4937
4951
|
role: "radio",
|
|
4938
4952
|
"aria-checked": d.value >= t,
|
|
4939
|
-
class: y(I(
|
|
4953
|
+
class: y(I(Y)("disabled:text-default-200 cursor-pointer hover:scale-110 focus:outline-none disabled:cursor-not-allowed", d.value >= t ? "text-secondary" : "text-default-300")),
|
|
4940
4954
|
disabled: e.disabled,
|
|
4941
4955
|
title: `${t}/${e.max}`,
|
|
4942
4956
|
"aria-label": `${t} / ${e.max}`,
|
|
4943
4957
|
onMouseenter: (e) => m(t),
|
|
4944
4958
|
onMouseleave: h,
|
|
4945
4959
|
onClick: (e) => p(t)
|
|
4946
|
-
}, [f(
|
|
4960
|
+
}, [f(Q, {
|
|
4947
4961
|
name: "lucide:lollipop",
|
|
4948
|
-
class: y(I(
|
|
4962
|
+
class: y(I(Y)("transition-colors", c.value))
|
|
4949
4963
|
}, null, 8, ["class"])], 42, fs))), 128))], 8, ds));
|
|
4950
4964
|
}
|
|
4951
4965
|
}), ms = [
|
|
@@ -4959,7 +4973,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4959
4973
|
key: 1,
|
|
4960
4974
|
"aria-hidden": "true",
|
|
4961
4975
|
class: "kun-reaction-count relative inline-block overflow-hidden text-center leading-[1.2] tabular-nums"
|
|
4962
|
-
}, _s = /*#__PURE__*/
|
|
4976
|
+
}, _s = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
4963
4977
|
name: "KunReaction",
|
|
4964
4978
|
__name: "Reaction",
|
|
4965
4979
|
props: /*@__PURE__*/ g({
|
|
@@ -5028,7 +5042,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5028
5042
|
btn: "gap-2 px-2.5 py-1.5 text-base",
|
|
5029
5043
|
icon: "1.4rem"
|
|
5030
5044
|
}
|
|
5031
|
-
}, D = o(() => E[r.size]), j = o(() => typeof s.value == "number" ? `${r.label},${s.value}` : r.label), N = o(() => r.color in
|
|
5045
|
+
}, D = o(() => E[r.size]), j = o(() => typeof s.value == "number" ? `${r.label},${s.value}` : r.label), N = o(() => r.color in _e), P = o(() => w.value && !N.value ? { color: r.color } : void 0), F = o(() => Y("relative inline-flex items-center rounded-full transition-colors select-none", D.value.btn, r.disabled ? "cursor-not-allowed opacity-50" : Y("cursor-pointer hover:bg-default-100", w.value && "hover:bg-default-100/60"), w.value ? N.value ? _e[r.color] : "" : "text-default-500"));
|
|
5032
5046
|
return (n, r) => (T(), l("button", {
|
|
5033
5047
|
type: "button",
|
|
5034
5048
|
class: y(F.value),
|
|
@@ -5042,9 +5056,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5042
5056
|
class: y(["kun-reaction-fx relative inline-flex shrink-0", h.value && "kun-reaction-pop"]),
|
|
5043
5057
|
style: b({ fontSize: D.value.icon }),
|
|
5044
5058
|
onAnimationend: r[1] ||= (e) => h.value = !1
|
|
5045
|
-
}, [A(n.$slots, "icon", { active: w.value }, () => [f(
|
|
5059
|
+
}, [A(n.$slots, "icon", { active: w.value }, () => [f(Q, {
|
|
5046
5060
|
name: e.icon,
|
|
5047
|
-
class: y(I(
|
|
5061
|
+
class: y(I(Y)("transition-colors", w.value && "fill-current"))
|
|
5048
5062
|
}, null, 8, ["name", "class"])], !0), g.value ? (T(), l(t, { key: 0 }, [u("span", {
|
|
5049
5063
|
"aria-hidden": "true",
|
|
5050
5064
|
class: "kun-reaction-ring border-2 border-current",
|
|
@@ -5057,7 +5071,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5057
5071
|
}, null, 4)), 64))], 64)) : c("", !0)], 38),
|
|
5058
5072
|
n.$slots.default ? (T(), l("span", hs, [A(n.$slots, "default", {}, void 0, !0)])) : c("", !0),
|
|
5059
5073
|
typeof s.value == "number" ? (T(), l("span", gs, [f(i, { name: m.value ? `kun-roll-${v.value}` : "" }, {
|
|
5060
|
-
default:
|
|
5074
|
+
default: G(() => [(T(), l("span", {
|
|
5061
5075
|
key: s.value,
|
|
5062
5076
|
class: "block"
|
|
5063
5077
|
}, M(s.value), 1))]),
|
|
@@ -5144,11 +5158,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5144
5158
|
}),
|
|
5145
5159
|
emits: /*@__PURE__*/ g(["set"], ["update:modelValue"]),
|
|
5146
5160
|
setup(e, { emit: r }) {
|
|
5147
|
-
let a = e, d =
|
|
5161
|
+
let a = e, d = Tt(() => a.rounded), p = o(() => Z[d.value]), m = z(e, "modelValue"), h = r, g = at("kun-select"), _ = o(() => `${g.value}-listbox`), x = O(!1), S = O(""), C = O(-1), w = O(null), E = O(null), D = O(null), A = O(null), { floatingStyles: j, transformOrigin: N } = an(w, E, {
|
|
5148
5162
|
placement: "bottom-start",
|
|
5149
5163
|
open: x,
|
|
5150
5164
|
offset: 4,
|
|
5151
|
-
middleware: [
|
|
5165
|
+
middleware: [Ne({ apply({ rects: e, elements: t, availableHeight: n }) {
|
|
5152
5166
|
Object.assign(t.floating.style, {
|
|
5153
5167
|
width: `${e.reference.width}px`,
|
|
5154
5168
|
maxHeight: `${Math.min(280, n - 8)}px`
|
|
@@ -5161,43 +5175,43 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5161
5175
|
if (!a.searchable || !S.value.trim()) return a.options;
|
|
5162
5176
|
let e = S.value.trim().toLowerCase();
|
|
5163
5177
|
return a.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
5164
|
-
}),
|
|
5178
|
+
}), W = o(() => C.value >= 0 && H.value[C.value] ? `${g.value}-opt-${C.value}` : void 0), q = (e = 0, t = 1) => {
|
|
5165
5179
|
let n = H.value;
|
|
5166
5180
|
for (let r = e; r >= 0 && r < n.length; r += t) if (!n[r].disabled) return r;
|
|
5167
5181
|
return -1;
|
|
5168
|
-
},
|
|
5182
|
+
}, ee = () => {
|
|
5169
5183
|
if (a.disabled || x.value) return;
|
|
5170
5184
|
x.value = !0, S.value = "";
|
|
5171
5185
|
let e = H.value.findIndex((e) => F.value.has(e.value));
|
|
5172
|
-
C.value = e >= 0 ? e :
|
|
5173
|
-
a.searchable && A.value?.focus({ preventScroll: !0 }),
|
|
5186
|
+
C.value = e >= 0 ? e : q(), v(() => {
|
|
5187
|
+
a.searchable && A.value?.focus({ preventScroll: !0 }), se();
|
|
5174
5188
|
});
|
|
5175
|
-
},
|
|
5189
|
+
}, te = (e = !0) => {
|
|
5176
5190
|
x.value && (x.value = !1, S.value = "", e && v(() => w.value?.focus({ preventScroll: !0 })));
|
|
5177
|
-
},
|
|
5178
|
-
|
|
5179
|
-
E.value?.contains(e.target) ||
|
|
5191
|
+
}, ne = () => x.value ? te() : ee();
|
|
5192
|
+
xe(w, (e) => {
|
|
5193
|
+
E.value?.contains(e.target) || te(!1);
|
|
5180
5194
|
});
|
|
5181
|
-
let
|
|
5195
|
+
let re = (e) => {
|
|
5182
5196
|
if (e.disabled) return;
|
|
5183
5197
|
let t = a.options.findIndex((t) => t.value === e.value);
|
|
5184
5198
|
if (a.multiple) {
|
|
5185
5199
|
let t = Array.isArray(m.value) ? [...m.value] : [], n = t.indexOf(e.value);
|
|
5186
5200
|
n >= 0 ? t.splice(n, 1) : t.push(e.value), m.value = t, a.searchable && v(() => A.value?.focus({ preventScroll: !0 }));
|
|
5187
|
-
} else m.value = e.value,
|
|
5201
|
+
} else m.value = e.value, te();
|
|
5188
5202
|
h("set", e.value, t);
|
|
5189
|
-
},
|
|
5203
|
+
}, ie = () => {
|
|
5190
5204
|
let e = H.value[C.value];
|
|
5191
|
-
e &&
|
|
5192
|
-
},
|
|
5205
|
+
e && re(e);
|
|
5206
|
+
}, ae = (e) => {
|
|
5193
5207
|
a.disabled || (m.value = (Array.isArray(m.value) ? [...m.value] : []).filter((t) => t !== e));
|
|
5194
|
-
},
|
|
5208
|
+
}, oe = () => {
|
|
5195
5209
|
a.disabled || (m.value = a.multiple ? [] : null);
|
|
5196
|
-
},
|
|
5210
|
+
}, se = () => {
|
|
5197
5211
|
v(() => {
|
|
5198
5212
|
on(D.value, D.value?.querySelector(`[data-index="${C.value}"]`));
|
|
5199
5213
|
});
|
|
5200
|
-
},
|
|
5214
|
+
}, ce = (e) => {
|
|
5201
5215
|
let t = H.value.length;
|
|
5202
5216
|
if (!t) return;
|
|
5203
5217
|
let n = C.value;
|
|
@@ -5205,14 +5219,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5205
5219
|
C.value = n;
|
|
5206
5220
|
break;
|
|
5207
5221
|
}
|
|
5208
|
-
|
|
5209
|
-
},
|
|
5210
|
-
C.value = e === 1 ?
|
|
5211
|
-
},
|
|
5212
|
-
|
|
5213
|
-
let t = a.options.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(
|
|
5214
|
-
t >= 0 && (C.value = t,
|
|
5215
|
-
},
|
|
5222
|
+
se();
|
|
5223
|
+
}, ue = (e) => {
|
|
5224
|
+
C.value = e === 1 ? q(0, 1) : q(H.value.length - 1, -1), se();
|
|
5225
|
+
}, de = "", fe = null, pe = (e) => {
|
|
5226
|
+
de += e.toLowerCase(), fe && clearTimeout(fe), fe = setTimeout(() => de = "", 600);
|
|
5227
|
+
let t = a.options.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(de));
|
|
5228
|
+
t >= 0 && (C.value = t, se());
|
|
5229
|
+
}, me = (e) => {
|
|
5216
5230
|
if (a.disabled) return;
|
|
5217
5231
|
let t = e.key;
|
|
5218
5232
|
if (!x.value) {
|
|
@@ -5221,40 +5235,40 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5221
5235
|
"ArrowUp",
|
|
5222
5236
|
"Enter",
|
|
5223
5237
|
" "
|
|
5224
|
-
].includes(t) && (e.preventDefault(),
|
|
5238
|
+
].includes(t) && (e.preventDefault(), ee());
|
|
5225
5239
|
return;
|
|
5226
5240
|
}
|
|
5227
5241
|
switch (t) {
|
|
5228
5242
|
case "ArrowDown":
|
|
5229
|
-
e.preventDefault(),
|
|
5243
|
+
e.preventDefault(), ce(1);
|
|
5230
5244
|
break;
|
|
5231
5245
|
case "ArrowUp":
|
|
5232
|
-
e.preventDefault(),
|
|
5246
|
+
e.preventDefault(), ce(-1);
|
|
5233
5247
|
break;
|
|
5234
5248
|
case "Home":
|
|
5235
|
-
e.preventDefault(),
|
|
5249
|
+
e.preventDefault(), ue(1);
|
|
5236
5250
|
break;
|
|
5237
5251
|
case "End":
|
|
5238
|
-
e.preventDefault(),
|
|
5252
|
+
e.preventDefault(), ue(-1);
|
|
5239
5253
|
break;
|
|
5240
5254
|
case "Enter":
|
|
5241
|
-
e.preventDefault(),
|
|
5255
|
+
e.preventDefault(), ie();
|
|
5242
5256
|
break;
|
|
5243
5257
|
case " ":
|
|
5244
|
-
a.searchable || (e.preventDefault(),
|
|
5258
|
+
a.searchable || (e.preventDefault(), ie());
|
|
5245
5259
|
break;
|
|
5246
5260
|
case "Escape":
|
|
5247
|
-
e.preventDefault(),
|
|
5261
|
+
e.preventDefault(), te();
|
|
5248
5262
|
break;
|
|
5249
5263
|
case "Tab":
|
|
5250
|
-
|
|
5264
|
+
te(!1);
|
|
5251
5265
|
break;
|
|
5252
|
-
default: !a.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey &&
|
|
5266
|
+
default: !a.searchable && t.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && pe(t);
|
|
5253
5267
|
}
|
|
5254
5268
|
};
|
|
5255
5269
|
return U(H, () => {
|
|
5256
|
-
x.value && (C.value < 0 || C.value >= H.value.length || H.value[C.value]?.disabled) && (C.value =
|
|
5257
|
-
}), (r, o) => (T(), l("div", { class: y(I(
|
|
5270
|
+
x.value && (C.value < 0 || C.value >= H.value.length || H.value[C.value]?.disabled) && (C.value = q());
|
|
5271
|
+
}), (r, o) => (T(), l("div", { class: y(I(Y)("relative w-full", a.className)) }, [
|
|
5258
5272
|
e.label ? (T(), l("label", {
|
|
5259
5273
|
key: 0,
|
|
5260
5274
|
id: `${I(g)}-label`,
|
|
@@ -5272,11 +5286,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5272
5286
|
"aria-expanded": x.value,
|
|
5273
5287
|
"aria-haspopup": "listbox",
|
|
5274
5288
|
"aria-controls": _.value,
|
|
5275
|
-
"aria-activedescendant": x.value ?
|
|
5289
|
+
"aria-activedescendant": x.value ? W.value : void 0,
|
|
5276
5290
|
"aria-disabled": e.disabled || void 0,
|
|
5277
|
-
class: y(I(
|
|
5278
|
-
onClick:
|
|
5279
|
-
onKeydown:
|
|
5291
|
+
class: y(I(Y)("flex w-full cursor-pointer items-center justify-between gap-2 text-left transition-[color,box-shadow]", I(le)[a.size], p.value, "bg-content1 shadow-kun-sm border", e.error ? I(Y)("border-danger-300", I(X).danger) : I(Y)("border-kun", I(X)[e.color]), e.disabled && "cursor-not-allowed opacity-60")),
|
|
5292
|
+
onClick: ne,
|
|
5293
|
+
onKeydown: me
|
|
5280
5294
|
}, [
|
|
5281
5295
|
e.multiple && B.value ? (T(), l("span", bs, [(T(!0), l(t, null, k(L.value, (t) => (T(), l("span", {
|
|
5282
5296
|
key: String(t.value),
|
|
@@ -5286,9 +5300,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5286
5300
|
type: "button",
|
|
5287
5301
|
class: "hover:text-danger shrink-0",
|
|
5288
5302
|
"aria-label": `移除 ${t.label}`,
|
|
5289
|
-
onClick:
|
|
5290
|
-
onMousedown: o[0] ||=
|
|
5291
|
-
}, [f(
|
|
5303
|
+
onClick: J((e) => ae(t.value), ["stop"]),
|
|
5304
|
+
onMousedown: o[0] ||= J(() => {}, ["stop", "prevent"])
|
|
5305
|
+
}, [f(Q, {
|
|
5292
5306
|
name: "lucide:x",
|
|
5293
5307
|
class: "size-3"
|
|
5294
5308
|
})], 40, Ss))]))), 128))])) : (T(), l("span", {
|
|
@@ -5300,13 +5314,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5300
5314
|
type: "button",
|
|
5301
5315
|
class: "text-default-400 hover:text-default-600 shrink-0",
|
|
5302
5316
|
"aria-label": "清除",
|
|
5303
|
-
onClick:
|
|
5304
|
-
onMousedown: o[1] ||=
|
|
5305
|
-
}, [f(
|
|
5317
|
+
onClick: J(oe, ["stop"]),
|
|
5318
|
+
onMousedown: o[1] ||= J(() => {}, ["stop", "prevent"])
|
|
5319
|
+
}, [f(Q, {
|
|
5306
5320
|
name: "lucide:circle-x",
|
|
5307
5321
|
class: "size-4"
|
|
5308
5322
|
})], 32)) : c("", !0),
|
|
5309
|
-
f(
|
|
5323
|
+
f(Q, {
|
|
5310
5324
|
name: "lucide:chevron-down",
|
|
5311
5325
|
class: y(["pointer-events-none shrink-0 transition-transform", x.value ? "rotate-180" : ""])
|
|
5312
5326
|
}, null, 8, ["class"])
|
|
@@ -5330,13 +5344,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5330
5344
|
"leave-from-class": "opacity-100 scale-100",
|
|
5331
5345
|
"leave-to-class": "opacity-0 scale-95"
|
|
5332
5346
|
}, {
|
|
5333
|
-
default:
|
|
5347
|
+
default: G(() => [x.value ? (T(), l("div", {
|
|
5334
5348
|
key: 0,
|
|
5335
5349
|
ref_key: "dropdownRef",
|
|
5336
5350
|
ref: E,
|
|
5337
5351
|
style: b([I(j), { transformOrigin: I(N) }]),
|
|
5338
|
-
class: y(I(
|
|
5339
|
-
}, [e.searchable ? (T(), l("div", Ts, [
|
|
5352
|
+
class: y(I(Y)("bg-content1 z-kun-popover flex flex-col overflow-hidden p-1 shadow-kun-md", p.value))
|
|
5353
|
+
}, [e.searchable ? (T(), l("div", Ts, [K(u("input", {
|
|
5340
5354
|
ref_key: "searchRef",
|
|
5341
5355
|
ref: A,
|
|
5342
5356
|
"onUpdate:modelValue": o[2] ||= (e) => S.value = e,
|
|
@@ -5346,9 +5360,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5346
5360
|
role: "combobox",
|
|
5347
5361
|
"aria-controls": _.value,
|
|
5348
5362
|
"aria-expanded": x.value,
|
|
5349
|
-
"aria-activedescendant":
|
|
5350
|
-
class: y(I(
|
|
5351
|
-
onKeydown:
|
|
5363
|
+
"aria-activedescendant": W.value,
|
|
5364
|
+
class: y(I(Y)("bg-content1 shadow-kun-sm border-kun w-full rounded-kun-sm border px-2.5 py-1.5 text-sm", I(X)[e.color])),
|
|
5365
|
+
onKeydown: me
|
|
5352
5366
|
}, null, 42, Es), [[V, S.value]])])) : c("", !0), u("ul", {
|
|
5353
5367
|
ref_key: "listRef",
|
|
5354
5368
|
ref: D,
|
|
@@ -5365,9 +5379,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5365
5379
|
role: "option",
|
|
5366
5380
|
"aria-selected": F.value.has(e.value),
|
|
5367
5381
|
"aria-disabled": e.disabled || void 0,
|
|
5368
|
-
onClick: (t) =>
|
|
5382
|
+
onClick: (t) => re(e),
|
|
5369
5383
|
onMousemove: (n) => !e.disabled && (C.value = t)
|
|
5370
|
-
}, [u("span", ks, M(e.label), 1), F.value.has(e.value) ? (T(), s(
|
|
5384
|
+
}, [u("span", ks, M(e.label), 1), F.value.has(e.value) ? (T(), s(Q, {
|
|
5371
5385
|
key: 0,
|
|
5372
5386
|
name: "lucide:check",
|
|
5373
5387
|
class: "text-primary ml-2 shrink-0"
|
|
@@ -5377,7 +5391,323 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5377
5391
|
e.error ? (T(), l("p", js, M(e.error), 1)) : e.description ? (T(), l("p", Ms, M(e.description), 1)) : c("", !0)
|
|
5378
5392
|
], 2));
|
|
5379
5393
|
}
|
|
5380
|
-
}), Ps =
|
|
5394
|
+
}), Ps = /* @__PURE__ */ p({
|
|
5395
|
+
name: "KunShatter",
|
|
5396
|
+
__name: "Shatter",
|
|
5397
|
+
props: /*@__PURE__*/ g({
|
|
5398
|
+
trigger: { default: "manual" },
|
|
5399
|
+
pieces: { default: 24 },
|
|
5400
|
+
duration: { default: 1100 },
|
|
5401
|
+
origin: { default: "center" },
|
|
5402
|
+
spread: { default: 1 },
|
|
5403
|
+
gravity: { default: 1 },
|
|
5404
|
+
rotation: { default: 140 },
|
|
5405
|
+
fade: {
|
|
5406
|
+
type: Boolean,
|
|
5407
|
+
default: !0
|
|
5408
|
+
},
|
|
5409
|
+
easing: { default: "linear" },
|
|
5410
|
+
seed: {},
|
|
5411
|
+
reassemble: {
|
|
5412
|
+
type: Boolean,
|
|
5413
|
+
default: !0
|
|
5414
|
+
},
|
|
5415
|
+
autoRestore: { default: 0 },
|
|
5416
|
+
keepSpace: {
|
|
5417
|
+
type: Boolean,
|
|
5418
|
+
default: !1
|
|
5419
|
+
},
|
|
5420
|
+
disabled: {
|
|
5421
|
+
type: Boolean,
|
|
5422
|
+
default: !1
|
|
5423
|
+
},
|
|
5424
|
+
disableAnimation: {
|
|
5425
|
+
type: Boolean,
|
|
5426
|
+
default: !1
|
|
5427
|
+
},
|
|
5428
|
+
zIndex: { default: 9999 },
|
|
5429
|
+
className: { default: "" }
|
|
5430
|
+
}, {
|
|
5431
|
+
shattered: {
|
|
5432
|
+
type: Boolean,
|
|
5433
|
+
default: !1
|
|
5434
|
+
},
|
|
5435
|
+
shatteredModifiers: {}
|
|
5436
|
+
}),
|
|
5437
|
+
emits: /*@__PURE__*/ g([
|
|
5438
|
+
"shatterStart",
|
|
5439
|
+
"shatterEnd",
|
|
5440
|
+
"restoreEnd"
|
|
5441
|
+
], ["update:shattered"]),
|
|
5442
|
+
setup(e, { expose: t, emit: n }) {
|
|
5443
|
+
let r = e, i = z(e, "shattered"), a = n, o = O(null), s = Te("(prefers-reduced-motion: reduce)"), c = O("idle"), u = null, d = [], f = null, p = {
|
|
5444
|
+
x: 0,
|
|
5445
|
+
y: 0,
|
|
5446
|
+
set: !1
|
|
5447
|
+
}, m = null, h = (e) => {
|
|
5448
|
+
e.style.visibility = "", r.keepSpace ? e.style.visibility = "hidden" : e.style.display = "none";
|
|
5449
|
+
}, g = (e) => {
|
|
5450
|
+
e.style.visibility = "", e.style.display = "";
|
|
5451
|
+
}, _ = (e, t, n) => e < t ? t : e > n ? n : e;
|
|
5452
|
+
function v(e) {
|
|
5453
|
+
return () => {
|
|
5454
|
+
e |= 0, e = e + 1831565813 | 0;
|
|
5455
|
+
let t = Math.imul(e ^ e >>> 15, 1 | e);
|
|
5456
|
+
return t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t, ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
5457
|
+
};
|
|
5458
|
+
}
|
|
5459
|
+
function b(e, t, n, r, i, a) {
|
|
5460
|
+
let o = [], s = Math.hypot(e, t), c = Math.round(n * .68);
|
|
5461
|
+
for (let n = 0; n < c; n++) {
|
|
5462
|
+
let n = r() * Math.PI * 2, c = s * .55 * r() ** 1.7;
|
|
5463
|
+
o.push([_(i + Math.cos(n) * c, 0, e), _(a + Math.sin(n) * c, 0, t)]);
|
|
5464
|
+
}
|
|
5465
|
+
for (let i = c; i < n; i++) o.push([r() * e, r() * t]);
|
|
5466
|
+
return o.map(([e, t]) => [e + (r() - .5) * .5, t + (r() - .5) * .5]);
|
|
5467
|
+
}
|
|
5468
|
+
function C(e, t, n) {
|
|
5469
|
+
let r = (t[0] + n[0]) / 2, i = (t[1] + n[1]) / 2, a = n[0] - t[0], o = n[1] - t[1], s = (e) => (e[0] - r) * a + (e[1] - i) * o, c = [];
|
|
5470
|
+
for (let t = 0; t < e.length; t++) {
|
|
5471
|
+
let n = e[t], r = e[(t + 1) % e.length];
|
|
5472
|
+
if (!n || !r) continue;
|
|
5473
|
+
let i = s(n), a = s(r);
|
|
5474
|
+
if (i <= 0 && c.push(n), i < 0 && a > 0 || i > 0 && a < 0) {
|
|
5475
|
+
let e = i / (i - a);
|
|
5476
|
+
c.push([n[0] + e * (r[0] - n[0]), n[1] + e * (r[1] - n[1])]);
|
|
5477
|
+
}
|
|
5478
|
+
}
|
|
5479
|
+
return c;
|
|
5480
|
+
}
|
|
5481
|
+
function w(e, t, n) {
|
|
5482
|
+
let r = [];
|
|
5483
|
+
for (let i = 0; i < e.length; i++) {
|
|
5484
|
+
let a = e[i];
|
|
5485
|
+
if (!a) continue;
|
|
5486
|
+
let o = [
|
|
5487
|
+
[0, 0],
|
|
5488
|
+
[t, 0],
|
|
5489
|
+
[t, n],
|
|
5490
|
+
[0, n]
|
|
5491
|
+
];
|
|
5492
|
+
for (let t = 0; t < e.length && o.length >= 3; t++) {
|
|
5493
|
+
let n = e[t];
|
|
5494
|
+
i !== t && n && (o = C(o, a, n));
|
|
5495
|
+
}
|
|
5496
|
+
o.length >= 3 && r.push(o);
|
|
5497
|
+
}
|
|
5498
|
+
return r;
|
|
5499
|
+
}
|
|
5500
|
+
function E(e, t) {
|
|
5501
|
+
let n = r.origin;
|
|
5502
|
+
return n === "top" ? [e / 2, 0] : n === "pointer" ? p.set ? [_(p.x, 0, e), _(p.y, 0, t)] : [e / 2, t / 2] : n && typeof n == "object" ? [_(n.x, 0, e), _(n.y, 0, t)] : [e / 2, t / 2];
|
|
5503
|
+
}
|
|
5504
|
+
function D(e, t, n, i, a, o) {
|
|
5505
|
+
let s = v(n || 1), c = w(b(e, t, _(Math.round(r.pieces), 2, 160), s, i, a), e, t), l = r.spread * Math.hypot(e, t) * .5, u = Math.max(1, Math.hypot(Math.max(i, e - i), Math.max(a, t - a))), d = [];
|
|
5506
|
+
for (let e of c) {
|
|
5507
|
+
let t = Infinity, n = Infinity, c = -Infinity, f = -Infinity, p = 0, m = 0;
|
|
5508
|
+
for (let [r, i] of e) r < t && (t = r), i < n && (n = i), r > c && (c = r), i > f && (f = i), p += r, m += i;
|
|
5509
|
+
p /= e.length, m /= e.length;
|
|
5510
|
+
let h = c - t, g = f - n;
|
|
5511
|
+
if (h < .5 || g < .5) continue;
|
|
5512
|
+
let _ = e.map(([e, r]) => `${(e - t).toFixed(2)}px ${(r - n).toFixed(2)}px`).join(","), v = p - i, y = m - a, b = Math.hypot(v, y);
|
|
5513
|
+
if (b < .01) {
|
|
5514
|
+
let e = s() * Math.PI * 2;
|
|
5515
|
+
v = Math.cos(e), y = Math.sin(e), b = 1;
|
|
5516
|
+
}
|
|
5517
|
+
v /= b, y /= b;
|
|
5518
|
+
let x = l * (.32 + s() * .55), S = v * x, C = y * x * .8, w = r.gravity * l * (.85 + s() * .5), T = (s() * 2 - 1) * r.rotation, E = .8 + s() * .16, D = .5 + s() * .18, O = b / u * Math.min(r.duration * .22, 120), k = S, A = C + w, j = [];
|
|
5519
|
+
for (let e = 0; e <= 16; e++) {
|
|
5520
|
+
let t = e / 16, n, i, a, s, c;
|
|
5521
|
+
if (o === "out") {
|
|
5522
|
+
let e = 1 - (1 - t) ** 1.7;
|
|
5523
|
+
n = S * e, i = C * e + w * t * t, a = T * t, s = 1 - (1 - E) * t, c = r.fade ? t < D ? 1 : Math.max(0, 1 - (t - D) / (1 - D)) : 1;
|
|
5524
|
+
} else {
|
|
5525
|
+
let e = 1 - (1 - t) ** 2, o = 1 - e;
|
|
5526
|
+
n = k * o, i = A * o, a = T * o, s = E + (1 - E) * e, c = r.fade ? Math.min(1, t / .4) : 1;
|
|
5527
|
+
}
|
|
5528
|
+
j.push({
|
|
5529
|
+
offset: +t.toFixed(4),
|
|
5530
|
+
transform: `translate3d(${n.toFixed(1)}px, ${i.toFixed(1)}px, 0) rotate(${a.toFixed(1)}deg) scale(${s.toFixed(3)})`,
|
|
5531
|
+
opacity: +c.toFixed(3),
|
|
5532
|
+
easing: "linear"
|
|
5533
|
+
});
|
|
5534
|
+
}
|
|
5535
|
+
d.push({
|
|
5536
|
+
minX: t,
|
|
5537
|
+
minY: n,
|
|
5538
|
+
bw: h,
|
|
5539
|
+
bh: g,
|
|
5540
|
+
clip: _,
|
|
5541
|
+
originX: p - t,
|
|
5542
|
+
originY: m - n,
|
|
5543
|
+
delay: O,
|
|
5544
|
+
kf: j
|
|
5545
|
+
});
|
|
5546
|
+
}
|
|
5547
|
+
return d;
|
|
5548
|
+
}
|
|
5549
|
+
function k(e, t) {
|
|
5550
|
+
let n = o.value;
|
|
5551
|
+
if (!n) return [];
|
|
5552
|
+
let i = e.width, a = e.height, s = n.cloneNode(!0);
|
|
5553
|
+
s.removeAttribute("id"), Object.assign(s.style, {
|
|
5554
|
+
margin: "0",
|
|
5555
|
+
inset: "auto",
|
|
5556
|
+
position: "static",
|
|
5557
|
+
transform: "none",
|
|
5558
|
+
display: "",
|
|
5559
|
+
visibility: "visible"
|
|
5560
|
+
});
|
|
5561
|
+
let c = document.createElement("div");
|
|
5562
|
+
Object.assign(c.style, {
|
|
5563
|
+
position: "absolute",
|
|
5564
|
+
left: `${e.left + window.scrollX}px`,
|
|
5565
|
+
top: `${e.top + window.scrollY}px`,
|
|
5566
|
+
width: `${i}px`,
|
|
5567
|
+
height: `${a}px`,
|
|
5568
|
+
pointerEvents: "none",
|
|
5569
|
+
overflow: "visible",
|
|
5570
|
+
contain: "layout",
|
|
5571
|
+
zIndex: String(r.zIndex)
|
|
5572
|
+
}), c.setAttribute("aria-hidden", "true");
|
|
5573
|
+
let l = document.createDocumentFragment(), d = [];
|
|
5574
|
+
for (let e of t) {
|
|
5575
|
+
let t = document.createElement("div");
|
|
5576
|
+
Object.assign(t.style, {
|
|
5577
|
+
position: "absolute",
|
|
5578
|
+
left: `${e.minX}px`,
|
|
5579
|
+
top: `${e.minY}px`,
|
|
5580
|
+
width: `${e.bw}px`,
|
|
5581
|
+
height: `${e.bh}px`,
|
|
5582
|
+
overflow: "hidden",
|
|
5583
|
+
clipPath: `polygon(${e.clip})`,
|
|
5584
|
+
transformOrigin: `${e.originX.toFixed(2)}px ${e.originY.toFixed(2)}px`,
|
|
5585
|
+
willChange: "transform, opacity",
|
|
5586
|
+
contain: "layout paint",
|
|
5587
|
+
backfaceVisibility: "hidden"
|
|
5588
|
+
});
|
|
5589
|
+
let n = s.cloneNode(!0);
|
|
5590
|
+
Object.assign(n.style, {
|
|
5591
|
+
position: "absolute",
|
|
5592
|
+
left: `${-e.minX}px`,
|
|
5593
|
+
top: `${-e.minY}px`,
|
|
5594
|
+
width: `${i}px`,
|
|
5595
|
+
height: `${a}px`,
|
|
5596
|
+
margin: "0"
|
|
5597
|
+
}), t.appendChild(n), l.appendChild(t), d.push({
|
|
5598
|
+
el: t,
|
|
5599
|
+
desc: e
|
|
5600
|
+
});
|
|
5601
|
+
}
|
|
5602
|
+
return c.appendChild(l), document.body.appendChild(c), u = c, d;
|
|
5603
|
+
}
|
|
5604
|
+
function j(e, t) {
|
|
5605
|
+
if (d = e.map(({ el: e, desc: t }) => e.animate(t.kf, {
|
|
5606
|
+
duration: r.duration,
|
|
5607
|
+
delay: t.delay,
|
|
5608
|
+
easing: r.easing,
|
|
5609
|
+
fill: "both"
|
|
5610
|
+
})), !d.length) {
|
|
5611
|
+
t();
|
|
5612
|
+
return;
|
|
5613
|
+
}
|
|
5614
|
+
Promise.allSettled(d.map((e) => e.finished)).then(t);
|
|
5615
|
+
}
|
|
5616
|
+
function M(e) {
|
|
5617
|
+
let t = o.value;
|
|
5618
|
+
if (!t || c.value !== "idle" || r.disabled) return;
|
|
5619
|
+
let n = t.getBoundingClientRect(), i = n.width, l = n.height;
|
|
5620
|
+
if (a("shatterStart"), c.value = "shattering", s.value || r.disableAnimation || i < 2 || l < 2 || typeof t.animate != "function") {
|
|
5621
|
+
m = null, N();
|
|
5622
|
+
return;
|
|
5623
|
+
}
|
|
5624
|
+
let [u, d] = e ?? E(i, l);
|
|
5625
|
+
m = {
|
|
5626
|
+
seed: (r.seed ?? Math.floor((typeof performance < "u" ? performance.now() : 0) * 1e3)) >>> 0 || 1,
|
|
5627
|
+
ox: u,
|
|
5628
|
+
oy: d
|
|
5629
|
+
};
|
|
5630
|
+
let f = k(n, D(i, l, m.seed, u, d, "out"));
|
|
5631
|
+
t.style.visibility = "hidden", requestAnimationFrame(() => {
|
|
5632
|
+
c.value === "shattering" && j(f, () => {
|
|
5633
|
+
c.value === "shattering" && N();
|
|
5634
|
+
});
|
|
5635
|
+
});
|
|
5636
|
+
}
|
|
5637
|
+
function N() {
|
|
5638
|
+
L();
|
|
5639
|
+
let e = o.value;
|
|
5640
|
+
e && h(e), c.value = "shattered", i.value = !0, a("shatterEnd"), r.autoRestore > 0 && (f = setTimeout(P, r.autoRestore));
|
|
5641
|
+
}
|
|
5642
|
+
function P() {
|
|
5643
|
+
if (f &&= (clearTimeout(f), null), c.value === "idle") {
|
|
5644
|
+
i.value = !1;
|
|
5645
|
+
return;
|
|
5646
|
+
}
|
|
5647
|
+
if (c.value === "restoring") return;
|
|
5648
|
+
L();
|
|
5649
|
+
let e = o.value, t = r.reassemble && !s.value && !r.disableAnimation && !!m && !!e && typeof e?.animate == "function";
|
|
5650
|
+
if (!e || !t || !m) {
|
|
5651
|
+
e && g(e), c.value = "idle", i.value = !1;
|
|
5652
|
+
return;
|
|
5653
|
+
}
|
|
5654
|
+
e.style.display = "", e.style.visibility = "hidden";
|
|
5655
|
+
let n = e.getBoundingClientRect(), a = n.width, l = n.height;
|
|
5656
|
+
if (a < 2 || l < 2) {
|
|
5657
|
+
g(e), c.value = "idle", i.value = !1;
|
|
5658
|
+
return;
|
|
5659
|
+
}
|
|
5660
|
+
c.value = "restoring";
|
|
5661
|
+
let u = k(n, D(a, l, m.seed, m.ox, m.oy, "in"));
|
|
5662
|
+
requestAnimationFrame(() => {
|
|
5663
|
+
c.value === "restoring" && j(u, () => {
|
|
5664
|
+
c.value === "restoring" && F();
|
|
5665
|
+
});
|
|
5666
|
+
});
|
|
5667
|
+
}
|
|
5668
|
+
function F() {
|
|
5669
|
+
L();
|
|
5670
|
+
let e = o.value;
|
|
5671
|
+
e && g(e), c.value = "idle", i.value = !1, a("restoreEnd");
|
|
5672
|
+
}
|
|
5673
|
+
function L() {
|
|
5674
|
+
for (let e of d) try {
|
|
5675
|
+
e.cancel();
|
|
5676
|
+
} catch {}
|
|
5677
|
+
d = [], u &&= (u.remove(), null);
|
|
5678
|
+
}
|
|
5679
|
+
function R(e) {
|
|
5680
|
+
if (r.trigger !== "click" || c.value !== "idle" || r.disabled) return;
|
|
5681
|
+
let t = o.value;
|
|
5682
|
+
if (!t) return;
|
|
5683
|
+
let n = t.getBoundingClientRect();
|
|
5684
|
+
M([e.clientX - n.left, e.clientY - n.top]);
|
|
5685
|
+
}
|
|
5686
|
+
function B(e) {
|
|
5687
|
+
if (r.origin !== "pointer") return;
|
|
5688
|
+
let t = o.value;
|
|
5689
|
+
if (!t) return;
|
|
5690
|
+
let n = t.getBoundingClientRect();
|
|
5691
|
+
p.x = e.clientX - n.left, p.y = e.clientY - n.top, p.set = !0;
|
|
5692
|
+
}
|
|
5693
|
+
return U(i, (e) => {
|
|
5694
|
+
e && c.value === "idle" ? M() : !e && c.value !== "idle" && P();
|
|
5695
|
+
}), S(() => {
|
|
5696
|
+
i.value && M();
|
|
5697
|
+
}), x(() => {
|
|
5698
|
+
f && clearTimeout(f), L();
|
|
5699
|
+
}), t({
|
|
5700
|
+
shatter: (e) => M(e),
|
|
5701
|
+
restore: P
|
|
5702
|
+
}), (t, n) => (T(), l("div", {
|
|
5703
|
+
ref_key: "rootRef",
|
|
5704
|
+
ref: o,
|
|
5705
|
+
class: y(I(Y)("kun-shatter inline-block", e.className)),
|
|
5706
|
+
onClick: R,
|
|
5707
|
+
onPointermovePassive: B
|
|
5708
|
+
}, [A(t.$slots, "default")], 34));
|
|
5709
|
+
}
|
|
5710
|
+
}), Fs = { class: "relative" }, Is = ["aria-label"], Ls = /* @__PURE__ */ p({
|
|
5381
5711
|
name: "KunScrollShadow",
|
|
5382
5712
|
__name: "ScrollShadow",
|
|
5383
5713
|
props: {
|
|
@@ -5389,8 +5719,8 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5389
5719
|
ariaLabel: { default: "scrollable content" }
|
|
5390
5720
|
},
|
|
5391
5721
|
setup(e) {
|
|
5392
|
-
let t = e, n = O(null), r = O(null), { x: i, y: a } =
|
|
5393
|
-
|
|
5722
|
+
let t = e, n = O(null), r = O(null), { x: i, y: a } = Ee(n, { throttle: 50 }), { width: s, height: c } = Ce(r), { width: d, height: f } = Ce(n), p = O(!1), m = O(!1);
|
|
5723
|
+
W(() => {
|
|
5394
5724
|
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));
|
|
5395
5725
|
});
|
|
5396
5726
|
let h = o(() => t.axis === "horizontal" ? "left-0 top-0 bottom-0" : "top-0 left-0 right-0"), g = o(() => t.axis === "horizontal" ? "right-0 top-0 bottom-0" : "bottom-0 left-0 right-0"), _ = o(() => {
|
|
@@ -5406,10 +5736,10 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5406
5736
|
}
|
|
5407
5737
|
};
|
|
5408
5738
|
});
|
|
5409
|
-
return (i, a) => (T(), l("div",
|
|
5739
|
+
return (i, a) => (T(), l("div", Fs, [
|
|
5410
5740
|
u("div", {
|
|
5411
5741
|
"aria-hidden": "true",
|
|
5412
|
-
class: y(I(
|
|
5742
|
+
class: y(I(Y)("pointer-events-none absolute z-10 transition-opacity", h.value, p.value ? "opacity-100" : "opacity-0")),
|
|
5413
5743
|
style: b(_.value.start)
|
|
5414
5744
|
}, null, 6),
|
|
5415
5745
|
u("div", {
|
|
@@ -5418,20 +5748,20 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5418
5748
|
tabindex: "0",
|
|
5419
5749
|
role: "region",
|
|
5420
5750
|
"aria-label": e.ariaLabel,
|
|
5421
|
-
class: y(I(
|
|
5751
|
+
class: y(I(Y)("scrollbar-hide", e.axis === "horizontal" ? "overflow-x-auto" : "overflow-y-auto", t.className))
|
|
5422
5752
|
}, [u("div", {
|
|
5423
5753
|
ref_key: "contentWrapper",
|
|
5424
5754
|
ref: r,
|
|
5425
|
-
class: y(I(
|
|
5426
|
-
}, [A(i.$slots, "default")], 2)], 10,
|
|
5755
|
+
class: y(I(Y)(e.axis === "horizontal" ? "flex w-max gap-3" : "flex w-full flex-col gap-3", t.contentClass))
|
|
5756
|
+
}, [A(i.$slots, "default")], 2)], 10, Is),
|
|
5427
5757
|
u("div", {
|
|
5428
5758
|
"aria-hidden": "true",
|
|
5429
|
-
class: y(I(
|
|
5759
|
+
class: y(I(Y)("pointer-events-none absolute z-10 transition-opacity", g.value, m.value ? "opacity-100" : "opacity-0")),
|
|
5430
5760
|
style: b(_.value.end)
|
|
5431
5761
|
}, null, 6)
|
|
5432
5762
|
]));
|
|
5433
5763
|
}
|
|
5434
|
-
}),
|
|
5764
|
+
}), Rs = /* @__PURE__ */ p({
|
|
5435
5765
|
name: "KunSkeleton",
|
|
5436
5766
|
__name: "Skeleton",
|
|
5437
5767
|
props: {
|
|
@@ -5447,7 +5777,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5447
5777
|
className: { default: "" }
|
|
5448
5778
|
},
|
|
5449
5779
|
setup(e) {
|
|
5450
|
-
let t = e, n =
|
|
5780
|
+
let t = e, n = Tt(() => t.rounded), r = o(() => t.variant === "circle" ? "rounded-full" : t.variant === "text" ? "rounded-md" : Z[n.value]), i = o(() => {
|
|
5451
5781
|
let e = t.height || (t.variant === "text" ? "1em" : t.variant === "circle" ? "2.5rem" : "1.25rem");
|
|
5452
5782
|
return {
|
|
5453
5783
|
width: t.width || (t.variant === "circle" ? e : "100%"),
|
|
@@ -5457,20 +5787,20 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5457
5787
|
return (t, n) => e.loaded ? A(t.$slots, "default", { key: 0 }) : (T(), l("span", {
|
|
5458
5788
|
key: 1,
|
|
5459
5789
|
"aria-hidden": "true",
|
|
5460
|
-
class: y(I(
|
|
5790
|
+
class: y(I(Y)("bg-default-200 dark:bg-default-100 block shrink-0", e.animation === "pulse" && "motion-safe:animate-pulse", r.value, e.className)),
|
|
5461
5791
|
style: b(i.value)
|
|
5462
5792
|
}, null, 6));
|
|
5463
5793
|
}
|
|
5464
|
-
}),
|
|
5794
|
+
}), zs = {
|
|
5465
5795
|
key: 0,
|
|
5466
5796
|
class: "mb-1.5 flex items-center justify-between gap-2"
|
|
5467
|
-
},
|
|
5797
|
+
}, Bs = ["id"], Vs = {
|
|
5468
5798
|
key: 1,
|
|
5469
5799
|
class: "text-default-500 text-sm tabular-nums"
|
|
5470
|
-
},
|
|
5800
|
+
}, Hs = {
|
|
5471
5801
|
key: 0,
|
|
5472
5802
|
class: "bg-content1 text-foreground border-kun pointer-events-none absolute bottom-full left-1/2 mb-2 -translate-x-1/2 rounded-kun-sm border px-2 py-0.5 text-xs font-medium tabular-nums shadow-kun-sm"
|
|
5473
|
-
},
|
|
5803
|
+
}, Us = [
|
|
5474
5804
|
"tabindex",
|
|
5475
5805
|
"aria-label",
|
|
5476
5806
|
"aria-labelledby",
|
|
@@ -5479,16 +5809,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5479
5809
|
"aria-valuemax",
|
|
5480
5810
|
"aria-valuetext",
|
|
5481
5811
|
"aria-disabled"
|
|
5482
|
-
],
|
|
5812
|
+
], Ws = {
|
|
5483
5813
|
key: 0,
|
|
5484
5814
|
class: "relative mt-1 h-4"
|
|
5485
|
-
},
|
|
5815
|
+
}, Gs = {
|
|
5486
5816
|
key: 1,
|
|
5487
5817
|
class: "text-danger mt-1 text-sm"
|
|
5488
|
-
},
|
|
5818
|
+
}, Ks = {
|
|
5489
5819
|
key: 2,
|
|
5490
5820
|
class: "text-default-500 mt-1 text-sm"
|
|
5491
|
-
},
|
|
5821
|
+
}, qs = /* @__PURE__ */ p({
|
|
5492
5822
|
name: "KunSlider",
|
|
5493
5823
|
__name: "Slider",
|
|
5494
5824
|
props: /*@__PURE__*/ g({
|
|
@@ -5521,7 +5851,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5521
5851
|
}),
|
|
5522
5852
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
5523
5853
|
setup(e, { emit: n }) {
|
|
5524
|
-
let r = z(e, "modelValue"), a = e, s = n, d =
|
|
5854
|
+
let r = z(e, "modelValue"), a = e, s = n, d = at("kun-slider"), p = {
|
|
5525
5855
|
xs: {
|
|
5526
5856
|
track: "h-1",
|
|
5527
5857
|
thumb: "size-3.5"
|
|
@@ -5637,18 +5967,18 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5637
5967
|
}, V = o(() => a.showTooltip && x.value && !a.disabled);
|
|
5638
5968
|
return w(() => {
|
|
5639
5969
|
R();
|
|
5640
|
-
}), (n, a) => (T(), l("div", { class: y(I(
|
|
5641
|
-
e.label || e.showValue ? (T(), l("div",
|
|
5970
|
+
}), (n, a) => (T(), l("div", { class: y(I(Y)("w-full", e.disabled && "opacity-50")) }, [
|
|
5971
|
+
e.label || e.showValue ? (T(), l("div", zs, [e.label ? (T(), l("label", {
|
|
5642
5972
|
key: 0,
|
|
5643
5973
|
id: `${I(d)}-label`,
|
|
5644
5974
|
class: "text-default-700 block text-sm font-medium"
|
|
5645
|
-
}, M(e.label), 9,
|
|
5975
|
+
}, M(e.label), 9, Bs)) : c("", !0), e.showValue ? (T(), l("span", Vs, M(j.value), 1)) : c("", !0)])) : c("", !0),
|
|
5646
5976
|
u("div", {
|
|
5647
5977
|
class: y(["kun-slider relative py-2", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
5648
5978
|
ref_key: "sliderRef",
|
|
5649
5979
|
ref: _,
|
|
5650
5980
|
onMousedownPassive: L,
|
|
5651
|
-
onTouchstartPassive:
|
|
5981
|
+
onTouchstartPassive: J(L, ["stop"])
|
|
5652
5982
|
}, [u("div", { class: y(["bg-default relative w-full rounded-full", m.value.track]) }, [
|
|
5653
5983
|
u("div", {
|
|
5654
5984
|
class: y(["absolute h-full rounded-full", g.value.fill]),
|
|
@@ -5670,7 +6000,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5670
6000
|
"leave-active-class": "transition duration-kun-exit ease-kun-in",
|
|
5671
6001
|
"leave-to-class": "opacity-0 translate-y-1"
|
|
5672
6002
|
}, {
|
|
5673
|
-
default:
|
|
6003
|
+
default: G(() => [V.value ? (T(), l("span", Hs, M(j.value), 1)) : c("", !0)]),
|
|
5674
6004
|
_: 1
|
|
5675
6005
|
}), u("div", {
|
|
5676
6006
|
class: y(["bg-content1 rounded-full border-2 transition-shadow duration-kun-fast hover:ring-4 focus-visible:ring-4 focus-visible:outline-none active:ring-4", [
|
|
@@ -5690,23 +6020,23 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5690
6020
|
"aria-disabled": e.disabled || void 0,
|
|
5691
6021
|
"aria-orientation": "horizontal",
|
|
5692
6022
|
onMousedownPassive: L,
|
|
5693
|
-
onTouchstartPassive:
|
|
6023
|
+
onTouchstartPassive: J(L, ["stop"]),
|
|
5694
6024
|
onKeydown: B,
|
|
5695
6025
|
onFocus: a[0] ||= (e) => x.value = !0,
|
|
5696
6026
|
onBlur: a[1] ||= (e) => !v.value && (x.value = !1)
|
|
5697
|
-
}, null, 42,
|
|
5698
|
-
], 2), N.value.some((e) => e.label) ? (T(), l("div",
|
|
6027
|
+
}, null, 42, Us)], 36)
|
|
6028
|
+
], 2), N.value.some((e) => e.label) ? (T(), l("div", Ws, [(T(!0), l(t, null, k(N.value, (e, t) => K((T(), l("span", {
|
|
5699
6029
|
key: t,
|
|
5700
6030
|
class: "text-default-500 absolute -translate-x-1/2 text-xs whitespace-nowrap",
|
|
5701
6031
|
style: b({ left: e.percent + "%" })
|
|
5702
6032
|
}, M(e.label), 5)), [[H, e.label]])), 128))])) : c("", !0)], 34),
|
|
5703
|
-
e.error ? (T(), l("p",
|
|
6033
|
+
e.error ? (T(), l("p", Gs, M(e.error), 1)) : e.description ? (T(), l("p", Ks, M(e.description), 1)) : c("", !0)
|
|
5704
6034
|
], 2));
|
|
5705
6035
|
}
|
|
5706
|
-
}),
|
|
6036
|
+
}), Js = ["aria-current"], Ys = {
|
|
5707
6037
|
key: 0,
|
|
5708
6038
|
class: "text-default-500 mt-0.5 text-xs"
|
|
5709
|
-
},
|
|
6039
|
+
}, Xs = /* @__PURE__ */ p({
|
|
5710
6040
|
name: "KunSteps",
|
|
5711
6041
|
__name: "Steps",
|
|
5712
6042
|
props: {
|
|
@@ -5748,32 +6078,32 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5748
6078
|
}, p = (e) => e < n.current ? "done" : e === n.current ? "active" : "pending", m = (e) => {
|
|
5749
6079
|
let t = p(e);
|
|
5750
6080
|
if (t === "pending") return "border-2 border-default-200 text-default-400 bg-transparent";
|
|
5751
|
-
let r =
|
|
5752
|
-
return t === "active" ?
|
|
5753
|
-
}, h = (e) => e < n.current ?
|
|
5754
|
-
return (n, i) => (T(), l("ol", { class: y(I(
|
|
6081
|
+
let r = Y(me[n.color], ge[n.color]);
|
|
6082
|
+
return t === "active" ? Y(r, "ring-4", f[n.color]) : r;
|
|
6083
|
+
}, h = (e) => e < n.current ? me[n.color] : "bg-default-200";
|
|
6084
|
+
return (n, i) => (T(), l("ol", { class: y(I(Y)(r.value ? "flex flex-col" : "flex w-full items-start", e.className)) }, [(T(!0), l(t, null, k(e.items, (n, i) => (T(), l("li", {
|
|
5755
6085
|
key: i,
|
|
5756
|
-
class: y(r.value ? I(
|
|
6086
|
+
class: y(r.value ? I(Y)("flex", a.value.gap) : I(Y)("relative flex-1 last:flex-none", i < e.items.length - 1 && "pr-2")),
|
|
5757
6087
|
"aria-current": p(i) === "active" ? "step" : void 0
|
|
5758
|
-
}, [u("div", { class: y(r.value ? "flex flex-col items-center" : "flex w-full items-center") }, [u("span", { class: y(I(
|
|
6088
|
+
}, [u("div", { class: y(r.value ? "flex flex-col items-center" : "flex w-full items-center") }, [u("span", { class: y(I(Y)("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" ? (T(), s(Q, {
|
|
5759
6089
|
key: 0,
|
|
5760
6090
|
name: "lucide:check",
|
|
5761
6091
|
class: y(a.value.icon)
|
|
5762
|
-
}, null, 8, ["class"])) : n.icon ? (T(), s(
|
|
6092
|
+
}, null, 8, ["class"])) : n.icon ? (T(), s(Q, {
|
|
5763
6093
|
key: 1,
|
|
5764
6094
|
name: n.icon,
|
|
5765
6095
|
class: y(a.value.icon)
|
|
5766
6096
|
}, null, 8, ["name", "class"])) : (T(), l(t, { key: 2 }, [d(M(i + 1), 1)], 64))], 2), i < e.items.length - 1 ? (T(), l("span", {
|
|
5767
6097
|
key: 0,
|
|
5768
|
-
class: y(I(
|
|
5769
|
-
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : I(
|
|
6098
|
+
class: y(I(Y)("transition-colors", r.value ? "mt-1 w-0.5 flex-1" : "mx-2 h-0.5 flex-1", h(i)))
|
|
6099
|
+
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : I(Y)("mt-2", i < e.items.length - 1 ? "pr-2" : "")) }, [u("p", { class: y(I(Y)("font-medium", a.value.title, p(i) === "pending" ? "text-default-400" : p(i) === "active" ? I(_e)[e.color] : "text-foreground")) }, M(n.title), 3), n.description ? (T(), l("p", Ys, M(n.description), 1)) : c("", !0)], 2)], 10, Js))), 128))], 2));
|
|
5770
6100
|
}
|
|
5771
|
-
}),
|
|
6101
|
+
}), Zs = [
|
|
5772
6102
|
"id",
|
|
5773
6103
|
"checked",
|
|
5774
6104
|
"disabled",
|
|
5775
6105
|
"aria-describedby"
|
|
5776
|
-
],
|
|
6106
|
+
], Qs = { class: "relative" }, $s = ["id"], ec = ["id"], tc = /* @__PURE__ */ p({
|
|
5777
6107
|
name: "KunSwitch",
|
|
5778
6108
|
__name: "Switch",
|
|
5779
6109
|
props: /*@__PURE__*/ g({
|
|
@@ -5796,7 +6126,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5796
6126
|
}),
|
|
5797
6127
|
emits: ["update:modelValue"],
|
|
5798
6128
|
setup(e) {
|
|
5799
|
-
let t = e, n = z(e, "modelValue"), r =
|
|
6129
|
+
let t = e, n = z(e, "modelValue"), r = at("kun-switch"), i = {
|
|
5800
6130
|
xs: {
|
|
5801
6131
|
track: "h-4 w-7",
|
|
5802
6132
|
thumb: "size-3",
|
|
@@ -5833,7 +6163,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5833
6163
|
gap: "ml-3.5"
|
|
5834
6164
|
}
|
|
5835
6165
|
}, a = o(() => i[t.size]);
|
|
5836
|
-
return (t, i) => (T(), l("div", null, [u("label", { class: y(I(
|
|
6166
|
+
return (t, i) => (T(), l("div", null, [u("label", { class: y(I(Y)("inline-flex cursor-pointer items-center", e.disabled ? "cursor-not-allowed" : "", e.className)) }, [
|
|
5837
6167
|
u("input", {
|
|
5838
6168
|
id: I(r),
|
|
5839
6169
|
type: "checkbox",
|
|
@@ -5842,28 +6172,28 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5842
6172
|
disabled: e.disabled,
|
|
5843
6173
|
"aria-describedby": e.error || e.description ? `${I(r)}-desc` : void 0,
|
|
5844
6174
|
onChange: i[0] ||= (e) => n.value = e.target.checked
|
|
5845
|
-
}, null, 40,
|
|
5846
|
-
u("div",
|
|
6175
|
+
}, null, 40, Zs),
|
|
6176
|
+
u("div", Qs, [u("div", { class: y(["rounded-full transition-colors duration-kun-fast ease-kun-standard peer-focus-visible:ring-2 peer-focus-visible:ring-primary/50", [
|
|
5847
6177
|
a.value.track,
|
|
5848
6178
|
n.value ? "bg-primary" : "bg-default-500",
|
|
5849
6179
|
e.disabled ? "opacity-50" : "",
|
|
5850
6180
|
n.value && e.disabled ? "bg-primary-300" : ""
|
|
5851
|
-
]]) }, null, 2), u("div", { class: y(I(
|
|
6181
|
+
]]) }, null, 2), u("div", { class: y(I(Y)("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)]),
|
|
5852
6182
|
e.label ? (T(), l("span", {
|
|
5853
6183
|
key: 0,
|
|
5854
|
-
class: y(I(
|
|
6184
|
+
class: y(I(Y)("font-medium", a.value.gap, a.value.text, e.disabled ? "text-default-400" : "", e.labelClassName))
|
|
5855
6185
|
}, M(e.label), 3)) : c("", !0)
|
|
5856
6186
|
], 2), e.error ? (T(), l("p", {
|
|
5857
6187
|
key: 0,
|
|
5858
6188
|
id: `${I(r)}-desc`,
|
|
5859
6189
|
class: "text-danger mt-1 text-sm"
|
|
5860
|
-
}, M(e.error), 9,
|
|
6190
|
+
}, M(e.error), 9, $s)) : e.description ? (T(), l("p", {
|
|
5861
6191
|
key: 1,
|
|
5862
6192
|
id: `${I(r)}-desc`,
|
|
5863
6193
|
class: "text-default-500 mt-1 text-sm"
|
|
5864
|
-
}, M(e.description), 9,
|
|
6194
|
+
}, M(e.description), 9, ec)) : c("", !0)]));
|
|
5865
6195
|
}
|
|
5866
|
-
}),
|
|
6196
|
+
}), nc = Symbol("kun-tab-panels"), rc = (e, t) => `${e ?? "kun"}-tab-${t}`, ic = (e, t) => `${e ?? "kun"}-tabpanel-${t}`, ac = ["aria-orientation"], oc = { key: 1 }, sc = /* @__PURE__ */ p({
|
|
5867
6197
|
name: "KunTab",
|
|
5868
6198
|
__name: "Tab",
|
|
5869
6199
|
props: /*@__PURE__*/ g({
|
|
@@ -5899,7 +6229,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5899
6229
|
}),
|
|
5900
6230
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
5901
6231
|
setup(e, { emit: n }) {
|
|
5902
|
-
let r = e, i = z(e, "modelValue"), a = n, d =
|
|
6232
|
+
let r = e, i = z(e, "modelValue"), a = n, d = ut(), p = o(() => r.orientation === "vertical"), m = {
|
|
5903
6233
|
sm: "text-sm px-2.5 py-1.5",
|
|
5904
6234
|
md: "text-sm px-3 py-2",
|
|
5905
6235
|
lg: "text-base px-4 py-2.5"
|
|
@@ -5999,31 +6329,31 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5999
6329
|
disabled: e.disabled || r.disabled
|
|
6000
6330
|
}, V = (e, t, n) => {
|
|
6001
6331
|
t.href && e.preventDefault(), L(t, n);
|
|
6002
|
-
}, H = (e) =>
|
|
6003
|
-
let e = p.value ?
|
|
6332
|
+
}, H = (e) => rc(r.name, e), W = (e) => ic(r.name, e), K = (e) => i.value === e.value, q = o(() => Y("relative", p.value ? "inline-flex flex-col" : "inline-flex", r.fullWidth && "w-full", r.disabled && "opacity-50 cursor-not-allowed", r.scrollable && (p.value ? "max-h-full overflow-y-auto scrollbar-hide" : "max-w-full overflow-x-auto scrollbar-hide"), r.className)), J = o(() => {
|
|
6333
|
+
let e = p.value ? Y("relative flex flex-col items-stretch", h[r.size]) : Y("relative flex items-center", h[r.size]);
|
|
6004
6334
|
switch (r.variant) {
|
|
6005
|
-
case "underlined": return
|
|
6335
|
+
case "underlined": return Y(e, r.innerClassName);
|
|
6006
6336
|
case "solid":
|
|
6007
|
-
case "light": return
|
|
6008
|
-
case "bordered": return
|
|
6009
|
-
case "pills": return
|
|
6010
|
-
default: return
|
|
6337
|
+
case "light": return Y(e, "border border-kun rounded-kun-lg p-1 bg-content2/30", r.innerClassName);
|
|
6338
|
+
case "bordered": return Y(e, "border border-kun rounded-kun-lg p-1", r.innerClassName);
|
|
6339
|
+
case "pills": return Y(e, r.innerClassName);
|
|
6340
|
+
default: return Y(e, r.innerClassName);
|
|
6011
6341
|
}
|
|
6012
|
-
}),
|
|
6342
|
+
}), ee = {
|
|
6013
6343
|
start: "justify-start",
|
|
6014
6344
|
center: "justify-center",
|
|
6015
6345
|
end: "justify-end"
|
|
6016
|
-
},
|
|
6017
|
-
let t =
|
|
6346
|
+
}, te = (e) => {
|
|
6347
|
+
let t = K(e), n = Y("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 = !ae.value;
|
|
6018
6348
|
switch (r.variant) {
|
|
6019
|
-
case "underlined": return
|
|
6020
|
-
case "solid": return
|
|
6021
|
-
case "light": return
|
|
6022
|
-
case "bordered": return
|
|
6023
|
-
case "pills": return
|
|
6349
|
+
case "underlined": return Y(n, t ? _e[r.color] : "text-default-500 hover:text-foreground");
|
|
6350
|
+
case "solid": return Y(n, "rounded-kun-md", t ? Y(ge[r.color], i && me[r.color]) : "text-default-500 hover:text-foreground");
|
|
6351
|
+
case "light": return Y(n, "rounded-kun-md", t ? Y(_e[r.color], i && re[r.color]) : "text-default-500 hover:text-foreground");
|
|
6352
|
+
case "bordered": return Y(n, "rounded-kun-md border", t ? Y(se[r.color], _e[r.color]) : "border-transparent text-default-500 hover:text-foreground");
|
|
6353
|
+
case "pills": return Y(n, "rounded-full", t ? he[r.color] : "text-default-500 hover:text-foreground");
|
|
6024
6354
|
default: return n;
|
|
6025
6355
|
}
|
|
6026
|
-
},
|
|
6356
|
+
}, ne = (e) => r.variant === "underlined" && K(e) && !ae.value ? { boxShadow: p.value ? "inset 2px 0 0 0 currentColor" : "inset 0 -2px 0 0 currentColor" } : void 0, re = {
|
|
6027
6357
|
default: "bg-default/15",
|
|
6028
6358
|
primary: "bg-primary/15",
|
|
6029
6359
|
secondary: "bg-secondary/15",
|
|
@@ -6031,28 +6361,28 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6031
6361
|
warning: "bg-warning/15",
|
|
6032
6362
|
danger: "bg-danger/15",
|
|
6033
6363
|
info: "bg-info/15"
|
|
6034
|
-
},
|
|
6364
|
+
}, ie = o(() => {
|
|
6035
6365
|
switch (r.variant) {
|
|
6036
|
-
case "underlined": return
|
|
6037
|
-
case "solid": return
|
|
6038
|
-
case "light": return
|
|
6366
|
+
case "underlined": return Y("absolute rounded-full", oe[r.color], p.value ? "left-0 top-0" : "bottom-0 left-0");
|
|
6367
|
+
case "solid": return Y("absolute top-0 left-0 rounded-kun-md", me[r.color]);
|
|
6368
|
+
case "light": return Y("absolute top-0 left-0 rounded-kun-md", re[r.color]);
|
|
6039
6369
|
default: return null;
|
|
6040
6370
|
}
|
|
6041
|
-
}),
|
|
6371
|
+
}), ae = o(() => !!ie.value && w.value >= 0 && Object.keys(E.value).length > 0), ce = o(() => {
|
|
6042
6372
|
let e = { ...E.value };
|
|
6043
6373
|
return r.disableAnimation || (e.transition = "transform var(--kun-dur-base) var(--ease-kun-standard), width var(--kun-dur-base) var(--ease-kun-standard)"), e;
|
|
6044
6374
|
});
|
|
6045
|
-
return (n, r) => (T(), l("div", { class: y(
|
|
6375
|
+
return (n, r) => (T(), l("div", { class: y(q.value) }, [u("div", {
|
|
6046
6376
|
ref_key: "listRef",
|
|
6047
6377
|
ref: A,
|
|
6048
|
-
class: y(
|
|
6378
|
+
class: y(J.value),
|
|
6049
6379
|
role: "tablist",
|
|
6050
6380
|
"aria-orientation": e.orientation
|
|
6051
|
-
}, [
|
|
6381
|
+
}, [ae.value ? (T(), l("div", {
|
|
6052
6382
|
key: 0,
|
|
6053
6383
|
"aria-hidden": "true",
|
|
6054
|
-
class: y(
|
|
6055
|
-
style: b(
|
|
6384
|
+
class: y(ie.value),
|
|
6385
|
+
style: b(ce.value)
|
|
6056
6386
|
}, null, 6)) : c("", !0), (T(!0), l(t, null, k(e.items, (t, n) => (T(), s(j(R(t)), _({
|
|
6057
6387
|
key: t.value,
|
|
6058
6388
|
ref_for: !0,
|
|
@@ -6060,20 +6390,20 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6060
6390
|
}, { ref_for: !0 }, B(t), {
|
|
6061
6391
|
id: H(t.value),
|
|
6062
6392
|
role: "tab",
|
|
6063
|
-
"aria-controls":
|
|
6064
|
-
"aria-selected":
|
|
6393
|
+
"aria-controls": W(t.value),
|
|
6394
|
+
"aria-selected": K(t),
|
|
6065
6395
|
"aria-disabled": t.disabled || e.disabled,
|
|
6066
|
-
tabindex:
|
|
6067
|
-
class:
|
|
6068
|
-
style:
|
|
6396
|
+
tabindex: K(t) && !t.disabled && !e.disabled ? 0 : -1,
|
|
6397
|
+
class: te(t),
|
|
6398
|
+
style: ne(t),
|
|
6069
6399
|
onClick: (e) => V(e, t, n),
|
|
6070
6400
|
onKeydown: (e) => I(e, n)
|
|
6071
6401
|
}), {
|
|
6072
|
-
default:
|
|
6402
|
+
default: G(() => [t.icon ? (T(), l("span", {
|
|
6073
6403
|
key: 0,
|
|
6074
6404
|
class: "inline-flex shrink-0",
|
|
6075
6405
|
style: b({ fontSize: e.iconSize })
|
|
6076
|
-
}, [f(
|
|
6406
|
+
}, [f(Q, { name: t.icon }, null, 8, ["name"])], 4)) : c("", !0), t.textValue ? (T(), l("span", oc, M(t.textValue), 1)) : c("", !0)]),
|
|
6077
6407
|
_: 2
|
|
6078
6408
|
}, 1040, [
|
|
6079
6409
|
"id",
|
|
@@ -6085,14 +6415,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6085
6415
|
"style",
|
|
6086
6416
|
"onClick",
|
|
6087
6417
|
"onKeydown"
|
|
6088
|
-
]))), 128))], 10,
|
|
6418
|
+
]))), 128))], 10, ac)], 2));
|
|
6089
6419
|
}
|
|
6090
|
-
}),
|
|
6420
|
+
}), cc = [
|
|
6091
6421
|
"id",
|
|
6092
6422
|
"aria-labelledby",
|
|
6093
6423
|
"tabindex",
|
|
6094
6424
|
"data-kun-tab-hidden"
|
|
6095
|
-
],
|
|
6425
|
+
], lc = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
6096
6426
|
name: "KunTabPanel",
|
|
6097
6427
|
__name: "TabPanel",
|
|
6098
6428
|
props: {
|
|
@@ -6109,7 +6439,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6109
6439
|
},
|
|
6110
6440
|
emits: ["activate"],
|
|
6111
6441
|
setup(e, { emit: t }) {
|
|
6112
|
-
let n = e, r = t, i = m(
|
|
6442
|
+
let n = e, r = t, i = m(nc, null), a = o(() => n.active ?? i?.active.value), s = o(() => a.value === n.value), u = o(() => n.forceMount ? "eager" : n.mount ?? i?.mount.value ?? "eager"), d = o(() => n.hiddenStrategy ?? i?.hiddenStrategy.value ?? "until-found"), f = o(() => n.name ?? i?.name.value), p = o(() => ic(f.value, n.value)), h = o(() => rc(f.value, n.value)), g = O(s.value);
|
|
6113
6443
|
U(s, (e) => {
|
|
6114
6444
|
e && (g.value = !0);
|
|
6115
6445
|
});
|
|
@@ -6142,11 +6472,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6142
6472
|
"aria-labelledby": h.value,
|
|
6143
6473
|
tabindex: s.value ? 0 : -1,
|
|
6144
6474
|
"data-kun-tab-hidden": !b.value && x.value ? "" : void 0,
|
|
6145
|
-
class: y(I(
|
|
6475
|
+
class: y(I(Y)("focus:outline-none", e.className)),
|
|
6146
6476
|
onBeforematch: w
|
|
6147
|
-
}, [A(t.$slots, "default", {}, void 0, !0)], 42,
|
|
6477
|
+
}, [A(t.$slots, "default", {}, void 0, !0)], 42, cc)) : c("", !0);
|
|
6148
6478
|
}
|
|
6149
|
-
}), [["__scopeId", "data-v-ccf67b4b"]]),
|
|
6479
|
+
}), [["__scopeId", "data-v-ccf67b4b"]]), uc = /* @__PURE__ */ p({
|
|
6150
6480
|
name: "KunTabPanels",
|
|
6151
6481
|
__name: "TabPanels",
|
|
6152
6482
|
props: /*@__PURE__*/ g({
|
|
@@ -6160,7 +6490,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6160
6490
|
emits: ["update:modelValue"],
|
|
6161
6491
|
setup(e) {
|
|
6162
6492
|
let t = e, n = z(e, "modelValue");
|
|
6163
|
-
return E(
|
|
6493
|
+
return E(nc, {
|
|
6164
6494
|
active: o(() => n.value),
|
|
6165
6495
|
activate: (e) => {
|
|
6166
6496
|
n.value = e;
|
|
@@ -6170,24 +6500,24 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6170
6500
|
name: o(() => t.name)
|
|
6171
6501
|
}), (e, t) => (T(), l("div", null, [A(e.$slots, "default")]));
|
|
6172
6502
|
}
|
|
6173
|
-
}),
|
|
6503
|
+
}), dc = { class: "w-full" }, fc = ["for"], pc = [
|
|
6174
6504
|
"aria-label",
|
|
6175
6505
|
"aria-invalid",
|
|
6176
6506
|
"aria-disabled"
|
|
6177
|
-
],
|
|
6507
|
+
], mc = [
|
|
6178
6508
|
"tabindex",
|
|
6179
6509
|
"aria-label",
|
|
6180
6510
|
"onKeydown"
|
|
6181
|
-
],
|
|
6511
|
+
], hc = ["aria-label", "onClick"], gc = [
|
|
6182
6512
|
"id",
|
|
6183
6513
|
"placeholder",
|
|
6184
6514
|
"disabled",
|
|
6185
6515
|
"readonly",
|
|
6186
6516
|
"aria-describedby"
|
|
6187
|
-
],
|
|
6517
|
+
], _c = {
|
|
6188
6518
|
key: 1,
|
|
6189
6519
|
class: "text-default-400 ml-auto text-xs tabular-nums"
|
|
6190
|
-
},
|
|
6520
|
+
}, vc = ["id"], yc = ["id"], bc = /* @__PURE__ */ p({
|
|
6191
6521
|
name: "KunTagInput",
|
|
6192
6522
|
__name: "TagInput",
|
|
6193
6523
|
props: /*@__PURE__*/ g({
|
|
@@ -6264,10 +6594,10 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6264
6594
|
"invalid"
|
|
6265
6595
|
], ["update:modelValue"]),
|
|
6266
6596
|
setup(e, { emit: n }) {
|
|
6267
|
-
let r = e, i =
|
|
6597
|
+
let r = e, i = Tt(() => r.rounded), a = o(() => Z[i.value]), s = o(() => r.description || r.helperText), d = z(e, "modelValue"), p = n, m = O(null), h = O([]), g = O(""), _ = O(!1), b = (e, t) => {
|
|
6268
6598
|
let n = e && typeof e == "object" && "$el" in e ? e.$el ?? null : e;
|
|
6269
6599
|
n instanceof HTMLElement && (h.value[t] = n);
|
|
6270
|
-
}, x = O(!1), S =
|
|
6600
|
+
}, x = O(!1), S = at("kun-tag-input"), C = (e) => {
|
|
6271
6601
|
let t = e;
|
|
6272
6602
|
return r.trim && (t = t.trim()), r.transform && (t = r.transform(t)), t;
|
|
6273
6603
|
}, w = (e, t) => {
|
|
@@ -6348,48 +6678,48 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6348
6678
|
r.confirmOnBlur && N();
|
|
6349
6679
|
}, U = () => {
|
|
6350
6680
|
r.disabled || r.readonly || m.value?.focus();
|
|
6351
|
-
},
|
|
6681
|
+
}, W = {
|
|
6352
6682
|
xs: "min-h-[26px]",
|
|
6353
6683
|
sm: "min-h-[34px]",
|
|
6354
6684
|
md: "min-h-[38px]",
|
|
6355
6685
|
lg: "min-h-[46px]",
|
|
6356
6686
|
xl: "min-h-[54px]"
|
|
6357
|
-
},
|
|
6687
|
+
}, G = {
|
|
6358
6688
|
xs: "px-2.5 py-1 gap-1",
|
|
6359
6689
|
sm: "px-3.5 py-1.5 gap-1.5",
|
|
6360
6690
|
md: "px-4 py-2 gap-2",
|
|
6361
6691
|
lg: "px-5 py-2.5 gap-2",
|
|
6362
6692
|
xl: "px-6 py-3 gap-2.5"
|
|
6363
|
-
},
|
|
6693
|
+
}, q = {
|
|
6364
6694
|
xs: "text-xs",
|
|
6365
6695
|
sm: "text-sm",
|
|
6366
6696
|
md: "text-sm",
|
|
6367
6697
|
lg: "text-base",
|
|
6368
6698
|
xl: "text-lg"
|
|
6369
|
-
},
|
|
6370
|
-
return (n, r) => (T(), l("div",
|
|
6699
|
+
}, ee = o(() => Y("flex flex-wrap items-center transition-shadow", a.value, W[r.size], G[r.size], q[r.size], "border border-transparent", !r.error && "border-kun", r.variant === "flat" && "bg-content1 shadow-kun-sm", r.error ? de.danger : de[r.color], r.error && "border-danger", r.disabled && "opacity-50 cursor-not-allowed bg-default-100", r.readonly && "cursor-default", r.className)), te = o(() => Y("inline-flex items-center gap-1 rounded-full font-medium whitespace-nowrap select-none", ve("flat", r.color), ce[r.size], X[r.color])), ne = o(() => d.value.length >= r.maxTags);
|
|
6700
|
+
return (n, r) => (T(), l("div", dc, [
|
|
6371
6701
|
e.label ? (T(), l("label", {
|
|
6372
6702
|
key: 0,
|
|
6373
6703
|
for: I(S),
|
|
6374
6704
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
6375
|
-
}, M(e.label), 9,
|
|
6705
|
+
}, M(e.label), 9, fc)) : c("", !0),
|
|
6376
6706
|
u("div", {
|
|
6377
6707
|
role: "group",
|
|
6378
6708
|
"aria-label": e.label || "tag input",
|
|
6379
6709
|
"aria-invalid": !!e.error,
|
|
6380
6710
|
"aria-disabled": e.disabled,
|
|
6381
|
-
class: y(
|
|
6711
|
+
class: y(ee.value),
|
|
6382
6712
|
onClick: U
|
|
6383
6713
|
}, [
|
|
6384
6714
|
(T(!0), l(t, null, k(d.value, (t, i) => (T(), l("span", {
|
|
6385
6715
|
key: `${i}-${t}`,
|
|
6386
6716
|
ref_for: !0,
|
|
6387
6717
|
ref: (e) => b(e, i),
|
|
6388
|
-
class: y(
|
|
6718
|
+
class: y(te.value),
|
|
6389
6719
|
tabindex: e.disabled || e.readonly ? -1 : 0,
|
|
6390
6720
|
"aria-label": `标签 ${t}`,
|
|
6391
6721
|
onKeydown: (e) => F(e, i),
|
|
6392
|
-
onClick: r[0] ||=
|
|
6722
|
+
onClick: r[0] ||= J(() => {}, ["stop"])
|
|
6393
6723
|
}, [A(n.$slots, "tag", {
|
|
6394
6724
|
tag: t,
|
|
6395
6725
|
index: i,
|
|
@@ -6400,12 +6730,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6400
6730
|
tabindex: "-1",
|
|
6401
6731
|
"aria-label": `移除标签 ${t}`,
|
|
6402
6732
|
class: "hover:text-danger -mr-0.5 ml-1 inline-flex cursor-pointer rounded-full p-0.5 transition-colors focus:outline-none",
|
|
6403
|
-
onClick:
|
|
6404
|
-
}, [f(
|
|
6733
|
+
onClick: J((e) => j(i), ["stop"])
|
|
6734
|
+
}, [f(Q, {
|
|
6405
6735
|
name: "lucide:x",
|
|
6406
6736
|
class: "size-3.5"
|
|
6407
|
-
})], 8,
|
|
6408
|
-
e.readonly ? c("", !0) :
|
|
6737
|
+
})], 8, hc)) : c("", !0)])], 42, mc))), 128)),
|
|
6738
|
+
e.readonly ? c("", !0) : K((T(), l("input", {
|
|
6409
6739
|
key: 0,
|
|
6410
6740
|
id: I(S),
|
|
6411
6741
|
ref_key: "inputEl",
|
|
@@ -6415,7 +6745,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6415
6745
|
enterkeyhint: "enter",
|
|
6416
6746
|
placeholder: d.value.length === 0 ? e.placeholder : "",
|
|
6417
6747
|
disabled: e.disabled,
|
|
6418
|
-
readonly:
|
|
6748
|
+
readonly: ne.value,
|
|
6419
6749
|
"aria-describedby": e.error || s.value ? `${I(S)}-msg` : void 0,
|
|
6420
6750
|
class: "placeholder-default-400 min-w-[80px] flex-1 bg-transparent outline-none disabled:cursor-not-allowed read-only:cursor-not-allowed",
|
|
6421
6751
|
onKeydown: P,
|
|
@@ -6423,21 +6753,21 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6423
6753
|
onCompositionend: R,
|
|
6424
6754
|
onPaste: B,
|
|
6425
6755
|
onBlur: H
|
|
6426
|
-
}, null, 40,
|
|
6427
|
-
e.showCounter && e.maxTags !== Infinity ? (T(), l("span",
|
|
6428
|
-
], 10,
|
|
6756
|
+
}, null, 40, gc)), [[V, g.value]]),
|
|
6757
|
+
e.showCounter && e.maxTags !== Infinity ? (T(), l("span", _c, M(d.value.length) + "/" + M(e.maxTags), 1)) : c("", !0)
|
|
6758
|
+
], 10, pc),
|
|
6429
6759
|
e.error ? (T(), l("p", {
|
|
6430
6760
|
key: 1,
|
|
6431
6761
|
id: `${I(S)}-msg`,
|
|
6432
6762
|
class: "text-danger mt-1 text-sm"
|
|
6433
|
-
}, M(e.error), 9,
|
|
6763
|
+
}, M(e.error), 9, vc)) : s.value ? (T(), l("p", {
|
|
6434
6764
|
key: 2,
|
|
6435
6765
|
id: `${I(S)}-msg`,
|
|
6436
6766
|
class: "text-default-500 mt-1 text-sm"
|
|
6437
|
-
}, M(s.value), 9,
|
|
6767
|
+
}, M(s.value), 9, yc)) : c("", !0)
|
|
6438
6768
|
]));
|
|
6439
6769
|
}
|
|
6440
|
-
}),
|
|
6770
|
+
}), xc = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
6441
6771
|
name: "KunText",
|
|
6442
6772
|
__name: "Text",
|
|
6443
6773
|
props: {
|
|
@@ -6446,12 +6776,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6446
6776
|
},
|
|
6447
6777
|
setup(e) {
|
|
6448
6778
|
let t = e, n = o(() => t.content.replace(/([_/])/g, "$1"));
|
|
6449
|
-
return (e, r) => (T(), l("span", { class: y(I(
|
|
6779
|
+
return (e, r) => (T(), l("span", { class: y(I(Y)("kun-text-block", t.className)) }, M(n.value), 3));
|
|
6450
6780
|
}
|
|
6451
|
-
}), [["__scopeId", "data-v-e9ad81ae"]]),
|
|
6781
|
+
}), [["__scopeId", "data-v-e9ad81ae"]]), Sc = { class: "w-full" }, Cc = ["for"], wc = {
|
|
6452
6782
|
key: 0,
|
|
6453
6783
|
class: "text-danger ml-1"
|
|
6454
|
-
},
|
|
6784
|
+
}, Tc = { class: "relative" }, Ec = [
|
|
6455
6785
|
"id",
|
|
6456
6786
|
"name",
|
|
6457
6787
|
"placeholder",
|
|
@@ -6462,16 +6792,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6462
6792
|
"minlength",
|
|
6463
6793
|
"rows",
|
|
6464
6794
|
"autofocus"
|
|
6465
|
-
],
|
|
6795
|
+
], Dc = {
|
|
6466
6796
|
key: 0,
|
|
6467
6797
|
class: "text-default-500 absolute right-2 bottom-2 text-xs"
|
|
6468
|
-
},
|
|
6798
|
+
}, Oc = {
|
|
6469
6799
|
key: 1,
|
|
6470
6800
|
class: "text-danger mt-1 text-sm"
|
|
6471
|
-
},
|
|
6801
|
+
}, kc = {
|
|
6472
6802
|
key: 2,
|
|
6473
6803
|
class: "text-default-500 mt-1 text-sm"
|
|
6474
|
-
},
|
|
6804
|
+
}, Ac = /* @__PURE__ */ p({
|
|
6475
6805
|
name: "KunTextarea",
|
|
6476
6806
|
__name: "Textarea",
|
|
6477
6807
|
props: /*@__PURE__*/ g({
|
|
@@ -6527,7 +6857,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6527
6857
|
"input"
|
|
6528
6858
|
], ["update:modelValue"]),
|
|
6529
6859
|
setup(e, { expose: t, emit: n }) {
|
|
6530
|
-
let r = e, i =
|
|
6860
|
+
let r = e, i = Tt(() => r.rounded), a = o(() => Z[i.value]), s = o(() => r.description || r.hint), f = z(e, "modelValue"), p = at("kun-textarea"), m = O(null), h = n;
|
|
6531
6861
|
U(f, () => {
|
|
6532
6862
|
r.autoGrow && v(() => _());
|
|
6533
6863
|
});
|
|
@@ -6556,13 +6886,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6556
6886
|
});
|
|
6557
6887
|
},
|
|
6558
6888
|
textareaRef: m
|
|
6559
|
-
}), (t, n) => (T(), l("div",
|
|
6889
|
+
}), (t, n) => (T(), l("div", Sc, [
|
|
6560
6890
|
e.label ? (T(), l("label", {
|
|
6561
6891
|
key: 0,
|
|
6562
6892
|
for: I(p),
|
|
6563
6893
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
6564
|
-
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span",
|
|
6565
|
-
u("div",
|
|
6894
|
+
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span", wc, "*")) : c("", !0)], 8, Cc)) : c("", !0),
|
|
6895
|
+
u("div", Tc, [K(u("textarea", {
|
|
6566
6896
|
id: I(p),
|
|
6567
6897
|
ref_key: "textareaRef",
|
|
6568
6898
|
ref: m,
|
|
@@ -6576,34 +6906,34 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6576
6906
|
minlength: e.minlength,
|
|
6577
6907
|
rows: e.rows,
|
|
6578
6908
|
autofocus: e.autofocus,
|
|
6579
|
-
class: y(I(
|
|
6909
|
+
class: y(I(Y)("scrollbar-hide w-full bg-content1 shadow-kun-sm border transition-[color,box-shadow] duration-kun-fast ease-kun-standard", I(le)[r.size], a.value, e.error ? I(Y)("border-danger-300", I(X).danger) : I(Y)("border-kun", I(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")),
|
|
6580
6910
|
onInput: g,
|
|
6581
6911
|
onBlur: n[1] ||= (e) => h("blur", e),
|
|
6582
6912
|
onFocus: n[2] ||= (e) => h("focus", e)
|
|
6583
|
-
}, null, 42,
|
|
6584
|
-
e.error ? (T(), l("p",
|
|
6913
|
+
}, null, 42, Ec), [[V, f.value]]), e.maxlength && e.showCharCount ? (T(), l("div", Dc, M(f.value.length) + "/" + M(e.maxlength), 1)) : c("", !0)]),
|
|
6914
|
+
e.error ? (T(), l("p", Oc, M(e.error), 1)) : s.value ? (T(), l("p", kc, M(s.value), 1)) : c("", !0)
|
|
6585
6915
|
]));
|
|
6586
6916
|
}
|
|
6587
|
-
}),
|
|
6917
|
+
}), jc = /* @__PURE__ */ p({
|
|
6588
6918
|
name: "KunTimeline",
|
|
6589
6919
|
__name: "Timeline",
|
|
6590
6920
|
props: { className: { default: "" } },
|
|
6591
6921
|
setup(e) {
|
|
6592
|
-
return (t, n) => (T(), l("ol", { class: y(I(
|
|
6922
|
+
return (t, n) => (T(), l("ol", { class: y(I(Y)("kun-timeline relative", e.className)) }, [A(t.$slots, "default")], 2));
|
|
6593
6923
|
}
|
|
6594
|
-
}),
|
|
6924
|
+
}), Mc = { class: "flex flex-col items-center self-stretch" }, Nc = {
|
|
6595
6925
|
key: 0,
|
|
6596
6926
|
class: "flex flex-wrap items-center justify-between gap-x-3"
|
|
6597
|
-
},
|
|
6927
|
+
}, Pc = {
|
|
6598
6928
|
key: 0,
|
|
6599
6929
|
class: "text-foreground font-medium"
|
|
6600
|
-
},
|
|
6930
|
+
}, Fc = {
|
|
6601
6931
|
key: 1,
|
|
6602
6932
|
class: "text-default-400 text-xs"
|
|
6603
|
-
},
|
|
6933
|
+
}, Ic = {
|
|
6604
6934
|
key: 1,
|
|
6605
6935
|
class: "text-default-600 mt-1 text-sm"
|
|
6606
|
-
},
|
|
6936
|
+
}, Lc = /* @__PURE__ */ p({
|
|
6607
6937
|
name: "KunTimelineItem",
|
|
6608
6938
|
__name: "TimelineItem",
|
|
6609
6939
|
props: {
|
|
@@ -6615,18 +6945,18 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6615
6945
|
},
|
|
6616
6946
|
setup(e) {
|
|
6617
6947
|
let t = e, n = o(() => !!t.icon);
|
|
6618
|
-
return (t, r) => (T(), l("li", { class: y(I(
|
|
6948
|
+
return (t, r) => (T(), l("li", { class: y(I(Y)("flex gap-3", e.className)) }, [u("div", Mc, [n.value ? (T(), l("span", {
|
|
6619
6949
|
key: 0,
|
|
6620
|
-
class: y(I(
|
|
6621
|
-
}, [f(
|
|
6950
|
+
class: y(I(Y)("inline-flex size-7 shrink-0 items-center justify-center rounded-full", I(me)[e.color], I(ge)[e.color]))
|
|
6951
|
+
}, [f(Q, {
|
|
6622
6952
|
name: e.icon,
|
|
6623
6953
|
class: "size-4"
|
|
6624
6954
|
}, null, 8, ["name"])], 2)) : (T(), l("span", {
|
|
6625
6955
|
key: 1,
|
|
6626
|
-
class: y(I(
|
|
6627
|
-
}, null, 2)), r[0] ||= u("span", { class: "kun-tl-line bg-default-200 my-1.5 w-px flex-1" }, null, -1)]), u("div", { class: y(["kun-tl-content min-w-0 flex-1 pb-6", n.value ? "pt-0.5" : ""]) }, [e.title || e.time || t.$slots.title || t.$slots.time ? (T(), l("div",
|
|
6956
|
+
class: y(I(Y)("mt-1.5 size-3 shrink-0 rounded-full", I(me)[e.color]))
|
|
6957
|
+
}, null, 2)), r[0] ||= u("span", { class: "kun-tl-line bg-default-200 my-1.5 w-px flex-1" }, null, -1)]), u("div", { class: y(["kun-tl-content min-w-0 flex-1 pb-6", n.value ? "pt-0.5" : ""]) }, [e.title || e.time || t.$slots.title || t.$slots.time ? (T(), l("div", Nc, [e.title || t.$slots.title ? (T(), l("p", Pc, [A(t.$slots, "title", {}, () => [d(M(e.title), 1)])])) : c("", !0), e.time || t.$slots.time ? (T(), l("span", Fc, [A(t.$slots, "time", {}, () => [d(M(e.time), 1)])])) : c("", !0)])) : c("", !0), t.$slots.default ? (T(), l("div", Ic, [A(t.$slots, "default")])) : c("", !0)], 2)], 2));
|
|
6628
6958
|
}
|
|
6629
|
-
}),
|
|
6959
|
+
}), Rc = ["aria-describedby"], zc = ["id"], Bc = /* @__PURE__ */ p({
|
|
6630
6960
|
name: "KunTooltip",
|
|
6631
6961
|
__name: "Tooltip",
|
|
6632
6962
|
props: {
|
|
@@ -6646,7 +6976,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6646
6976
|
}
|
|
6647
6977
|
},
|
|
6648
6978
|
setup(e) {
|
|
6649
|
-
let t = e, r =
|
|
6979
|
+
let t = e, r = Tt(() => t.rounded), a = o(() => Z[r.value]), u = O(null), p = O(null), m = O(!1), h = at("kun-tooltip"), g = null, _ = null, { floatingStyles: v, arrowRef: x, arrowStyles: S } = an(u, p, {
|
|
6650
6980
|
placement: () => t.position,
|
|
6651
6981
|
open: m,
|
|
6652
6982
|
offset: 8,
|
|
@@ -6661,13 +6991,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6661
6991
|
return (t, r) => (T(), l("div", {
|
|
6662
6992
|
ref_key: "triggerRef",
|
|
6663
6993
|
ref: u,
|
|
6664
|
-
class: y(I(
|
|
6994
|
+
class: y(I(Y)("relative inline-block", e.className)),
|
|
6665
6995
|
"aria-describedby": m.value ? I(h) : void 0,
|
|
6666
6996
|
onMouseenter: w,
|
|
6667
6997
|
onMouseleave: E,
|
|
6668
6998
|
onFocusin: w,
|
|
6669
6999
|
onFocusout: E,
|
|
6670
|
-
onKeydown:
|
|
7000
|
+
onKeydown: q(E, ["escape"])
|
|
6671
7001
|
}, [A(t.$slots, "default"), (T(), s(n, { to: "body" }, [f(i, {
|
|
6672
7002
|
"enter-active-class": "transition-opacity duration-kun-base ease-kun-out",
|
|
6673
7003
|
"enter-from-class": "opacity-0",
|
|
@@ -6676,13 +7006,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6676
7006
|
"leave-from-class": "opacity-100",
|
|
6677
7007
|
"leave-to-class": "opacity-0"
|
|
6678
7008
|
}, {
|
|
6679
|
-
default:
|
|
7009
|
+
default: G(() => [m.value ? (T(), l("div", {
|
|
6680
7010
|
key: 0,
|
|
6681
7011
|
ref_key: "tooltipRef",
|
|
6682
7012
|
ref: p,
|
|
6683
7013
|
id: I(h),
|
|
6684
7014
|
role: "tooltip",
|
|
6685
|
-
class: y(I(
|
|
7015
|
+
class: y(I(Y)("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")),
|
|
6686
7016
|
style: b(I(v))
|
|
6687
7017
|
}, [A(t.$slots, "content", {}, () => [d(M(e.text), 1)]), e.showArrow ? (T(), l("div", {
|
|
6688
7018
|
key: 0,
|
|
@@ -6690,15 +7020,15 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6690
7020
|
ref: x,
|
|
6691
7021
|
class: "bg-content1 absolute size-2 rotate-45",
|
|
6692
7022
|
style: b(I(S))
|
|
6693
|
-
}, null, 4)) : c("", !0)], 14,
|
|
7023
|
+
}, null, 4)) : c("", !0)], 14, zc)) : c("", !0)]),
|
|
6694
7024
|
_: 3
|
|
6695
|
-
})]))], 42,
|
|
7025
|
+
})]))], 42, Rc));
|
|
6696
7026
|
}
|
|
6697
|
-
}),
|
|
7027
|
+
}), Vc = (e) => [
|
|
6698
7028
|
"image/jpeg",
|
|
6699
7029
|
"image/png",
|
|
6700
7030
|
"image/webp"
|
|
6701
|
-
].includes(e.type) ? !0 : (console.error("Invalid file type"), !1),
|
|
7031
|
+
].includes(e.type) ? !0 : (console.error("Invalid file type"), !1), Hc = async (e, t, n) => new Promise((r) => {
|
|
6702
7032
|
let i = new FileReader();
|
|
6703
7033
|
i.onload = (e) => {
|
|
6704
7034
|
let i = new Image();
|
|
@@ -6709,13 +7039,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6709
7039
|
}, "image/webp", .77);
|
|
6710
7040
|
}, i.src = e.target?.result;
|
|
6711
7041
|
}, i.readAsDataURL(e);
|
|
6712
|
-
}),
|
|
7042
|
+
}), Uc = {
|
|
6713
7043
|
key: 0,
|
|
6714
7044
|
class: "absolute inset-0 flex flex-col items-center justify-center"
|
|
6715
|
-
},
|
|
7045
|
+
}, Wc = {
|
|
6716
7046
|
key: 0,
|
|
6717
7047
|
class: "text-default-500 mt-2 text-sm"
|
|
6718
|
-
},
|
|
7048
|
+
}, Gc = ["src"], Kc = { class: "max-w-xl" }, qc = { class: "mt-4 flex justify-end space-x-2" }, Jc = /* @__PURE__ */ p({
|
|
6719
7049
|
name: "KunUpload",
|
|
6720
7050
|
__name: "Upload",
|
|
6721
7051
|
props: {
|
|
@@ -6729,14 +7059,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6729
7059
|
},
|
|
6730
7060
|
emits: ["setImage"],
|
|
6731
7061
|
setup(e, { emit: t }) {
|
|
6732
|
-
let n = e, r =
|
|
6733
|
-
|
|
7062
|
+
let n = e, r = Tt(() => n.rounded), i = o(() => Z[r.value]), a = o(() => n.description || n.hint), p = t, m = O(), h = O(), g = O(""), _ = O(!1), v = O(""), x = o(() => n.initialImage || ""), S = (e) => {
|
|
7063
|
+
Vc(e) && (v.value = URL.createObjectURL(e), _.value = !0);
|
|
6734
7064
|
}, C = async (e) => {
|
|
6735
7065
|
let t = e.canvas, r = await new Promise((e) => {
|
|
6736
7066
|
t.toBlob((t) => {
|
|
6737
7067
|
t && e(t);
|
|
6738
7068
|
}, "image/webp", .77);
|
|
6739
|
-
}), i = await
|
|
7069
|
+
}), i = await Hc(new File([r], "cropped.webp", { type: "image/webp" }), n.size, n.size / n.aspect);
|
|
6740
7070
|
h.value = i, g.value = URL.createObjectURL(i);
|
|
6741
7071
|
}, w = (e) => {
|
|
6742
7072
|
let t = e.target;
|
|
@@ -6754,22 +7084,22 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6754
7084
|
};
|
|
6755
7085
|
return (t, r) => (T(), l("div", null, [u("div", {
|
|
6756
7086
|
tabindex: "0",
|
|
6757
|
-
class: y(I(
|
|
7087
|
+
class: y(I(Y)("border-default-500 hover:border-default-700 relative cursor-pointer border-2 border-dashed transition-colors", i.value, e.className)),
|
|
6758
7088
|
style: b({ "aspect-ratio": n.aspect }),
|
|
6759
7089
|
onDrop: E,
|
|
6760
7090
|
onDragover: D,
|
|
6761
7091
|
onClick: k
|
|
6762
7092
|
}, [
|
|
6763
|
-
!g.value && !x.value ? (T(), l("div",
|
|
7093
|
+
!g.value && !x.value ? (T(), l("div", Uc, [f(Q, {
|
|
6764
7094
|
name: "lucide:plus",
|
|
6765
7095
|
class: "text-default-500 text-3xl"
|
|
6766
|
-
}), a.value ? (T(), l("span",
|
|
7096
|
+
}), a.value ? (T(), l("span", Wc, M(a.value), 1)) : c("", !0)])) : c("", !0),
|
|
6767
7097
|
g.value || x.value ? (T(), l("img", {
|
|
6768
7098
|
key: 1,
|
|
6769
7099
|
src: g.value || x.value,
|
|
6770
7100
|
alt: "上传图片",
|
|
6771
|
-
class: y(I(
|
|
6772
|
-
}, null, 10,
|
|
7101
|
+
class: y(I(Y)("h-full w-full object-cover", i.value))
|
|
7102
|
+
}, null, 10, Gc)) : c("", !0),
|
|
6773
7103
|
u("input", {
|
|
6774
7104
|
ref_key: "input",
|
|
6775
7105
|
ref: m,
|
|
@@ -6783,37 +7113,37 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6783
7113
|
"is-dismissable": !1,
|
|
6784
7114
|
"onUpdate:modelValue": r[1] ||= (e) => _.value = e
|
|
6785
7115
|
}, {
|
|
6786
|
-
default:
|
|
7116
|
+
default: G(() => [u("div", Kc, [
|
|
6787
7117
|
r[4] ||= u("div", { class: "mb-4" }, [u("h3", { class: "text-lg font-semibold" }, "裁剪图片")], -1),
|
|
6788
|
-
v.value ? (T(), s(I(
|
|
7118
|
+
v.value ? (T(), s(I(tt), {
|
|
6789
7119
|
key: 0,
|
|
6790
7120
|
src: v.value,
|
|
6791
7121
|
"stencil-props": { aspectRatio: n.aspect },
|
|
6792
7122
|
onChange: C
|
|
6793
7123
|
}, null, 8, ["src", "stencil-props"])) : c("", !0),
|
|
6794
|
-
u("div",
|
|
7124
|
+
u("div", qc, [f($, {
|
|
6795
7125
|
variant: "light",
|
|
6796
7126
|
color: "danger",
|
|
6797
7127
|
onClick: r[0] ||= (e) => _.value = !1
|
|
6798
7128
|
}, {
|
|
6799
|
-
default:
|
|
7129
|
+
default: G(() => [...r[2] ||= [d(" 取消 ", -1)]]),
|
|
6800
7130
|
_: 1
|
|
6801
7131
|
}), f($, {
|
|
6802
7132
|
variant: "solid",
|
|
6803
7133
|
color: "primary",
|
|
6804
7134
|
onClick: A
|
|
6805
7135
|
}, {
|
|
6806
|
-
default:
|
|
7136
|
+
default: G(() => [...r[3] ||= [d(" 确定 ", -1)]]),
|
|
6807
7137
|
_: 1
|
|
6808
7138
|
})])
|
|
6809
7139
|
])]),
|
|
6810
7140
|
_: 1
|
|
6811
7141
|
}, 8, ["model-value"])]));
|
|
6812
7142
|
}
|
|
6813
|
-
}),
|
|
7143
|
+
}), Yc = { class: "flex min-w-0 flex-col text-sm" }, Xc = { class: "truncate" }, Zc = {
|
|
6814
7144
|
key: 0,
|
|
6815
7145
|
class: "text-default-500 truncate"
|
|
6816
|
-
},
|
|
7146
|
+
}, Qc = /* @__PURE__ */ p({
|
|
6817
7147
|
name: "KunUserChip",
|
|
6818
7148
|
__name: "UserChip",
|
|
6819
7149
|
props: {
|
|
@@ -6832,13 +7162,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6832
7162
|
floatingPosition: { default: "top" }
|
|
6833
7163
|
},
|
|
6834
7164
|
setup(e) {
|
|
6835
|
-
let t = e, n =
|
|
7165
|
+
let t = e, n = ut(), r = o(() => t.isNavigation && !!t.user?.id), i = o(() => {
|
|
6836
7166
|
if (!r.value) return {};
|
|
6837
7167
|
let e = n.userLinkTemplate.replace("{id}", String(t.user?.id));
|
|
6838
7168
|
return typeof n.linkComponent == "string" ? { href: e } : { to: e };
|
|
6839
7169
|
});
|
|
6840
|
-
return (a, o) => (T(), s(j(r.value ? I(n).linkComponent : "div"), _(i.value, { class: I(
|
|
6841
|
-
default:
|
|
7170
|
+
return (a, o) => (T(), s(j(r.value ? I(n).linkComponent : "div"), _(i.value, { class: I(Y)("flex items-center gap-2 text-inherit no-underline", r.value && "cursor-pointer", t.className) }), {
|
|
7171
|
+
default: G(() => [f(bn, {
|
|
6842
7172
|
"floating-position": t.floatingPosition,
|
|
6843
7173
|
"disable-floating": t.disableFloating,
|
|
6844
7174
|
user: e.user,
|
|
@@ -6849,15 +7179,15 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6849
7179
|
"disable-floating",
|
|
6850
7180
|
"user",
|
|
6851
7181
|
"size"
|
|
6852
|
-
]), u("div",
|
|
7182
|
+
]), u("div", Yc, [u("span", Xc, M(e.user?.name || "未知用户"), 1), e.description ? (T(), l("span", Zc, M(e.description), 1)) : c("", !0)])]),
|
|
6853
7183
|
_: 1
|
|
6854
7184
|
}, 16, ["class"]));
|
|
6855
7185
|
}
|
|
6856
7186
|
});
|
|
6857
7187
|
//#endregion
|
|
6858
7188
|
//#region src/resolver.ts
|
|
6859
|
-
function
|
|
6860
|
-
let t = new Set(
|
|
7189
|
+
function $c(e = {}) {
|
|
7190
|
+
let t = new Set(nt), n = e.importStyle ?? !0;
|
|
6861
7191
|
return {
|
|
6862
7192
|
type: "component",
|
|
6863
7193
|
resolve(e) {
|
|
@@ -6871,9 +7201,9 @@ function Qc(e = {}) {
|
|
|
6871
7201
|
}
|
|
6872
7202
|
//#endregion
|
|
6873
7203
|
//#region src/index.ts
|
|
6874
|
-
var
|
|
6875
|
-
KunAccordion:
|
|
6876
|
-
KunAccordionItem:
|
|
7204
|
+
var el = {
|
|
7205
|
+
KunAccordion: it,
|
|
7206
|
+
KunAccordionItem: bt,
|
|
6877
7207
|
KunAlertProvider: en,
|
|
6878
7208
|
KunAutocomplete: gn,
|
|
6879
7209
|
KunAvatar: bn,
|
|
@@ -6896,7 +7226,7 @@ var $c = {
|
|
|
6896
7226
|
KunFadeCard: Gi,
|
|
6897
7227
|
KunFileInput: Qi,
|
|
6898
7228
|
KunHeader: ia,
|
|
6899
|
-
KunIcon:
|
|
7229
|
+
KunIcon: Q,
|
|
6900
7230
|
KunImage: yn,
|
|
6901
7231
|
KunImageNative: oa,
|
|
6902
7232
|
KunInfo: ua,
|
|
@@ -6921,25 +7251,26 @@ var $c = {
|
|
|
6921
7251
|
KunRating: ps,
|
|
6922
7252
|
KunReaction: _s,
|
|
6923
7253
|
KunRipple: Ot,
|
|
6924
|
-
KunScrollShadow:
|
|
7254
|
+
KunScrollShadow: Ls,
|
|
6925
7255
|
KunSelect: Ns,
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
7256
|
+
KunShatter: Ps,
|
|
7257
|
+
KunSkeleton: Rs,
|
|
7258
|
+
KunSlider: qs,
|
|
7259
|
+
KunSteps: Xs,
|
|
7260
|
+
KunSwitch: tc,
|
|
7261
|
+
KunTab: sc,
|
|
7262
|
+
KunTabPanel: lc,
|
|
7263
|
+
KunTabPanels: uc,
|
|
7264
|
+
KunTagInput: bc,
|
|
7265
|
+
KunText: xc,
|
|
7266
|
+
KunTextarea: Ac,
|
|
7267
|
+
KunTimeline: jc,
|
|
7268
|
+
KunTimelineItem: Lc,
|
|
7269
|
+
KunTooltip: Bc,
|
|
7270
|
+
KunUpload: Jc,
|
|
7271
|
+
KunUserChip: Qc
|
|
7272
|
+
}, tl = { install(e) {
|
|
7273
|
+
for (let [t, n] of Object.entries(el)) e.component(t, n);
|
|
6943
7274
|
} };
|
|
6944
7275
|
//#endregion
|
|
6945
|
-
export {
|
|
7276
|
+
export { nt as KUN_COMPONENT_NAMES, st as KUN_UI_DEFAULT_CONFIG, it as KunAccordion, bt as KunAccordionItem, en as KunAlertProvider, gn as KunAutocomplete, bn as KunAvatar, Cn as KunAvatarGroup, On as KunBadge, jn as KunBrand, $ as KunButton, In as KunCard, Un as KunCarousel, Wn as KunCarouselItem, Zn as KunCheckBox, An as KunChip, $r as KunContent, ti as KunContextMenu, ki as KunCopy, xi as KunDatePicker, ji as KunDivider, Hi as KunDrawer, Fi as KunDropdown, Gi as KunFadeCard, Qi as KunFileInput, ia as KunHeader, Q as KunIcon, yn as KunImage, oa as KunImageNative, ua as KunInfo, xa as KunInput, Zr as KunLightbox, wa as KunLightboxGallery, Ta as KunLightboxGalleryItem, Ea as KunLink, qa as KunLoading, Pa as KunLoli, Ba as KunLoliProvider, Ja as KunMarkdown, no as KunMessageProvider, Jt as KunModal, oo as KunNull, _o as KunNumberInput, Do as KunPagination, jo as KunPinInput, Go as KunPopover, Qo as KunProgress, us as KunRadioGroup, ps as KunRating, _s as KunReaction, Ot as KunRipple, Ls as KunScrollShadow, Ns as KunSelect, Ps as KunShatter, Rs as KunSkeleton, qs as KunSlider, Xs as KunSteps, tc as KunSwitch, sc as KunTab, lc as KunTabPanel, uc as KunTabPanels, bc as KunTagInput, xc as KunText, Ac as KunTextarea, jc as KunTimeline, Lc as KunTimelineItem, Bc as KunTooltip, tl as KunUI, tl as default, $c as KunUIResolver, Jc as KunUpload, Qc as KunUserChip, Vc as checkImageValid, te as decodeIfEncoded, Oa as getRandomLoli, ie as getRandomSticker, lt as installKunUIConfig, ct as provideKunUIConfig, Hc as resizeImage, Ft as useBodyScrollLock, Nr as useContentLightbox, Ki as useFilePicker, wt as useKunAlert, Ct as useKunAlertState, Kt as useKunBackgroundInert, Di as useKunCopy, an as useKunFloating, za as useKunLoliInfo, Ra as useKunLoliState, Ei as useKunMessage, Ti as useKunMessageState, Vt as useKunOverlayZIndex, Vo as useKunPointerMenu, ut as useKunUIConfig, at as useKunUniqueId, Tt as useResolvedRounded, Et as useRipple, Mr as useSpoilerContent };
|