@kungal/ui-vue 2.2.0 → 2.3.1
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 +53 -0
- package/dist/components/Carousel.vue.d.ts.map +1 -1
- package/dist/components/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/FileInput.vue.d.ts +1 -1
- package/dist/components/Image.vue.d.ts.map +1 -1
- package/dist/components/Popover.vue.d.ts.map +1 -1
- package/dist/components/types.d.ts +5 -0
- package/dist/components/types.d.ts.map +1 -1
- package/dist/composables/useKunFloating.d.ts +1 -0
- package/dist/composables/useKunFloating.d.ts.map +1 -1
- package/dist/index.js +708 -673
- 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.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
|
|
@@ -497,28 +497,38 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
497
497
|
bottom: "top",
|
|
498
498
|
left: "right"
|
|
499
499
|
}, an = (e, t, n = {}) => {
|
|
500
|
-
let r = O(null), i = n.constrain ?? !0, a = [
|
|
501
|
-
|
|
502
|
-
...i ? [
|
|
500
|
+
let r = O(null), i = n.constrain ?? !0, a = n.padding ?? 8, s = [
|
|
501
|
+
je(n.offset ?? 8),
|
|
502
|
+
...i ? [Ae(), Me({ padding: a })] : [],
|
|
503
|
+
...n.maxSize ? [Ne({
|
|
504
|
+
padding: a,
|
|
505
|
+
apply({ availableWidth: e, availableHeight: t, elements: n }) {
|
|
506
|
+
Object.assign(n.floating.style, {
|
|
507
|
+
maxWidth: `${Math.max(0, Math.floor(e))}px`,
|
|
508
|
+
maxHeight: `${Math.max(0, Math.floor(t))}px`,
|
|
509
|
+
overflowY: "auto"
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
})] : [],
|
|
503
513
|
...n.middleware ?? [],
|
|
504
|
-
...n.arrow ? [
|
|
514
|
+
...n.arrow ? [Oe({
|
|
505
515
|
element: r,
|
|
506
516
|
padding: n.arrowPadding ?? 6
|
|
507
517
|
})] : []
|
|
508
|
-
], { floatingStyles:
|
|
518
|
+
], { floatingStyles: c, placement: l, middlewareData: u } = Pe(e, t, {
|
|
509
519
|
placement: o(() => F(n.placement) ?? "bottom"),
|
|
510
520
|
open: n.open,
|
|
511
|
-
whileElementsMounted:
|
|
521
|
+
whileElementsMounted: ke,
|
|
512
522
|
transform: n.transform ?? !1,
|
|
513
|
-
middleware:
|
|
523
|
+
middleware: s
|
|
514
524
|
});
|
|
515
525
|
return {
|
|
516
|
-
floatingStyles:
|
|
517
|
-
placement:
|
|
518
|
-
transformOrigin: nn(
|
|
526
|
+
floatingStyles: c,
|
|
527
|
+
placement: l,
|
|
528
|
+
transformOrigin: nn(l),
|
|
519
529
|
arrowRef: r,
|
|
520
530
|
arrowStyles: o(() => {
|
|
521
|
-
let e =
|
|
531
|
+
let e = u.value.arrow, t = rn[l.value.split("-")[0] ?? "bottom"] ?? "bottom";
|
|
522
532
|
return {
|
|
523
533
|
position: "absolute",
|
|
524
534
|
left: e?.x == null ? "" : `${e.x}px`,
|
|
@@ -526,7 +536,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
526
536
|
[t]: "calc(var(--kun-arrow-size, 0.5rem) / -2)"
|
|
527
537
|
};
|
|
528
538
|
}),
|
|
529
|
-
middlewareData:
|
|
539
|
+
middlewareData: u
|
|
530
540
|
};
|
|
531
541
|
}, on = (e, t) => {
|
|
532
542
|
if (!e || !t) return;
|
|
@@ -604,11 +614,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
604
614
|
}),
|
|
605
615
|
emits: /*@__PURE__*/ g(["select", "search"], ["update:modelValue"]),
|
|
606
616
|
setup(e, { expose: r, emit: a }) {
|
|
607
|
-
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, {
|
|
608
618
|
placement: "bottom-start",
|
|
609
619
|
open: w,
|
|
610
620
|
offset: 4,
|
|
611
|
-
middleware: [
|
|
621
|
+
middleware: [Ne({ apply({ rects: e, elements: t, availableHeight: n }) {
|
|
612
622
|
Object.assign(t.floating.style, {
|
|
613
623
|
width: `${e.reference.width}px`,
|
|
614
624
|
maxHeight: `${Math.min(280, n - 8)}px`
|
|
@@ -620,13 +630,13 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
620
630
|
return d.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
621
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 = () => {
|
|
622
632
|
d.disabled || w.value || (w.value = !0, E.value = V());
|
|
623
|
-
},
|
|
633
|
+
}, W = () => {
|
|
624
634
|
w.value = !1;
|
|
625
|
-
},
|
|
635
|
+
}, K = () => {
|
|
626
636
|
v(() => {
|
|
627
637
|
on(P.value, P.value?.querySelector(`[data-index="${E.value}"]`));
|
|
628
638
|
});
|
|
629
|
-
},
|
|
639
|
+
}, q = (e) => {
|
|
630
640
|
let t = R.value.length;
|
|
631
641
|
if (!t) return;
|
|
632
642
|
let n = E.value;
|
|
@@ -634,44 +644,44 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
634
644
|
E.value = n;
|
|
635
645
|
break;
|
|
636
646
|
}
|
|
637
|
-
|
|
638
|
-
},
|
|
639
|
-
e.disabled || (p.value = e.label, D.value = !1, m("select", e),
|
|
640
|
-
},
|
|
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) => {
|
|
641
651
|
p.value = e.target.value, D.value = !0, m("search", p.value), H(), E.value = V();
|
|
642
|
-
},
|
|
652
|
+
}, te = (e) => {
|
|
643
653
|
if (!d.disabled) switch (e.key) {
|
|
644
654
|
case "ArrowDown":
|
|
645
|
-
e.preventDefault(), w.value ?
|
|
655
|
+
e.preventDefault(), w.value ? q(1) : H();
|
|
646
656
|
break;
|
|
647
657
|
case "ArrowUp":
|
|
648
|
-
e.preventDefault(), w.value &&
|
|
658
|
+
e.preventDefault(), w.value && q(-1);
|
|
649
659
|
break;
|
|
650
660
|
case "Enter":
|
|
651
|
-
w.value && R.value[E.value] && (e.preventDefault(),
|
|
661
|
+
w.value && R.value[E.value] && (e.preventDefault(), J(R.value[E.value]));
|
|
652
662
|
break;
|
|
653
663
|
case "Escape":
|
|
654
|
-
w.value && (e.preventDefault(),
|
|
664
|
+
w.value && (e.preventDefault(), W());
|
|
655
665
|
break;
|
|
656
666
|
case "Tab":
|
|
657
|
-
|
|
667
|
+
W();
|
|
658
668
|
break;
|
|
659
669
|
}
|
|
660
|
-
},
|
|
670
|
+
}, ne = () => {
|
|
661
671
|
setTimeout(() => {
|
|
662
672
|
!d.allowCustomValue && p.value && !d.options.some((e) => e.label.toLowerCase() === p.value.toLowerCase()) && (p.value = "", m("search", ""));
|
|
663
673
|
}, 120);
|
|
664
|
-
},
|
|
674
|
+
}, re = () => {
|
|
665
675
|
p.value = "", D.value = !0, m("search", ""), v(() => A.value?.focus({ preventScroll: !0 })), H();
|
|
666
676
|
};
|
|
667
|
-
return
|
|
668
|
-
N.value?.contains(e.target) ||
|
|
677
|
+
return xe(j, (e) => {
|
|
678
|
+
N.value?.contains(e.target) || W();
|
|
669
679
|
}), U(R, () => {
|
|
670
680
|
w.value && (E.value < 0 || E.value >= R.value.length || R.value[E.value]?.disabled) && (E.value = V());
|
|
671
681
|
}), r({
|
|
672
682
|
focus: () => A.value?.focus(),
|
|
673
683
|
blur: () => A.value?.blur()
|
|
674
|
-
}), (r, a) => (T(), l("div", { class: y(I(
|
|
684
|
+
}), (r, a) => (T(), l("div", { class: y(I(Y)("relative w-full")) }, [
|
|
675
685
|
e.label ? (T(), l("label", {
|
|
676
686
|
key: 0,
|
|
677
687
|
for: I(x),
|
|
@@ -699,19 +709,19 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
699
709
|
placeholder: e.placeholder,
|
|
700
710
|
disabled: e.disabled,
|
|
701
711
|
autocomplete: "off",
|
|
702
|
-
class: I(
|
|
703
|
-
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,
|
|
704
714
|
onFocus: H,
|
|
705
|
-
onKeydown:
|
|
706
|
-
onBlur:
|
|
715
|
+
onKeydown: te,
|
|
716
|
+
onBlur: ne
|
|
707
717
|
}), null, 16, cn), e.clearable && p.value && !e.disabled ? (T(), l("button", {
|
|
708
718
|
key: 0,
|
|
709
719
|
type: "button",
|
|
710
720
|
tabindex: "-1",
|
|
711
721
|
class: "text-default-400 hover:text-default-600 absolute inset-y-0 right-0 flex items-center pr-3",
|
|
712
722
|
"aria-label": "清除",
|
|
713
|
-
onClick:
|
|
714
|
-
}, [f(
|
|
723
|
+
onClick: re
|
|
724
|
+
}, [f(Q, {
|
|
715
725
|
name: "lucide:circle-x",
|
|
716
726
|
class: "size-4"
|
|
717
727
|
})])) : c("", !0)], 512),
|
|
@@ -729,12 +739,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
729
739
|
"leave-from-class": "opacity-100 scale-100",
|
|
730
740
|
"leave-to-class": "opacity-0 scale-95"
|
|
731
741
|
}, {
|
|
732
|
-
default:
|
|
742
|
+
default: G(() => [w.value && (R.value.length || D.value) ? (T(), l("div", {
|
|
733
743
|
key: 0,
|
|
734
744
|
ref_key: "dropdownRef",
|
|
735
745
|
ref: N,
|
|
736
746
|
style: b([I(F), { transformOrigin: I(L) }]),
|
|
737
|
-
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))
|
|
738
748
|
}, [u("ul", {
|
|
739
749
|
ref_key: "listRef",
|
|
740
750
|
ref: P,
|
|
@@ -749,7 +759,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
749
759
|
role: "option",
|
|
750
760
|
"aria-selected": t === E.value,
|
|
751
761
|
"aria-disabled": e.disabled || void 0,
|
|
752
|
-
onClick: (t) =>
|
|
762
|
+
onClick: (t) => J(e),
|
|
753
763
|
onMousemove: (n) => !e.disabled && (E.value = t)
|
|
754
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)]),
|
|
755
765
|
_: 1
|
|
@@ -829,7 +839,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
829
839
|
sizes: { default: void 0 }
|
|
830
840
|
},
|
|
831
841
|
setup(e) {
|
|
832
|
-
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);
|
|
833
843
|
U(() => t.src, () => u.value = !1);
|
|
834
844
|
let { status: f, onLoad: p, onError: m } = vn(a, o(() => d.value)), h = () => {
|
|
835
845
|
m(), !u.value && t.fallbackSrc && (u.value = !0);
|
|
@@ -866,7 +876,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
866
876
|
}), S = o(() => t.aspectRatio ? { aspectRatio: t.aspectRatio } : void 0), C = o(() => t.skeleton);
|
|
867
877
|
return (t, n) => C.value ? (T(), l("div", {
|
|
868
878
|
key: 1,
|
|
869
|
-
class: y(I(
|
|
879
|
+
class: y(I(Y)("relative overflow-hidden", e.aspectRatio ? "block w-full" : "inline-block", e.className)),
|
|
870
880
|
style: b(S.value)
|
|
871
881
|
}, [I(f) === "loaded" ? c("", !0) : (T(), l("div", {
|
|
872
882
|
key: 0,
|
|
@@ -876,11 +886,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
876
886
|
ref_key: "imgEl",
|
|
877
887
|
ref: a
|
|
878
888
|
}, v.value, {
|
|
879
|
-
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),
|
|
880
890
|
onLoad: I(p),
|
|
881
891
|
onError: h
|
|
882
892
|
}), null, 16, ["class", "onLoad"]))], 6)) : (T(), s(j(r.value), _({ key: 0 }, v.value, {
|
|
883
|
-
class: I(
|
|
893
|
+
class: I(Y)(e.className, e.imageClassName),
|
|
884
894
|
onError: h
|
|
885
895
|
}), null, 16, ["class"]));
|
|
886
896
|
}
|
|
@@ -900,7 +910,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
900
910
|
floatingPosition: {}
|
|
901
911
|
},
|
|
902
912
|
setup(e) {
|
|
903
|
-
let t = e, n =
|
|
913
|
+
let t = e, n = ut(), r = o(() => t.isNavigation && !!t.user?.id), i = o(() => {
|
|
904
914
|
if (!r.value) return {};
|
|
905
915
|
let e = n.userLinkTemplate.replace("{id}", String(t.user?.id));
|
|
906
916
|
return typeof n.linkComponent == "string" ? { href: e } : { to: e };
|
|
@@ -914,12 +924,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
914
924
|
case "xl": return "size-12";
|
|
915
925
|
default: return "size-8";
|
|
916
926
|
}
|
|
917
|
-
}), c = o(() => t.user?.avatar ||
|
|
918
|
-
return (o, l) => (T(), s(j(r.value ? I(n).linkComponent : "div"), _(i.value, { class: I(
|
|
919
|
-
default:
|
|
920
|
-
"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),
|
|
921
931
|
src: c.value,
|
|
922
|
-
"fallback-src": I(
|
|
932
|
+
"fallback-src": I(ae)(e.user?.name ?? ""),
|
|
923
933
|
alt: e.user?.name ?? "未知用户"
|
|
924
934
|
}, null, 8, [
|
|
925
935
|
"class-name",
|
|
@@ -1002,7 +1012,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1002
1012
|
"top-left": "-top-1 -left-1",
|
|
1003
1013
|
"bottom-right": "-bottom-1 -right-1",
|
|
1004
1014
|
"bottom-left": "-bottom-1 -left-1"
|
|
1005
|
-
}, 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));
|
|
1006
1016
|
return (t, i) => d.value ? (T(), l("span", wn, [n.value ? (T(), l("span", {
|
|
1007
1017
|
key: 0,
|
|
1008
1018
|
class: y(f.value),
|
|
@@ -1035,7 +1045,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1035
1045
|
emits: ["close"],
|
|
1036
1046
|
setup(e, { emit: t }) {
|
|
1037
1047
|
let n = e, r = t;
|
|
1038
|
-
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)) }, [
|
|
1039
1049
|
A(t.$slots, "start"),
|
|
1040
1050
|
A(t.$slots, "default"),
|
|
1041
1051
|
e.closable ? (T(), l("button", {
|
|
@@ -1044,8 +1054,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1044
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",
|
|
1045
1055
|
"aria-label": "移除",
|
|
1046
1056
|
disabled: e.disabled,
|
|
1047
|
-
onClick: i[0] ||=
|
|
1048
|
-
}, [f(
|
|
1057
|
+
onClick: i[0] ||= J((e) => r("close"), ["stop"])
|
|
1058
|
+
}, [f(Q, {
|
|
1049
1059
|
name: "lucide:x",
|
|
1050
1060
|
class: "size-3.5"
|
|
1051
1061
|
})], 8, kn)) : c("", !0),
|
|
@@ -1066,9 +1076,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1066
1076
|
nameClass: { default: "text-xl" }
|
|
1067
1077
|
},
|
|
1068
1078
|
setup(e) {
|
|
1069
|
-
let t = e, n =
|
|
1079
|
+
let t = e, n = ut(), r = o(() => typeof n.linkComponent == "string" ? { href: t.to } : { to: t.to });
|
|
1070
1080
|
return (t, i) => (T(), s(j(I(n).linkComponent), _(r.value, { class: "flex cursor-pointer items-center gap-3 text-inherit no-underline" }), {
|
|
1071
|
-
default:
|
|
1081
|
+
default: G(() => [
|
|
1072
1082
|
f(yn, {
|
|
1073
1083
|
"class-name": e.iconClass,
|
|
1074
1084
|
src: e.iconSrc,
|
|
@@ -1084,7 +1094,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1084
1094
|
size: "md",
|
|
1085
1095
|
color: e.badgeColor
|
|
1086
1096
|
}, {
|
|
1087
|
-
default:
|
|
1097
|
+
default: G(() => [d(M(e.badge), 1)]),
|
|
1088
1098
|
_: 1
|
|
1089
1099
|
}, 8, ["color"])) : c("", !0)
|
|
1090
1100
|
]),
|
|
@@ -1127,7 +1137,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1127
1137
|
},
|
|
1128
1138
|
emits: ["click"],
|
|
1129
1139
|
setup(e, { emit: t }) {
|
|
1130
|
-
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) => {
|
|
1131
1141
|
p.value && d(e), r("click", e);
|
|
1132
1142
|
}, v = {
|
|
1133
1143
|
background: "bg-content1",
|
|
@@ -1138,20 +1148,20 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1138
1148
|
warning: "bg-warning-100/30 border-warning-300",
|
|
1139
1149
|
danger: "bg-danger-100/30 border-danger-300",
|
|
1140
1150
|
info: "bg-info-100/30 border-info-300"
|
|
1141
|
-
}, b =
|
|
1151
|
+
}, b = Tt(() => n.rounded), x = o(() => Z[b.value]), S = {
|
|
1142
1152
|
none: "p-0",
|
|
1143
1153
|
sm: "p-3",
|
|
1144
1154
|
md: "p-5",
|
|
1145
1155
|
lg: "p-6"
|
|
1146
1156
|
};
|
|
1147
1157
|
return (t, r) => (T(), s(j(m.value), _(h.value, {
|
|
1148
|
-
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),
|
|
1149
1159
|
onClick: g
|
|
1150
1160
|
}), {
|
|
1151
|
-
default:
|
|
1161
|
+
default: G(() => [
|
|
1152
1162
|
t.$slots.header ? (T(), l("div", Mn, [A(t.$slots, "header")])) : c("", !0),
|
|
1153
1163
|
t.$slots.cover ? (T(), l("div", Nn, [A(t.$slots, "cover")])) : c("", !0),
|
|
1154
|
-
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),
|
|
1155
1165
|
t.$slots.footer ? (T(), l("div", Pn, [A(t.$slots, "footer")])) : c("", !0),
|
|
1156
1166
|
f(Ot, { ripples: I(a) }, null, 8, ["ripples"])
|
|
1157
1167
|
]),
|
|
@@ -1195,122 +1205,136 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1195
1205
|
slidesPerView: o(() => Math.max(1, n.slidesPerView)),
|
|
1196
1206
|
gap: o(() => n.gap)
|
|
1197
1207
|
});
|
|
1198
|
-
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) => {
|
|
1199
1211
|
let t = e.children[0];
|
|
1200
1212
|
if (!t) return 0;
|
|
1201
1213
|
let n = parseFloat(getComputedStyle(e).columnGap || "0") || 0;
|
|
1202
1214
|
return t.getBoundingClientRect().width + n;
|
|
1203
|
-
},
|
|
1215
|
+
}, z = () => {
|
|
1204
1216
|
let e = r.value;
|
|
1205
1217
|
if (!e) return;
|
|
1206
1218
|
let t = i.value;
|
|
1207
|
-
if (!
|
|
1219
|
+
if (!w.value || t === 0) {
|
|
1208
1220
|
for (let t of Array.from(e.children)) t.style.order = "";
|
|
1209
1221
|
return;
|
|
1210
1222
|
}
|
|
1211
|
-
let n = d(
|
|
1223
|
+
let n = d(D.value - s.value, t);
|
|
1212
1224
|
Array.from(e.children).forEach((e, r) => {
|
|
1213
1225
|
e.style.order = String(d(r + n, t));
|
|
1214
1226
|
});
|
|
1215
|
-
},
|
|
1227
|
+
}, B = (e, t = !0) => {
|
|
1216
1228
|
let n = r.value;
|
|
1217
1229
|
if (!n) return;
|
|
1218
|
-
let i =
|
|
1230
|
+
let i = R(n), a = Math.max(0, Math.min(e, C.value));
|
|
1219
1231
|
n.scrollTo({
|
|
1220
1232
|
left: a * i,
|
|
1221
|
-
behavior: t && !
|
|
1233
|
+
behavior: t && !L ? "smooth" : "auto"
|
|
1222
1234
|
});
|
|
1223
|
-
},
|
|
1224
|
-
if (!
|
|
1235
|
+
}, V = () => B(a.value - 1), H = () => B(a.value + 1), U = (e) => {
|
|
1236
|
+
if (!N.value) return B(e);
|
|
1225
1237
|
let t = i.value;
|
|
1226
|
-
|
|
1227
|
-
},
|
|
1238
|
+
B(d(e + d(D.value - s.value, t), t));
|
|
1239
|
+
}, W = () => {
|
|
1228
1240
|
let e = r.value;
|
|
1229
|
-
if (!e || !
|
|
1230
|
-
let t =
|
|
1241
|
+
if (!e || !w.value || g()) return;
|
|
1242
|
+
let t = R(e);
|
|
1231
1243
|
if (!t) return;
|
|
1232
|
-
let n = Math.round(e.scrollLeft / t) -
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
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;
|
|
1239
1257
|
let e = r.value;
|
|
1240
1258
|
if (!e) return;
|
|
1241
|
-
let t =
|
|
1242
|
-
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();
|
|
1243
1261
|
});
|
|
1244
|
-
},
|
|
1245
|
-
|
|
1246
|
-
|
|
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);
|
|
1247
1268
|
}, n.autoplay));
|
|
1248
|
-
},
|
|
1249
|
-
|
|
1250
|
-
},
|
|
1269
|
+
}, re = () => {
|
|
1270
|
+
ee && clearInterval(ee), ee = void 0;
|
|
1271
|
+
}, ie = () => {
|
|
1251
1272
|
let e = r.value;
|
|
1252
|
-
if (i.value = e?.children.length ?? 0, i.value > 0 && (s.value = d(s.value, i.value)),
|
|
1253
|
-
let t =
|
|
1254
|
-
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);
|
|
1255
1276
|
}
|
|
1256
|
-
},
|
|
1277
|
+
}, ae = () => {
|
|
1257
1278
|
let e = r.value;
|
|
1258
|
-
if (e &&
|
|
1259
|
-
let t =
|
|
1260
|
-
t && (e.scrollLeft =
|
|
1279
|
+
if (e && w.value) {
|
|
1280
|
+
let t = R(e);
|
|
1281
|
+
t && (h(), e.scrollLeft = D.value * t);
|
|
1261
1282
|
}
|
|
1262
|
-
},
|
|
1283
|
+
}, oe = null;
|
|
1263
1284
|
return S(() => {
|
|
1264
|
-
|
|
1285
|
+
L = typeof matchMedia < "u" && matchMedia("(prefers-reduced-motion: reduce)").matches, ie();
|
|
1265
1286
|
let e = r.value;
|
|
1266
|
-
e && (e.addEventListener("scrollend",
|
|
1267
|
-
|
|
1268
|
-
}),
|
|
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();
|
|
1269
1290
|
}), x(() => {
|
|
1270
|
-
|
|
1291
|
+
re(), oe?.disconnect(), q && cancelAnimationFrame(q), clearTimeout(G), r.value?.removeEventListener("scrollend", W), window.removeEventListener("resize", ae);
|
|
1271
1292
|
}), (n, i) => (T(), l("div", {
|
|
1272
|
-
class: y(I(
|
|
1293
|
+
class: y(I(Y)("group/carousel relative", e.className)),
|
|
1273
1294
|
role: "region",
|
|
1274
1295
|
"aria-roledescription": "carousel",
|
|
1275
1296
|
"aria-label": e.ariaLabel,
|
|
1276
|
-
onPointerenter:
|
|
1277
|
-
onPointerleave:
|
|
1278
|
-
onFocusin:
|
|
1279
|
-
onFocusout:
|
|
1297
|
+
onPointerenter: re,
|
|
1298
|
+
onPointerleave: ne,
|
|
1299
|
+
onFocusin: re,
|
|
1300
|
+
onFocusout: ne
|
|
1280
1301
|
}, [
|
|
1281
1302
|
u("ul", {
|
|
1282
1303
|
ref_key: "trackRef",
|
|
1283
1304
|
ref: r,
|
|
1284
|
-
class: "scrollbar-hide flex snap-x snap-mandatory overflow-x-auto
|
|
1285
|
-
style: b({
|
|
1286
|
-
|
|
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
|
|
1287
1311
|
}, [A(n.$slots, "default")], 36),
|
|
1288
|
-
|
|
1312
|
+
j.value ? (T(), l(t, { key: 0 }, [u("button", {
|
|
1289
1313
|
type: "button",
|
|
1290
1314
|
"aria-label": "上一张",
|
|
1291
|
-
disabled: !
|
|
1315
|
+
disabled: !w.value && F.value <= 0,
|
|
1292
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",
|
|
1293
|
-
onClick:
|
|
1294
|
-
}, [f(
|
|
1317
|
+
onClick: V
|
|
1318
|
+
}, [f(Q, {
|
|
1295
1319
|
name: "lucide:chevron-left",
|
|
1296
1320
|
class: "size-5"
|
|
1297
1321
|
})], 8, zn), u("button", {
|
|
1298
1322
|
type: "button",
|
|
1299
1323
|
"aria-label": "下一张",
|
|
1300
|
-
disabled: !
|
|
1324
|
+
disabled: !w.value && F.value >= C.value,
|
|
1301
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",
|
|
1302
|
-
onClick:
|
|
1303
|
-
}, [f(
|
|
1326
|
+
onClick: H
|
|
1327
|
+
}, [f(Q, {
|
|
1304
1328
|
name: "lucide:chevron-right",
|
|
1305
1329
|
class: "size-5"
|
|
1306
1330
|
})], 8, Bn)], 64)) : c("", !0),
|
|
1307
|
-
|
|
1331
|
+
M.value ? (T(), l("div", Vn, [(T(!0), l(t, null, k(P.value, (e) => (T(), l("button", {
|
|
1308
1332
|
key: e,
|
|
1309
1333
|
type: "button",
|
|
1310
1334
|
"aria-label": `跳到第 ${e} 张`,
|
|
1311
|
-
"aria-current":
|
|
1312
|
-
class: y(I(
|
|
1313
|
-
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)
|
|
1314
1338
|
}, null, 10, Hn))), 128))])) : c("", !0)
|
|
1315
1339
|
], 42, Rn));
|
|
1316
1340
|
}
|
|
@@ -1324,7 +1348,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1324
1348
|
return e <= 1 ? "100%" : `calc((100% - ${e - 1} * ${n}) / ${e})`;
|
|
1325
1349
|
});
|
|
1326
1350
|
return (t, r) => (T(), l("li", {
|
|
1327
|
-
class: y(I(
|
|
1351
|
+
class: y(I(Y)("shrink-0 snap-start", e.className)),
|
|
1328
1352
|
style: b({ flexBasis: n.value }),
|
|
1329
1353
|
"aria-roledescription": "slide"
|
|
1330
1354
|
}, [A(t.$slots, "default")], 6));
|
|
@@ -1374,14 +1398,14 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1374
1398
|
}),
|
|
1375
1399
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
1376
1400
|
setup(e, { emit: t }) {
|
|
1377
|
-
let n = e, r = o(() =>
|
|
1401
|
+
let n = e, r = o(() => fe[n.size]), i = {
|
|
1378
1402
|
xs: "w-2",
|
|
1379
1403
|
sm: "w-2.5",
|
|
1380
1404
|
md: "w-2.5",
|
|
1381
1405
|
lg: "w-3",
|
|
1382
1406
|
xl: "w-3.5"
|
|
1383
|
-
}, a = z(e, "modelValue"), s = t, d =
|
|
1384
|
-
|
|
1407
|
+
}, a = z(e, "modelValue"), s = t, d = at("kun-checkbox"), p = O(null);
|
|
1408
|
+
W(() => {
|
|
1385
1409
|
p.value && (p.value.indeterminate = n.indeterminate);
|
|
1386
1410
|
});
|
|
1387
1411
|
let m = (e) => {
|
|
@@ -1403,8 +1427,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1403
1427
|
warning: "bg-warning border-warning",
|
|
1404
1428
|
danger: "bg-danger border-danger",
|
|
1405
1429
|
info: "bg-info border-info"
|
|
1406
|
-
}, _ = o(() =>
|
|
1407
|
-
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)) }, [
|
|
1408
1432
|
u("div", Gn, [
|
|
1409
1433
|
u("input", {
|
|
1410
1434
|
id: I(d),
|
|
@@ -1416,20 +1440,20 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1416
1440
|
checked: a.value,
|
|
1417
1441
|
disabled: e.disabled,
|
|
1418
1442
|
"aria-describedby": e.error || e.description ? `${I(d)}-desc` : void 0,
|
|
1419
|
-
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])),
|
|
1420
1444
|
onChange: m
|
|
1421
1445
|
}, null, 42, Kn),
|
|
1422
|
-
|
|
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, {
|
|
1423
1447
|
name: "lucide:check",
|
|
1424
1448
|
class: y(r.value.check)
|
|
1425
1449
|
}, null, 8, ["class"])], 2), [[H, !e.indeterminate]]),
|
|
1426
|
-
|
|
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]])
|
|
1427
1451
|
]),
|
|
1428
1452
|
A(t.$slots, "default"),
|
|
1429
1453
|
e.label ? (T(), l("label", {
|
|
1430
1454
|
key: 0,
|
|
1431
1455
|
for: I(d),
|
|
1432
|
-
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"))
|
|
1433
1457
|
}, M(e.label), 11, Jn)) : c("", !0)
|
|
1434
1458
|
], 2), e.error ? (T(), l("p", {
|
|
1435
1459
|
key: 0,
|
|
@@ -1690,7 +1714,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1690
1714
|
], Hr = ["src", "alt"], Ur = {
|
|
1691
1715
|
class: "min-w-[3.5rem] text-center text-sm font-medium tabular-nums text-white",
|
|
1692
1716
|
"aria-live": "polite"
|
|
1693
|
-
}, 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({
|
|
1694
1718
|
name: "KunLightbox",
|
|
1695
1719
|
__name: "Lightbox",
|
|
1696
1720
|
props: {
|
|
@@ -1721,39 +1745,39 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1721
1745
|
let e = Math.min(Gr, d.value + qr);
|
|
1722
1746
|
if (e === d.value) return;
|
|
1723
1747
|
d.value = e;
|
|
1724
|
-
let t =
|
|
1748
|
+
let t = le(v.x, v.y);
|
|
1725
1749
|
v.x = t.x, v.y = t.y;
|
|
1726
|
-
},
|
|
1750
|
+
}, W = () => {
|
|
1727
1751
|
let e = Math.max(Wr, d.value - qr);
|
|
1728
1752
|
if (e === d.value) return;
|
|
1729
1753
|
d.value = e;
|
|
1730
|
-
let t =
|
|
1754
|
+
let t = le(v.x, v.y);
|
|
1731
1755
|
v.x = t.x, v.y = t.y;
|
|
1732
|
-
}, G = () => {
|
|
1733
|
-
_.value += 90;
|
|
1734
1756
|
}, K = () => {
|
|
1757
|
+
_.value += 90;
|
|
1758
|
+
}, q = () => {
|
|
1735
1759
|
_.value -= 90;
|
|
1736
|
-
},
|
|
1760
|
+
}, ee = (e) => {
|
|
1737
1761
|
let t = document;
|
|
1738
1762
|
typeof t.startViewTransition == "function" ? t.startViewTransition(e) : e();
|
|
1739
|
-
}, { lock:
|
|
1763
|
+
}, { lock: Y, unlock: te } = Ft(), ne = !1;
|
|
1740
1764
|
U(() => r.isOpen, (e) => {
|
|
1741
1765
|
let t = F.value;
|
|
1742
|
-
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)));
|
|
1743
1767
|
}, { flush: "post" }), U(() => r.initialIndex, () => {
|
|
1744
1768
|
s.value = r.initialIndex || 0, V();
|
|
1745
1769
|
});
|
|
1746
|
-
let
|
|
1747
|
-
r.isOpen && (a("update:isOpen", !1), V()),
|
|
1748
|
-
},
|
|
1770
|
+
let re = () => {
|
|
1771
|
+
r.isOpen && (a("update:isOpen", !1), V()), ne &&= (te(), !1);
|
|
1772
|
+
}, ie = (e) => {
|
|
1749
1773
|
e.target === F.value && a("update:isOpen", !1);
|
|
1750
|
-
},
|
|
1774
|
+
}, ae = () => {
|
|
1751
1775
|
S.value || a("update:isOpen", !1);
|
|
1752
|
-
},
|
|
1776
|
+
}, oe = () => {
|
|
1753
1777
|
P.value = "slide-next", V(), s.value = (s.value + 1) % r.images.length;
|
|
1754
|
-
},
|
|
1778
|
+
}, se = () => {
|
|
1755
1779
|
P.value = "slide-prev", V(), s.value = (s.value - 1 + r.images.length) % r.images.length;
|
|
1756
|
-
},
|
|
1780
|
+
}, ce = () => {
|
|
1757
1781
|
if (!I.value || !L.value) return {
|
|
1758
1782
|
minX: 0,
|
|
1759
1783
|
maxX: 0,
|
|
@@ -1767,17 +1791,17 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1767
1791
|
minY: -a,
|
|
1768
1792
|
maxY: a
|
|
1769
1793
|
};
|
|
1770
|
-
},
|
|
1794
|
+
}, le = (e, t) => {
|
|
1771
1795
|
if (d.value <= 1) return {
|
|
1772
1796
|
x: 0,
|
|
1773
1797
|
y: 0
|
|
1774
1798
|
};
|
|
1775
|
-
let n =
|
|
1799
|
+
let n = ce();
|
|
1776
1800
|
return {
|
|
1777
1801
|
x: Math.min(Math.max(e, n.minX), n.maxX),
|
|
1778
1802
|
y: Math.min(Math.max(t, n.minY), n.maxY)
|
|
1779
1803
|
};
|
|
1780
|
-
},
|
|
1804
|
+
}, ue = (e) => {
|
|
1781
1805
|
e.preventDefault();
|
|
1782
1806
|
let t = -e.deltaY, n = d.value + (t > 0 ? .2 : -.2), r = Math.max(Wr, Math.min(Gr, n));
|
|
1783
1807
|
if (r !== d.value) {
|
|
@@ -1786,14 +1810,14 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1786
1810
|
let n = e.clientX - t.left, i = e.clientY - t.top, a = r / d.value, o = {
|
|
1787
1811
|
x: n - (n - v.x) * a,
|
|
1788
1812
|
y: i - (i - v.y) * a
|
|
1789
|
-
}, s =
|
|
1813
|
+
}, s = le(o.x, o.y);
|
|
1790
1814
|
v.x = s.x, v.y = s.y, d.value = r;
|
|
1791
1815
|
}
|
|
1792
|
-
},
|
|
1816
|
+
}, X = (e) => {
|
|
1793
1817
|
x.value = !0, S.value = !1, j.value = Date.now();
|
|
1794
1818
|
let t = "touches" in e ? e.touches[0] : e;
|
|
1795
1819
|
C.x = t.clientX - v.x, C.y = t.clientY - v.y, N.x = t.clientX, N.y = t.clientY;
|
|
1796
|
-
},
|
|
1820
|
+
}, de = (e) => {
|
|
1797
1821
|
if (!x.value) return;
|
|
1798
1822
|
let t = "touches" in e ? e.touches[0] : e;
|
|
1799
1823
|
if ((Math.abs(t.clientX - N.x) > Jr || Math.abs(t.clientY - N.y) > Jr) && (S.value = !0), d.value <= 1) {
|
|
@@ -1803,13 +1827,13 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1803
1827
|
let n = {
|
|
1804
1828
|
x: t.clientX - C.x,
|
|
1805
1829
|
y: t.clientY - C.y
|
|
1806
|
-
}, r =
|
|
1830
|
+
}, r = le(n.x, n.y);
|
|
1807
1831
|
v.x = r.x, v.y = r.y;
|
|
1808
|
-
},
|
|
1832
|
+
}, Z = (e) => {
|
|
1809
1833
|
if (!x.value) return;
|
|
1810
1834
|
let t = ("touches" in e ? e.changedTouches[0] : e).clientX - N.x, n = Date.now() - j.value, r = Math.abs(t) / n;
|
|
1811
|
-
d.value <= 1 && Math.abs(t) > Kr && r > .2 && (t > 0 ?
|
|
1812
|
-
},
|
|
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) => {
|
|
1813
1837
|
let n = L.value?.getBoundingClientRect();
|
|
1814
1838
|
if (!n) return;
|
|
1815
1839
|
if (d.value > Wr) {
|
|
@@ -1818,24 +1842,24 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1818
1842
|
}
|
|
1819
1843
|
let r = e - n.left, i = t - n.top;
|
|
1820
1844
|
d.value = 2;
|
|
1821
|
-
let a =
|
|
1845
|
+
let a = le(r - n.width / 2, i - n.height / 2);
|
|
1822
1846
|
v.x = a.x, v.y = a.y;
|
|
1823
|
-
},
|
|
1847
|
+
}, pe = (e) => fe(e.clientX, e.clientY), me = (e) => {
|
|
1824
1848
|
if (e.touches.length >= 2) {
|
|
1825
1849
|
x.value = !1, p.value = !0;
|
|
1826
1850
|
let [t, n] = [e.touches[0], e.touches[1]];
|
|
1827
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;
|
|
1828
|
-
} else e.touches.length === 1 && !p.value &&
|
|
1829
|
-
},
|
|
1852
|
+
} else e.touches.length === 1 && !p.value && X(e);
|
|
1853
|
+
}, he = (e) => {
|
|
1830
1854
|
if (e.touches.length >= 2 && p.value) {
|
|
1831
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();
|
|
1832
1856
|
if (c) {
|
|
1833
|
-
let e = i - c.left - c.width / 2, t = a - c.top - c.height / 2, n = s / d.value, r = e - (e - v.x) * n, o = t - (t - v.y) * n, l = i - 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);
|
|
1834
1858
|
v.x = f.x, v.y = f.y;
|
|
1835
1859
|
}
|
|
1836
1860
|
d.value = s, A.value = r, E.x = i, E.y = a;
|
|
1837
|
-
} else e.touches.length === 1 && x.value &&
|
|
1838
|
-
},
|
|
1861
|
+
} else e.touches.length === 1 && x.value && de(e);
|
|
1862
|
+
}, ge = (e) => {
|
|
1839
1863
|
if (p.value) {
|
|
1840
1864
|
if (e.touches.length >= 2) return;
|
|
1841
1865
|
if (p.value = !1, e.touches.length === 1) {
|
|
@@ -1844,7 +1868,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1844
1868
|
}
|
|
1845
1869
|
return;
|
|
1846
1870
|
}
|
|
1847
|
-
if (
|
|
1871
|
+
if (Z(e), e.touches.length !== 0) return;
|
|
1848
1872
|
let t = e.changedTouches[0];
|
|
1849
1873
|
if (!t) return;
|
|
1850
1874
|
if (Math.abs(t.clientX - N.x) > Xr || Math.abs(t.clientY - N.y) > Xr) {
|
|
@@ -1852,8 +1876,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1852
1876
|
return;
|
|
1853
1877
|
}
|
|
1854
1878
|
let n = Date.now();
|
|
1855
|
-
n - m < Yr && Math.abs(t.clientX - h) < Xr && Math.abs(t.clientY - g) < Xr ? (
|
|
1856
|
-
},
|
|
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 () => {
|
|
1857
1881
|
let e = R.value;
|
|
1858
1882
|
if (!e) return;
|
|
1859
1883
|
let t = e.split("/").pop() || "image";
|
|
@@ -1865,39 +1889,39 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1865
1889
|
} catch (t) {
|
|
1866
1890
|
console.warn("[KunLightbox] direct download blocked (likely CORS), opening in new tab", t), window.open(e, "_blank", "noopener,noreferrer");
|
|
1867
1891
|
}
|
|
1868
|
-
},
|
|
1892
|
+
}, ve = (e) => {
|
|
1869
1893
|
e === s.value || e < 0 || e >= r.images.length || (P.value = e > s.value ? "slide-next" : "slide-prev", V(), s.value = e);
|
|
1870
|
-
},
|
|
1871
|
-
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());
|
|
1872
1896
|
};
|
|
1873
1897
|
return w(() => {
|
|
1874
|
-
|
|
1898
|
+
ne && te();
|
|
1875
1899
|
}), (n, r) => (T(), l("dialog", {
|
|
1876
1900
|
ref_key: "dialogRef",
|
|
1877
1901
|
ref: F,
|
|
1878
1902
|
"aria-label": "图片查看器",
|
|
1879
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",
|
|
1880
|
-
onClose:
|
|
1881
|
-
onClick:
|
|
1882
|
-
onKeydown:
|
|
1904
|
+
onClose: re,
|
|
1905
|
+
onClick: ie,
|
|
1906
|
+
onKeydown: be
|
|
1883
1907
|
}, [e.isOpen ? (T(), l("div", Pr, [
|
|
1884
1908
|
u("div", {
|
|
1885
1909
|
ref_key: "containerRef",
|
|
1886
1910
|
ref: L,
|
|
1887
1911
|
class: "kun-lightbox-stage relative flex h-full w-full touch-none items-center justify-center overflow-hidden",
|
|
1888
|
-
onClick:
|
|
1889
|
-
onWheel:
|
|
1890
|
-
onMousedown:
|
|
1891
|
-
onMousemove:
|
|
1892
|
-
onMouseup:
|
|
1893
|
-
onMouseleave:
|
|
1894
|
-
onTouchstartPassive:
|
|
1895
|
-
onTouchmovePassive:
|
|
1896
|
-
onTouchend:
|
|
1897
|
-
onTouchcancel:
|
|
1898
|
-
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
|
|
1899
1923
|
}, [f(i, { name: P.value }, {
|
|
1900
|
-
default:
|
|
1924
|
+
default: G(() => [(T(), l("div", {
|
|
1901
1925
|
key: s.value,
|
|
1902
1926
|
class: "kun-lightbox-slide absolute inset-0 flex items-center justify-center"
|
|
1903
1927
|
}, [u("img", {
|
|
@@ -1908,7 +1932,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1908
1932
|
class: "kun-lightbox-image max-h-full max-w-full will-change-transform",
|
|
1909
1933
|
style: b(B.value),
|
|
1910
1934
|
draggable: "false",
|
|
1911
|
-
onClick: r[0] ||=
|
|
1935
|
+
onClick: r[0] ||= J(() => {}, ["stop"])
|
|
1912
1936
|
}, null, 12, Fr)]))]),
|
|
1913
1937
|
_: 1
|
|
1914
1938
|
}, 8, ["name"])], 544),
|
|
@@ -1921,9 +1945,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1921
1945
|
rounded: "lg",
|
|
1922
1946
|
"aria-label": "关闭",
|
|
1923
1947
|
"class-name": "absolute top-4 right-4 z-50 bg-black/70 backdrop-blur-md border border-white/10 shadow-lg",
|
|
1924
|
-
onClick: r[1] ||=
|
|
1948
|
+
onClick: r[1] ||= J((e) => a("update:isOpen", !1), ["stop"])
|
|
1925
1949
|
}, {
|
|
1926
|
-
default:
|
|
1950
|
+
default: G(() => [f(Q, {
|
|
1927
1951
|
name: "lucide:x",
|
|
1928
1952
|
class: "text-white"
|
|
1929
1953
|
})]),
|
|
@@ -1937,9 +1961,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1937
1961
|
rounded: "lg",
|
|
1938
1962
|
"aria-label": "上一张",
|
|
1939
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",
|
|
1940
|
-
onClick:
|
|
1964
|
+
onClick: J(se, ["stop"])
|
|
1941
1965
|
}, {
|
|
1942
|
-
default:
|
|
1966
|
+
default: G(() => [f(Q, {
|
|
1943
1967
|
name: "lucide:chevron-left",
|
|
1944
1968
|
class: "text-white"
|
|
1945
1969
|
})]),
|
|
@@ -1952,9 +1976,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1952
1976
|
rounded: "lg",
|
|
1953
1977
|
"aria-label": "下一张",
|
|
1954
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",
|
|
1955
|
-
onClick:
|
|
1979
|
+
onClick: J(oe, ["stop"])
|
|
1956
1980
|
}, {
|
|
1957
|
-
default:
|
|
1981
|
+
default: G(() => [f(Q, {
|
|
1958
1982
|
name: "lucide:chevron-right",
|
|
1959
1983
|
class: "text-white"
|
|
1960
1984
|
})]),
|
|
@@ -1967,7 +1991,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1967
1991
|
"aria-label": `跳转到第 ${t + 1} 张`,
|
|
1968
1992
|
"aria-current": t === s.value,
|
|
1969
1993
|
class: y(["size-2 rounded-full transition-colors", t === s.value ? "bg-primary-500" : "bg-default-400/60 hover:bg-default-300"]),
|
|
1970
|
-
onClick:
|
|
1994
|
+
onClick: J((e) => ve(t), ["stop"])
|
|
1971
1995
|
}, null, 10, zr))), 128))])) : c("", !0),
|
|
1972
1996
|
e.images.length > 1 ? (T(), l("div", Br, [(T(!0), l(t, null, k(e.images, (e, t) => (T(), l("button", {
|
|
1973
1997
|
key: `thumb-${t}`,
|
|
@@ -1975,7 +1999,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1975
1999
|
"aria-label": `跳转到第 ${t + 1} 张`,
|
|
1976
2000
|
"aria-current": t === s.value,
|
|
1977
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"]),
|
|
1978
|
-
onClick:
|
|
2002
|
+
onClick: J((e) => ve(t), ["stop"])
|
|
1979
2003
|
}, [u("img", {
|
|
1980
2004
|
src: e.src,
|
|
1981
2005
|
alt: e.alt ?? "",
|
|
@@ -1984,7 +2008,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1984
2008
|
}, null, 8, Hr)], 10, Vr))), 128))])) : c("", !0),
|
|
1985
2009
|
u("div", {
|
|
1986
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",
|
|
1987
|
-
onClick: r[2] ||=
|
|
2011
|
+
onClick: r[2] ||= J(() => {}, ["stop"])
|
|
1988
2012
|
}, [
|
|
1989
2013
|
f($, {
|
|
1990
2014
|
"is-icon-only": !0,
|
|
@@ -1993,15 +2017,15 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
1993
2017
|
size: "lg",
|
|
1994
2018
|
rounded: "full",
|
|
1995
2019
|
"aria-label": "缩小",
|
|
1996
|
-
onClick:
|
|
2020
|
+
onClick: W
|
|
1997
2021
|
}, {
|
|
1998
|
-
default:
|
|
2022
|
+
default: G(() => [f(Q, {
|
|
1999
2023
|
name: "lucide:zoom-out",
|
|
2000
2024
|
class: "text-white"
|
|
2001
2025
|
})]),
|
|
2002
2026
|
_: 1
|
|
2003
2027
|
}),
|
|
2004
|
-
u("span", Ur, M(
|
|
2028
|
+
u("span", Ur, M(ye.value) + "% ", 1),
|
|
2005
2029
|
f($, {
|
|
2006
2030
|
"is-icon-only": !0,
|
|
2007
2031
|
color: "default",
|
|
@@ -2011,7 +2035,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2011
2035
|
"aria-label": "放大",
|
|
2012
2036
|
onClick: H
|
|
2013
2037
|
}, {
|
|
2014
|
-
default:
|
|
2038
|
+
default: G(() => [f(Q, {
|
|
2015
2039
|
name: "lucide:zoom-in",
|
|
2016
2040
|
class: "text-white"
|
|
2017
2041
|
})]),
|
|
@@ -2028,9 +2052,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2028
2052
|
size: "lg",
|
|
2029
2053
|
rounded: "full",
|
|
2030
2054
|
"aria-label": "向左旋转 90°",
|
|
2031
|
-
onClick:
|
|
2055
|
+
onClick: q
|
|
2032
2056
|
}, {
|
|
2033
|
-
default:
|
|
2057
|
+
default: G(() => [f(Q, {
|
|
2034
2058
|
name: "lucide:rotate-ccw",
|
|
2035
2059
|
class: "text-white"
|
|
2036
2060
|
})]),
|
|
@@ -2043,9 +2067,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2043
2067
|
size: "lg",
|
|
2044
2068
|
rounded: "full",
|
|
2045
2069
|
"aria-label": "向右旋转 90°",
|
|
2046
|
-
onClick:
|
|
2070
|
+
onClick: K
|
|
2047
2071
|
}, {
|
|
2048
|
-
default:
|
|
2072
|
+
default: G(() => [f(Q, {
|
|
2049
2073
|
name: "lucide:rotate-cw",
|
|
2050
2074
|
class: "text-white"
|
|
2051
2075
|
})]),
|
|
@@ -2064,7 +2088,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2064
2088
|
"aria-label": "重置缩放/旋转/位置",
|
|
2065
2089
|
onClick: V
|
|
2066
2090
|
}, {
|
|
2067
|
-
default:
|
|
2091
|
+
default: G(() => [f(Q, {
|
|
2068
2092
|
name: "lucide:refresh-ccw",
|
|
2069
2093
|
class: "text-white"
|
|
2070
2094
|
})]),
|
|
@@ -2077,9 +2101,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2077
2101
|
size: "lg",
|
|
2078
2102
|
rounded: "full",
|
|
2079
2103
|
"aria-label": "下载",
|
|
2080
|
-
onClick:
|
|
2104
|
+
onClick: _e
|
|
2081
2105
|
}, {
|
|
2082
|
-
default:
|
|
2106
|
+
default: G(() => [f(Q, {
|
|
2083
2107
|
name: "lucide:download",
|
|
2084
2108
|
class: "text-white"
|
|
2085
2109
|
})]),
|
|
@@ -2089,7 +2113,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2089
2113
|
])
|
|
2090
2114
|
])) : c("", !0)], 544));
|
|
2091
2115
|
}
|
|
2092
|
-
}), [["__scopeId", "data-v-81a536ec"]]), Qr = ["innerHTML"], $r = /*#__PURE__*/
|
|
2116
|
+
}), [["__scopeId", "data-v-81a536ec"]]), Qr = ["innerHTML"], $r = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
2093
2117
|
name: "KunContent",
|
|
2094
2118
|
__name: "Content",
|
|
2095
2119
|
props: {
|
|
@@ -2107,7 +2131,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2107
2131
|
return (a, o) => (T(), l("div", null, [u("article", {
|
|
2108
2132
|
ref_key: "articleRef",
|
|
2109
2133
|
ref: t,
|
|
2110
|
-
class: y(I(
|
|
2134
|
+
class: y(I(Y)("kun-prose", e.compact && "kun-prose-compact", e.className)),
|
|
2111
2135
|
innerHTML: e.content
|
|
2112
2136
|
}, null, 10, Qr), f(Zr, {
|
|
2113
2137
|
"is-open": I(n),
|
|
@@ -2135,7 +2159,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2135
2159
|
},
|
|
2136
2160
|
emits: ["select", "close"],
|
|
2137
2161
|
setup(e, { emit: r }) {
|
|
2138
|
-
let a = e, d = r, p =
|
|
2162
|
+
let a = e, d = r, p = ut(), m = O(null), h = O(-1), g = O({
|
|
2139
2163
|
x: a.position?.x ?? 0,
|
|
2140
2164
|
y: a.position?.y ?? 0
|
|
2141
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) => {
|
|
@@ -2198,7 +2222,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2198
2222
|
return;
|
|
2199
2223
|
}
|
|
2200
2224
|
B(t);
|
|
2201
|
-
},
|
|
2225
|
+
}, W = (e) => {
|
|
2202
2226
|
switch (e.key) {
|
|
2203
2227
|
case "ArrowDown":
|
|
2204
2228
|
e.preventDefault(), A(1);
|
|
@@ -2229,7 +2253,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2229
2253
|
e.preventDefault(), P(!0);
|
|
2230
2254
|
break;
|
|
2231
2255
|
}
|
|
2232
|
-
},
|
|
2256
|
+
}, K = {
|
|
2233
2257
|
default: "focus:bg-default/20",
|
|
2234
2258
|
primary: "focus:bg-primary/20",
|
|
2235
2259
|
secondary: "focus:bg-secondary/20",
|
|
@@ -2237,7 +2261,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2237
2261
|
warning: "focus:bg-warning/20",
|
|
2238
2262
|
danger: "focus:bg-danger/20",
|
|
2239
2263
|
info: "focus:bg-info/20"
|
|
2240
|
-
},
|
|
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");
|
|
2241
2265
|
return (r, a) => (T(), s(n, { to: "body" }, [f(i, {
|
|
2242
2266
|
"enter-active-class": "transition duration-kun-base ease-kun-out",
|
|
2243
2267
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -2246,7 +2270,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2246
2270
|
"leave-from-class": "opacity-100 scale-100",
|
|
2247
2271
|
"leave-to-class": "opacity-0 scale-95"
|
|
2248
2272
|
}, {
|
|
2249
|
-
default:
|
|
2273
|
+
default: G(() => [e.visible && e.items.length ? (T(), l("div", {
|
|
2250
2274
|
key: 0,
|
|
2251
2275
|
ref_key: "menuRef",
|
|
2252
2276
|
ref: m,
|
|
@@ -2255,17 +2279,17 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2255
2279
|
tabindex: "-1",
|
|
2256
2280
|
class: "bg-content1 fixed z-kun-popover rounded-kun-lg p-1 text-sm shadow-kun-md outline-none",
|
|
2257
2281
|
style: b(z.value),
|
|
2258
|
-
onClick: a[0] ||=
|
|
2259
|
-
onKeydown:
|
|
2282
|
+
onClick: a[0] ||= J(() => {}, ["stop"]),
|
|
2283
|
+
onKeydown: W
|
|
2260
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), {
|
|
2261
2285
|
role: "menuitem",
|
|
2262
2286
|
tabindex: t === h.value ? 0 : -1,
|
|
2263
2287
|
"aria-disabled": e.disabled || void 0,
|
|
2264
|
-
class:
|
|
2288
|
+
class: q(e),
|
|
2265
2289
|
onClick: (t) => H(t, e),
|
|
2266
2290
|
onMouseenter: (n) => !e.disabled && D(t)
|
|
2267
2291
|
}), {
|
|
2268
|
-
default:
|
|
2292
|
+
default: G(() => [e.icon ? (T(), s(Q, {
|
|
2269
2293
|
key: 0,
|
|
2270
2294
|
name: e.icon,
|
|
2271
2295
|
class: "shrink-0 text-base"
|
|
@@ -2281,49 +2305,49 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2281
2305
|
_: 1
|
|
2282
2306
|
})]));
|
|
2283
2307
|
}
|
|
2284
|
-
}), ni = "yyyy-MM-dd", ri = (e, t = ni) =>
|
|
2308
|
+
}), ni = "yyyy-MM-dd", ri = (e, t = ni) => Be(e, t), ii = (e) => {
|
|
2285
2309
|
if (!e) return null;
|
|
2286
|
-
if (e instanceof Date) return
|
|
2287
|
-
let t =
|
|
2288
|
-
return
|
|
2310
|
+
if (e instanceof Date) return Ke(e) ? e : null;
|
|
2311
|
+
let t = qe(e);
|
|
2312
|
+
return Ke(t) ? t : null;
|
|
2289
2313
|
}, ai = (e) => {
|
|
2290
2314
|
switch (e) {
|
|
2291
|
-
case "ja": return
|
|
2292
|
-
case "zh-CN": return
|
|
2293
|
-
default: return
|
|
2315
|
+
case "ja": return $e;
|
|
2316
|
+
case "zh-CN": return et;
|
|
2317
|
+
default: return Qe;
|
|
2294
2318
|
}
|
|
2295
2319
|
}, oi = (e) => {
|
|
2296
|
-
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(() => {
|
|
2297
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;
|
|
2298
2322
|
return {
|
|
2299
|
-
weekdays: n || [...Array(7)].map((e, n) =>
|
|
2300
|
-
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 }))
|
|
2301
2325
|
};
|
|
2302
2326
|
}), a = (e) => {
|
|
2303
|
-
t.value =
|
|
2327
|
+
t.value = Fe(t.value, e);
|
|
2304
2328
|
}, s = (e) => {
|
|
2305
|
-
t.value =
|
|
2329
|
+
t.value = Ie(t.value, e);
|
|
2306
2330
|
}, c = o(() => {
|
|
2307
|
-
let n =
|
|
2308
|
-
start:
|
|
2309
|
-
end:
|
|
2310
|
-
}), 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));
|
|
2311
2335
|
return i.map((n) => {
|
|
2312
|
-
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;
|
|
2313
2337
|
return {
|
|
2314
2338
|
date: n,
|
|
2315
2339
|
key: ri(n),
|
|
2316
2340
|
dayOfMonth: n.getDate(),
|
|
2317
|
-
isCurrentMonth:
|
|
2318
|
-
isToday:
|
|
2341
|
+
isCurrentMonth: We(n, t.value),
|
|
2342
|
+
isToday: Ge(n),
|
|
2319
2343
|
isSelected: r,
|
|
2320
|
-
isRangeStart:
|
|
2321
|
-
isRangeEnd:
|
|
2344
|
+
isRangeStart: Ue(n, u),
|
|
2345
|
+
isRangeEnd: Ue(n, d),
|
|
2322
2346
|
isInRange: i,
|
|
2323
2347
|
isDisabled: o
|
|
2324
2348
|
};
|
|
2325
2349
|
});
|
|
2326
|
-
}), l = (t) =>
|
|
2350
|
+
}), l = (t) => Be(t, (e.valueFormat && "value" in e.valueFormat ? e.valueFormat.value : e.valueFormat) || ni);
|
|
2327
2351
|
return {
|
|
2328
2352
|
viewingDate: t,
|
|
2329
2353
|
i18n: i,
|
|
@@ -2334,7 +2358,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2334
2358
|
if (e.mode.value === "single") return l(t);
|
|
2335
2359
|
if (!n.value || Array.isArray(e.modelValue.value) && e.modelValue.value[1]) return n.value = t, [l(t), null];
|
|
2336
2360
|
let r = n.value;
|
|
2337
|
-
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];
|
|
2338
2362
|
},
|
|
2339
2363
|
formatDate: ri,
|
|
2340
2364
|
tempRangeStart: n
|
|
@@ -2390,21 +2414,30 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2390
2414
|
},
|
|
2391
2415
|
emits: ["update:modelValue"],
|
|
2392
2416
|
setup(e, { emit: r }) {
|
|
2393
|
-
let a = e, p =
|
|
2394
|
-
|
|
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) => {
|
|
2395
2419
|
x.value?.contains(e.target) || (g.value = !1);
|
|
2396
2420
|
});
|
|
2397
|
-
let { floatingStyles: C, placement: w } =
|
|
2421
|
+
let { floatingStyles: C, placement: w } = Pe(_, x, {
|
|
2398
2422
|
placement: "bottom-start",
|
|
2399
2423
|
open: g,
|
|
2400
|
-
whileElementsMounted:
|
|
2424
|
+
whileElementsMounted: ke,
|
|
2401
2425
|
transform: !1,
|
|
2402
2426
|
middleware: [
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2427
|
+
je(4),
|
|
2428
|
+
Ae(),
|
|
2429
|
+
Me({ padding: 8 }),
|
|
2430
|
+
Ne({
|
|
2431
|
+
padding: 8,
|
|
2432
|
+
apply({ availableHeight: e, elements: t }) {
|
|
2433
|
+
Object.assign(t.floating.style, {
|
|
2434
|
+
maxHeight: `${Math.max(0, Math.floor(e))}px`,
|
|
2435
|
+
overflowY: "auto"
|
|
2436
|
+
});
|
|
2437
|
+
}
|
|
2438
|
+
})
|
|
2406
2439
|
]
|
|
2407
|
-
}), 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({
|
|
2408
2441
|
modelValue: D,
|
|
2409
2442
|
mode: A,
|
|
2410
2443
|
minDate: j,
|
|
@@ -2414,44 +2447,44 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2414
2447
|
weekdays: R,
|
|
2415
2448
|
months: z,
|
|
2416
2449
|
valueFormat: B
|
|
2417
|
-
}),
|
|
2450
|
+
}), re = O(new Date(V.value));
|
|
2418
2451
|
U(V, (e) => {
|
|
2419
|
-
|
|
2452
|
+
re.value = new Date(e);
|
|
2420
2453
|
});
|
|
2421
|
-
let
|
|
2422
|
-
let t = new Date(
|
|
2423
|
-
t.setDate(t.getDate() + e),
|
|
2424
|
-
},
|
|
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) => {
|
|
2425
2458
|
if (g.value) switch (e.key) {
|
|
2426
2459
|
case "ArrowLeft":
|
|
2427
|
-
e.preventDefault(),
|
|
2460
|
+
e.preventDefault(), ie(-1);
|
|
2428
2461
|
break;
|
|
2429
2462
|
case "ArrowRight":
|
|
2430
|
-
e.preventDefault(),
|
|
2463
|
+
e.preventDefault(), ie(1);
|
|
2431
2464
|
break;
|
|
2432
2465
|
case "ArrowUp":
|
|
2433
|
-
e.preventDefault(),
|
|
2466
|
+
e.preventDefault(), ie(-7);
|
|
2434
2467
|
break;
|
|
2435
2468
|
case "ArrowDown":
|
|
2436
|
-
e.preventDefault(),
|
|
2469
|
+
e.preventDefault(), ie(7);
|
|
2437
2470
|
break;
|
|
2438
2471
|
case "Enter":
|
|
2439
|
-
e.preventDefault(),
|
|
2472
|
+
e.preventDefault(), ce(re.value);
|
|
2440
2473
|
break;
|
|
2441
2474
|
case "Escape":
|
|
2442
2475
|
e.preventDefault(), g.value = !1;
|
|
2443
2476
|
break;
|
|
2444
2477
|
}
|
|
2445
|
-
},
|
|
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 = () => {
|
|
2446
2479
|
a.disabled || (g.value = !g.value, g.value && v(() => _.value?.focus({ preventScroll: !0 })));
|
|
2447
|
-
},
|
|
2448
|
-
let t =
|
|
2480
|
+
}, ce = (e) => {
|
|
2481
|
+
let t = ee(e);
|
|
2449
2482
|
h("update:modelValue", t), (a.mode === "single" || Array.isArray(t) && t[1]) && (g.value = !1);
|
|
2450
|
-
},
|
|
2483
|
+
}, ue = () => {
|
|
2451
2484
|
h("update:modelValue", a.mode === "single" ? null : [null, null]);
|
|
2452
|
-
},
|
|
2453
|
-
if (!
|
|
2454
|
-
let t =
|
|
2485
|
+
}, de = (e) => {
|
|
2486
|
+
if (!ne.value || !S.value) return !1;
|
|
2487
|
+
let t = ne.value, n = S.value;
|
|
2455
2488
|
return !t || !n ? !1 : e > t && e < n || e < t && e > n;
|
|
2456
2489
|
};
|
|
2457
2490
|
return (r, o) => (T(), l("div", {
|
|
@@ -2459,23 +2492,23 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2459
2492
|
ref: _,
|
|
2460
2493
|
class: "relative w-full",
|
|
2461
2494
|
tabindex: "0",
|
|
2462
|
-
onKeydownCapture:
|
|
2495
|
+
onKeydownCapture: J(ae, ["prevent"])
|
|
2463
2496
|
}, [
|
|
2464
2497
|
e.label ? (T(), l("label", si, M(e.label), 1)) : c("", !0),
|
|
2465
2498
|
u("div", ci, [u("button", {
|
|
2466
2499
|
type: "button",
|
|
2467
2500
|
disabled: e.disabled,
|
|
2468
|
-
class: y(I(
|
|
2469
|
-
onClick:
|
|
2470
|
-
}, [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", {
|
|
2471
2504
|
key: 0,
|
|
2472
2505
|
class: "text-default-500 hover:text-default-800 mr-2 p-1",
|
|
2473
2506
|
"aria-label": "Clear date",
|
|
2474
|
-
onClick:
|
|
2475
|
-
}, [f(
|
|
2507
|
+
onClick: J(ue, ["stop"])
|
|
2508
|
+
}, [f(Q, {
|
|
2476
2509
|
name: "lucide:x",
|
|
2477
2510
|
class: "h-4 w-4"
|
|
2478
|
-
})])) : c("", !0), f(
|
|
2511
|
+
})])) : c("", !0), f(Q, {
|
|
2479
2512
|
name: "lucide:calendar",
|
|
2480
2513
|
class: "text-default-500"
|
|
2481
2514
|
})])], 10, li)]),
|
|
@@ -2487,11 +2520,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2487
2520
|
"leave-from-class": "opacity-100 scale-100",
|
|
2488
2521
|
"leave-to-class": "opacity-0 scale-95"
|
|
2489
2522
|
}, {
|
|
2490
|
-
default:
|
|
2523
|
+
default: G(() => [g.value ? (T(), l("div", {
|
|
2491
2524
|
key: 0,
|
|
2492
2525
|
ref_key: "dropdownRef",
|
|
2493
2526
|
ref: x,
|
|
2494
|
-
class: y(I(
|
|
2527
|
+
class: y(I(Y)("bg-content1 z-kun-popover p-3 shadow-kun-md", m.value)),
|
|
2495
2528
|
style: b([I(C), {
|
|
2496
2529
|
minWidth: "260px",
|
|
2497
2530
|
transformOrigin: I(E)
|
|
@@ -2505,18 +2538,18 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2505
2538
|
"is-icon-only": !0,
|
|
2506
2539
|
size: "sm",
|
|
2507
2540
|
"aria-label": "Previous year",
|
|
2508
|
-
onClick: o[0] ||= (e) => I(
|
|
2541
|
+
onClick: o[0] ||= (e) => I(q)(-1)
|
|
2509
2542
|
}, {
|
|
2510
|
-
default:
|
|
2543
|
+
default: G(() => [f(Q, { name: "lucide:chevrons-left" })]),
|
|
2511
2544
|
_: 1
|
|
2512
2545
|
}), f($, {
|
|
2513
2546
|
variant: "light",
|
|
2514
2547
|
"is-icon-only": !0,
|
|
2515
2548
|
size: "sm",
|
|
2516
2549
|
"aria-label": "Previous month",
|
|
2517
|
-
onClick: o[1] ||= (e) => I(
|
|
2550
|
+
onClick: o[1] ||= (e) => I(K)(-1)
|
|
2518
2551
|
}, {
|
|
2519
|
-
default:
|
|
2552
|
+
default: G(() => [f(Q, { name: "lucide:chevron-left" })]),
|
|
2520
2553
|
_: 1
|
|
2521
2554
|
})]),
|
|
2522
2555
|
u("div", pi, M(I(V).getFullYear()) + " / " + M(I(V).getMonth() + 1), 1),
|
|
@@ -2525,18 +2558,18 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2525
2558
|
"is-icon-only": !0,
|
|
2526
2559
|
size: "sm",
|
|
2527
2560
|
"aria-label": "Next month",
|
|
2528
|
-
onClick: o[2] ||= (e) => I(
|
|
2561
|
+
onClick: o[2] ||= (e) => I(K)(1)
|
|
2529
2562
|
}, {
|
|
2530
|
-
default:
|
|
2563
|
+
default: G(() => [f(Q, { name: "lucide:chevron-right" })]),
|
|
2531
2564
|
_: 1
|
|
2532
2565
|
}), f($, {
|
|
2533
2566
|
variant: "light",
|
|
2534
2567
|
"is-icon-only": !0,
|
|
2535
2568
|
size: "sm",
|
|
2536
2569
|
"aria-label": "Next year",
|
|
2537
|
-
onClick: o[3] ||= (e) => I(
|
|
2570
|
+
onClick: o[3] ||= (e) => I(q)(1)
|
|
2538
2571
|
}, {
|
|
2539
|
-
default:
|
|
2572
|
+
default: G(() => [f(Q, { name: "lucide:chevrons-right" })]),
|
|
2540
2573
|
_: 1
|
|
2541
2574
|
})])
|
|
2542
2575
|
]),
|
|
@@ -2544,41 +2577,41 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2544
2577
|
key: e,
|
|
2545
2578
|
class: "p-1 font-medium"
|
|
2546
2579
|
}, M(e), 1))), 128))]),
|
|
2547
|
-
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", {
|
|
2548
2581
|
key: t.key,
|
|
2549
2582
|
class: "p-0.5",
|
|
2550
2583
|
role: "gridcell"
|
|
2551
2584
|
}, [u("button", {
|
|
2552
2585
|
disabled: t.isDisabled,
|
|
2553
|
-
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")),
|
|
2554
2587
|
"aria-label": t.date.toDateString(),
|
|
2555
2588
|
"aria-selected": t.isSelected,
|
|
2556
|
-
tabindex: t.date.toDateString() ===
|
|
2557
|
-
onClick: (e) =>
|
|
2589
|
+
tabindex: t.date.toDateString() === re.value.toDateString() ? 0 : -1,
|
|
2590
|
+
onClick: (e) => ce(t.date),
|
|
2558
2591
|
onMouseenter: (e) => S.value = t.date,
|
|
2559
2592
|
onMouseleave: o[4] ||= (e) => S.value = null
|
|
2560
2593
|
}, M(t.dayOfMonth), 43, _i)]))), 128))]),
|
|
2561
2594
|
u("div", vi, [f($, {
|
|
2562
2595
|
size: "sm",
|
|
2563
2596
|
variant: "light",
|
|
2564
|
-
onClick: o[5] ||= (e) =>
|
|
2597
|
+
onClick: o[5] ||= (e) => ce(/* @__PURE__ */ new Date())
|
|
2565
2598
|
}, {
|
|
2566
|
-
default:
|
|
2599
|
+
default: G(() => [...o[7] ||= [d(" 今天 ", -1)]]),
|
|
2567
2600
|
_: 1
|
|
2568
2601
|
}), u("div", yi, [e.clearable ? (T(), s($, {
|
|
2569
2602
|
key: 0,
|
|
2570
2603
|
size: "sm",
|
|
2571
2604
|
variant: "light",
|
|
2572
|
-
onClick:
|
|
2605
|
+
onClick: ue
|
|
2573
2606
|
}, {
|
|
2574
|
-
default:
|
|
2607
|
+
default: G(() => [...o[8] ||= [d(" 清空 ", -1)]]),
|
|
2575
2608
|
_: 1
|
|
2576
2609
|
})) : c("", !0), f($, {
|
|
2577
2610
|
size: "sm",
|
|
2578
2611
|
variant: "light",
|
|
2579
2612
|
onClick: o[6] ||= (e) => g.value = !1
|
|
2580
2613
|
}, {
|
|
2581
|
-
default:
|
|
2614
|
+
default: G(() => [...o[9] ||= [d(" 关闭 ", -1)]]),
|
|
2582
2615
|
_: 1
|
|
2583
2616
|
})])])
|
|
2584
2617
|
], 6)) : c("", !0)]),
|
|
@@ -2613,7 +2646,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2613
2646
|
}
|
|
2614
2647
|
return o;
|
|
2615
2648
|
}, Di = async (e) => {
|
|
2616
|
-
let t =
|
|
2649
|
+
let t = ne(e);
|
|
2617
2650
|
try {
|
|
2618
2651
|
if (!navigator.clipboard) throw Error("Clipboard API unavailable");
|
|
2619
2652
|
return await navigator.clipboard.writeText(t), Ei(`${t} 复制成功`, "success"), !0;
|
|
@@ -2644,10 +2677,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2644
2677
|
color: n.value ? "success" : e.color,
|
|
2645
2678
|
size: e.size,
|
|
2646
2679
|
rounded: e.rounded,
|
|
2647
|
-
"class-name": I(
|
|
2680
|
+
"class-name": I(Y)("gap-2", e.className),
|
|
2648
2681
|
onClick: i
|
|
2649
2682
|
}, {
|
|
2650
|
-
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"])]),
|
|
2651
2684
|
_: 1
|
|
2652
2685
|
}, 8, [
|
|
2653
2686
|
"variant",
|
|
@@ -2681,7 +2714,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2681
2714
|
info: "border-info/20"
|
|
2682
2715
|
};
|
|
2683
2716
|
return (n, r) => (T(), l("div", {
|
|
2684
|
-
class: y(I(
|
|
2717
|
+
class: y(I(Y)("flex items-center", e.orientation === "horizontal" ? "w-full" : "h-full flex-col", e.className)),
|
|
2685
2718
|
role: "separator",
|
|
2686
2719
|
"aria-orientation": e.orientation === "vertical" ? "vertical" : void 0
|
|
2687
2720
|
}, [
|
|
@@ -2732,7 +2765,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2732
2765
|
let o = e, d = a, p = O(!1), m = O(-1), h = O(null), g = O(null), x = `kun-dropdown-${R()}`, { floatingStyles: S, transformOrigin: C } = an(h, g, {
|
|
2733
2766
|
placement: () => o.position,
|
|
2734
2767
|
open: p,
|
|
2735
|
-
offset: 6
|
|
2768
|
+
offset: 6,
|
|
2769
|
+
maxSize: !0
|
|
2736
2770
|
}), w = () => o.items.reduce((e, t, n) => (t.disabled || e.push(n), e), []), E = () => Array.from(g.value?.querySelectorAll("[role=\"menuitem\"]") ?? []), D = (e) => {
|
|
2737
2771
|
m.value = e, E()[e]?.focus({ preventScroll: !0 });
|
|
2738
2772
|
}, N = (e = "none") => {
|
|
@@ -2753,16 +2787,16 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2753
2787
|
t >= 0 && D(t);
|
|
2754
2788
|
}, H = (e) => {
|
|
2755
2789
|
e.disabled || (d("select", e), P(!0));
|
|
2756
|
-
}, U =
|
|
2790
|
+
}, U = ut(), W = (e) => e.href ? typeof U.linkComponent == "string" ? { href: e.href } : { to: e.href } : {
|
|
2757
2791
|
type: "button",
|
|
2758
2792
|
disabled: e.disabled
|
|
2759
|
-
},
|
|
2793
|
+
}, K = (e, t) => {
|
|
2760
2794
|
if (t.disabled) {
|
|
2761
2795
|
e.preventDefault();
|
|
2762
2796
|
return;
|
|
2763
2797
|
}
|
|
2764
2798
|
H(t);
|
|
2765
|
-
},
|
|
2799
|
+
}, q = (e) => {
|
|
2766
2800
|
if (!o.disabled) switch (e.key) {
|
|
2767
2801
|
case "ArrowDown":
|
|
2768
2802
|
case "Enter":
|
|
@@ -2773,7 +2807,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2773
2807
|
e.preventDefault(), N("last");
|
|
2774
2808
|
break;
|
|
2775
2809
|
}
|
|
2776
|
-
},
|
|
2810
|
+
}, J = (e) => {
|
|
2777
2811
|
switch (e.key) {
|
|
2778
2812
|
case "ArrowDown":
|
|
2779
2813
|
e.preventDefault(), L(1);
|
|
@@ -2806,12 +2840,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2806
2840
|
default: e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && (e.preventDefault(), V(e.key));
|
|
2807
2841
|
}
|
|
2808
2842
|
};
|
|
2809
|
-
|
|
2843
|
+
xe(h, (e) => {
|
|
2810
2844
|
g.value?.contains(e.target) || P();
|
|
2811
|
-
}),
|
|
2845
|
+
}), we("keydown", (e) => {
|
|
2812
2846
|
e.key === "Escape" && p.value && P(!0);
|
|
2813
2847
|
});
|
|
2814
|
-
let
|
|
2848
|
+
let ee = {
|
|
2815
2849
|
default: "focus:bg-default/20",
|
|
2816
2850
|
primary: "focus:bg-primary/20",
|
|
2817
2851
|
secondary: "focus:bg-secondary/20",
|
|
@@ -2819,7 +2853,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2819
2853
|
warning: "focus:bg-warning/20",
|
|
2820
2854
|
danger: "focus:bg-danger/20",
|
|
2821
2855
|
info: "focus:bg-info/20"
|
|
2822
|
-
},
|
|
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");
|
|
2823
2857
|
return r({
|
|
2824
2858
|
open: () => N("none"),
|
|
2825
2859
|
close: () => P(),
|
|
@@ -2829,13 +2863,13 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2829
2863
|
ref: h,
|
|
2830
2864
|
role: "button",
|
|
2831
2865
|
tabindex: e.disabled ? -1 : 0,
|
|
2832
|
-
class: y(I(
|
|
2866
|
+
class: y(I(Y)("inline-flex cursor-pointer items-center", e.disabled && "cursor-not-allowed opacity-50", e.triggerClass)),
|
|
2833
2867
|
"aria-haspopup": "menu",
|
|
2834
2868
|
"aria-expanded": p.value,
|
|
2835
2869
|
"aria-disabled": e.disabled || void 0,
|
|
2836
2870
|
"aria-controls": p.value ? x : void 0,
|
|
2837
2871
|
onClick: a[0] ||= (t) => e.disabled || F(),
|
|
2838
|
-
onKeydown:
|
|
2872
|
+
onKeydown: q
|
|
2839
2873
|
}, [A(r.$slots, "trigger")], 42, Ni), (T(), s(n, { to: "body" }, [f(i, {
|
|
2840
2874
|
"enter-active-class": "transition duration-kun-base ease-kun-out",
|
|
2841
2875
|
"enter-from-class": "opacity-0 scale-95",
|
|
@@ -2844,7 +2878,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2844
2878
|
"leave-from-class": "opacity-100 scale-100",
|
|
2845
2879
|
"leave-to-class": "opacity-0 scale-95"
|
|
2846
2880
|
}, {
|
|
2847
|
-
default:
|
|
2881
|
+
default: G(() => [p.value && e.items.length ? (T(), l("div", {
|
|
2848
2882
|
key: 0,
|
|
2849
2883
|
ref_key: "menuRef",
|
|
2850
2884
|
ref: g,
|
|
@@ -2852,21 +2886,21 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2852
2886
|
role: "menu",
|
|
2853
2887
|
"aria-orientation": "vertical",
|
|
2854
2888
|
tabindex: "-1",
|
|
2855
|
-
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)),
|
|
2856
2890
|
style: b([I(S), {
|
|
2857
2891
|
minWidth: `${e.minWidth}px`,
|
|
2858
2892
|
transformOrigin: I(C)
|
|
2859
2893
|
}]),
|
|
2860
|
-
onKeydown:
|
|
2861
|
-
}, [(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), {
|
|
2862
2896
|
role: "menuitem",
|
|
2863
2897
|
tabindex: t === m.value ? 0 : -1,
|
|
2864
2898
|
"aria-disabled": e.disabled || void 0,
|
|
2865
|
-
class:
|
|
2866
|
-
onClick: (t) =>
|
|
2899
|
+
class: te(e),
|
|
2900
|
+
onClick: (t) => K(t, e),
|
|
2867
2901
|
onMouseenter: (n) => !e.disabled && D(t)
|
|
2868
2902
|
}), {
|
|
2869
|
-
default:
|
|
2903
|
+
default: G(() => [e.icon ? (T(), s(Q, {
|
|
2870
2904
|
key: 0,
|
|
2871
2905
|
name: e.icon,
|
|
2872
2906
|
class: "shrink-0 text-base"
|
|
@@ -2891,7 +2925,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2891
2925
|
}, Vi = {
|
|
2892
2926
|
key: 3,
|
|
2893
2927
|
class: "border-kun border-t px-6 py-4"
|
|
2894
|
-
}, Hi = /*#__PURE__*/
|
|
2928
|
+
}, Hi = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
2895
2929
|
name: "KunDrawer",
|
|
2896
2930
|
__name: "Drawer",
|
|
2897
2931
|
props: /*@__PURE__*/ g({
|
|
@@ -2926,7 +2960,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2926
2960
|
}),
|
|
2927
2961
|
emits: /*@__PURE__*/ g(["close"], ["update:modelValue"]),
|
|
2928
2962
|
setup(e, { emit: t }) {
|
|
2929
|
-
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 = {
|
|
2930
2964
|
sm: "w-80",
|
|
2931
2965
|
md: "w-96",
|
|
2932
2966
|
lg: "w-[32rem]",
|
|
@@ -2958,35 +2992,35 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2958
2992
|
].filter(Boolean).join(" ");
|
|
2959
2993
|
}), N = o(() => `kun-drawer-${d.value}`), { lock: P, unlock: F } = Ft(), L = !1, R = (e) => {
|
|
2960
2994
|
e && !L ? (P(), L = !0) : !e && L && (F(), L = !1);
|
|
2961
|
-
}, { zIndex: B, claim: V, release: H, isTopmost:
|
|
2962
|
-
e && !
|
|
2963
|
-
}, { activate:
|
|
2964
|
-
e && !
|
|
2965
|
-
},
|
|
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, {
|
|
2966
3000
|
immediate: !1,
|
|
2967
3001
|
escapeDeactivates: !1,
|
|
2968
3002
|
allowOutsideClick: !0,
|
|
2969
3003
|
returnFocusOnDeactivate: !0
|
|
2970
|
-
}),
|
|
3004
|
+
}), se = () => {
|
|
2971
3005
|
r.isDismissable && (h.value = !1, g("close"));
|
|
2972
|
-
},
|
|
3006
|
+
}, ce = () => {
|
|
2973
3007
|
h.value = !1, g("close");
|
|
2974
3008
|
};
|
|
2975
|
-
return
|
|
2976
|
-
e.key === "Escape" && h.value &&
|
|
3009
|
+
return we("keydown", (e) => {
|
|
3010
|
+
e.key === "Escape" && h.value && W.value && se();
|
|
2977
3011
|
}), U(h, async (e) => {
|
|
2978
|
-
R(e),
|
|
3012
|
+
R(e), q(e), e ? (await v(), ae(), re(!0)) : (re(!1), oe());
|
|
2979
3013
|
}), S(async () => {
|
|
2980
|
-
h.value && (R(!0),
|
|
3014
|
+
h.value && (R(!0), q(!0), await v(), ae(), re(!0));
|
|
2981
3015
|
}), w(() => {
|
|
2982
|
-
R(!1),
|
|
3016
|
+
R(!1), q(!1), re(!1), oe();
|
|
2983
3017
|
}), (t, r) => (T(), s(n, { to: "body" }, [f(i, { name: N.value }, {
|
|
2984
|
-
default:
|
|
3018
|
+
default: G(() => [h.value ? (T(), l("div", {
|
|
2985
3019
|
key: 0,
|
|
2986
3020
|
ref_key: "trapEl",
|
|
2987
|
-
ref:
|
|
3021
|
+
ref: ie,
|
|
2988
3022
|
"data-kun-overlay": "",
|
|
2989
|
-
class: y(I(
|
|
3023
|
+
class: y(I(Y)("z-kun-modal fixed inset-0", e.className)),
|
|
2990
3024
|
style: b({ zIndex: I(B) }),
|
|
2991
3025
|
role: "dialog",
|
|
2992
3026
|
"aria-modal": "true",
|
|
@@ -2994,10 +3028,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
2994
3028
|
tabindex: "0"
|
|
2995
3029
|
}, [u("div", {
|
|
2996
3030
|
class: "bg-default-800/70 dark:bg-background/70 absolute inset-0 transition-opacity",
|
|
2997
|
-
onClick:
|
|
3031
|
+
onClick: se
|
|
2998
3032
|
}), u("div", {
|
|
2999
|
-
class: y(I(
|
|
3000
|
-
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"])
|
|
3001
3035
|
}, [
|
|
3002
3036
|
e.title || t.$slots.header || e.isShowCloseButton ? (T(), l("header", Li, [u("div", Ri, [e.title ? (T(), l("h2", {
|
|
3003
3037
|
key: 0,
|
|
@@ -3012,9 +3046,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3012
3046
|
"is-icon-only": !0,
|
|
3013
3047
|
"aria-label": "关闭抽屉",
|
|
3014
3048
|
"class-name": "shrink-0",
|
|
3015
|
-
onClick:
|
|
3049
|
+
onClick: ce
|
|
3016
3050
|
}, {
|
|
3017
|
-
default:
|
|
3051
|
+
default: G(() => [f(Q, { name: "lucide:x" })]),
|
|
3018
3052
|
_: 1
|
|
3019
3053
|
})) : c("", !0)])) : c("", !0),
|
|
3020
3054
|
e.withContainer ? (T(), l("div", Bi, [A(t.$slots, "default", {}, void 0, !0)])) : A(t.$slots, "default", { key: 2 }, void 0, !0),
|
|
@@ -3026,7 +3060,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3026
3060
|
}), [["__scopeId", "data-v-2c7f907c"]]), Ui = {
|
|
3027
3061
|
key: 0,
|
|
3028
3062
|
class: "grid grid-rows-[1fr] opacity-100"
|
|
3029
|
-
}, Wi = { class: "min-h-0 overflow-hidden" }, Gi = /*#__PURE__*/
|
|
3063
|
+
}, Wi = { class: "min-h-0 overflow-hidden" }, Gi = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3030
3064
|
name: "KunFadeCard",
|
|
3031
3065
|
__name: "FadeCard",
|
|
3032
3066
|
setup(n) {
|
|
@@ -3039,7 +3073,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3039
3073
|
"enter-from-class": "kun-fade-collapsed",
|
|
3040
3074
|
"leave-to-class": "kun-fade-collapsed"
|
|
3041
3075
|
}, {
|
|
3042
|
-
default:
|
|
3076
|
+
default: G(() => [p.value && f.value ? (T(), l("div", Ui, [u("div", Wi, [A(e.$slots, "default", {}, void 0, !0)])])) : c("", !0)]),
|
|
3043
3077
|
_: 3
|
|
3044
3078
|
}));
|
|
3045
3079
|
}
|
|
@@ -3132,7 +3166,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3132
3166
|
}), _ = () => {
|
|
3133
3167
|
n.disabled || m();
|
|
3134
3168
|
};
|
|
3135
|
-
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)) }, [
|
|
3136
3170
|
u("div", Ji, [A(t.$slots, "default", {
|
|
3137
3171
|
pick: _,
|
|
3138
3172
|
disabled: e.disabled,
|
|
@@ -3146,7 +3180,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3146
3180
|
type: "button",
|
|
3147
3181
|
onClick: _
|
|
3148
3182
|
}, {
|
|
3149
|
-
default:
|
|
3183
|
+
default: G(() => [e.triggerIcon ? (T(), s(Q, {
|
|
3150
3184
|
key: 0,
|
|
3151
3185
|
name: e.triggerIcon,
|
|
3152
3186
|
class: "mr-1 size-4"
|
|
@@ -3175,7 +3209,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3175
3209
|
scale: { default: "h1" }
|
|
3176
3210
|
},
|
|
3177
3211
|
setup(e) {
|
|
3178
|
-
let t = e, n = o(() =>
|
|
3212
|
+
let t = e, n = o(() => Y("font-medium", {
|
|
3179
3213
|
h1: "text-2xl sm:text-3xl",
|
|
3180
3214
|
h2: "text-xl sm:text-2xl",
|
|
3181
3215
|
h3: "text-lg sm:text-xl"
|
|
@@ -3185,7 +3219,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3185
3219
|
title: e.name,
|
|
3186
3220
|
class: y(n.value)
|
|
3187
3221
|
}, {
|
|
3188
|
-
default:
|
|
3222
|
+
default: G(() => [e.name ? (T(), l("span", na, M(e.name), 1)) : c("", !0), A(t.$slots, "title")]),
|
|
3189
3223
|
_: 3
|
|
3190
3224
|
}, 8, ["title", "class"])),
|
|
3191
3225
|
e.description ? (T(), l("p", ra, M(e.description), 1)) : c("", !0),
|
|
@@ -3213,7 +3247,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3213
3247
|
},
|
|
3214
3248
|
setup(e) {
|
|
3215
3249
|
return (t, n) => (T(), l("img", {
|
|
3216
|
-
class: y(I(
|
|
3250
|
+
class: y(I(Y)(e.className)),
|
|
3217
3251
|
src: e.src,
|
|
3218
3252
|
alt: e.alt,
|
|
3219
3253
|
loading: e.loading,
|
|
@@ -3238,7 +3272,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3238
3272
|
rounded: { default: void 0 }
|
|
3239
3273
|
},
|
|
3240
3274
|
setup(e) {
|
|
3241
|
-
let t = e, n =
|
|
3275
|
+
let t = e, n = Tt(() => t.rounded), r = o(() => Z[n.value]), i = o(() => {
|
|
3242
3276
|
switch (t.variant) {
|
|
3243
3277
|
case "solid":
|
|
3244
3278
|
case "shadow": return "border-[1.5px] border-transparent";
|
|
@@ -3283,7 +3317,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3283
3317
|
warning: "shadow-lg shadow-warning/40",
|
|
3284
3318
|
danger: "shadow-lg shadow-danger/40",
|
|
3285
3319
|
info: "shadow-lg shadow-info/40"
|
|
3286
|
-
}, 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(() => {
|
|
3287
3321
|
if (t.variant === "solid" || t.variant === "shadow") return "";
|
|
3288
3322
|
switch (t.color) {
|
|
3289
3323
|
case "primary": return "text-primary-900";
|
|
@@ -3295,8 +3329,8 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3295
3329
|
default: return "text-default-900";
|
|
3296
3330
|
}
|
|
3297
3331
|
});
|
|
3298
|
-
return (t, n) => (T(), l("div", { class: y(I(
|
|
3299
|
-
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, {
|
|
3300
3334
|
key: 0,
|
|
3301
3335
|
name: e.icon,
|
|
3302
3336
|
"class-name": "h-5 w-5 flex-shrink-0"
|
|
@@ -3381,7 +3415,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3381
3415
|
"pr-10",
|
|
3382
3416
|
"pr-[4.5rem]",
|
|
3383
3417
|
"pr-28"
|
|
3384
|
-
][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) => {
|
|
3385
3419
|
D.value = e.target.value;
|
|
3386
3420
|
}, R = (e) => {
|
|
3387
3421
|
N.value = !1, k("blur", e);
|
|
@@ -3426,7 +3460,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3426
3460
|
required: e.required,
|
|
3427
3461
|
"aria-invalid": s.value || void 0,
|
|
3428
3462
|
"aria-describedby": a.value || e.error ? `${I(P)}-desc` : void 0,
|
|
3429
|
-
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),
|
|
3430
3464
|
onInput: L,
|
|
3431
3465
|
onBlur: R,
|
|
3432
3466
|
onFocus: V
|
|
@@ -3441,7 +3475,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3441
3475
|
class: "text-default-400 hover:text-default-600 flex items-center",
|
|
3442
3476
|
"aria-label": "清除",
|
|
3443
3477
|
onClick: H
|
|
3444
|
-
}, [f(
|
|
3478
|
+
}, [f(Q, {
|
|
3445
3479
|
name: "lucide:circle-x",
|
|
3446
3480
|
class: "size-4"
|
|
3447
3481
|
})])) : c("", !0),
|
|
@@ -3453,7 +3487,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3453
3487
|
"aria-label": m.value ? "隐藏密码" : "显示密码",
|
|
3454
3488
|
"aria-pressed": m.value,
|
|
3455
3489
|
onClick: n[0] ||= (e) => m.value = !m.value
|
|
3456
|
-
}, [f(
|
|
3490
|
+
}, [f(Q, {
|
|
3457
3491
|
name: m.value ? "lucide:eye-off" : "lucide:eye",
|
|
3458
3492
|
class: "size-4"
|
|
3459
3493
|
}, null, 8, ["name"])], 8, va)) : c("", !0)
|
|
@@ -3515,7 +3549,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3515
3549
|
src: t.src,
|
|
3516
3550
|
alt: t.alt
|
|
3517
3551
|
});
|
|
3518
|
-
|
|
3552
|
+
W(() => {
|
|
3519
3553
|
r.src = t.src, r.alt = t.alt;
|
|
3520
3554
|
}), w(n.register(r));
|
|
3521
3555
|
let i = () => n.open(r), a = (e) => {
|
|
@@ -3530,7 +3564,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3530
3564
|
onClick: i,
|
|
3531
3565
|
onKeydown: a
|
|
3532
3566
|
}, {
|
|
3533
|
-
default:
|
|
3567
|
+
default: G(() => [A(t.$slots, "default", { open: i })]),
|
|
3534
3568
|
_: 3
|
|
3535
3569
|
}, 40, ["aria-label"])) : A(t.$slots, "default", {
|
|
3536
3570
|
key: 1,
|
|
@@ -3556,7 +3590,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3556
3590
|
}
|
|
3557
3591
|
},
|
|
3558
3592
|
setup(e) {
|
|
3559
|
-
let t = e, n =
|
|
3593
|
+
let t = e, n = ut(), r = o(() => {
|
|
3560
3594
|
switch (t.underline) {
|
|
3561
3595
|
case "none": return "";
|
|
3562
3596
|
case "hover": return "hover:underline underline-offset-3";
|
|
@@ -3589,11 +3623,11 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3589
3623
|
return (t, a) => (T(), s(j(I(n).linkComponent), _({
|
|
3590
3624
|
...u.value,
|
|
3591
3625
|
...t.$attrs
|
|
3592
|
-
}, { class: I(
|
|
3593
|
-
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(() => [
|
|
3594
3628
|
A(t.$slots, "prefix"),
|
|
3595
3629
|
A(t.$slots, "default"),
|
|
3596
|
-
e.isShowAnchorIcon ? (T(), s(
|
|
3630
|
+
e.isShowAnchorIcon ? (T(), s(Q, {
|
|
3597
3631
|
key: 0,
|
|
3598
3632
|
name: "lucide:external-link"
|
|
3599
3633
|
})) : c("", !0),
|
|
@@ -3620,7 +3654,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3620
3654
|
image: "data:image/webp;base64,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"
|
|
3621
3655
|
}
|
|
3622
3656
|
], Oa = () => {
|
|
3623
|
-
let e = Da[
|
|
3657
|
+
let e = Da[ye(0, Da.length - 1)] ?? Da[0];
|
|
3624
3658
|
return {
|
|
3625
3659
|
name: e.name,
|
|
3626
3660
|
loli: e.image
|
|
@@ -3628,7 +3662,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3628
3662
|
}, ka = {
|
|
3629
3663
|
key: 0,
|
|
3630
3664
|
class: "bg-background z-kun-message fixed right-0 bottom-0 left-0 min-h-30 w-full border-t"
|
|
3631
|
-
}, 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({
|
|
3632
3666
|
name: "KunLoli",
|
|
3633
3667
|
__name: "Loli",
|
|
3634
3668
|
props: {
|
|
@@ -3652,12 +3686,12 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3652
3686
|
"enter-active-class": "animate-fadeInUp",
|
|
3653
3687
|
"leave-active-class": "animate-fadeOutDown"
|
|
3654
3688
|
}, {
|
|
3655
|
-
default:
|
|
3689
|
+
default: G(() => [a.value ? (T(), l("div", ka, [
|
|
3656
3690
|
f(i, {
|
|
3657
3691
|
"enter-active-class": "animate-swing",
|
|
3658
3692
|
appear: ""
|
|
3659
3693
|
}, {
|
|
3660
|
-
default:
|
|
3694
|
+
default: G(() => [u("div", Aa, [u("span", ja, M(I(r)), 1)])]),
|
|
3661
3695
|
_: 1
|
|
3662
3696
|
}),
|
|
3663
3697
|
u("div", Ma, [f(yn, {
|
|
@@ -3668,7 +3702,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3668
3702
|
"enter-active-class": "animate-bounceInRight",
|
|
3669
3703
|
appear: ""
|
|
3670
3704
|
}, {
|
|
3671
|
-
default:
|
|
3705
|
+
default: G(() => [u("div", Na, M(`「 ${e.message} 」`), 1)]),
|
|
3672
3706
|
_: 1
|
|
3673
3707
|
}),
|
|
3674
3708
|
u("button", {
|
|
@@ -3676,7 +3710,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3676
3710
|
"aria-label": "关闭",
|
|
3677
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]",
|
|
3678
3712
|
onClick: p
|
|
3679
|
-
}, [f(
|
|
3713
|
+
}, [f(Q, {
|
|
3680
3714
|
name: "lucide:x",
|
|
3681
3715
|
class: "h-4 w-4"
|
|
3682
3716
|
})]),
|
|
@@ -3722,7 +3756,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3722
3756
|
role: "status",
|
|
3723
3757
|
"aria-live": "polite",
|
|
3724
3758
|
"aria-busy": !0
|
|
3725
|
-
}, qa = /*#__PURE__*/
|
|
3759
|
+
}, qa = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3726
3760
|
name: "KunLoading",
|
|
3727
3761
|
__name: "Loading",
|
|
3728
3762
|
props: {
|
|
@@ -3746,22 +3780,22 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3746
3780
|
lg: "size-10",
|
|
3747
3781
|
xl: "size-12"
|
|
3748
3782
|
};
|
|
3749
|
-
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, {
|
|
3750
3784
|
"enter-active-class": "transition-opacity duration-kun-slow",
|
|
3751
3785
|
"enter-from-class": "opacity-0",
|
|
3752
3786
|
"leave-active-class": "transition-opacity duration-kun-slow",
|
|
3753
3787
|
"leave-from-class": "opacity-0"
|
|
3754
3788
|
}, {
|
|
3755
|
-
default:
|
|
3789
|
+
default: G(() => [e.loading ? (T(), l("div", {
|
|
3756
3790
|
key: 0,
|
|
3757
3791
|
class: "bg-background/50 absolute inset-0 z-50 flex items-center justify-center rounded-kun-md",
|
|
3758
3792
|
role: "status",
|
|
3759
3793
|
"aria-live": "polite",
|
|
3760
3794
|
"aria-busy": e.loading
|
|
3761
|
-
}, [u("div", Ga, [e.spinner ? (T(), s(
|
|
3795
|
+
}, [u("div", Ga, [e.spinner ? (T(), s(Q, {
|
|
3762
3796
|
key: 0,
|
|
3763
3797
|
name: "svg-spinners:90-ring-with-bg",
|
|
3764
|
-
class: y(I(
|
|
3798
|
+
class: y(I(Y)("text-primary", r[e.size])),
|
|
3765
3799
|
"aria-hidden": "true"
|
|
3766
3800
|
}, null, 8, ["class"])) : (T(), s(oa, {
|
|
3767
3801
|
key: 1,
|
|
@@ -3771,10 +3805,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3771
3805
|
"class-name": "w-80 h-auto rounded-kun-md"
|
|
3772
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)]),
|
|
3773
3807
|
_: 1
|
|
3774
|
-
})])) : (T(), l("div", Ka, [e.spinner ? (T(), s(
|
|
3808
|
+
})])) : (T(), l("div", Ka, [e.spinner ? (T(), s(Q, {
|
|
3775
3809
|
key: 0,
|
|
3776
3810
|
name: "svg-spinners:90-ring-with-bg",
|
|
3777
|
-
class: y(I(
|
|
3811
|
+
class: y(I(Y)("text-primary", r[e.size])),
|
|
3778
3812
|
"aria-hidden": "true"
|
|
3779
3813
|
}, null, 8, ["class"])) : (T(), s(oa, {
|
|
3780
3814
|
key: 1,
|
|
@@ -3805,7 +3839,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3805
3839
|
}), Ya = ["role", "aria-live"], Xa = { class: "flex-1 text-sm font-medium" }, Za = { key: 0 }, Qa = ["innerHTML"], $a = {
|
|
3806
3840
|
key: 0,
|
|
3807
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"
|
|
3808
|
-
}, eo = 80, to = /*#__PURE__*/
|
|
3842
|
+
}, eo = 80, to = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3809
3843
|
name: "KunMessageItem",
|
|
3810
3844
|
__name: "MessageItem",
|
|
3811
3845
|
props: {
|
|
@@ -3877,7 +3911,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3877
3911
|
role: d.value ? "alert" : "status",
|
|
3878
3912
|
"aria-live": d.value ? "assertive" : "polite",
|
|
3879
3913
|
"aria-atomic": "true",
|
|
3880
|
-
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)),
|
|
3881
3915
|
style: b(g.value),
|
|
3882
3916
|
onMouseenter: k,
|
|
3883
3917
|
onMouseleave: A,
|
|
@@ -3886,9 +3920,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3886
3920
|
onPointerup: x,
|
|
3887
3921
|
onPointercancel: x
|
|
3888
3922
|
}, [
|
|
3889
|
-
f(
|
|
3923
|
+
f(Q, {
|
|
3890
3924
|
name: j.value.iconName,
|
|
3891
|
-
class: y(I(
|
|
3925
|
+
class: y(I(Y)("mt-0.5 mr-3 h-6 w-6 flex-shrink-0", j.value.icon))
|
|
3892
3926
|
}, null, 8, ["name", "class"]),
|
|
3893
3927
|
u("div", Xa, [i.value ? (T(), l("div", {
|
|
3894
3928
|
key: 1,
|
|
@@ -3901,7 +3935,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3901
3935
|
"aria-label": "关闭",
|
|
3902
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",
|
|
3903
3937
|
onClick: n[0] ||= (t) => r("remove", e.id)
|
|
3904
|
-
}, [f(
|
|
3938
|
+
}, [f(Q, {
|
|
3905
3939
|
name: "lucide:x",
|
|
3906
3940
|
class: "size-4"
|
|
3907
3941
|
})]),
|
|
@@ -3913,7 +3947,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3913
3947
|
}, null, 2))
|
|
3914
3948
|
], 46, Ya));
|
|
3915
3949
|
}
|
|
3916
|
-
}), [["__scopeId", "data-v-a80e8a61"]]), no = /*#__PURE__*/
|
|
3950
|
+
}), [["__scopeId", "data-v-a80e8a61"]]), no = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
3917
3951
|
name: "KunMessageProvider",
|
|
3918
3952
|
__name: "MessageProvider",
|
|
3919
3953
|
setup(e) {
|
|
@@ -3946,7 +3980,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
3946
3980
|
tag: "div",
|
|
3947
3981
|
class: "w-full"
|
|
3948
3982
|
}, {
|
|
3949
|
-
default:
|
|
3983
|
+
default: G(() => [(T(!0), l(t, null, k(e, (e) => (T(), s(to, _({ key: e.id }, { ref_for: !0 }, e, {
|
|
3950
3984
|
class: "pointer-events-auto",
|
|
3951
3985
|
onRemove: I(i)
|
|
3952
3986
|
}), null, 16, ["onRemove"]))), 128))]),
|
|
@@ -4041,7 +4075,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4041
4075
|
}),
|
|
4042
4076
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
4043
4077
|
setup(e, { expose: t, emit: n }) {
|
|
4044
|
-
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 = {
|
|
4045
4079
|
xs: {
|
|
4046
4080
|
text: "text-xs",
|
|
4047
4081
|
py: "py-1",
|
|
@@ -4117,16 +4151,16 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4117
4151
|
for: I(m),
|
|
4118
4152
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
4119
4153
|
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span", lo, "*")) : c("", !0)], 8, co)) : c("", !0),
|
|
4120
|
-
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")) }, [
|
|
4121
4155
|
e.controls ? (T(), l("button", {
|
|
4122
4156
|
key: 0,
|
|
4123
4157
|
type: "button",
|
|
4124
4158
|
tabindex: "-1",
|
|
4125
4159
|
disabled: !N.value,
|
|
4126
|
-
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)),
|
|
4127
4161
|
"aria-label": "减少",
|
|
4128
4162
|
onClick: n[0] ||= (e) => j(-1)
|
|
4129
|
-
}, [f(
|
|
4163
|
+
}, [f(Q, {
|
|
4130
4164
|
name: "lucide:minus",
|
|
4131
4165
|
class: "size-4"
|
|
4132
4166
|
})], 10, uo)) : c("", !0),
|
|
@@ -4148,7 +4182,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4148
4182
|
disabled: e.disabled,
|
|
4149
4183
|
readonly: e.readonly,
|
|
4150
4184
|
required: e.required,
|
|
4151
|
-
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"),
|
|
4152
4186
|
onInput: k,
|
|
4153
4187
|
onFocus: n[1] ||= (e) => x.value = !0,
|
|
4154
4188
|
onBlur: A,
|
|
@@ -4159,10 +4193,10 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4159
4193
|
type: "button",
|
|
4160
4194
|
tabindex: "-1",
|
|
4161
4195
|
disabled: !P.value,
|
|
4162
|
-
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)),
|
|
4163
4197
|
"aria-label": "增加",
|
|
4164
4198
|
onClick: n[2] ||= (e) => j(1)
|
|
4165
|
-
}, [f(
|
|
4199
|
+
}, [f(Q, {
|
|
4166
4200
|
name: "lucide:plus",
|
|
4167
4201
|
class: "size-4"
|
|
4168
4202
|
})], 10, po)) : c("", !0)
|
|
@@ -4197,7 +4231,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4197
4231
|
},
|
|
4198
4232
|
emits: ["update:currentPage"],
|
|
4199
4233
|
setup(e, { emit: n }) {
|
|
4200
|
-
let r = e, i = n, a = O(""), c =
|
|
4234
|
+
let r = e, i = n, a = O(""), c = at("kun-pagination"), p = o(() => {
|
|
4201
4235
|
let e = [];
|
|
4202
4236
|
if (r.totalPage <= 7) return Array.from({ length: r.totalPage }, (e, t) => t + 1);
|
|
4203
4237
|
e.push(1), r.currentPage > 3 && e.push("...");
|
|
@@ -4231,9 +4265,9 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4231
4265
|
let r = t.getAttribute("role");
|
|
4232
4266
|
return !!r && g.has(r);
|
|
4233
4267
|
};
|
|
4234
|
-
return
|
|
4268
|
+
return Se("ArrowLeft", (e) => {
|
|
4235
4269
|
_(e) || r.currentPage > 1 && m(r.currentPage - 1);
|
|
4236
|
-
}),
|
|
4270
|
+
}), Se("ArrowRight", (e) => {
|
|
4237
4271
|
_(e) || r.currentPage < r.totalPage && m(r.currentPage + 1);
|
|
4238
4272
|
}), (n, r) => (T(), l("nav", vo, [u("div", yo, [u("div", bo, [
|
|
4239
4273
|
f($, {
|
|
@@ -4246,7 +4280,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4246
4280
|
class: y({ "cursor-not-allowed opacity-50": e.isLoading || e.currentPage === 1 }),
|
|
4247
4281
|
onClick: r[0] ||= (t) => m(e.currentPage - 1)
|
|
4248
4282
|
}, {
|
|
4249
|
-
default:
|
|
4283
|
+
default: G(() => [f(Q, { name: "lucide:chevron-left" })]),
|
|
4250
4284
|
_: 1
|
|
4251
4285
|
}, 8, [
|
|
4252
4286
|
"href",
|
|
@@ -4263,7 +4297,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4263
4297
|
"aria-current": e.currentPage === n ? "page" : void 0,
|
|
4264
4298
|
onClick: (e) => m(Number(n))
|
|
4265
4299
|
}, {
|
|
4266
|
-
default:
|
|
4300
|
+
default: G(() => [d(M(n), 1)]),
|
|
4267
4301
|
_: 2
|
|
4268
4302
|
}, 1032, [
|
|
4269
4303
|
"variant",
|
|
@@ -4283,7 +4317,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4283
4317
|
class: y({ "cursor-not-allowed opacity-50": e.isLoading || e.currentPage === e.totalPage }),
|
|
4284
4318
|
onClick: r[1] ||= (t) => m(e.currentPage + 1)
|
|
4285
4319
|
}, {
|
|
4286
|
-
default:
|
|
4320
|
+
default: G(() => [f(Q, { name: "lucide:chevron-right" })]),
|
|
4287
4321
|
_: 1
|
|
4288
4322
|
}, 8, [
|
|
4289
4323
|
"href",
|
|
@@ -4292,15 +4326,15 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4292
4326
|
])
|
|
4293
4327
|
]), u("div", Co, [
|
|
4294
4328
|
r[3] ||= d(" 您可以使用 ", -1),
|
|
4295
|
-
f(
|
|
4296
|
-
f(
|
|
4329
|
+
f(Q, { name: "lucide:arrow-left" }),
|
|
4330
|
+
f(Q, { name: "lucide:arrow-right" }),
|
|
4297
4331
|
r[4] ||= d(" 来进行快速翻页 ", -1)
|
|
4298
4332
|
])]), u("div", wo, [
|
|
4299
4333
|
u("label", {
|
|
4300
4334
|
for: I(c),
|
|
4301
4335
|
class: "text-sm"
|
|
4302
4336
|
}, "跳转到页数", 8, To),
|
|
4303
|
-
|
|
4337
|
+
K(u("input", {
|
|
4304
4338
|
id: I(c),
|
|
4305
4339
|
"onUpdate:modelValue": r[2] ||= (e) => a.value = e,
|
|
4306
4340
|
type: "number",
|
|
@@ -4308,15 +4342,15 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4308
4342
|
disabled: e.isLoading,
|
|
4309
4343
|
min: "1",
|
|
4310
4344
|
max: e.totalPage,
|
|
4311
|
-
class: y(I(
|
|
4312
|
-
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"])
|
|
4313
4347
|
}, null, 42, Eo), [[V, a.value]]),
|
|
4314
4348
|
f($, {
|
|
4315
4349
|
size: "sm",
|
|
4316
4350
|
disabled: e.isLoading,
|
|
4317
4351
|
onClick: h
|
|
4318
4352
|
}, {
|
|
4319
|
-
default:
|
|
4353
|
+
default: G(() => [...r[5] ||= [d(" 跳转 ", -1)]]),
|
|
4320
4354
|
_: 1
|
|
4321
4355
|
}, 8, ["disabled"])
|
|
4322
4356
|
])]));
|
|
@@ -4366,7 +4400,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4366
4400
|
}),
|
|
4367
4401
|
emits: /*@__PURE__*/ g(["complete"], ["update:modelValue"]),
|
|
4368
4402
|
setup(e, { emit: n }) {
|
|
4369
|
-
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) => {
|
|
4370
4404
|
let t = Array.from({ length: r.length }, (t, n) => e[n] ?? "");
|
|
4371
4405
|
t.join("\0") !== d.value.join("\0") && (d.value = t);
|
|
4372
4406
|
};
|
|
@@ -4421,7 +4455,7 @@ var rt = /* @__PURE__ */ "KunAccordion.KunAccordionItem.KunAlertProvider.KunAuto
|
|
|
4421
4455
|
placeholder: e.placeholder,
|
|
4422
4456
|
"aria-label": `${e.ariaLabel} 第 ${n + 1} 位`,
|
|
4423
4457
|
"aria-invalid": e.isInvalid || void 0,
|
|
4424
|
-
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")),
|
|
4425
4459
|
onInput: (e) => x(n, e),
|
|
4426
4460
|
onKeydown: (e) => C(n, e),
|
|
4427
4461
|
onPaste: (e) => w(n, e),
|
|
@@ -4518,7 +4552,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4518
4552
|
innerClass: { default: "" },
|
|
4519
4553
|
autoPosition: {
|
|
4520
4554
|
type: Boolean,
|
|
4521
|
-
default: !
|
|
4555
|
+
default: !0
|
|
4522
4556
|
},
|
|
4523
4557
|
rounded: { default: void 0 },
|
|
4524
4558
|
ariaLabel: {},
|
|
@@ -4536,11 +4570,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4536
4570
|
group: { default: void 0 }
|
|
4537
4571
|
},
|
|
4538
4572
|
setup(e, { expose: t }) {
|
|
4539
|
-
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, {
|
|
4540
4574
|
placement: () => r.position,
|
|
4541
4575
|
open: p,
|
|
4542
4576
|
offset: 8,
|
|
4543
4577
|
constrain: r.autoPosition,
|
|
4578
|
+
maxSize: r.autoPosition && !r.showArrow,
|
|
4544
4579
|
arrow: r.showArrow
|
|
4545
4580
|
}), w = null, E = () => {
|
|
4546
4581
|
let e = h.value;
|
|
@@ -4560,9 +4595,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4560
4595
|
if (e) return;
|
|
4561
4596
|
let t = h.value;
|
|
4562
4597
|
!t || !t.contains(document.activeElement) || m.value?.querySelector("button,a[href],input:not([disabled]),select,textarea,[tabindex]:not([tabindex=\"-1\"])")?.focus({ preventScroll: !0 });
|
|
4563
|
-
}),
|
|
4598
|
+
}), xe(m, (e) => {
|
|
4564
4599
|
h.value?.contains(e.target) || k(!1);
|
|
4565
|
-
}),
|
|
4600
|
+
}), we("keydown", (e) => {
|
|
4566
4601
|
e.key === "Escape" && p.value && k();
|
|
4567
4602
|
}), t({
|
|
4568
4603
|
open: D,
|
|
@@ -4584,7 +4619,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4584
4619
|
"leave-from-class": "transform scale-100 opacity-100",
|
|
4585
4620
|
"leave-to-class": "transform scale-95 opacity-0"
|
|
4586
4621
|
}, {
|
|
4587
|
-
default:
|
|
4622
|
+
default: G(() => [p.value ? (T(), l("div", _({
|
|
4588
4623
|
key: 0,
|
|
4589
4624
|
ref_key: "popoverRef",
|
|
4590
4625
|
ref: h,
|
|
@@ -4592,9 +4627,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4592
4627
|
role: "dialog",
|
|
4593
4628
|
tabindex: "-1",
|
|
4594
4629
|
"aria-label": e.ariaLabel || "popover",
|
|
4595
|
-
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),
|
|
4596
4631
|
style: [I(y), { transformOrigin: I(x) }],
|
|
4597
|
-
onKeydown: r[0] ||=
|
|
4632
|
+
onKeydown: r[0] ||= q((e) => k(), ["escape"])
|
|
4598
4633
|
}, N(I(P), !0)), [A(t.$slots, "default"), e.showArrow ? (T(), l("div", {
|
|
4599
4634
|
key: 0,
|
|
4600
4635
|
ref_key: "arrowRef",
|
|
@@ -4616,7 +4651,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4616
4651
|
"aria-label",
|
|
4617
4652
|
"aria-valuenow",
|
|
4618
4653
|
"aria-valuemax"
|
|
4619
|
-
], Zo = 45, Qo = /*#__PURE__*/
|
|
4654
|
+
], Zo = 45, Qo = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
4620
4655
|
name: "KunProgress",
|
|
4621
4656
|
__name: "Progress",
|
|
4622
4657
|
props: {
|
|
@@ -4649,7 +4684,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4649
4684
|
case "xl": return "h-5";
|
|
4650
4685
|
default: return "h-3";
|
|
4651
4686
|
}
|
|
4652
|
-
}), i =
|
|
4687
|
+
}), i = Tt(() => t.rounded), a = o(() => Z[i.value]), s = {
|
|
4653
4688
|
default: "text-default",
|
|
4654
4689
|
primary: "text-primary",
|
|
4655
4690
|
secondary: "text-secondary",
|
|
@@ -4665,8 +4700,8 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4665
4700
|
warning: "bg-gradient-to-r from-warning-400 to-warning-600",
|
|
4666
4701
|
danger: "bg-gradient-to-r from-danger-400 to-danger-600",
|
|
4667
4702
|
info: "bg-gradient-to-r from-info-400 to-info-600"
|
|
4668
|
-
}, f = o(() =>
|
|
4669
|
-
let e =
|
|
4703
|
+
}, f = o(() => ge[t.color]), p = o(() => {
|
|
4704
|
+
let e = me[t.color];
|
|
4670
4705
|
switch (t.variant) {
|
|
4671
4706
|
case "gradient": return d[t.color];
|
|
4672
4707
|
case "striped": return `${e} bg-[length:1rem_1rem] bg-gradient-to-r from-white/20 to-transparent animate-[progress-stripes_1s_linear_infinite]`;
|
|
@@ -4718,14 +4753,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4718
4753
|
"aria-valuemax": e.max
|
|
4719
4754
|
}, [e.indeterminate ? (T(), l("div", {
|
|
4720
4755
|
key: 0,
|
|
4721
|
-
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))
|
|
4722
4757
|
}, null, 2)) : (T(), l("div", {
|
|
4723
4758
|
key: 1,
|
|
4724
|
-
class: y(I(
|
|
4759
|
+
class: y(I(Y)("flex h-full items-center transition-all duration-kun-slow ease-kun-out", p.value)),
|
|
4725
4760
|
style: b(`width:${n.value}%`)
|
|
4726
4761
|
}, [e.showLabel ? (T(), l("span", {
|
|
4727
4762
|
key: 0,
|
|
4728
|
-
class: y(I(
|
|
4763
|
+
class: y(I(Y)("px-2 text-xs font-medium", f.value))
|
|
4729
4764
|
}, M(n.value) + "% ", 3)) : c("", !0)], 6))], 10, Xo))]));
|
|
4730
4765
|
}
|
|
4731
4766
|
}), [["__scopeId", "data-v-698d88e3"]]), $o = ["id"], es = [
|
|
@@ -4777,11 +4812,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4777
4812
|
}),
|
|
4778
4813
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
4779
4814
|
setup(e, { emit: n }) {
|
|
4780
|
-
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(() => {
|
|
4781
4816
|
let e = r.options.findIndex((e) => e.value === i.value);
|
|
4782
4817
|
return e >= 0 && !h(r.options[e]) ? e : r.options.findIndex((e) => !h(e));
|
|
4783
4818
|
}), _ = o(() => {
|
|
4784
|
-
let e =
|
|
4819
|
+
let e = fe[r.size];
|
|
4785
4820
|
return {
|
|
4786
4821
|
indicator: e.box,
|
|
4787
4822
|
dot: e.dot,
|
|
@@ -4821,7 +4856,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4821
4856
|
}
|
|
4822
4857
|
}
|
|
4823
4858
|
};
|
|
4824
|
-
return (n, r) => (T(), l("div", { class: y(I(
|
|
4859
|
+
return (n, r) => (T(), l("div", { class: y(I(Y)("w-full", e.className)) }, [
|
|
4825
4860
|
e.label ? (T(), l("div", {
|
|
4826
4861
|
key: 0,
|
|
4827
4862
|
id: p.value,
|
|
@@ -4832,7 +4867,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4832
4867
|
"aria-label": e.label ? void 0 : e.ariaLabel || "radio group",
|
|
4833
4868
|
"aria-labelledby": e.label ? p.value : void 0,
|
|
4834
4869
|
"aria-disabled": e.disabled || void 0,
|
|
4835
|
-
class: y(I(
|
|
4870
|
+
class: y(I(Y)("flex", e.orientation === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-3"))
|
|
4836
4871
|
}, [e.variant === "classic" ? (T(!0), l(t, { key: 0 }, k(e.options, (t, n) => (T(), l("label", {
|
|
4837
4872
|
key: String(t.value),
|
|
4838
4873
|
ref_for: !0,
|
|
@@ -4841,12 +4876,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4841
4876
|
"aria-checked": i.value === t.value,
|
|
4842
4877
|
"aria-disabled": h(t) || void 0,
|
|
4843
4878
|
tabindex: g.value === n && !h(t) ? 0 : -1,
|
|
4844
|
-
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")),
|
|
4845
4880
|
onClick: (e) => b(t, n),
|
|
4846
4881
|
onKeydown: (e) => S(e, n)
|
|
4847
|
-
}, [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", {
|
|
4848
4883
|
key: 0,
|
|
4849
|
-
class: y(I(
|
|
4884
|
+
class: y(I(Y)("block rounded-full", _.value.dot, I(oe)[e.color]))
|
|
4850
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", {
|
|
4851
4886
|
key: String(t.value),
|
|
4852
4887
|
ref_for: !0,
|
|
@@ -4855,12 +4890,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4855
4890
|
"aria-checked": i.value === t.value,
|
|
4856
4891
|
"aria-disabled": h(t) || void 0,
|
|
4857
4892
|
tabindex: g.value === n && !h(t) ? 0 : -1,
|
|
4858
|
-
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")),
|
|
4859
4894
|
onClick: (e) => b(t, n),
|
|
4860
4895
|
onKeydown: (e) => S(e, n)
|
|
4861
|
-
}, [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", {
|
|
4862
4897
|
key: 0,
|
|
4863
|
-
class: y(I(
|
|
4898
|
+
class: y(I(Y)("block rounded-full", _.value.dot, I(oe)[e.color]))
|
|
4864
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),
|
|
4865
4900
|
e.error ? (T(), l("p", ls, M(e.error), 1)) : c("", !0)
|
|
4866
4901
|
], 2));
|
|
@@ -4915,16 +4950,16 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4915
4950
|
type: "button",
|
|
4916
4951
|
role: "radio",
|
|
4917
4952
|
"aria-checked": d.value >= t,
|
|
4918
|
-
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")),
|
|
4919
4954
|
disabled: e.disabled,
|
|
4920
4955
|
title: `${t}/${e.max}`,
|
|
4921
4956
|
"aria-label": `${t} / ${e.max}`,
|
|
4922
4957
|
onMouseenter: (e) => m(t),
|
|
4923
4958
|
onMouseleave: h,
|
|
4924
4959
|
onClick: (e) => p(t)
|
|
4925
|
-
}, [f(
|
|
4960
|
+
}, [f(Q, {
|
|
4926
4961
|
name: "lucide:lollipop",
|
|
4927
|
-
class: y(I(
|
|
4962
|
+
class: y(I(Y)("transition-colors", c.value))
|
|
4928
4963
|
}, null, 8, ["class"])], 42, fs))), 128))], 8, ds));
|
|
4929
4964
|
}
|
|
4930
4965
|
}), ms = [
|
|
@@ -4938,7 +4973,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
4938
4973
|
key: 1,
|
|
4939
4974
|
"aria-hidden": "true",
|
|
4940
4975
|
class: "kun-reaction-count relative inline-block overflow-hidden text-center leading-[1.2] tabular-nums"
|
|
4941
|
-
}, _s = /*#__PURE__*/
|
|
4976
|
+
}, _s = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
4942
4977
|
name: "KunReaction",
|
|
4943
4978
|
__name: "Reaction",
|
|
4944
4979
|
props: /*@__PURE__*/ g({
|
|
@@ -5007,7 +5042,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5007
5042
|
btn: "gap-2 px-2.5 py-1.5 text-base",
|
|
5008
5043
|
icon: "1.4rem"
|
|
5009
5044
|
}
|
|
5010
|
-
}, 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"));
|
|
5011
5046
|
return (n, r) => (T(), l("button", {
|
|
5012
5047
|
type: "button",
|
|
5013
5048
|
class: y(F.value),
|
|
@@ -5021,9 +5056,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5021
5056
|
class: y(["kun-reaction-fx relative inline-flex shrink-0", h.value && "kun-reaction-pop"]),
|
|
5022
5057
|
style: b({ fontSize: D.value.icon }),
|
|
5023
5058
|
onAnimationend: r[1] ||= (e) => h.value = !1
|
|
5024
|
-
}, [A(n.$slots, "icon", { active: w.value }, () => [f(
|
|
5059
|
+
}, [A(n.$slots, "icon", { active: w.value }, () => [f(Q, {
|
|
5025
5060
|
name: e.icon,
|
|
5026
|
-
class: y(I(
|
|
5061
|
+
class: y(I(Y)("transition-colors", w.value && "fill-current"))
|
|
5027
5062
|
}, null, 8, ["name", "class"])], !0), g.value ? (T(), l(t, { key: 0 }, [u("span", {
|
|
5028
5063
|
"aria-hidden": "true",
|
|
5029
5064
|
class: "kun-reaction-ring border-2 border-current",
|
|
@@ -5036,7 +5071,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5036
5071
|
}, null, 4)), 64))], 64)) : c("", !0)], 38),
|
|
5037
5072
|
n.$slots.default ? (T(), l("span", hs, [A(n.$slots, "default", {}, void 0, !0)])) : c("", !0),
|
|
5038
5073
|
typeof s.value == "number" ? (T(), l("span", gs, [f(i, { name: m.value ? `kun-roll-${v.value}` : "" }, {
|
|
5039
|
-
default:
|
|
5074
|
+
default: G(() => [(T(), l("span", {
|
|
5040
5075
|
key: s.value,
|
|
5041
5076
|
class: "block"
|
|
5042
5077
|
}, M(s.value), 1))]),
|
|
@@ -5123,11 +5158,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5123
5158
|
}),
|
|
5124
5159
|
emits: /*@__PURE__*/ g(["set"], ["update:modelValue"]),
|
|
5125
5160
|
setup(e, { emit: r }) {
|
|
5126
|
-
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, {
|
|
5127
5162
|
placement: "bottom-start",
|
|
5128
5163
|
open: x,
|
|
5129
5164
|
offset: 4,
|
|
5130
|
-
middleware: [
|
|
5165
|
+
middleware: [Ne({ apply({ rects: e, elements: t, availableHeight: n }) {
|
|
5131
5166
|
Object.assign(t.floating.style, {
|
|
5132
5167
|
width: `${e.reference.width}px`,
|
|
5133
5168
|
maxHeight: `${Math.min(280, n - 8)}px`
|
|
@@ -5140,43 +5175,43 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5140
5175
|
if (!a.searchable || !S.value.trim()) return a.options;
|
|
5141
5176
|
let e = S.value.trim().toLowerCase();
|
|
5142
5177
|
return a.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
5143
|
-
}),
|
|
5178
|
+
}), W = o(() => C.value >= 0 && H.value[C.value] ? `${g.value}-opt-${C.value}` : void 0), q = (e = 0, t = 1) => {
|
|
5144
5179
|
let n = H.value;
|
|
5145
5180
|
for (let r = e; r >= 0 && r < n.length; r += t) if (!n[r].disabled) return r;
|
|
5146
5181
|
return -1;
|
|
5147
|
-
},
|
|
5182
|
+
}, ee = () => {
|
|
5148
5183
|
if (a.disabled || x.value) return;
|
|
5149
5184
|
x.value = !0, S.value = "";
|
|
5150
5185
|
let e = H.value.findIndex((e) => F.value.has(e.value));
|
|
5151
|
-
C.value = e >= 0 ? e :
|
|
5152
|
-
a.searchable && A.value?.focus({ preventScroll: !0 }),
|
|
5186
|
+
C.value = e >= 0 ? e : q(), v(() => {
|
|
5187
|
+
a.searchable && A.value?.focus({ preventScroll: !0 }), se();
|
|
5153
5188
|
});
|
|
5154
|
-
},
|
|
5189
|
+
}, te = (e = !0) => {
|
|
5155
5190
|
x.value && (x.value = !1, S.value = "", e && v(() => w.value?.focus({ preventScroll: !0 })));
|
|
5156
|
-
},
|
|
5157
|
-
|
|
5158
|
-
E.value?.contains(e.target) ||
|
|
5191
|
+
}, ne = () => x.value ? te() : ee();
|
|
5192
|
+
xe(w, (e) => {
|
|
5193
|
+
E.value?.contains(e.target) || te(!1);
|
|
5159
5194
|
});
|
|
5160
|
-
let
|
|
5195
|
+
let re = (e) => {
|
|
5161
5196
|
if (e.disabled) return;
|
|
5162
5197
|
let t = a.options.findIndex((t) => t.value === e.value);
|
|
5163
5198
|
if (a.multiple) {
|
|
5164
5199
|
let t = Array.isArray(m.value) ? [...m.value] : [], n = t.indexOf(e.value);
|
|
5165
5200
|
n >= 0 ? t.splice(n, 1) : t.push(e.value), m.value = t, a.searchable && v(() => A.value?.focus({ preventScroll: !0 }));
|
|
5166
|
-
} else m.value = e.value,
|
|
5201
|
+
} else m.value = e.value, te();
|
|
5167
5202
|
h("set", e.value, t);
|
|
5168
|
-
},
|
|
5203
|
+
}, ie = () => {
|
|
5169
5204
|
let e = H.value[C.value];
|
|
5170
|
-
e &&
|
|
5171
|
-
},
|
|
5205
|
+
e && re(e);
|
|
5206
|
+
}, ae = (e) => {
|
|
5172
5207
|
a.disabled || (m.value = (Array.isArray(m.value) ? [...m.value] : []).filter((t) => t !== e));
|
|
5173
|
-
},
|
|
5208
|
+
}, oe = () => {
|
|
5174
5209
|
a.disabled || (m.value = a.multiple ? [] : null);
|
|
5175
|
-
},
|
|
5210
|
+
}, se = () => {
|
|
5176
5211
|
v(() => {
|
|
5177
5212
|
on(D.value, D.value?.querySelector(`[data-index="${C.value}"]`));
|
|
5178
5213
|
});
|
|
5179
|
-
},
|
|
5214
|
+
}, ce = (e) => {
|
|
5180
5215
|
let t = H.value.length;
|
|
5181
5216
|
if (!t) return;
|
|
5182
5217
|
let n = C.value;
|
|
@@ -5184,14 +5219,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5184
5219
|
C.value = n;
|
|
5185
5220
|
break;
|
|
5186
5221
|
}
|
|
5187
|
-
|
|
5188
|
-
},
|
|
5189
|
-
C.value = e === 1 ?
|
|
5190
|
-
},
|
|
5191
|
-
|
|
5192
|
-
let t = a.options.findIndex((e) => !e.disabled && e.label.toLowerCase().startsWith(
|
|
5193
|
-
t >= 0 && (C.value = t,
|
|
5194
|
-
},
|
|
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) => {
|
|
5195
5230
|
if (a.disabled) return;
|
|
5196
5231
|
let t = e.key;
|
|
5197
5232
|
if (!x.value) {
|
|
@@ -5200,40 +5235,40 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5200
5235
|
"ArrowUp",
|
|
5201
5236
|
"Enter",
|
|
5202
5237
|
" "
|
|
5203
|
-
].includes(t) && (e.preventDefault(),
|
|
5238
|
+
].includes(t) && (e.preventDefault(), ee());
|
|
5204
5239
|
return;
|
|
5205
5240
|
}
|
|
5206
5241
|
switch (t) {
|
|
5207
5242
|
case "ArrowDown":
|
|
5208
|
-
e.preventDefault(),
|
|
5243
|
+
e.preventDefault(), ce(1);
|
|
5209
5244
|
break;
|
|
5210
5245
|
case "ArrowUp":
|
|
5211
|
-
e.preventDefault(),
|
|
5246
|
+
e.preventDefault(), ce(-1);
|
|
5212
5247
|
break;
|
|
5213
5248
|
case "Home":
|
|
5214
|
-
e.preventDefault(),
|
|
5249
|
+
e.preventDefault(), ue(1);
|
|
5215
5250
|
break;
|
|
5216
5251
|
case "End":
|
|
5217
|
-
e.preventDefault(),
|
|
5252
|
+
e.preventDefault(), ue(-1);
|
|
5218
5253
|
break;
|
|
5219
5254
|
case "Enter":
|
|
5220
|
-
e.preventDefault(),
|
|
5255
|
+
e.preventDefault(), ie();
|
|
5221
5256
|
break;
|
|
5222
5257
|
case " ":
|
|
5223
|
-
a.searchable || (e.preventDefault(),
|
|
5258
|
+
a.searchable || (e.preventDefault(), ie());
|
|
5224
5259
|
break;
|
|
5225
5260
|
case "Escape":
|
|
5226
|
-
e.preventDefault(),
|
|
5261
|
+
e.preventDefault(), te();
|
|
5227
5262
|
break;
|
|
5228
5263
|
case "Tab":
|
|
5229
|
-
|
|
5264
|
+
te(!1);
|
|
5230
5265
|
break;
|
|
5231
|
-
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);
|
|
5232
5267
|
}
|
|
5233
5268
|
};
|
|
5234
5269
|
return U(H, () => {
|
|
5235
|
-
x.value && (C.value < 0 || C.value >= H.value.length || H.value[C.value]?.disabled) && (C.value =
|
|
5236
|
-
}), (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)) }, [
|
|
5237
5272
|
e.label ? (T(), l("label", {
|
|
5238
5273
|
key: 0,
|
|
5239
5274
|
id: `${I(g)}-label`,
|
|
@@ -5251,11 +5286,11 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5251
5286
|
"aria-expanded": x.value,
|
|
5252
5287
|
"aria-haspopup": "listbox",
|
|
5253
5288
|
"aria-controls": _.value,
|
|
5254
|
-
"aria-activedescendant": x.value ?
|
|
5289
|
+
"aria-activedescendant": x.value ? W.value : void 0,
|
|
5255
5290
|
"aria-disabled": e.disabled || void 0,
|
|
5256
|
-
class: y(I(
|
|
5257
|
-
onClick:
|
|
5258
|
-
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
|
|
5259
5294
|
}, [
|
|
5260
5295
|
e.multiple && B.value ? (T(), l("span", bs, [(T(!0), l(t, null, k(L.value, (t) => (T(), l("span", {
|
|
5261
5296
|
key: String(t.value),
|
|
@@ -5265,9 +5300,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5265
5300
|
type: "button",
|
|
5266
5301
|
class: "hover:text-danger shrink-0",
|
|
5267
5302
|
"aria-label": `移除 ${t.label}`,
|
|
5268
|
-
onClick:
|
|
5269
|
-
onMousedown: o[0] ||=
|
|
5270
|
-
}, [f(
|
|
5303
|
+
onClick: J((e) => ae(t.value), ["stop"]),
|
|
5304
|
+
onMousedown: o[0] ||= J(() => {}, ["stop", "prevent"])
|
|
5305
|
+
}, [f(Q, {
|
|
5271
5306
|
name: "lucide:x",
|
|
5272
5307
|
class: "size-3"
|
|
5273
5308
|
})], 40, Ss))]))), 128))])) : (T(), l("span", {
|
|
@@ -5279,13 +5314,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5279
5314
|
type: "button",
|
|
5280
5315
|
class: "text-default-400 hover:text-default-600 shrink-0",
|
|
5281
5316
|
"aria-label": "清除",
|
|
5282
|
-
onClick:
|
|
5283
|
-
onMousedown: o[1] ||=
|
|
5284
|
-
}, [f(
|
|
5317
|
+
onClick: J(oe, ["stop"]),
|
|
5318
|
+
onMousedown: o[1] ||= J(() => {}, ["stop", "prevent"])
|
|
5319
|
+
}, [f(Q, {
|
|
5285
5320
|
name: "lucide:circle-x",
|
|
5286
5321
|
class: "size-4"
|
|
5287
5322
|
})], 32)) : c("", !0),
|
|
5288
|
-
f(
|
|
5323
|
+
f(Q, {
|
|
5289
5324
|
name: "lucide:chevron-down",
|
|
5290
5325
|
class: y(["pointer-events-none shrink-0 transition-transform", x.value ? "rotate-180" : ""])
|
|
5291
5326
|
}, null, 8, ["class"])
|
|
@@ -5309,13 +5344,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5309
5344
|
"leave-from-class": "opacity-100 scale-100",
|
|
5310
5345
|
"leave-to-class": "opacity-0 scale-95"
|
|
5311
5346
|
}, {
|
|
5312
|
-
default:
|
|
5347
|
+
default: G(() => [x.value ? (T(), l("div", {
|
|
5313
5348
|
key: 0,
|
|
5314
5349
|
ref_key: "dropdownRef",
|
|
5315
5350
|
ref: E,
|
|
5316
5351
|
style: b([I(j), { transformOrigin: I(N) }]),
|
|
5317
|
-
class: y(I(
|
|
5318
|
-
}, [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", {
|
|
5319
5354
|
ref_key: "searchRef",
|
|
5320
5355
|
ref: A,
|
|
5321
5356
|
"onUpdate:modelValue": o[2] ||= (e) => S.value = e,
|
|
@@ -5325,9 +5360,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5325
5360
|
role: "combobox",
|
|
5326
5361
|
"aria-controls": _.value,
|
|
5327
5362
|
"aria-expanded": x.value,
|
|
5328
|
-
"aria-activedescendant":
|
|
5329
|
-
class: y(I(
|
|
5330
|
-
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
|
|
5331
5366
|
}, null, 42, Es), [[V, S.value]])])) : c("", !0), u("ul", {
|
|
5332
5367
|
ref_key: "listRef",
|
|
5333
5368
|
ref: D,
|
|
@@ -5344,9 +5379,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5344
5379
|
role: "option",
|
|
5345
5380
|
"aria-selected": F.value.has(e.value),
|
|
5346
5381
|
"aria-disabled": e.disabled || void 0,
|
|
5347
|
-
onClick: (t) =>
|
|
5382
|
+
onClick: (t) => re(e),
|
|
5348
5383
|
onMousemove: (n) => !e.disabled && (C.value = t)
|
|
5349
|
-
}, [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, {
|
|
5350
5385
|
key: 0,
|
|
5351
5386
|
name: "lucide:check",
|
|
5352
5387
|
class: "text-primary ml-2 shrink-0"
|
|
@@ -5368,8 +5403,8 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5368
5403
|
ariaLabel: { default: "scrollable content" }
|
|
5369
5404
|
},
|
|
5370
5405
|
setup(e) {
|
|
5371
|
-
let t = e, n = O(null), r = O(null), { x: i, y: a } =
|
|
5372
|
-
|
|
5406
|
+
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);
|
|
5407
|
+
W(() => {
|
|
5373
5408
|
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));
|
|
5374
5409
|
});
|
|
5375
5410
|
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(() => {
|
|
@@ -5388,7 +5423,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5388
5423
|
return (i, a) => (T(), l("div", Ps, [
|
|
5389
5424
|
u("div", {
|
|
5390
5425
|
"aria-hidden": "true",
|
|
5391
|
-
class: y(I(
|
|
5426
|
+
class: y(I(Y)("pointer-events-none absolute z-10 transition-opacity", h.value, p.value ? "opacity-100" : "opacity-0")),
|
|
5392
5427
|
style: b(_.value.start)
|
|
5393
5428
|
}, null, 6),
|
|
5394
5429
|
u("div", {
|
|
@@ -5397,15 +5432,15 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5397
5432
|
tabindex: "0",
|
|
5398
5433
|
role: "region",
|
|
5399
5434
|
"aria-label": e.ariaLabel,
|
|
5400
|
-
class: y(I(
|
|
5435
|
+
class: y(I(Y)("scrollbar-hide", e.axis === "horizontal" ? "overflow-x-auto" : "overflow-y-auto", t.className))
|
|
5401
5436
|
}, [u("div", {
|
|
5402
5437
|
ref_key: "contentWrapper",
|
|
5403
5438
|
ref: r,
|
|
5404
|
-
class: y(I(
|
|
5439
|
+
class: y(I(Y)(e.axis === "horizontal" ? "flex w-max gap-3" : "flex w-full flex-col gap-3", t.contentClass))
|
|
5405
5440
|
}, [A(i.$slots, "default")], 2)], 10, Fs),
|
|
5406
5441
|
u("div", {
|
|
5407
5442
|
"aria-hidden": "true",
|
|
5408
|
-
class: y(I(
|
|
5443
|
+
class: y(I(Y)("pointer-events-none absolute z-10 transition-opacity", g.value, m.value ? "opacity-100" : "opacity-0")),
|
|
5409
5444
|
style: b(_.value.end)
|
|
5410
5445
|
}, null, 6)
|
|
5411
5446
|
]));
|
|
@@ -5426,7 +5461,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5426
5461
|
className: { default: "" }
|
|
5427
5462
|
},
|
|
5428
5463
|
setup(e) {
|
|
5429
|
-
let t = e, n =
|
|
5464
|
+
let t = e, n = Tt(() => t.rounded), r = o(() => t.variant === "circle" ? "rounded-full" : t.variant === "text" ? "rounded-md" : Z[n.value]), i = o(() => {
|
|
5430
5465
|
let e = t.height || (t.variant === "text" ? "1em" : t.variant === "circle" ? "2.5rem" : "1.25rem");
|
|
5431
5466
|
return {
|
|
5432
5467
|
width: t.width || (t.variant === "circle" ? e : "100%"),
|
|
@@ -5436,7 +5471,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5436
5471
|
return (t, n) => e.loaded ? A(t.$slots, "default", { key: 0 }) : (T(), l("span", {
|
|
5437
5472
|
key: 1,
|
|
5438
5473
|
"aria-hidden": "true",
|
|
5439
|
-
class: y(I(
|
|
5474
|
+
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)),
|
|
5440
5475
|
style: b(i.value)
|
|
5441
5476
|
}, null, 6));
|
|
5442
5477
|
}
|
|
@@ -5500,7 +5535,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5500
5535
|
}),
|
|
5501
5536
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
5502
5537
|
setup(e, { emit: n }) {
|
|
5503
|
-
let r = z(e, "modelValue"), a = e, s = n, d =
|
|
5538
|
+
let r = z(e, "modelValue"), a = e, s = n, d = at("kun-slider"), p = {
|
|
5504
5539
|
xs: {
|
|
5505
5540
|
track: "h-1",
|
|
5506
5541
|
thumb: "size-3.5"
|
|
@@ -5616,7 +5651,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5616
5651
|
}, V = o(() => a.showTooltip && x.value && !a.disabled);
|
|
5617
5652
|
return w(() => {
|
|
5618
5653
|
R();
|
|
5619
|
-
}), (n, a) => (T(), l("div", { class: y(I(
|
|
5654
|
+
}), (n, a) => (T(), l("div", { class: y(I(Y)("w-full", e.disabled && "opacity-50")) }, [
|
|
5620
5655
|
e.label || e.showValue ? (T(), l("div", Rs, [e.label ? (T(), l("label", {
|
|
5621
5656
|
key: 0,
|
|
5622
5657
|
id: `${I(d)}-label`,
|
|
@@ -5627,7 +5662,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5627
5662
|
ref_key: "sliderRef",
|
|
5628
5663
|
ref: _,
|
|
5629
5664
|
onMousedownPassive: L,
|
|
5630
|
-
onTouchstartPassive:
|
|
5665
|
+
onTouchstartPassive: J(L, ["stop"])
|
|
5631
5666
|
}, [u("div", { class: y(["bg-default relative w-full rounded-full", m.value.track]) }, [
|
|
5632
5667
|
u("div", {
|
|
5633
5668
|
class: y(["absolute h-full rounded-full", g.value.fill]),
|
|
@@ -5649,7 +5684,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5649
5684
|
"leave-active-class": "transition duration-kun-exit ease-kun-in",
|
|
5650
5685
|
"leave-to-class": "opacity-0 translate-y-1"
|
|
5651
5686
|
}, {
|
|
5652
|
-
default:
|
|
5687
|
+
default: G(() => [V.value ? (T(), l("span", Vs, M(j.value), 1)) : c("", !0)]),
|
|
5653
5688
|
_: 1
|
|
5654
5689
|
}), u("div", {
|
|
5655
5690
|
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", [
|
|
@@ -5669,12 +5704,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5669
5704
|
"aria-disabled": e.disabled || void 0,
|
|
5670
5705
|
"aria-orientation": "horizontal",
|
|
5671
5706
|
onMousedownPassive: L,
|
|
5672
|
-
onTouchstartPassive:
|
|
5707
|
+
onTouchstartPassive: J(L, ["stop"]),
|
|
5673
5708
|
onKeydown: B,
|
|
5674
5709
|
onFocus: a[0] ||= (e) => x.value = !0,
|
|
5675
5710
|
onBlur: a[1] ||= (e) => !v.value && (x.value = !1)
|
|
5676
5711
|
}, null, 42, Hs)], 36)
|
|
5677
|
-
], 2), N.value.some((e) => e.label) ? (T(), l("div", Us, [(T(!0), l(t, null, k(N.value, (e, t) =>
|
|
5712
|
+
], 2), N.value.some((e) => e.label) ? (T(), l("div", Us, [(T(!0), l(t, null, k(N.value, (e, t) => K((T(), l("span", {
|
|
5678
5713
|
key: t,
|
|
5679
5714
|
class: "text-default-500 absolute -translate-x-1/2 text-xs whitespace-nowrap",
|
|
5680
5715
|
style: b({ left: e.percent + "%" })
|
|
@@ -5727,25 +5762,25 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5727
5762
|
}, p = (e) => e < n.current ? "done" : e === n.current ? "active" : "pending", m = (e) => {
|
|
5728
5763
|
let t = p(e);
|
|
5729
5764
|
if (t === "pending") return "border-2 border-default-200 text-default-400 bg-transparent";
|
|
5730
|
-
let r =
|
|
5731
|
-
return t === "active" ?
|
|
5732
|
-
}, h = (e) => e < n.current ?
|
|
5733
|
-
return (n, i) => (T(), l("ol", { class: y(I(
|
|
5765
|
+
let r = Y(me[n.color], ge[n.color]);
|
|
5766
|
+
return t === "active" ? Y(r, "ring-4", f[n.color]) : r;
|
|
5767
|
+
}, h = (e) => e < n.current ? me[n.color] : "bg-default-200";
|
|
5768
|
+
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", {
|
|
5734
5769
|
key: i,
|
|
5735
|
-
class: y(r.value ? I(
|
|
5770
|
+
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")),
|
|
5736
5771
|
"aria-current": p(i) === "active" ? "step" : void 0
|
|
5737
|
-
}, [u("div", { class: y(r.value ? "flex flex-col items-center" : "flex w-full items-center") }, [u("span", { class: y(I(
|
|
5772
|
+
}, [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, {
|
|
5738
5773
|
key: 0,
|
|
5739
5774
|
name: "lucide:check",
|
|
5740
5775
|
class: y(a.value.icon)
|
|
5741
|
-
}, null, 8, ["class"])) : n.icon ? (T(), s(
|
|
5776
|
+
}, null, 8, ["class"])) : n.icon ? (T(), s(Q, {
|
|
5742
5777
|
key: 1,
|
|
5743
5778
|
name: n.icon,
|
|
5744
5779
|
class: y(a.value.icon)
|
|
5745
5780
|
}, null, 8, ["name", "class"])) : (T(), l(t, { key: 2 }, [d(M(i + 1), 1)], 64))], 2), i < e.items.length - 1 ? (T(), l("span", {
|
|
5746
5781
|
key: 0,
|
|
5747
|
-
class: y(I(
|
|
5748
|
-
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : I(
|
|
5782
|
+
class: y(I(Y)("transition-colors", r.value ? "mt-1 w-0.5 flex-1" : "mx-2 h-0.5 flex-1", h(i)))
|
|
5783
|
+
}, null, 2)) : c("", !0)], 2), u("div", { class: y(r.value ? "pb-6" : I(Y)("mt-2", i < e.items.length - 1 ? "pr-2" : "")) }, [u("p", { class: y(I(Y)("font-medium", a.value.title, p(i) === "pending" ? "text-default-400" : p(i) === "active" ? I(_e)[e.color] : "text-foreground")) }, M(n.title), 3), n.description ? (T(), l("p", Js, M(n.description), 1)) : c("", !0)], 2)], 10, qs))), 128))], 2));
|
|
5749
5784
|
}
|
|
5750
5785
|
}), Xs = [
|
|
5751
5786
|
"id",
|
|
@@ -5775,7 +5810,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5775
5810
|
}),
|
|
5776
5811
|
emits: ["update:modelValue"],
|
|
5777
5812
|
setup(e) {
|
|
5778
|
-
let t = e, n = z(e, "modelValue"), r =
|
|
5813
|
+
let t = e, n = z(e, "modelValue"), r = at("kun-switch"), i = {
|
|
5779
5814
|
xs: {
|
|
5780
5815
|
track: "h-4 w-7",
|
|
5781
5816
|
thumb: "size-3",
|
|
@@ -5812,7 +5847,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5812
5847
|
gap: "ml-3.5"
|
|
5813
5848
|
}
|
|
5814
5849
|
}, a = o(() => i[t.size]);
|
|
5815
|
-
return (t, i) => (T(), l("div", null, [u("label", { class: y(I(
|
|
5850
|
+
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)) }, [
|
|
5816
5851
|
u("input", {
|
|
5817
5852
|
id: I(r),
|
|
5818
5853
|
type: "checkbox",
|
|
@@ -5827,10 +5862,10 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5827
5862
|
n.value ? "bg-primary" : "bg-default-500",
|
|
5828
5863
|
e.disabled ? "opacity-50" : "",
|
|
5829
5864
|
n.value && e.disabled ? "bg-primary-300" : ""
|
|
5830
|
-
]]) }, null, 2), u("div", { class: y(I(
|
|
5865
|
+
]]) }, 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)]),
|
|
5831
5866
|
e.label ? (T(), l("span", {
|
|
5832
5867
|
key: 0,
|
|
5833
|
-
class: y(I(
|
|
5868
|
+
class: y(I(Y)("font-medium", a.value.gap, a.value.text, e.disabled ? "text-default-400" : "", e.labelClassName))
|
|
5834
5869
|
}, M(e.label), 3)) : c("", !0)
|
|
5835
5870
|
], 2), e.error ? (T(), l("p", {
|
|
5836
5871
|
key: 0,
|
|
@@ -5878,7 +5913,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5878
5913
|
}),
|
|
5879
5914
|
emits: /*@__PURE__*/ g(["change"], ["update:modelValue"]),
|
|
5880
5915
|
setup(e, { emit: n }) {
|
|
5881
|
-
let r = e, i = z(e, "modelValue"), a = n, d =
|
|
5916
|
+
let r = e, i = z(e, "modelValue"), a = n, d = ut(), p = o(() => r.orientation === "vertical"), m = {
|
|
5882
5917
|
sm: "text-sm px-2.5 py-1.5",
|
|
5883
5918
|
md: "text-sm px-3 py-2",
|
|
5884
5919
|
lg: "text-base px-4 py-2.5"
|
|
@@ -5978,31 +6013,31 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
5978
6013
|
disabled: e.disabled || r.disabled
|
|
5979
6014
|
}, V = (e, t, n) => {
|
|
5980
6015
|
t.href && e.preventDefault(), L(t, n);
|
|
5981
|
-
}, H = (e) => nc(r.name, e),
|
|
5982
|
-
let e = p.value ?
|
|
6016
|
+
}, H = (e) => nc(r.name, e), W = (e) => rc(r.name, e), K = (e) => i.value === e.value, q = o(() => Y("relative", p.value ? "inline-flex flex-col" : "inline-flex", r.fullWidth && "w-full", r.disabled && "opacity-50 cursor-not-allowed", r.scrollable && (p.value ? "max-h-full overflow-y-auto scrollbar-hide" : "max-w-full overflow-x-auto scrollbar-hide"), r.className)), J = o(() => {
|
|
6017
|
+
let e = p.value ? Y("relative flex flex-col items-stretch", h[r.size]) : Y("relative flex items-center", h[r.size]);
|
|
5983
6018
|
switch (r.variant) {
|
|
5984
|
-
case "underlined": return
|
|
6019
|
+
case "underlined": return Y(e, r.innerClassName);
|
|
5985
6020
|
case "solid":
|
|
5986
|
-
case "light": return
|
|
5987
|
-
case "bordered": return
|
|
5988
|
-
case "pills": return
|
|
5989
|
-
default: return
|
|
6021
|
+
case "light": return Y(e, "border border-kun rounded-kun-lg p-1 bg-content2/30", r.innerClassName);
|
|
6022
|
+
case "bordered": return Y(e, "border border-kun rounded-kun-lg p-1", r.innerClassName);
|
|
6023
|
+
case "pills": return Y(e, r.innerClassName);
|
|
6024
|
+
default: return Y(e, r.innerClassName);
|
|
5990
6025
|
}
|
|
5991
|
-
}),
|
|
6026
|
+
}), ee = {
|
|
5992
6027
|
start: "justify-start",
|
|
5993
6028
|
center: "justify-center",
|
|
5994
6029
|
end: "justify-end"
|
|
5995
|
-
},
|
|
5996
|
-
let t =
|
|
6030
|
+
}, te = (e) => {
|
|
6031
|
+
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;
|
|
5997
6032
|
switch (r.variant) {
|
|
5998
|
-
case "underlined": return
|
|
5999
|
-
case "solid": return
|
|
6000
|
-
case "light": return
|
|
6001
|
-
case "bordered": return
|
|
6002
|
-
case "pills": return
|
|
6033
|
+
case "underlined": return Y(n, t ? _e[r.color] : "text-default-500 hover:text-foreground");
|
|
6034
|
+
case "solid": return Y(n, "rounded-kun-md", t ? Y(ge[r.color], i && me[r.color]) : "text-default-500 hover:text-foreground");
|
|
6035
|
+
case "light": return Y(n, "rounded-kun-md", t ? Y(_e[r.color], i && re[r.color]) : "text-default-500 hover:text-foreground");
|
|
6036
|
+
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");
|
|
6037
|
+
case "pills": return Y(n, "rounded-full", t ? he[r.color] : "text-default-500 hover:text-foreground");
|
|
6003
6038
|
default: return n;
|
|
6004
6039
|
}
|
|
6005
|
-
},
|
|
6040
|
+
}, 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 = {
|
|
6006
6041
|
default: "bg-default/15",
|
|
6007
6042
|
primary: "bg-primary/15",
|
|
6008
6043
|
secondary: "bg-secondary/15",
|
|
@@ -6010,28 +6045,28 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6010
6045
|
warning: "bg-warning/15",
|
|
6011
6046
|
danger: "bg-danger/15",
|
|
6012
6047
|
info: "bg-info/15"
|
|
6013
|
-
},
|
|
6048
|
+
}, ie = o(() => {
|
|
6014
6049
|
switch (r.variant) {
|
|
6015
|
-
case "underlined": return
|
|
6016
|
-
case "solid": return
|
|
6017
|
-
case "light": return
|
|
6050
|
+
case "underlined": return Y("absolute rounded-full", oe[r.color], p.value ? "left-0 top-0" : "bottom-0 left-0");
|
|
6051
|
+
case "solid": return Y("absolute top-0 left-0 rounded-kun-md", me[r.color]);
|
|
6052
|
+
case "light": return Y("absolute top-0 left-0 rounded-kun-md", re[r.color]);
|
|
6018
6053
|
default: return null;
|
|
6019
6054
|
}
|
|
6020
|
-
}),
|
|
6055
|
+
}), ae = o(() => !!ie.value && w.value >= 0 && Object.keys(E.value).length > 0), ce = o(() => {
|
|
6021
6056
|
let e = { ...E.value };
|
|
6022
6057
|
return r.disableAnimation || (e.transition = "transform var(--kun-dur-base) var(--ease-kun-standard), width var(--kun-dur-base) var(--ease-kun-standard)"), e;
|
|
6023
6058
|
});
|
|
6024
|
-
return (n, r) => (T(), l("div", { class: y(
|
|
6059
|
+
return (n, r) => (T(), l("div", { class: y(q.value) }, [u("div", {
|
|
6025
6060
|
ref_key: "listRef",
|
|
6026
6061
|
ref: A,
|
|
6027
|
-
class: y(
|
|
6062
|
+
class: y(J.value),
|
|
6028
6063
|
role: "tablist",
|
|
6029
6064
|
"aria-orientation": e.orientation
|
|
6030
|
-
}, [
|
|
6065
|
+
}, [ae.value ? (T(), l("div", {
|
|
6031
6066
|
key: 0,
|
|
6032
6067
|
"aria-hidden": "true",
|
|
6033
|
-
class: y(
|
|
6034
|
-
style: b(
|
|
6068
|
+
class: y(ie.value),
|
|
6069
|
+
style: b(ce.value)
|
|
6035
6070
|
}, null, 6)) : c("", !0), (T(!0), l(t, null, k(e.items, (t, n) => (T(), s(j(R(t)), _({
|
|
6036
6071
|
key: t.value,
|
|
6037
6072
|
ref_for: !0,
|
|
@@ -6039,20 +6074,20 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6039
6074
|
}, { ref_for: !0 }, B(t), {
|
|
6040
6075
|
id: H(t.value),
|
|
6041
6076
|
role: "tab",
|
|
6042
|
-
"aria-controls":
|
|
6043
|
-
"aria-selected":
|
|
6077
|
+
"aria-controls": W(t.value),
|
|
6078
|
+
"aria-selected": K(t),
|
|
6044
6079
|
"aria-disabled": t.disabled || e.disabled,
|
|
6045
|
-
tabindex:
|
|
6046
|
-
class:
|
|
6047
|
-
style:
|
|
6080
|
+
tabindex: K(t) && !t.disabled && !e.disabled ? 0 : -1,
|
|
6081
|
+
class: te(t),
|
|
6082
|
+
style: ne(t),
|
|
6048
6083
|
onClick: (e) => V(e, t, n),
|
|
6049
6084
|
onKeydown: (e) => I(e, n)
|
|
6050
6085
|
}), {
|
|
6051
|
-
default:
|
|
6086
|
+
default: G(() => [t.icon ? (T(), l("span", {
|
|
6052
6087
|
key: 0,
|
|
6053
6088
|
class: "inline-flex shrink-0",
|
|
6054
6089
|
style: b({ fontSize: e.iconSize })
|
|
6055
|
-
}, [f(
|
|
6090
|
+
}, [f(Q, { name: t.icon }, null, 8, ["name"])], 4)) : c("", !0), t.textValue ? (T(), l("span", ac, M(t.textValue), 1)) : c("", !0)]),
|
|
6056
6091
|
_: 2
|
|
6057
6092
|
}, 1040, [
|
|
6058
6093
|
"id",
|
|
@@ -6071,7 +6106,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6071
6106
|
"aria-labelledby",
|
|
6072
6107
|
"tabindex",
|
|
6073
6108
|
"data-kun-tab-hidden"
|
|
6074
|
-
], cc = /*#__PURE__*/
|
|
6109
|
+
], cc = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
6075
6110
|
name: "KunTabPanel",
|
|
6076
6111
|
__name: "TabPanel",
|
|
6077
6112
|
props: {
|
|
@@ -6121,7 +6156,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6121
6156
|
"aria-labelledby": h.value,
|
|
6122
6157
|
tabindex: s.value ? 0 : -1,
|
|
6123
6158
|
"data-kun-tab-hidden": !b.value && x.value ? "" : void 0,
|
|
6124
|
-
class: y(I(
|
|
6159
|
+
class: y(I(Y)("focus:outline-none", e.className)),
|
|
6125
6160
|
onBeforematch: w
|
|
6126
6161
|
}, [A(t.$slots, "default", {}, void 0, !0)], 42, sc)) : c("", !0);
|
|
6127
6162
|
}
|
|
@@ -6243,10 +6278,10 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6243
6278
|
"invalid"
|
|
6244
6279
|
], ["update:modelValue"]),
|
|
6245
6280
|
setup(e, { emit: n }) {
|
|
6246
|
-
let r = e, i =
|
|
6281
|
+
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) => {
|
|
6247
6282
|
let n = e && typeof e == "object" && "$el" in e ? e.$el ?? null : e;
|
|
6248
6283
|
n instanceof HTMLElement && (h.value[t] = n);
|
|
6249
|
-
}, x = O(!1), S =
|
|
6284
|
+
}, x = O(!1), S = at("kun-tag-input"), C = (e) => {
|
|
6250
6285
|
let t = e;
|
|
6251
6286
|
return r.trim && (t = t.trim()), r.transform && (t = r.transform(t)), t;
|
|
6252
6287
|
}, w = (e, t) => {
|
|
@@ -6327,25 +6362,25 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6327
6362
|
r.confirmOnBlur && N();
|
|
6328
6363
|
}, U = () => {
|
|
6329
6364
|
r.disabled || r.readonly || m.value?.focus();
|
|
6330
|
-
},
|
|
6365
|
+
}, W = {
|
|
6331
6366
|
xs: "min-h-[26px]",
|
|
6332
6367
|
sm: "min-h-[34px]",
|
|
6333
6368
|
md: "min-h-[38px]",
|
|
6334
6369
|
lg: "min-h-[46px]",
|
|
6335
6370
|
xl: "min-h-[54px]"
|
|
6336
|
-
},
|
|
6371
|
+
}, G = {
|
|
6337
6372
|
xs: "px-2.5 py-1 gap-1",
|
|
6338
6373
|
sm: "px-3.5 py-1.5 gap-1.5",
|
|
6339
6374
|
md: "px-4 py-2 gap-2",
|
|
6340
6375
|
lg: "px-5 py-2.5 gap-2",
|
|
6341
6376
|
xl: "px-6 py-3 gap-2.5"
|
|
6342
|
-
},
|
|
6377
|
+
}, q = {
|
|
6343
6378
|
xs: "text-xs",
|
|
6344
6379
|
sm: "text-sm",
|
|
6345
6380
|
md: "text-sm",
|
|
6346
6381
|
lg: "text-base",
|
|
6347
6382
|
xl: "text-lg"
|
|
6348
|
-
},
|
|
6383
|
+
}, 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);
|
|
6349
6384
|
return (n, r) => (T(), l("div", uc, [
|
|
6350
6385
|
e.label ? (T(), l("label", {
|
|
6351
6386
|
key: 0,
|
|
@@ -6357,18 +6392,18 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6357
6392
|
"aria-label": e.label || "tag input",
|
|
6358
6393
|
"aria-invalid": !!e.error,
|
|
6359
6394
|
"aria-disabled": e.disabled,
|
|
6360
|
-
class: y(
|
|
6395
|
+
class: y(ee.value),
|
|
6361
6396
|
onClick: U
|
|
6362
6397
|
}, [
|
|
6363
6398
|
(T(!0), l(t, null, k(d.value, (t, i) => (T(), l("span", {
|
|
6364
6399
|
key: `${i}-${t}`,
|
|
6365
6400
|
ref_for: !0,
|
|
6366
6401
|
ref: (e) => b(e, i),
|
|
6367
|
-
class: y(
|
|
6402
|
+
class: y(te.value),
|
|
6368
6403
|
tabindex: e.disabled || e.readonly ? -1 : 0,
|
|
6369
6404
|
"aria-label": `标签 ${t}`,
|
|
6370
6405
|
onKeydown: (e) => F(e, i),
|
|
6371
|
-
onClick: r[0] ||=
|
|
6406
|
+
onClick: r[0] ||= J(() => {}, ["stop"])
|
|
6372
6407
|
}, [A(n.$slots, "tag", {
|
|
6373
6408
|
tag: t,
|
|
6374
6409
|
index: i,
|
|
@@ -6379,12 +6414,12 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6379
6414
|
tabindex: "-1",
|
|
6380
6415
|
"aria-label": `移除标签 ${t}`,
|
|
6381
6416
|
class: "hover:text-danger -mr-0.5 ml-1 inline-flex cursor-pointer rounded-full p-0.5 transition-colors focus:outline-none",
|
|
6382
|
-
onClick:
|
|
6383
|
-
}, [f(
|
|
6417
|
+
onClick: J((e) => j(i), ["stop"])
|
|
6418
|
+
}, [f(Q, {
|
|
6384
6419
|
name: "lucide:x",
|
|
6385
6420
|
class: "size-3.5"
|
|
6386
6421
|
})], 8, mc)) : c("", !0)])], 42, pc))), 128)),
|
|
6387
|
-
e.readonly ? c("", !0) :
|
|
6422
|
+
e.readonly ? c("", !0) : K((T(), l("input", {
|
|
6388
6423
|
key: 0,
|
|
6389
6424
|
id: I(S),
|
|
6390
6425
|
ref_key: "inputEl",
|
|
@@ -6394,7 +6429,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6394
6429
|
enterkeyhint: "enter",
|
|
6395
6430
|
placeholder: d.value.length === 0 ? e.placeholder : "",
|
|
6396
6431
|
disabled: e.disabled,
|
|
6397
|
-
readonly:
|
|
6432
|
+
readonly: ne.value,
|
|
6398
6433
|
"aria-describedby": e.error || s.value ? `${I(S)}-msg` : void 0,
|
|
6399
6434
|
class: "placeholder-default-400 min-w-[80px] flex-1 bg-transparent outline-none disabled:cursor-not-allowed read-only:cursor-not-allowed",
|
|
6400
6435
|
onKeydown: P,
|
|
@@ -6416,7 +6451,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6416
6451
|
}, M(s.value), 9, vc)) : c("", !0)
|
|
6417
6452
|
]));
|
|
6418
6453
|
}
|
|
6419
|
-
}), bc = /*#__PURE__*/
|
|
6454
|
+
}), bc = /*#__PURE__*/ pt(/* @__PURE__ */ p({
|
|
6420
6455
|
name: "KunText",
|
|
6421
6456
|
__name: "Text",
|
|
6422
6457
|
props: {
|
|
@@ -6425,7 +6460,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6425
6460
|
},
|
|
6426
6461
|
setup(e) {
|
|
6427
6462
|
let t = e, n = o(() => t.content.replace(/([_/])/g, "$1"));
|
|
6428
|
-
return (e, r) => (T(), l("span", { class: y(I(
|
|
6463
|
+
return (e, r) => (T(), l("span", { class: y(I(Y)("kun-text-block", t.className)) }, M(n.value), 3));
|
|
6429
6464
|
}
|
|
6430
6465
|
}), [["__scopeId", "data-v-e9ad81ae"]]), xc = { class: "w-full" }, Sc = ["for"], Cc = {
|
|
6431
6466
|
key: 0,
|
|
@@ -6506,7 +6541,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6506
6541
|
"input"
|
|
6507
6542
|
], ["update:modelValue"]),
|
|
6508
6543
|
setup(e, { expose: t, emit: n }) {
|
|
6509
|
-
let r = e, i =
|
|
6544
|
+
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;
|
|
6510
6545
|
U(f, () => {
|
|
6511
6546
|
r.autoGrow && v(() => _());
|
|
6512
6547
|
});
|
|
@@ -6541,7 +6576,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6541
6576
|
for: I(p),
|
|
6542
6577
|
class: "text-default-700 mb-1 block text-sm font-medium"
|
|
6543
6578
|
}, [d(M(e.label) + " ", 1), e.required ? (T(), l("span", Cc, "*")) : c("", !0)], 8, Sc)) : c("", !0),
|
|
6544
|
-
u("div", wc, [
|
|
6579
|
+
u("div", wc, [K(u("textarea", {
|
|
6545
6580
|
id: I(p),
|
|
6546
6581
|
ref_key: "textareaRef",
|
|
6547
6582
|
ref: m,
|
|
@@ -6555,7 +6590,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6555
6590
|
minlength: e.minlength,
|
|
6556
6591
|
rows: e.rows,
|
|
6557
6592
|
autofocus: e.autofocus,
|
|
6558
|
-
class: y(I(
|
|
6593
|
+
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")),
|
|
6559
6594
|
onInput: g,
|
|
6560
6595
|
onBlur: n[1] ||= (e) => h("blur", e),
|
|
6561
6596
|
onFocus: n[2] ||= (e) => h("focus", e)
|
|
@@ -6568,7 +6603,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6568
6603
|
__name: "Timeline",
|
|
6569
6604
|
props: { className: { default: "" } },
|
|
6570
6605
|
setup(e) {
|
|
6571
|
-
return (t, n) => (T(), l("ol", { class: y(I(
|
|
6606
|
+
return (t, n) => (T(), l("ol", { class: y(I(Y)("kun-timeline relative", e.className)) }, [A(t.$slots, "default")], 2));
|
|
6572
6607
|
}
|
|
6573
6608
|
}), jc = { class: "flex flex-col items-center self-stretch" }, Mc = {
|
|
6574
6609
|
key: 0,
|
|
@@ -6594,15 +6629,15 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6594
6629
|
},
|
|
6595
6630
|
setup(e) {
|
|
6596
6631
|
let t = e, n = o(() => !!t.icon);
|
|
6597
|
-
return (t, r) => (T(), l("li", { class: y(I(
|
|
6632
|
+
return (t, r) => (T(), l("li", { class: y(I(Y)("flex gap-3", e.className)) }, [u("div", jc, [n.value ? (T(), l("span", {
|
|
6598
6633
|
key: 0,
|
|
6599
|
-
class: y(I(
|
|
6600
|
-
}, [f(
|
|
6634
|
+
class: y(I(Y)("inline-flex size-7 shrink-0 items-center justify-center rounded-full", I(me)[e.color], I(ge)[e.color]))
|
|
6635
|
+
}, [f(Q, {
|
|
6601
6636
|
name: e.icon,
|
|
6602
6637
|
class: "size-4"
|
|
6603
6638
|
}, null, 8, ["name"])], 2)) : (T(), l("span", {
|
|
6604
6639
|
key: 1,
|
|
6605
|
-
class: y(I(
|
|
6640
|
+
class: y(I(Y)("mt-1.5 size-3 shrink-0 rounded-full", I(me)[e.color]))
|
|
6606
6641
|
}, null, 2)), r[0] ||= u("span", { class: "kun-tl-line bg-default-200 my-1.5 w-px flex-1" }, null, -1)]), u("div", { class: y(["kun-tl-content min-w-0 flex-1 pb-6", n.value ? "pt-0.5" : ""]) }, [e.title || e.time || t.$slots.title || t.$slots.time ? (T(), l("div", Mc, [e.title || t.$slots.title ? (T(), l("p", Nc, [A(t.$slots, "title", {}, () => [d(M(e.title), 1)])])) : c("", !0), e.time || t.$slots.time ? (T(), l("span", Pc, [A(t.$slots, "time", {}, () => [d(M(e.time), 1)])])) : c("", !0)])) : c("", !0), t.$slots.default ? (T(), l("div", Fc, [A(t.$slots, "default")])) : c("", !0)], 2)], 2));
|
|
6607
6642
|
}
|
|
6608
6643
|
}), Lc = ["aria-describedby"], Rc = ["id"], zc = /* @__PURE__ */ p({
|
|
@@ -6625,7 +6660,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6625
6660
|
}
|
|
6626
6661
|
},
|
|
6627
6662
|
setup(e) {
|
|
6628
|
-
let t = e, r =
|
|
6663
|
+
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, {
|
|
6629
6664
|
placement: () => t.position,
|
|
6630
6665
|
open: m,
|
|
6631
6666
|
offset: 8,
|
|
@@ -6640,13 +6675,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6640
6675
|
return (t, r) => (T(), l("div", {
|
|
6641
6676
|
ref_key: "triggerRef",
|
|
6642
6677
|
ref: u,
|
|
6643
|
-
class: y(I(
|
|
6678
|
+
class: y(I(Y)("relative inline-block", e.className)),
|
|
6644
6679
|
"aria-describedby": m.value ? I(h) : void 0,
|
|
6645
6680
|
onMouseenter: w,
|
|
6646
6681
|
onMouseleave: E,
|
|
6647
6682
|
onFocusin: w,
|
|
6648
6683
|
onFocusout: E,
|
|
6649
|
-
onKeydown:
|
|
6684
|
+
onKeydown: q(E, ["escape"])
|
|
6650
6685
|
}, [A(t.$slots, "default"), (T(), s(n, { to: "body" }, [f(i, {
|
|
6651
6686
|
"enter-active-class": "transition-opacity duration-kun-base ease-kun-out",
|
|
6652
6687
|
"enter-from-class": "opacity-0",
|
|
@@ -6655,13 +6690,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6655
6690
|
"leave-from-class": "opacity-100",
|
|
6656
6691
|
"leave-to-class": "opacity-0"
|
|
6657
6692
|
}, {
|
|
6658
|
-
default:
|
|
6693
|
+
default: G(() => [m.value ? (T(), l("div", {
|
|
6659
6694
|
key: 0,
|
|
6660
6695
|
ref_key: "tooltipRef",
|
|
6661
6696
|
ref: p,
|
|
6662
6697
|
id: I(h),
|
|
6663
6698
|
role: "tooltip",
|
|
6664
|
-
class: y(I(
|
|
6699
|
+
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")),
|
|
6665
6700
|
style: b(I(v))
|
|
6666
6701
|
}, [A(t.$slots, "content", {}, () => [d(M(e.text), 1)]), e.showArrow ? (T(), l("div", {
|
|
6667
6702
|
key: 0,
|
|
@@ -6708,7 +6743,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6708
6743
|
},
|
|
6709
6744
|
emits: ["setImage"],
|
|
6710
6745
|
setup(e, { emit: t }) {
|
|
6711
|
-
let n = e, r =
|
|
6746
|
+
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) => {
|
|
6712
6747
|
Bc(e) && (v.value = URL.createObjectURL(e), _.value = !0);
|
|
6713
6748
|
}, C = async (e) => {
|
|
6714
6749
|
let t = e.canvas, r = await new Promise((e) => {
|
|
@@ -6733,13 +6768,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6733
6768
|
};
|
|
6734
6769
|
return (t, r) => (T(), l("div", null, [u("div", {
|
|
6735
6770
|
tabindex: "0",
|
|
6736
|
-
class: y(I(
|
|
6771
|
+
class: y(I(Y)("border-default-500 hover:border-default-700 relative cursor-pointer border-2 border-dashed transition-colors", i.value, e.className)),
|
|
6737
6772
|
style: b({ "aspect-ratio": n.aspect }),
|
|
6738
6773
|
onDrop: E,
|
|
6739
6774
|
onDragover: D,
|
|
6740
6775
|
onClick: k
|
|
6741
6776
|
}, [
|
|
6742
|
-
!g.value && !x.value ? (T(), l("div", Hc, [f(
|
|
6777
|
+
!g.value && !x.value ? (T(), l("div", Hc, [f(Q, {
|
|
6743
6778
|
name: "lucide:plus",
|
|
6744
6779
|
class: "text-default-500 text-3xl"
|
|
6745
6780
|
}), a.value ? (T(), l("span", Uc, M(a.value), 1)) : c("", !0)])) : c("", !0),
|
|
@@ -6747,7 +6782,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6747
6782
|
key: 1,
|
|
6748
6783
|
src: g.value || x.value,
|
|
6749
6784
|
alt: "上传图片",
|
|
6750
|
-
class: y(I(
|
|
6785
|
+
class: y(I(Y)("h-full w-full object-cover", i.value))
|
|
6751
6786
|
}, null, 10, Wc)) : c("", !0),
|
|
6752
6787
|
u("input", {
|
|
6753
6788
|
ref_key: "input",
|
|
@@ -6762,9 +6797,9 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6762
6797
|
"is-dismissable": !1,
|
|
6763
6798
|
"onUpdate:modelValue": r[1] ||= (e) => _.value = e
|
|
6764
6799
|
}, {
|
|
6765
|
-
default:
|
|
6800
|
+
default: G(() => [u("div", Gc, [
|
|
6766
6801
|
r[4] ||= u("div", { class: "mb-4" }, [u("h3", { class: "text-lg font-semibold" }, "裁剪图片")], -1),
|
|
6767
|
-
v.value ? (T(), s(I(
|
|
6802
|
+
v.value ? (T(), s(I(tt), {
|
|
6768
6803
|
key: 0,
|
|
6769
6804
|
src: v.value,
|
|
6770
6805
|
"stencil-props": { aspectRatio: n.aspect },
|
|
@@ -6775,14 +6810,14 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6775
6810
|
color: "danger",
|
|
6776
6811
|
onClick: r[0] ||= (e) => _.value = !1
|
|
6777
6812
|
}, {
|
|
6778
|
-
default:
|
|
6813
|
+
default: G(() => [...r[2] ||= [d(" 取消 ", -1)]]),
|
|
6779
6814
|
_: 1
|
|
6780
6815
|
}), f($, {
|
|
6781
6816
|
variant: "solid",
|
|
6782
6817
|
color: "primary",
|
|
6783
6818
|
onClick: A
|
|
6784
6819
|
}, {
|
|
6785
|
-
default:
|
|
6820
|
+
default: G(() => [...r[3] ||= [d(" 确定 ", -1)]]),
|
|
6786
6821
|
_: 1
|
|
6787
6822
|
})])
|
|
6788
6823
|
])]),
|
|
@@ -6811,13 +6846,13 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6811
6846
|
floatingPosition: { default: "top" }
|
|
6812
6847
|
},
|
|
6813
6848
|
setup(e) {
|
|
6814
|
-
let t = e, n =
|
|
6849
|
+
let t = e, n = ut(), r = o(() => t.isNavigation && !!t.user?.id), i = o(() => {
|
|
6815
6850
|
if (!r.value) return {};
|
|
6816
6851
|
let e = n.userLinkTemplate.replace("{id}", String(t.user?.id));
|
|
6817
6852
|
return typeof n.linkComponent == "string" ? { href: e } : { to: e };
|
|
6818
6853
|
});
|
|
6819
|
-
return (a, o) => (T(), s(j(r.value ? I(n).linkComponent : "div"), _(i.value, { class: I(
|
|
6820
|
-
default:
|
|
6854
|
+
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) }), {
|
|
6855
|
+
default: G(() => [f(bn, {
|
|
6821
6856
|
"floating-position": t.floatingPosition,
|
|
6822
6857
|
"disable-floating": t.disableFloating,
|
|
6823
6858
|
user: e.user,
|
|
@@ -6836,7 +6871,7 @@ var Ho = { class: "relative inline-block" }, Uo = ["aria-expanded", "aria-contro
|
|
|
6836
6871
|
//#endregion
|
|
6837
6872
|
//#region src/resolver.ts
|
|
6838
6873
|
function Qc(e = {}) {
|
|
6839
|
-
let t = new Set(
|
|
6874
|
+
let t = new Set(nt), n = e.importStyle ?? !0;
|
|
6840
6875
|
return {
|
|
6841
6876
|
type: "component",
|
|
6842
6877
|
resolve(e) {
|
|
@@ -6851,8 +6886,8 @@ function Qc(e = {}) {
|
|
|
6851
6886
|
//#endregion
|
|
6852
6887
|
//#region src/index.ts
|
|
6853
6888
|
var $c = {
|
|
6854
|
-
KunAccordion:
|
|
6855
|
-
KunAccordionItem:
|
|
6889
|
+
KunAccordion: it,
|
|
6890
|
+
KunAccordionItem: bt,
|
|
6856
6891
|
KunAlertProvider: en,
|
|
6857
6892
|
KunAutocomplete: gn,
|
|
6858
6893
|
KunAvatar: bn,
|
|
@@ -6875,7 +6910,7 @@ var $c = {
|
|
|
6875
6910
|
KunFadeCard: Gi,
|
|
6876
6911
|
KunFileInput: Qi,
|
|
6877
6912
|
KunHeader: ia,
|
|
6878
|
-
KunIcon:
|
|
6913
|
+
KunIcon: Q,
|
|
6879
6914
|
KunImage: yn,
|
|
6880
6915
|
KunImageNative: oa,
|
|
6881
6916
|
KunInfo: ua,
|
|
@@ -6921,4 +6956,4 @@ var $c = {
|
|
|
6921
6956
|
for (let [t, n] of Object.entries($c)) e.component(t, n);
|
|
6922
6957
|
} };
|
|
6923
6958
|
//#endregion
|
|
6924
|
-
export {
|
|
6959
|
+
export { nt as KUN_COMPONENT_NAMES, st as KUN_UI_DEFAULT_CONFIG, it as KunAccordion, bt as KunAccordionItem, en as KunAlertProvider, gn as KunAutocomplete, bn as KunAvatar, Cn as KunAvatarGroup, On as KunBadge, jn as KunBrand, $ as KunButton, In as KunCard, Un as KunCarousel, Wn as KunCarouselItem, Zn as KunCheckBox, An as KunChip, $r as KunContent, ti as KunContextMenu, ki as KunCopy, xi as KunDatePicker, ji as KunDivider, Hi as KunDrawer, Fi as KunDropdown, Gi as KunFadeCard, Qi as KunFileInput, ia as KunHeader, Q as KunIcon, yn as KunImage, oa as KunImageNative, ua as KunInfo, xa as KunInput, Zr as KunLightbox, wa as KunLightboxGallery, Ta as KunLightboxGalleryItem, Ea as KunLink, qa as KunLoading, Pa as KunLoli, Ba as KunLoliProvider, Ja as KunMarkdown, no as KunMessageProvider, Jt as KunModal, oo as KunNull, _o as KunNumberInput, Do as KunPagination, jo as KunPinInput, Go as KunPopover, Qo as KunProgress, us as KunRadioGroup, ps as KunRating, _s as KunReaction, Ot as KunRipple, Is as KunScrollShadow, Ns as KunSelect, Ls as KunSkeleton, Ks as KunSlider, Ys as KunSteps, ec as KunSwitch, oc as KunTab, cc as KunTabPanel, lc as KunTabPanels, yc as KunTagInput, bc as KunText, kc as KunTextarea, Ac as KunTimeline, Ic as KunTimelineItem, zc as KunTooltip, el as KunUI, el as default, Qc as KunUIResolver, qc as KunUpload, Zc as KunUserChip, Bc as checkImageValid, te as decodeIfEncoded, Oa as getRandomLoli, ie as getRandomSticker, lt as installKunUIConfig, ct as provideKunUIConfig, Vc 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 };
|