@komarcalabs/design-system 0.1.1 → 0.1.3
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/README.md +13 -8
- package/dist/index.js +79 -43
- package/dist/plugin-mUxynfRy.js +3064 -0
- package/dist/react/components/KmSkeleton.d.ts +16 -0
- package/dist/react/components/KmSkeleton.d.ts.map +1 -0
- package/dist/react/components/index.d.ts +1 -0
- package/dist/react/components/index.d.ts.map +1 -1
- package/dist/react.js +191 -149
- package/dist/skeleton-D8D5ibC2.js +664 -0
- package/dist/styles.css +1 -1
- package/dist/tokens.js +28 -17
- package/dist/treeview-C6_M73YM.js +641 -0
- package/dist/variants/alert.d.ts +201 -6
- package/dist/variants/alert.d.ts.map +1 -1
- package/dist/variants/checkbox.d.ts +133 -0
- package/dist/variants/checkbox.d.ts.map +1 -0
- package/dist/variants/index.d.ts +8 -0
- package/dist/variants/index.d.ts.map +1 -1
- package/dist/variants/pagination.d.ts +91 -0
- package/dist/variants/pagination.d.ts.map +1 -0
- package/dist/variants/radio.d.ts +143 -0
- package/dist/variants/radio.d.ts.map +1 -0
- package/dist/variants/select.d.ts +46 -1
- package/dist/variants/select.d.ts.map +1 -1
- package/dist/variants/skeleton.d.ts +64 -0
- package/dist/variants/skeleton.d.ts.map +1 -0
- package/dist/variants/table.d.ts +106 -0
- package/dist/variants/table.d.ts.map +1 -0
- package/dist/variants/tabs.d.ts +124 -0
- package/dist/variants/tabs.d.ts.map +1 -0
- package/dist/variants/toggleSwitch.d.ts +9 -0
- package/dist/variants/toggleSwitch.d.ts.map +1 -1
- package/dist/variants/treeview.d.ts +97 -0
- package/dist/variants/treeview.d.ts.map +1 -0
- package/dist/variants/typography.d.ts +377 -0
- package/dist/variants/typography.d.ts.map +1 -0
- package/dist/vue/components/KmAlert.vue.d.ts +16 -1
- package/dist/vue/components/KmAlert.vue.d.ts.map +1 -1
- package/dist/vue/components/KmBadge.vue.d.ts +2 -0
- package/dist/vue/components/KmBadge.vue.d.ts.map +1 -1
- package/dist/vue/components/KmButton.vue.d.ts +3 -1
- package/dist/vue/components/KmButton.vue.d.ts.map +1 -1
- package/dist/vue/components/KmCheckbox.vue.d.ts +45 -0
- package/dist/vue/components/KmCheckbox.vue.d.ts.map +1 -0
- package/dist/vue/components/KmDialog/KmDialog.vue.d.ts +2 -2
- package/dist/vue/components/KmDialog/KmDialog.vue.d.ts.map +1 -1
- package/dist/vue/components/KmFormControl.vue.d.ts +37 -0
- package/dist/vue/components/KmFormControl.vue.d.ts.map +1 -0
- package/dist/vue/components/KmHeading.vue.d.ts +34 -0
- package/dist/vue/components/KmHeading.vue.d.ts.map +1 -0
- package/dist/vue/components/KmHtml.vue.d.ts +32 -0
- package/dist/vue/components/KmHtml.vue.d.ts.map +1 -0
- package/dist/vue/components/KmInput.vue.d.ts +2 -0
- package/dist/vue/components/KmInput.vue.d.ts.map +1 -1
- package/dist/vue/components/KmPagination/KmPagination.vue.d.ts +53 -0
- package/dist/vue/components/KmPagination/KmPagination.vue.d.ts.map +1 -0
- package/dist/vue/components/KmPagination/index.d.ts +3 -0
- package/dist/vue/components/KmPagination/index.d.ts.map +1 -0
- package/dist/vue/components/KmPopover.vue.d.ts +141 -0
- package/dist/vue/components/KmPopover.vue.d.ts.map +1 -0
- package/dist/vue/components/KmRadio.vue.d.ts +47 -0
- package/dist/vue/components/KmRadio.vue.d.ts.map +1 -0
- package/dist/vue/components/KmRadioGroup.vue.d.ts +42 -0
- package/dist/vue/components/KmRadioGroup.vue.d.ts.map +1 -0
- package/dist/vue/components/KmScrollArea.vue.d.ts +60 -0
- package/dist/vue/components/KmScrollArea.vue.d.ts.map +1 -0
- package/dist/vue/components/KmSelect.vue.d.ts +66 -17
- package/dist/vue/components/KmSelect.vue.d.ts.map +1 -1
- package/dist/vue/components/KmSkeleton.vue.d.ts +38 -0
- package/dist/vue/components/KmSkeleton.vue.d.ts.map +1 -0
- package/dist/vue/components/KmStepper.vue.d.ts +8 -2
- package/dist/vue/components/KmStepper.vue.d.ts.map +1 -1
- package/dist/vue/components/KmTable/KmTable.vue.d.ts +39 -0
- package/dist/vue/components/KmTable/KmTable.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableBody.vue.d.ts +21 -0
- package/dist/vue/components/KmTable/KmTableBody.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableCaption.vue.d.ts +21 -0
- package/dist/vue/components/KmTable/KmTableCaption.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableCell.vue.d.ts +25 -0
- package/dist/vue/components/KmTable/KmTableCell.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableFooter.vue.d.ts +21 -0
- package/dist/vue/components/KmTable/KmTableFooter.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableHead.vue.d.ts +24 -0
- package/dist/vue/components/KmTable/KmTableHead.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableHeader.vue.d.ts +21 -0
- package/dist/vue/components/KmTable/KmTableHeader.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/KmTableRow.vue.d.ts +24 -0
- package/dist/vue/components/KmTable/KmTableRow.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTable/index.d.ts +17 -0
- package/dist/vue/components/KmTable/index.d.ts.map +1 -0
- package/dist/vue/components/KmTabs/KmTabs.vue.d.ts +45 -0
- package/dist/vue/components/KmTabs/KmTabs.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTabs/KmTabsContent.vue.d.ts +24 -0
- package/dist/vue/components/KmTabs/KmTabsContent.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTabs/KmTabsList.vue.d.ts +22 -0
- package/dist/vue/components/KmTabs/KmTabsList.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTabs/KmTabsTrigger.vue.d.ts +26 -0
- package/dist/vue/components/KmTabs/KmTabsTrigger.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTabs/index.d.ts +9 -0
- package/dist/vue/components/KmTabs/index.d.ts.map +1 -0
- package/dist/vue/components/KmText.vue.d.ts +43 -0
- package/dist/vue/components/KmText.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTextarea.vue.d.ts +2 -0
- package/dist/vue/components/KmTextarea.vue.d.ts.map +1 -1
- package/dist/vue/components/KmTreeview/KmTreeNode.vue.d.ts +37 -0
- package/dist/vue/components/KmTreeview/KmTreeNode.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTreeview/KmTreeview.vue.d.ts +48 -0
- package/dist/vue/components/KmTreeview/KmTreeview.vue.d.ts.map +1 -0
- package/dist/vue/components/KmTreeview/index.d.ts +5 -0
- package/dist/vue/components/KmTreeview/index.d.ts.map +1 -0
- package/dist/vue/components/KmTreeview/types.d.ts +11 -0
- package/dist/vue/components/KmTreeview/types.d.ts.map +1 -0
- package/dist/vue/components/index.d.ts +19 -0
- package/dist/vue/components/index.d.ts.map +1 -1
- package/dist/vue/plugin.d.ts.map +1 -1
- package/dist/vue.js +40 -15
- package/package.json +1 -1
- package/dist/carousel-D_f-K2v2.js +0 -83
- package/dist/plugin-DfFKi2ZR.js +0 -941
- package/dist/toggleSwitch-CpBXc_jq.js +0 -369
|
@@ -0,0 +1,3064 @@
|
|
|
1
|
+
import { defineComponent as z, computed as m, openBlock as l, createElementBlock as r, normalizeClass as s, renderSlot as h, createElementVNode as i, createCommentVNode as g, createTextVNode as j, toDisplayString as y, unref as o, createBlock as S, resolveDynamicComponent as R, withCtx as k, ref as E, watch as ce, nextTick as ve, onMounted as fe, onBeforeUnmount as he, withDirectives as ne, vShow as ie, createVNode as T, withModifiers as D, vModelText as ge, Fragment as H, renderList as q, onUnmounted as be, normalizeStyle as J, withKeys as U, inject as O, provide as Y, reactive as pe, toRef as F, useAttrs as ye, mergeProps as G, useModel as X, mergeModels as oe, resolveComponent as ke } from "vue";
|
|
2
|
+
import { a as we, c as xe, s as $e, h as Ce, g as Be, b as ze, e as Ve, r as Ke, d as Se, f as Te, t as Me, p as Pe, i as Ae } from "./treeview-C6_M73YM.js";
|
|
3
|
+
import { DialogRoot as Le, DialogPortal as Ie, DialogOverlay as je, DialogContent as Ze, DialogTitle as He, SelectRoot as Re, SelectTrigger as Oe, SelectIcon as qe, SelectPortal as Ee, SelectContent as De, SelectScrollUpButton as Ne, SelectViewport as We, SelectItem as ee, SelectItemText as te, SelectItemIndicator as ae, SelectGroup as Ue, SelectLabel as Fe, SelectScrollDownButton as Qe, ScrollAreaRoot as Je, ScrollAreaViewport as Ge, ScrollAreaScrollbar as de, ScrollAreaThumb as ue, ScrollAreaCorner as Xe, HoverCardRoot as Ye, HoverCardTrigger as _e, HoverCardPortal as et, HoverCardContent as tt, HoverCardArrow as at, PopoverRoot as lt, PopoverTrigger as st, PopoverPortal as nt, PopoverContent as ot, PopoverArrow as rt, TabsRoot as it, TabsList as dt, TabsTrigger as ut, TabsContent as ct, PaginationRoot as ft, PaginationList as mt, PaginationFirst as vt, PaginationPrev as ht, PaginationListItem as gt, PaginationEllipsis as bt, PaginationNext as pt, PaginationLast as yt } from "reka-ui";
|
|
4
|
+
import { a as kt, b as wt, c as xt, d as $t, f as _, i as Ct, s as Bt, g as zt, t as Vt, h as I, j as Kt, e as St } from "./skeleton-D8D5ibC2.js";
|
|
5
|
+
const Tt = /* @__PURE__ */ z({
|
|
6
|
+
__name: "KmAlert",
|
|
7
|
+
props: {
|
|
8
|
+
tone: { default: "neutral" },
|
|
9
|
+
variant: { default: "subtle" },
|
|
10
|
+
size: { default: "md" },
|
|
11
|
+
title: {},
|
|
12
|
+
description: {},
|
|
13
|
+
icon: { type: Boolean, default: !0 },
|
|
14
|
+
closable: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["close"],
|
|
17
|
+
setup(e, { emit: t }) {
|
|
18
|
+
const a = e, n = t, u = m(
|
|
19
|
+
() => kt({
|
|
20
|
+
tone: a.tone,
|
|
21
|
+
variant: a.variant,
|
|
22
|
+
size: a.size
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
return (d, c) => (l(), r("div", {
|
|
26
|
+
class: s(u.value.root()),
|
|
27
|
+
role: "alert"
|
|
28
|
+
}, [
|
|
29
|
+
e.icon || d.$slots.icon ? (l(), r("div", {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: s(u.value.iconWrapper())
|
|
32
|
+
}, [
|
|
33
|
+
h(d.$slots, "icon", {}, () => [
|
|
34
|
+
e.tone === "success" ? (l(), r("svg", {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: s(u.value.icon()),
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
viewBox: "0 0 20 20",
|
|
39
|
+
fill: "currentColor"
|
|
40
|
+
}, [...c[1] || (c[1] = [
|
|
41
|
+
i("path", {
|
|
42
|
+
"fill-rule": "evenodd",
|
|
43
|
+
d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",
|
|
44
|
+
"clip-rule": "evenodd"
|
|
45
|
+
}, null, -1)
|
|
46
|
+
])], 2)) : e.tone === "warning" ? (l(), r("svg", {
|
|
47
|
+
key: 1,
|
|
48
|
+
class: s(u.value.icon()),
|
|
49
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
50
|
+
viewBox: "0 0 20 20",
|
|
51
|
+
fill: "currentColor"
|
|
52
|
+
}, [...c[2] || (c[2] = [
|
|
53
|
+
i("path", {
|
|
54
|
+
"fill-rule": "evenodd",
|
|
55
|
+
d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
56
|
+
"clip-rule": "evenodd"
|
|
57
|
+
}, null, -1)
|
|
58
|
+
])], 2)) : e.tone === "danger" ? (l(), r("svg", {
|
|
59
|
+
key: 2,
|
|
60
|
+
class: s(u.value.icon()),
|
|
61
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
62
|
+
viewBox: "0 0 20 20",
|
|
63
|
+
fill: "currentColor"
|
|
64
|
+
}, [...c[3] || (c[3] = [
|
|
65
|
+
i("path", {
|
|
66
|
+
"fill-rule": "evenodd",
|
|
67
|
+
d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z",
|
|
68
|
+
"clip-rule": "evenodd"
|
|
69
|
+
}, null, -1)
|
|
70
|
+
])], 2)) : e.tone === "info" ? (l(), r("svg", {
|
|
71
|
+
key: 3,
|
|
72
|
+
class: s(u.value.icon()),
|
|
73
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
74
|
+
viewBox: "0 0 20 20",
|
|
75
|
+
fill: "currentColor"
|
|
76
|
+
}, [...c[4] || (c[4] = [
|
|
77
|
+
i("path", {
|
|
78
|
+
"fill-rule": "evenodd",
|
|
79
|
+
d: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",
|
|
80
|
+
"clip-rule": "evenodd"
|
|
81
|
+
}, null, -1)
|
|
82
|
+
])], 2)) : (l(), r("svg", {
|
|
83
|
+
key: 4,
|
|
84
|
+
class: s(u.value.icon()),
|
|
85
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
86
|
+
viewBox: "0 0 20 20",
|
|
87
|
+
fill: "currentColor"
|
|
88
|
+
}, [...c[5] || (c[5] = [
|
|
89
|
+
i("path", {
|
|
90
|
+
"fill-rule": "evenodd",
|
|
91
|
+
d: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
92
|
+
"clip-rule": "evenodd"
|
|
93
|
+
}, null, -1)
|
|
94
|
+
])], 2))
|
|
95
|
+
])
|
|
96
|
+
], 2)) : g("", !0),
|
|
97
|
+
i("div", {
|
|
98
|
+
class: s(u.value.content())
|
|
99
|
+
}, [
|
|
100
|
+
e.title || d.$slots.title ? (l(), r("div", {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: s(u.value.title())
|
|
103
|
+
}, [
|
|
104
|
+
h(d.$slots, "title", {}, () => [
|
|
105
|
+
j(y(e.title), 1)
|
|
106
|
+
])
|
|
107
|
+
], 2)) : g("", !0),
|
|
108
|
+
e.description || d.$slots.default ? (l(), r("div", {
|
|
109
|
+
key: 1,
|
|
110
|
+
class: s(u.value.description())
|
|
111
|
+
}, [
|
|
112
|
+
h(d.$slots, "default", {}, () => [
|
|
113
|
+
j(y(e.description), 1)
|
|
114
|
+
])
|
|
115
|
+
], 2)) : g("", !0),
|
|
116
|
+
d.$slots.actions ? (l(), r("div", {
|
|
117
|
+
key: 2,
|
|
118
|
+
class: s(u.value.actions())
|
|
119
|
+
}, [
|
|
120
|
+
h(d.$slots, "actions")
|
|
121
|
+
], 2)) : g("", !0)
|
|
122
|
+
], 2),
|
|
123
|
+
e.closable ? (l(), r("button", {
|
|
124
|
+
key: 1,
|
|
125
|
+
type: "button",
|
|
126
|
+
class: s(u.value.closeButton()),
|
|
127
|
+
"aria-label": "Cerrar notificación",
|
|
128
|
+
onClick: c[0] || (c[0] = (p) => n("close"))
|
|
129
|
+
}, [...c[6] || (c[6] = [
|
|
130
|
+
i("svg", {
|
|
131
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
132
|
+
viewBox: "0 0 20 20",
|
|
133
|
+
fill: "currentColor",
|
|
134
|
+
class: "w-4 h-4"
|
|
135
|
+
}, [
|
|
136
|
+
i("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
|
|
137
|
+
], -1)
|
|
138
|
+
])], 2)) : g("", !0)
|
|
139
|
+
], 2));
|
|
140
|
+
}
|
|
141
|
+
}), Mt = ["aria-label"], Pt = ["src", "alt"], At = { key: 1 }, Lt = /* @__PURE__ */ z({
|
|
142
|
+
__name: "KmAvatar",
|
|
143
|
+
props: {
|
|
144
|
+
displayName: {},
|
|
145
|
+
src: {},
|
|
146
|
+
size: { default: "sm" },
|
|
147
|
+
initials: {}
|
|
148
|
+
},
|
|
149
|
+
setup(e) {
|
|
150
|
+
const t = e, a = m(() => t.initials ? t.initials : t.displayName ? t.displayName.trim().split(/\s+/).filter((n, u) => u < 2).map((n) => n[0]).join("").toUpperCase() : "");
|
|
151
|
+
return (n, u) => (l(), r("div", {
|
|
152
|
+
class: s(o(we)({ size: e.size, hasImage: !!e.src })),
|
|
153
|
+
role: "img",
|
|
154
|
+
"aria-label": e.displayName
|
|
155
|
+
}, [
|
|
156
|
+
e.src ? (l(), r("img", {
|
|
157
|
+
key: 0,
|
|
158
|
+
src: e.src,
|
|
159
|
+
alt: e.displayName,
|
|
160
|
+
class: "h-full w-full object-cover"
|
|
161
|
+
}, null, 8, Pt)) : (l(), r("span", At, y(a.value), 1))
|
|
162
|
+
], 10, Mt));
|
|
163
|
+
}
|
|
164
|
+
}), It = /* @__PURE__ */ z({
|
|
165
|
+
__name: "KmBadge",
|
|
166
|
+
props: {
|
|
167
|
+
tone: { default: "neutral" },
|
|
168
|
+
size: { default: "md" }
|
|
169
|
+
},
|
|
170
|
+
setup(e) {
|
|
171
|
+
return (t, a) => (l(), r("span", {
|
|
172
|
+
class: s(o(wt)({ tone: e.tone, size: e.size }))
|
|
173
|
+
}, [
|
|
174
|
+
h(t.$slots, "default")
|
|
175
|
+
], 2));
|
|
176
|
+
}
|
|
177
|
+
}), jt = /* @__PURE__ */ z({
|
|
178
|
+
__name: "KmButton",
|
|
179
|
+
props: {
|
|
180
|
+
as: { default: "button" },
|
|
181
|
+
variant: { default: "solid" },
|
|
182
|
+
size: { default: "md" },
|
|
183
|
+
disabled: { type: Boolean, default: !1 },
|
|
184
|
+
loading: { type: Boolean, default: !1 },
|
|
185
|
+
href: {},
|
|
186
|
+
target: {},
|
|
187
|
+
to: {},
|
|
188
|
+
type: { default: "button" }
|
|
189
|
+
},
|
|
190
|
+
setup(e) {
|
|
191
|
+
const t = e, a = m(() => t.as), n = m(
|
|
192
|
+
() => xt({
|
|
193
|
+
variant: t.variant,
|
|
194
|
+
size: t.size,
|
|
195
|
+
loading: t.loading
|
|
196
|
+
})
|
|
197
|
+
), u = m(() => ({
|
|
198
|
+
"animate-spin": t.loading,
|
|
199
|
+
"h-4 w-4": t.size === "sm" || t.size === "xs",
|
|
200
|
+
"h-5 w-5": t.size === "md" || t.size === "lg"
|
|
201
|
+
}));
|
|
202
|
+
return (d, c) => (l(), S(R(a.value), {
|
|
203
|
+
class: s(n.value),
|
|
204
|
+
href: e.as === "a" ? e.href : void 0,
|
|
205
|
+
target: e.as === "a" ? e.target : void 0,
|
|
206
|
+
to: e.as === "router-link" ? e.to : void 0,
|
|
207
|
+
type: e.as === "button" ? e.type : void 0,
|
|
208
|
+
disabled: e.as === "button" ? e.disabled || e.loading : void 0,
|
|
209
|
+
"aria-disabled": e.as === "a" && (e.disabled || e.loading) ? "true" : void 0,
|
|
210
|
+
"aria-busy": e.loading ? "true" : void 0
|
|
211
|
+
}, {
|
|
212
|
+
default: k(() => [
|
|
213
|
+
e.loading ? (l(), r("svg", {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: s(u.value),
|
|
216
|
+
viewBox: "0 0 24 24",
|
|
217
|
+
fill: "none",
|
|
218
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
219
|
+
}, [...c[0] || (c[0] = [
|
|
220
|
+
i("circle", {
|
|
221
|
+
class: "opacity-25",
|
|
222
|
+
cx: "12",
|
|
223
|
+
cy: "12",
|
|
224
|
+
r: "10",
|
|
225
|
+
stroke: "currentColor",
|
|
226
|
+
"stroke-width": "4"
|
|
227
|
+
}, null, -1),
|
|
228
|
+
i("path", {
|
|
229
|
+
class: "opacity-75",
|
|
230
|
+
fill: "currentColor",
|
|
231
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
232
|
+
}, null, -1)
|
|
233
|
+
])], 2)) : g("", !0),
|
|
234
|
+
h(d.$slots, "default")
|
|
235
|
+
]),
|
|
236
|
+
_: 3
|
|
237
|
+
}, 8, ["class", "href", "target", "to", "type", "disabled", "aria-disabled", "aria-busy"]));
|
|
238
|
+
}
|
|
239
|
+
}), Zt = /* @__PURE__ */ z({
|
|
240
|
+
__name: "KmCard",
|
|
241
|
+
setup(e) {
|
|
242
|
+
const t = $t();
|
|
243
|
+
return (a, n) => (l(), r("section", {
|
|
244
|
+
class: s(o(t).root())
|
|
245
|
+
}, [
|
|
246
|
+
a.$slots.header ? (l(), r("header", {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: s(o(t).header())
|
|
249
|
+
}, [
|
|
250
|
+
h(a.$slots, "header")
|
|
251
|
+
], 2)) : g("", !0),
|
|
252
|
+
i("div", {
|
|
253
|
+
class: s(o(t).body())
|
|
254
|
+
}, [
|
|
255
|
+
h(a.$slots, "default")
|
|
256
|
+
], 2),
|
|
257
|
+
a.$slots.footer ? (l(), r("footer", {
|
|
258
|
+
key: 1,
|
|
259
|
+
class: s(o(t).footer())
|
|
260
|
+
}, [
|
|
261
|
+
h(a.$slots, "footer")
|
|
262
|
+
], 2)) : g("", !0)
|
|
263
|
+
], 2));
|
|
264
|
+
}
|
|
265
|
+
}), Ht = /* @__PURE__ */ z({
|
|
266
|
+
__name: "KmCarousel",
|
|
267
|
+
props: {
|
|
268
|
+
watchItems: { default: () => [] }
|
|
269
|
+
},
|
|
270
|
+
setup(e, { expose: t }) {
|
|
271
|
+
const a = e, n = xe(), u = m(() => n.root()), d = m(() => n.button()), c = m(() => n.wrapper()), p = E(null), f = E(!1), b = E(!1), M = () => {
|
|
272
|
+
if (!p.value) return;
|
|
273
|
+
const { scrollLeft: x, scrollWidth: B, clientWidth: $ } = p.value;
|
|
274
|
+
f.value = x > 10, b.value = x + $ < B - 10;
|
|
275
|
+
}, w = (x) => {
|
|
276
|
+
if (!p.value) return;
|
|
277
|
+
const B = p.value.clientWidth;
|
|
278
|
+
p.value.scrollBy({
|
|
279
|
+
left: x === "left" ? -B : B,
|
|
280
|
+
behavior: "smooth"
|
|
281
|
+
});
|
|
282
|
+
};
|
|
283
|
+
ce(
|
|
284
|
+
() => a.watchItems,
|
|
285
|
+
() => {
|
|
286
|
+
ve(() => {
|
|
287
|
+
M();
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
{ deep: !0 }
|
|
291
|
+
);
|
|
292
|
+
let v = null;
|
|
293
|
+
return fe(() => {
|
|
294
|
+
M(), window.addEventListener("resize", M), p.value && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => {
|
|
295
|
+
M();
|
|
296
|
+
}), v.observe(p.value));
|
|
297
|
+
}), he(() => {
|
|
298
|
+
window.removeEventListener("resize", M), v && p.value && v.unobserve(p.value);
|
|
299
|
+
}), t({
|
|
300
|
+
recheck: M
|
|
301
|
+
}), (x, B) => (l(), r("div", {
|
|
302
|
+
class: s(u.value)
|
|
303
|
+
}, [
|
|
304
|
+
ne(i("button", {
|
|
305
|
+
onClick: B[0] || (B[0] = ($) => w("left")),
|
|
306
|
+
class: s([d.value, "carousel-btn-left"]),
|
|
307
|
+
"aria-label": "Deslizar a la izquierda"
|
|
308
|
+
}, [...B[2] || (B[2] = [
|
|
309
|
+
i("svg", {
|
|
310
|
+
class: "w-5 h-5",
|
|
311
|
+
fill: "none",
|
|
312
|
+
viewBox: "0 0 24 24",
|
|
313
|
+
stroke: "currentColor",
|
|
314
|
+
"stroke-width": "2.5"
|
|
315
|
+
}, [
|
|
316
|
+
i("path", {
|
|
317
|
+
"stroke-linecap": "round",
|
|
318
|
+
"stroke-linejoin": "round",
|
|
319
|
+
d: "M15 19l-7-7 7-7"
|
|
320
|
+
})
|
|
321
|
+
], -1)
|
|
322
|
+
])], 2), [
|
|
323
|
+
[ie, f.value]
|
|
324
|
+
]),
|
|
325
|
+
ne(i("button", {
|
|
326
|
+
onClick: B[1] || (B[1] = ($) => w("right")),
|
|
327
|
+
class: s([d.value, "carousel-btn-right"]),
|
|
328
|
+
"aria-label": "Deslizar a la derecha"
|
|
329
|
+
}, [...B[3] || (B[3] = [
|
|
330
|
+
i("svg", {
|
|
331
|
+
class: "w-5 h-5",
|
|
332
|
+
fill: "none",
|
|
333
|
+
viewBox: "0 0 24 24",
|
|
334
|
+
stroke: "currentColor",
|
|
335
|
+
"stroke-width": "2.5"
|
|
336
|
+
}, [
|
|
337
|
+
i("path", {
|
|
338
|
+
"stroke-linecap": "round",
|
|
339
|
+
"stroke-linejoin": "round",
|
|
340
|
+
d: "M9 5l7 7-7 7"
|
|
341
|
+
})
|
|
342
|
+
], -1)
|
|
343
|
+
])], 2), [
|
|
344
|
+
[ie, b.value]
|
|
345
|
+
]),
|
|
346
|
+
i("div", {
|
|
347
|
+
ref_key: "sliderRef",
|
|
348
|
+
ref: p,
|
|
349
|
+
onScroll: M,
|
|
350
|
+
class: s(c.value)
|
|
351
|
+
}, [
|
|
352
|
+
h(x.$slots, "default", {}, void 0, !0)
|
|
353
|
+
], 34)
|
|
354
|
+
], 2));
|
|
355
|
+
}
|
|
356
|
+
}), Rt = (e, t) => {
|
|
357
|
+
const a = e.__vccOpts || e;
|
|
358
|
+
for (const [n, u] of t)
|
|
359
|
+
a[n] = u;
|
|
360
|
+
return a;
|
|
361
|
+
}, Xl = /* @__PURE__ */ Rt(Ht, [["__scopeId", "data-v-9659c808"]]), Yl = /* @__PURE__ */ z({
|
|
362
|
+
__name: "KmDialog",
|
|
363
|
+
props: {
|
|
364
|
+
open: { type: Boolean },
|
|
365
|
+
defaultOpen: { type: Boolean },
|
|
366
|
+
modal: { type: Boolean },
|
|
367
|
+
size: { default: "md" },
|
|
368
|
+
preventScroll: { type: Boolean, default: !0 }
|
|
369
|
+
},
|
|
370
|
+
emits: ["update:open"],
|
|
371
|
+
setup(e, { emit: t }) {
|
|
372
|
+
const a = e, n = t, u = m(() => {
|
|
373
|
+
const d = "w-full max-w-full rounded-km-lg bg-km-surface p-6 shadow-km-xl";
|
|
374
|
+
switch (a.size) {
|
|
375
|
+
case "sm":
|
|
376
|
+
return `${d} max-w-sm`;
|
|
377
|
+
case "md":
|
|
378
|
+
return `${d} max-w-md`;
|
|
379
|
+
case "lg":
|
|
380
|
+
return `${d} max-w-lg`;
|
|
381
|
+
case "xl":
|
|
382
|
+
return `${d} max-w-xl`;
|
|
383
|
+
case "2xl":
|
|
384
|
+
return `${d} max-w-2xl`;
|
|
385
|
+
case "3xl":
|
|
386
|
+
return `${d} max-w-3xl`;
|
|
387
|
+
case "full":
|
|
388
|
+
return `${d} max-w-full m-4`;
|
|
389
|
+
default:
|
|
390
|
+
return d;
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
return (d, c) => (l(), S(o(Le), {
|
|
394
|
+
open: e.open,
|
|
395
|
+
modal: !0,
|
|
396
|
+
"onUpdate:open": c[0] || (c[0] = (p) => n("update:open", p))
|
|
397
|
+
}, {
|
|
398
|
+
default: k(() => [
|
|
399
|
+
T(o(Ie), null, {
|
|
400
|
+
default: k(() => [
|
|
401
|
+
T(o(je), { class: "fixed inset-0 z-50 bg-black/50 backdrop-blur-sm km-dialog-overlay" }),
|
|
402
|
+
T(o(Ze), {
|
|
403
|
+
class: s([u.value, "fixed left-1/2 top-1/2 z-[60] km-dialog-content"])
|
|
404
|
+
}, {
|
|
405
|
+
default: k(() => [
|
|
406
|
+
h(d.$slots, "default")
|
|
407
|
+
]),
|
|
408
|
+
_: 3
|
|
409
|
+
}, 8, ["class"])
|
|
410
|
+
]),
|
|
411
|
+
_: 3
|
|
412
|
+
})
|
|
413
|
+
]),
|
|
414
|
+
_: 3
|
|
415
|
+
}, 8, ["open"]));
|
|
416
|
+
}
|
|
417
|
+
}), Ot = { class: "flex items-start justify-between gap-4" }, qt = { class: "space-y-1.5" }, Et = {
|
|
418
|
+
key: 1,
|
|
419
|
+
class: "text-sm text-km-muted-foreground"
|
|
420
|
+
}, _l = /* @__PURE__ */ z({
|
|
421
|
+
__name: "KmDialogHeader",
|
|
422
|
+
props: {
|
|
423
|
+
title: {},
|
|
424
|
+
description: {},
|
|
425
|
+
showClose: { type: Boolean }
|
|
426
|
+
},
|
|
427
|
+
emits: ["close"],
|
|
428
|
+
setup(e, { emit: t }) {
|
|
429
|
+
const a = t;
|
|
430
|
+
return (n, u) => (l(), r("div", Ot, [
|
|
431
|
+
i("div", qt, [
|
|
432
|
+
e.title ? (l(), S(o(He), {
|
|
433
|
+
key: 0,
|
|
434
|
+
class: "text-lg font-semibold text-km-foreground"
|
|
435
|
+
}, {
|
|
436
|
+
default: k(() => [
|
|
437
|
+
j(y(e.title), 1)
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
})) : g("", !0),
|
|
441
|
+
e.description ? (l(), r("p", Et, y(e.description), 1)) : g("", !0)
|
|
442
|
+
]),
|
|
443
|
+
e.showClose ? (l(), r("button", {
|
|
444
|
+
key: 0,
|
|
445
|
+
type: "button",
|
|
446
|
+
class: "rounded-km-sm p-1 text-km-muted-foreground hover:text-km-foreground focus:outline-none focus:ring-2 focus:ring-km-primary",
|
|
447
|
+
onClick: u[0] || (u[0] = (d) => a("close"))
|
|
448
|
+
}, [...u[1] || (u[1] = [
|
|
449
|
+
i("svg", {
|
|
450
|
+
class: "h-4 w-4",
|
|
451
|
+
viewBox: "0 0 24 24",
|
|
452
|
+
fill: "none",
|
|
453
|
+
stroke: "currentColor",
|
|
454
|
+
"stroke-width": "2"
|
|
455
|
+
}, [
|
|
456
|
+
i("path", {
|
|
457
|
+
d: "M18 6L6 18M6 6l12 12",
|
|
458
|
+
"stroke-linecap": "round",
|
|
459
|
+
"stroke-linejoin": "round"
|
|
460
|
+
})
|
|
461
|
+
], -1)
|
|
462
|
+
])])) : g("", !0)
|
|
463
|
+
]));
|
|
464
|
+
}
|
|
465
|
+
}), Dt = { class: "mt-4" }, es = /* @__PURE__ */ z({
|
|
466
|
+
__name: "KmDialogBody",
|
|
467
|
+
setup(e) {
|
|
468
|
+
return (t, a) => (l(), r("div", Dt, [
|
|
469
|
+
h(t.$slots, "default")
|
|
470
|
+
]));
|
|
471
|
+
}
|
|
472
|
+
}), ts = /* @__PURE__ */ z({
|
|
473
|
+
__name: "KmDialogFooter",
|
|
474
|
+
props: {
|
|
475
|
+
align: {},
|
|
476
|
+
gap: {}
|
|
477
|
+
},
|
|
478
|
+
setup(e) {
|
|
479
|
+
return (t, a) => (l(), r("div", {
|
|
480
|
+
class: s(["mt-6 flex", [
|
|
481
|
+
e.align === "start" && "justify-start",
|
|
482
|
+
e.align === "center" && "justify-center",
|
|
483
|
+
e.align === "end" && "justify-end",
|
|
484
|
+
e.gap === "sm" && "gap-2",
|
|
485
|
+
e.gap === "md" && "gap-3",
|
|
486
|
+
e.gap === "lg" && "gap-4"
|
|
487
|
+
]])
|
|
488
|
+
}, [
|
|
489
|
+
h(t.$slots, "default")
|
|
490
|
+
], 2));
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
let Nt = 0;
|
|
494
|
+
function N(e = "km") {
|
|
495
|
+
const t = Nt++;
|
|
496
|
+
return `${e}-${t}`;
|
|
497
|
+
}
|
|
498
|
+
const Wt = ["for"], Ut = {
|
|
499
|
+
key: 0,
|
|
500
|
+
class: "text-km-danger ml-0.5",
|
|
501
|
+
"aria-hidden": "true"
|
|
502
|
+
}, Ft = { class: "relative flex items-center" }, Qt = ["id", "value", "type", "placeholder", "disabled", "required", "aria-invalid", "aria-describedby"], Jt = {
|
|
503
|
+
key: 0,
|
|
504
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
505
|
+
fill: "none",
|
|
506
|
+
viewBox: "0 0 24 24",
|
|
507
|
+
"stroke-width": "1.5",
|
|
508
|
+
stroke: "currentColor",
|
|
509
|
+
class: "size-5"
|
|
510
|
+
}, Gt = {
|
|
511
|
+
key: 1,
|
|
512
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
513
|
+
fill: "none",
|
|
514
|
+
viewBox: "0 0 24 24",
|
|
515
|
+
"stroke-width": "1.5",
|
|
516
|
+
stroke: "currentColor",
|
|
517
|
+
class: "size-5"
|
|
518
|
+
}, Xt = ["id"], Yt = ["id"], _t = /* @__PURE__ */ z({
|
|
519
|
+
__name: "KmInput",
|
|
520
|
+
props: {
|
|
521
|
+
id: {},
|
|
522
|
+
modelValue: {},
|
|
523
|
+
label: {},
|
|
524
|
+
hint: {},
|
|
525
|
+
error: {},
|
|
526
|
+
placeholder: {},
|
|
527
|
+
type: { default: "text" },
|
|
528
|
+
disabled: { type: Boolean, default: !1 },
|
|
529
|
+
required: { type: Boolean, default: !1 }
|
|
530
|
+
},
|
|
531
|
+
emits: ["update:modelValue"],
|
|
532
|
+
setup(e, { emit: t }) {
|
|
533
|
+
const a = e, n = t, u = N("km-input"), d = m(() => a.id || u), c = _(), p = m(() => {
|
|
534
|
+
if (a.error) return `${d.value}-error`;
|
|
535
|
+
if (a.hint) return `${d.value}-hint`;
|
|
536
|
+
}), f = E(!1), b = m(() => a.type === "password" ? f.value ? "text" : "password" : a.type), M = () => {
|
|
537
|
+
f.value = !f.value;
|
|
538
|
+
};
|
|
539
|
+
return (w, v) => (l(), r("label", {
|
|
540
|
+
class: s(o(c).root()),
|
|
541
|
+
for: d.value
|
|
542
|
+
}, [
|
|
543
|
+
e.label ? (l(), r("span", {
|
|
544
|
+
key: 0,
|
|
545
|
+
class: s(o(c).label())
|
|
546
|
+
}, [
|
|
547
|
+
j(y(e.label) + " ", 1),
|
|
548
|
+
e.required ? (l(), r("span", Ut, "*")) : g("", !0)
|
|
549
|
+
], 2)) : g("", !0),
|
|
550
|
+
i("div", Ft, [
|
|
551
|
+
i("input", {
|
|
552
|
+
id: d.value,
|
|
553
|
+
class: s([
|
|
554
|
+
o(Ct)(),
|
|
555
|
+
a.type === "password" ? "pr-10" : ""
|
|
556
|
+
]),
|
|
557
|
+
value: e.modelValue,
|
|
558
|
+
type: b.value,
|
|
559
|
+
placeholder: e.placeholder,
|
|
560
|
+
disabled: e.disabled,
|
|
561
|
+
required: e.required,
|
|
562
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
563
|
+
"aria-describedby": p.value,
|
|
564
|
+
onInput: v[0] || (v[0] = (x) => n("update:modelValue", x.target.value))
|
|
565
|
+
}, null, 42, Qt),
|
|
566
|
+
e.type === "password" ? (l(), r("button", {
|
|
567
|
+
key: 0,
|
|
568
|
+
type: "button",
|
|
569
|
+
class: "absolute right-3 text-km-muted-foreground hover:text-km-foreground focus:outline-none",
|
|
570
|
+
onClick: D(M, ["prevent"])
|
|
571
|
+
}, [
|
|
572
|
+
f.value ? (l(), r("svg", Gt, [...v[2] || (v[2] = [
|
|
573
|
+
i("path", {
|
|
574
|
+
"stroke-linecap": "round",
|
|
575
|
+
"stroke-linejoin": "round",
|
|
576
|
+
d: "M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"
|
|
577
|
+
}, null, -1)
|
|
578
|
+
])])) : (l(), r("svg", Jt, [...v[1] || (v[1] = [
|
|
579
|
+
i("path", {
|
|
580
|
+
"stroke-linecap": "round",
|
|
581
|
+
"stroke-linejoin": "round",
|
|
582
|
+
d: "M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"
|
|
583
|
+
}, null, -1)
|
|
584
|
+
])]))
|
|
585
|
+
])) : g("", !0)
|
|
586
|
+
]),
|
|
587
|
+
e.error ? (l(), r("div", {
|
|
588
|
+
key: 1,
|
|
589
|
+
id: `${d.value}-error`,
|
|
590
|
+
class: s([o(c).error(), "flex items-center gap-1 mt-0.5 animate-fadeIn"])
|
|
591
|
+
}, [
|
|
592
|
+
v[3] || (v[3] = i("svg", {
|
|
593
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
594
|
+
viewBox: "0 0 20 20",
|
|
595
|
+
fill: "currentColor",
|
|
596
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
597
|
+
}, [
|
|
598
|
+
i("path", {
|
|
599
|
+
"fill-rule": "evenodd",
|
|
600
|
+
d: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
601
|
+
"clip-rule": "evenodd"
|
|
602
|
+
})
|
|
603
|
+
], -1)),
|
|
604
|
+
i("span", null, y(e.error), 1)
|
|
605
|
+
], 10, Xt)) : e.hint ? (l(), r("span", {
|
|
606
|
+
key: 2,
|
|
607
|
+
id: `${d.value}-hint`,
|
|
608
|
+
class: s(o(c).hint())
|
|
609
|
+
}, y(e.hint), 11, Yt)) : g("", !0)
|
|
610
|
+
], 10, Wt));
|
|
611
|
+
}
|
|
612
|
+
}), ea = ["for"], ta = {
|
|
613
|
+
key: 0,
|
|
614
|
+
class: "text-km-danger ml-0.5",
|
|
615
|
+
"aria-hidden": "true"
|
|
616
|
+
}, aa = { class: "flex items-center gap-2 truncate flex-1 min-w-0 text-left" }, la = {
|
|
617
|
+
key: 0,
|
|
618
|
+
class: "flex items-center gap-2 truncate min-w-0 flex-1"
|
|
619
|
+
}, sa = { class: "truncate font-medium text-km-foreground min-w-0" }, na = {
|
|
620
|
+
key: 1,
|
|
621
|
+
class: "px-1.5 py-0.2 text-[10px] font-semibold rounded bg-slate-100 text-slate-600 border border-slate-200/60 shrink-0"
|
|
622
|
+
}, oa = {
|
|
623
|
+
key: 1,
|
|
624
|
+
class: "text-km-muted-foreground truncate min-w-0"
|
|
625
|
+
}, ra = { class: "flex items-center gap-1.5 shrink-0 ml-1" }, ia = {
|
|
626
|
+
key: 0,
|
|
627
|
+
class: "p-1 border-b border-slate-100 mb-1"
|
|
628
|
+
}, da = { class: "relative flex items-center" }, ua = ["placeholder"], ca = {
|
|
629
|
+
key: 0,
|
|
630
|
+
class: "px-3 py-4 text-center text-xs text-slate-400 select-none"
|
|
631
|
+
}, fa = { class: "flex items-center gap-2 truncate" }, ma = { class: "flex flex-col text-left truncate" }, va = {
|
|
632
|
+
key: 0,
|
|
633
|
+
class: "text-[10px] text-slate-400 font-normal truncate"
|
|
634
|
+
}, ha = {
|
|
635
|
+
key: 1,
|
|
636
|
+
class: "ml-auto px-1.5 py-0.2 text-[10px] font-semibold rounded bg-slate-100 text-slate-600 border border-slate-200/60"
|
|
637
|
+
}, ga = { class: "flex items-center gap-2 truncate" }, ba = { class: "flex flex-col text-left truncate" }, pa = {
|
|
638
|
+
key: 0,
|
|
639
|
+
class: "text-[10px] text-slate-400 font-normal truncate"
|
|
640
|
+
}, ya = {
|
|
641
|
+
key: 1,
|
|
642
|
+
class: "ml-auto px-1.5 py-0.2 text-[10px] font-semibold rounded bg-slate-100 text-slate-600 border border-slate-200/60"
|
|
643
|
+
}, ka = { class: "flex items-center gap-2 truncate" }, wa = { class: "flex flex-col text-left truncate" }, xa = {
|
|
644
|
+
key: 0,
|
|
645
|
+
class: "text-[10px] text-slate-400 font-normal truncate"
|
|
646
|
+
}, $a = {
|
|
647
|
+
key: 1,
|
|
648
|
+
class: "ml-auto px-1.5 py-0.2 text-[10px] font-semibold rounded bg-slate-100 text-slate-600 border border-slate-200/60"
|
|
649
|
+
}, Ca = ["id"], Ba = ["id"], za = /* @__PURE__ */ z({
|
|
650
|
+
__name: "KmSelect",
|
|
651
|
+
props: {
|
|
652
|
+
id: {},
|
|
653
|
+
name: {},
|
|
654
|
+
modelValue: {},
|
|
655
|
+
options: {},
|
|
656
|
+
label: {},
|
|
657
|
+
hint: {},
|
|
658
|
+
error: {},
|
|
659
|
+
placeholder: {},
|
|
660
|
+
disabled: { type: Boolean, default: !1 },
|
|
661
|
+
required: { type: Boolean, default: !1 },
|
|
662
|
+
size: { default: "md" },
|
|
663
|
+
variant: { default: "default" },
|
|
664
|
+
searchable: { type: Boolean, default: !1 },
|
|
665
|
+
searchPlaceholder: { default: "Buscar..." },
|
|
666
|
+
clearable: { type: Boolean, default: !1 },
|
|
667
|
+
portal: { type: Boolean, default: !0 },
|
|
668
|
+
to: {},
|
|
669
|
+
side: { default: "bottom" },
|
|
670
|
+
align: { default: "start" },
|
|
671
|
+
sideOffset: { default: 6 },
|
|
672
|
+
tabindex: {},
|
|
673
|
+
autofocus: { type: Boolean },
|
|
674
|
+
triggerClass: {},
|
|
675
|
+
contentClass: {},
|
|
676
|
+
itemClass: {}
|
|
677
|
+
},
|
|
678
|
+
emits: ["update:modelValue", "change", "clear"],
|
|
679
|
+
setup(e, { expose: t, emit: a }) {
|
|
680
|
+
const n = e, u = a, d = E(null), c = N("km-select"), p = m(() => n.id || c), f = _(), b = m(() => {
|
|
681
|
+
if (n.error) return `${p.value}-error`;
|
|
682
|
+
if (n.hint) return `${p.value}-hint`;
|
|
683
|
+
}), M = m(() => !n.options || !Array.isArray(n.options) ? [] : n.options.map((K) => typeof K == "object" && K !== null && "value" in K ? K : {
|
|
684
|
+
label: String(K),
|
|
685
|
+
value: K
|
|
686
|
+
})), w = E(""), v = m(() => {
|
|
687
|
+
if (!n.searchable || !w.value.trim())
|
|
688
|
+
return M.value;
|
|
689
|
+
const K = w.value.toLowerCase().trim();
|
|
690
|
+
return M.value.filter((V) => {
|
|
691
|
+
const C = V.label.toLowerCase().includes(K), W = V.description ? V.description.toLowerCase().includes(K) : !1;
|
|
692
|
+
return C || W;
|
|
693
|
+
});
|
|
694
|
+
}), x = m(() => {
|
|
695
|
+
const K = {}, V = [];
|
|
696
|
+
for (const C of v.value)
|
|
697
|
+
C.group ? (K[C.group] || (K[C.group] = []), K[C.group].push(C)) : V.push(C);
|
|
698
|
+
return { groups: K, ungrouped: V, hasGroups: Object.keys(K).length > 0 };
|
|
699
|
+
}), B = m(() => n.modelValue === void 0 || n.modelValue === null || n.modelValue === "" ? "" : String(n.modelValue)), $ = m(() => {
|
|
700
|
+
if (!(n.modelValue === void 0 || n.modelValue === null || n.modelValue === ""))
|
|
701
|
+
return M.value.find((K) => String(K.value) === String(n.modelValue));
|
|
702
|
+
}), L = (K) => {
|
|
703
|
+
if (K === "") {
|
|
704
|
+
u("update:modelValue", ""), u("change", "");
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
const V = M.value.find((W) => String(W.value) === K), C = V ? V.value : K;
|
|
708
|
+
u("update:modelValue", C), u("change", C);
|
|
709
|
+
}, P = (K) => {
|
|
710
|
+
K.stopPropagation(), u("update:modelValue", ""), u("change", ""), u("clear");
|
|
711
|
+
}, A = (K) => {
|
|
712
|
+
K || (w.value = "");
|
|
713
|
+
};
|
|
714
|
+
return t({
|
|
715
|
+
focus: (K) => {
|
|
716
|
+
var C;
|
|
717
|
+
const V = ((C = d.value) == null ? void 0 : C.$el) || (typeof document < "u" ? document.getElementById(p.value) : null);
|
|
718
|
+
V && typeof V.focus == "function" && V.focus(K);
|
|
719
|
+
},
|
|
720
|
+
blur: () => {
|
|
721
|
+
var V;
|
|
722
|
+
const K = ((V = d.value) == null ? void 0 : V.$el) || (typeof document < "u" ? document.getElementById(p.value) : null);
|
|
723
|
+
K && typeof K.blur == "function" && K.blur();
|
|
724
|
+
}
|
|
725
|
+
}), (K, V) => (l(), r("div", {
|
|
726
|
+
class: s(o(f).root())
|
|
727
|
+
}, [
|
|
728
|
+
e.label ? (l(), r("label", {
|
|
729
|
+
key: 0,
|
|
730
|
+
for: p.value,
|
|
731
|
+
class: s(o(f).label())
|
|
732
|
+
}, [
|
|
733
|
+
j(y(e.label) + " ", 1),
|
|
734
|
+
e.required ? (l(), r("span", ta, "*")) : g("", !0)
|
|
735
|
+
], 10, ea)) : g("", !0),
|
|
736
|
+
T(o(Re), {
|
|
737
|
+
"model-value": B.value,
|
|
738
|
+
disabled: e.disabled,
|
|
739
|
+
required: e.required,
|
|
740
|
+
name: e.name,
|
|
741
|
+
"onUpdate:modelValue": L,
|
|
742
|
+
"onUpdate:open": A
|
|
743
|
+
}, {
|
|
744
|
+
default: k(() => [
|
|
745
|
+
T(o(Oe), {
|
|
746
|
+
id: p.value,
|
|
747
|
+
ref_key: "triggerRef",
|
|
748
|
+
ref: d,
|
|
749
|
+
tabindex: e.tabindex !== void 0 ? Number(e.tabindex) : 0,
|
|
750
|
+
autofocus: e.autofocus,
|
|
751
|
+
class: s([
|
|
752
|
+
o(Bt)({ size: e.size, variant: e.variant, error: !!e.error }),
|
|
753
|
+
e.triggerClass
|
|
754
|
+
]),
|
|
755
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
756
|
+
"aria-describedby": b.value
|
|
757
|
+
}, {
|
|
758
|
+
default: k(() => [
|
|
759
|
+
i("div", aa, [
|
|
760
|
+
h(K.$slots, "prefix"),
|
|
761
|
+
h(K.$slots, "trigger", {
|
|
762
|
+
selectedOption: $.value,
|
|
763
|
+
placeholder: e.placeholder
|
|
764
|
+
}, () => [
|
|
765
|
+
$.value ? (l(), r("div", la, [
|
|
766
|
+
$.value.icon && typeof $.value.icon == "object" ? (l(), S(R($.value.icon), {
|
|
767
|
+
key: 0,
|
|
768
|
+
class: "w-4 h-4 shrink-0 text-slate-500"
|
|
769
|
+
})) : g("", !0),
|
|
770
|
+
i("span", sa, y($.value.label), 1),
|
|
771
|
+
$.value.badge ? (l(), r("span", na, y($.value.badge), 1)) : g("", !0)
|
|
772
|
+
])) : (l(), r("span", oa, y(e.placeholder || "Seleccionar..."), 1))
|
|
773
|
+
])
|
|
774
|
+
]),
|
|
775
|
+
i("div", ra, [
|
|
776
|
+
e.clearable && e.modelValue && !e.disabled ? (l(), r("button", {
|
|
777
|
+
key: 0,
|
|
778
|
+
type: "button",
|
|
779
|
+
tabindex: "-1",
|
|
780
|
+
class: "p-0.5 text-slate-400 hover:text-slate-600 rounded focus:outline-none transition-colors cursor-pointer",
|
|
781
|
+
onClick: P
|
|
782
|
+
}, [...V[2] || (V[2] = [
|
|
783
|
+
i("svg", {
|
|
784
|
+
class: "w-3.5 h-3.5",
|
|
785
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
786
|
+
viewBox: "0 0 20 20",
|
|
787
|
+
fill: "currentColor"
|
|
788
|
+
}, [
|
|
789
|
+
i("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
|
|
790
|
+
], -1)
|
|
791
|
+
])])) : g("", !0),
|
|
792
|
+
T(o(qe), { "as-child": "" }, {
|
|
793
|
+
default: k(() => [
|
|
794
|
+
h(K.$slots, "icon", {}, () => [
|
|
795
|
+
V[3] || (V[3] = i("svg", {
|
|
796
|
+
class: "w-4 h-4 text-slate-400 group-hover:text-slate-600 transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
797
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
798
|
+
viewBox: "0 0 20 20",
|
|
799
|
+
fill: "currentColor"
|
|
800
|
+
}, [
|
|
801
|
+
i("path", {
|
|
802
|
+
"fill-rule": "evenodd",
|
|
803
|
+
d: "M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",
|
|
804
|
+
"clip-rule": "evenodd"
|
|
805
|
+
})
|
|
806
|
+
], -1))
|
|
807
|
+
])
|
|
808
|
+
]),
|
|
809
|
+
_: 3
|
|
810
|
+
})
|
|
811
|
+
])
|
|
812
|
+
]),
|
|
813
|
+
_: 3
|
|
814
|
+
}, 8, ["id", "tabindex", "autofocus", "class", "aria-invalid", "aria-describedby"]),
|
|
815
|
+
T(o(Ee), {
|
|
816
|
+
to: e.to,
|
|
817
|
+
disabled: !e.portal
|
|
818
|
+
}, {
|
|
819
|
+
default: k(() => [
|
|
820
|
+
T(o(De), {
|
|
821
|
+
side: e.side,
|
|
822
|
+
align: e.align,
|
|
823
|
+
"side-offset": e.sideOffset,
|
|
824
|
+
position: "popper",
|
|
825
|
+
class: s([
|
|
826
|
+
"z-[9999] min-w-[var(--reka-select-trigger-width)] max-h-72 overflow-hidden rounded-xl bg-white border border-slate-200/90 shadow-xl shadow-slate-900/10 p-1 text-slate-800 backdrop-blur-md outline-none select-none",
|
|
827
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
828
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
829
|
+
e.contentClass
|
|
830
|
+
])
|
|
831
|
+
}, {
|
|
832
|
+
default: k(() => [
|
|
833
|
+
T(o(Ne), { class: "flex items-center justify-center py-1 text-slate-400 hover:text-slate-600 cursor-pointer" }, {
|
|
834
|
+
default: k(() => [...V[4] || (V[4] = [
|
|
835
|
+
i("svg", {
|
|
836
|
+
class: "w-4 h-4",
|
|
837
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
838
|
+
viewBox: "0 0 20 20",
|
|
839
|
+
fill: "currentColor"
|
|
840
|
+
}, [
|
|
841
|
+
i("path", {
|
|
842
|
+
"fill-rule": "evenodd",
|
|
843
|
+
d: "M14.77 12.79a.75.75 0 0 1-1.06-.02L10 8.832 6.29 12.77a.75.75 0 1 1-1.08-1.04l4.25-4.5a.75.75 0 0 1 1.08 0l4.25 4.5a.75.75 0 0 1-.02 1.06Z",
|
|
844
|
+
"clip-rule": "evenodd"
|
|
845
|
+
})
|
|
846
|
+
], -1)
|
|
847
|
+
])]),
|
|
848
|
+
_: 1
|
|
849
|
+
}),
|
|
850
|
+
e.searchable ? (l(), r("div", ia, [
|
|
851
|
+
i("div", da, [
|
|
852
|
+
V[5] || (V[5] = i("svg", {
|
|
853
|
+
class: "w-3.5 h-3.5 absolute left-2.5 text-slate-400 pointer-events-none",
|
|
854
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
855
|
+
viewBox: "0 0 20 20",
|
|
856
|
+
fill: "currentColor"
|
|
857
|
+
}, [
|
|
858
|
+
i("path", {
|
|
859
|
+
"fill-rule": "evenodd",
|
|
860
|
+
d: "M9 3.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11ZM2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Z",
|
|
861
|
+
"clip-rule": "evenodd"
|
|
862
|
+
})
|
|
863
|
+
], -1)),
|
|
864
|
+
ne(i("input", {
|
|
865
|
+
"onUpdate:modelValue": V[0] || (V[0] = (C) => w.value = C),
|
|
866
|
+
type: "text",
|
|
867
|
+
placeholder: e.searchPlaceholder,
|
|
868
|
+
class: "w-full pl-8 pr-2.5 py-1.5 text-xs text-slate-800 bg-slate-50 border border-slate-200 rounded-lg focus:outline-none focus:border-km-primary focus:bg-white",
|
|
869
|
+
onKeydown: V[1] || (V[1] = D(() => {
|
|
870
|
+
}, ["stop"]))
|
|
871
|
+
}, null, 40, ua), [
|
|
872
|
+
[ge, w.value]
|
|
873
|
+
])
|
|
874
|
+
])
|
|
875
|
+
])) : g("", !0),
|
|
876
|
+
T(o(We), { class: "p-0.5 space-y-0.5 max-h-60 overflow-y-auto" }, {
|
|
877
|
+
default: k(() => [
|
|
878
|
+
v.value.length === 0 ? (l(), r("div", ca, [
|
|
879
|
+
h(K.$slots, "empty", {}, () => [
|
|
880
|
+
V[6] || (V[6] = j("No se encontraron opciones", -1))
|
|
881
|
+
])
|
|
882
|
+
])) : g("", !0),
|
|
883
|
+
x.value.hasGroups ? (l(), r(H, { key: 1 }, [
|
|
884
|
+
(l(!0), r(H, null, q(x.value.ungrouped, (C) => (l(), S(o(ee), {
|
|
885
|
+
key: String(C.value),
|
|
886
|
+
value: String(C.value),
|
|
887
|
+
disabled: C.disabled,
|
|
888
|
+
class: s([
|
|
889
|
+
"relative flex items-center justify-between gap-2 select-none rounded-lg px-2.5 py-2 text-xs font-medium text-slate-700 outline-none transition-colors cursor-pointer",
|
|
890
|
+
"data-[highlighted]:bg-slate-100 data-[highlighted]:text-slate-900",
|
|
891
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
892
|
+
"data-[state=checked]:text-km-primary data-[state=checked]:font-semibold data-[state=checked]:bg-km-primary-light/40",
|
|
893
|
+
e.itemClass
|
|
894
|
+
])
|
|
895
|
+
}, {
|
|
896
|
+
default: k(() => [
|
|
897
|
+
i("div", fa, [
|
|
898
|
+
h(K.$slots, "item", {
|
|
899
|
+
option: C,
|
|
900
|
+
selected: String(C.value) === B.value
|
|
901
|
+
}, () => [
|
|
902
|
+
C.icon && typeof C.icon == "object" ? (l(), S(R(C.icon), {
|
|
903
|
+
key: 0,
|
|
904
|
+
class: "w-4 h-4 shrink-0 text-slate-400"
|
|
905
|
+
})) : g("", !0),
|
|
906
|
+
i("div", ma, [
|
|
907
|
+
T(o(te), { class: "truncate" }, {
|
|
908
|
+
default: k(() => [
|
|
909
|
+
j(y(C.label), 1)
|
|
910
|
+
]),
|
|
911
|
+
_: 2
|
|
912
|
+
}, 1024),
|
|
913
|
+
C.description ? (l(), r("span", va, y(C.description), 1)) : g("", !0)
|
|
914
|
+
]),
|
|
915
|
+
C.badge ? (l(), r("span", ha, y(C.badge), 1)) : g("", !0)
|
|
916
|
+
])
|
|
917
|
+
]),
|
|
918
|
+
T(o(ae), { class: "shrink-0 flex items-center justify-center ml-2" }, {
|
|
919
|
+
default: k(() => [...V[7] || (V[7] = [
|
|
920
|
+
i("svg", {
|
|
921
|
+
class: "w-4 h-4 text-km-primary",
|
|
922
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
923
|
+
viewBox: "0 0 20 20",
|
|
924
|
+
fill: "currentColor"
|
|
925
|
+
}, [
|
|
926
|
+
i("path", {
|
|
927
|
+
"fill-rule": "evenodd",
|
|
928
|
+
d: "M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",
|
|
929
|
+
"clip-rule": "evenodd"
|
|
930
|
+
})
|
|
931
|
+
], -1)
|
|
932
|
+
])]),
|
|
933
|
+
_: 1
|
|
934
|
+
})
|
|
935
|
+
]),
|
|
936
|
+
_: 2
|
|
937
|
+
}, 1032, ["value", "disabled", "class"]))), 128)),
|
|
938
|
+
(l(!0), r(H, null, q(x.value.groups, (C, W) => (l(), S(o(Ue), {
|
|
939
|
+
key: W,
|
|
940
|
+
class: "pt-1.5"
|
|
941
|
+
}, {
|
|
942
|
+
default: k(() => [
|
|
943
|
+
T(o(Fe), { class: "px-2.5 py-1 text-[10px] font-bold uppercase tracking-wider text-slate-400 select-none" }, {
|
|
944
|
+
default: k(() => [
|
|
945
|
+
j(y(W), 1)
|
|
946
|
+
]),
|
|
947
|
+
_: 2
|
|
948
|
+
}, 1024),
|
|
949
|
+
(l(!0), r(H, null, q(C, (Z) => (l(), S(o(ee), {
|
|
950
|
+
key: String(Z.value),
|
|
951
|
+
value: String(Z.value),
|
|
952
|
+
disabled: Z.disabled,
|
|
953
|
+
class: s([
|
|
954
|
+
"relative flex items-center justify-between gap-2 select-none rounded-lg px-2.5 py-2 text-xs font-medium text-slate-700 outline-none transition-colors cursor-pointer",
|
|
955
|
+
"data-[highlighted]:bg-slate-100 data-[highlighted]:text-slate-900",
|
|
956
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
957
|
+
"data-[state=checked]:text-km-primary data-[state=checked]:font-semibold data-[state=checked]:bg-km-primary-light/40",
|
|
958
|
+
e.itemClass
|
|
959
|
+
])
|
|
960
|
+
}, {
|
|
961
|
+
default: k(() => [
|
|
962
|
+
i("div", ga, [
|
|
963
|
+
h(K.$slots, "item", {
|
|
964
|
+
option: Z,
|
|
965
|
+
selected: String(Z.value) === B.value
|
|
966
|
+
}, () => [
|
|
967
|
+
Z.icon && typeof Z.icon == "object" ? (l(), S(R(Z.icon), {
|
|
968
|
+
key: 0,
|
|
969
|
+
class: "w-4 h-4 shrink-0 text-slate-400"
|
|
970
|
+
})) : g("", !0),
|
|
971
|
+
i("div", ba, [
|
|
972
|
+
T(o(te), { class: "truncate" }, {
|
|
973
|
+
default: k(() => [
|
|
974
|
+
j(y(Z.label), 1)
|
|
975
|
+
]),
|
|
976
|
+
_: 2
|
|
977
|
+
}, 1024),
|
|
978
|
+
Z.description ? (l(), r("span", pa, y(Z.description), 1)) : g("", !0)
|
|
979
|
+
]),
|
|
980
|
+
Z.badge ? (l(), r("span", ya, y(Z.badge), 1)) : g("", !0)
|
|
981
|
+
])
|
|
982
|
+
]),
|
|
983
|
+
T(o(ae), { class: "shrink-0 flex items-center justify-center ml-2" }, {
|
|
984
|
+
default: k(() => [...V[8] || (V[8] = [
|
|
985
|
+
i("svg", {
|
|
986
|
+
class: "w-4 h-4 text-km-primary",
|
|
987
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
988
|
+
viewBox: "0 0 20 20",
|
|
989
|
+
fill: "currentColor"
|
|
990
|
+
}, [
|
|
991
|
+
i("path", {
|
|
992
|
+
"fill-rule": "evenodd",
|
|
993
|
+
d: "M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",
|
|
994
|
+
"clip-rule": "evenodd"
|
|
995
|
+
})
|
|
996
|
+
], -1)
|
|
997
|
+
])]),
|
|
998
|
+
_: 1
|
|
999
|
+
})
|
|
1000
|
+
]),
|
|
1001
|
+
_: 2
|
|
1002
|
+
}, 1032, ["value", "disabled", "class"]))), 128))
|
|
1003
|
+
]),
|
|
1004
|
+
_: 2
|
|
1005
|
+
}, 1024))), 128))
|
|
1006
|
+
], 64)) : (l(!0), r(H, { key: 2 }, q(v.value, (C) => (l(), S(o(ee), {
|
|
1007
|
+
key: String(C.value),
|
|
1008
|
+
value: String(C.value),
|
|
1009
|
+
disabled: C.disabled,
|
|
1010
|
+
class: s([
|
|
1011
|
+
"relative flex items-center justify-between gap-2 select-none rounded-lg px-2.5 py-2 text-xs font-medium text-slate-700 outline-none transition-colors cursor-pointer",
|
|
1012
|
+
"data-[highlighted]:bg-slate-100 data-[highlighted]:text-slate-900",
|
|
1013
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-40",
|
|
1014
|
+
"data-[state=checked]:text-km-primary data-[state=checked]:font-semibold data-[state=checked]:bg-km-primary-light/40",
|
|
1015
|
+
e.itemClass
|
|
1016
|
+
])
|
|
1017
|
+
}, {
|
|
1018
|
+
default: k(() => [
|
|
1019
|
+
i("div", ka, [
|
|
1020
|
+
h(K.$slots, "item", {
|
|
1021
|
+
option: C,
|
|
1022
|
+
selected: String(C.value) === B.value
|
|
1023
|
+
}, () => [
|
|
1024
|
+
C.icon && typeof C.icon == "object" ? (l(), S(R(C.icon), {
|
|
1025
|
+
key: 0,
|
|
1026
|
+
class: "w-4 h-4 shrink-0 text-slate-400"
|
|
1027
|
+
})) : g("", !0),
|
|
1028
|
+
i("div", wa, [
|
|
1029
|
+
T(o(te), { class: "truncate" }, {
|
|
1030
|
+
default: k(() => [
|
|
1031
|
+
j(y(C.label), 1)
|
|
1032
|
+
]),
|
|
1033
|
+
_: 2
|
|
1034
|
+
}, 1024),
|
|
1035
|
+
C.description ? (l(), r("span", xa, y(C.description), 1)) : g("", !0)
|
|
1036
|
+
]),
|
|
1037
|
+
C.badge ? (l(), r("span", $a, y(C.badge), 1)) : g("", !0)
|
|
1038
|
+
])
|
|
1039
|
+
]),
|
|
1040
|
+
T(o(ae), { class: "shrink-0 flex items-center justify-center ml-2" }, {
|
|
1041
|
+
default: k(() => [...V[9] || (V[9] = [
|
|
1042
|
+
i("svg", {
|
|
1043
|
+
class: "w-4 h-4 text-km-primary",
|
|
1044
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1045
|
+
viewBox: "0 0 20 20",
|
|
1046
|
+
fill: "currentColor"
|
|
1047
|
+
}, [
|
|
1048
|
+
i("path", {
|
|
1049
|
+
"fill-rule": "evenodd",
|
|
1050
|
+
d: "M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",
|
|
1051
|
+
"clip-rule": "evenodd"
|
|
1052
|
+
})
|
|
1053
|
+
], -1)
|
|
1054
|
+
])]),
|
|
1055
|
+
_: 1
|
|
1056
|
+
})
|
|
1057
|
+
]),
|
|
1058
|
+
_: 2
|
|
1059
|
+
}, 1032, ["value", "disabled", "class"]))), 128))
|
|
1060
|
+
]),
|
|
1061
|
+
_: 3
|
|
1062
|
+
}),
|
|
1063
|
+
T(o(Qe), { class: "flex items-center justify-center py-1 text-slate-400 hover:text-slate-600 cursor-pointer" }, {
|
|
1064
|
+
default: k(() => [...V[10] || (V[10] = [
|
|
1065
|
+
i("svg", {
|
|
1066
|
+
class: "w-4 h-4",
|
|
1067
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1068
|
+
viewBox: "0 0 20 20",
|
|
1069
|
+
fill: "currentColor"
|
|
1070
|
+
}, [
|
|
1071
|
+
i("path", {
|
|
1072
|
+
"fill-rule": "evenodd",
|
|
1073
|
+
d: "M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.168l3.71-3.938a.75.75 0 1 1 1.08 1.04l-4.25 4.5a.75.75 0 0 1-1.08 0l-4.25-4.5a.75.75 0 0 1 .02-1.06Z",
|
|
1074
|
+
"clip-rule": "evenodd"
|
|
1075
|
+
})
|
|
1076
|
+
], -1)
|
|
1077
|
+
])]),
|
|
1078
|
+
_: 1
|
|
1079
|
+
})
|
|
1080
|
+
]),
|
|
1081
|
+
_: 3
|
|
1082
|
+
}, 8, ["side", "align", "side-offset", "class"])
|
|
1083
|
+
]),
|
|
1084
|
+
_: 3
|
|
1085
|
+
}, 8, ["to", "disabled"])
|
|
1086
|
+
]),
|
|
1087
|
+
_: 3
|
|
1088
|
+
}, 8, ["model-value", "disabled", "required", "name"]),
|
|
1089
|
+
e.error ? (l(), r("div", {
|
|
1090
|
+
key: 1,
|
|
1091
|
+
id: `${p.value}-error`,
|
|
1092
|
+
class: s([o(f).error(), "flex items-center gap-1 mt-0.5 animate-fadeIn"])
|
|
1093
|
+
}, [
|
|
1094
|
+
V[11] || (V[11] = i("svg", {
|
|
1095
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1096
|
+
viewBox: "0 0 20 20",
|
|
1097
|
+
fill: "currentColor",
|
|
1098
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
1099
|
+
}, [
|
|
1100
|
+
i("path", {
|
|
1101
|
+
"fill-rule": "evenodd",
|
|
1102
|
+
d: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
1103
|
+
"clip-rule": "evenodd"
|
|
1104
|
+
})
|
|
1105
|
+
], -1)),
|
|
1106
|
+
i("span", null, y(e.error), 1)
|
|
1107
|
+
], 10, Ca)) : e.hint ? (l(), r("span", {
|
|
1108
|
+
key: 2,
|
|
1109
|
+
id: `${p.value}-hint`,
|
|
1110
|
+
class: s(o(f).hint())
|
|
1111
|
+
}, y(e.hint), 11, Ba)) : g("", !0)
|
|
1112
|
+
], 2));
|
|
1113
|
+
}
|
|
1114
|
+
}), Va = /* @__PURE__ */ z({
|
|
1115
|
+
__name: "KmSpinner",
|
|
1116
|
+
props: {
|
|
1117
|
+
size: { default: "sm" },
|
|
1118
|
+
color: { default: "current" }
|
|
1119
|
+
},
|
|
1120
|
+
setup(e) {
|
|
1121
|
+
return (t, a) => (l(), r("svg", {
|
|
1122
|
+
"aria-hidden": "true",
|
|
1123
|
+
class: s(o($e)({ size: e.size, color: e.color })),
|
|
1124
|
+
viewBox: "0 0 100 101",
|
|
1125
|
+
fill: "none",
|
|
1126
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1127
|
+
}, [...a[0] || (a[0] = [
|
|
1128
|
+
i("path", {
|
|
1129
|
+
d: "M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",
|
|
1130
|
+
fill: "rgba(229, 231, 235, 0.3)"
|
|
1131
|
+
}, null, -1),
|
|
1132
|
+
i("path", {
|
|
1133
|
+
d: "M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",
|
|
1134
|
+
fill: "currentColor"
|
|
1135
|
+
}, null, -1)
|
|
1136
|
+
])], 2));
|
|
1137
|
+
}
|
|
1138
|
+
}), Ka = /* @__PURE__ */ z({
|
|
1139
|
+
__name: "KmStack",
|
|
1140
|
+
props: {
|
|
1141
|
+
as: { default: "div" },
|
|
1142
|
+
direction: { default: "column" },
|
|
1143
|
+
gap: { default: "md" },
|
|
1144
|
+
align: { default: "stretch" },
|
|
1145
|
+
justify: { default: "start" },
|
|
1146
|
+
wrap: { default: !1 }
|
|
1147
|
+
},
|
|
1148
|
+
setup(e) {
|
|
1149
|
+
const t = e, a = m(
|
|
1150
|
+
() => zt({
|
|
1151
|
+
direction: t.direction,
|
|
1152
|
+
gap: t.gap,
|
|
1153
|
+
align: t.align,
|
|
1154
|
+
justify: t.justify,
|
|
1155
|
+
wrap: t.wrap
|
|
1156
|
+
})
|
|
1157
|
+
);
|
|
1158
|
+
return (n, u) => (l(), S(R(e.as), {
|
|
1159
|
+
class: s(a.value)
|
|
1160
|
+
}, {
|
|
1161
|
+
default: k(() => [
|
|
1162
|
+
h(n.$slots, "default")
|
|
1163
|
+
]),
|
|
1164
|
+
_: 3
|
|
1165
|
+
}, 8, ["class"]));
|
|
1166
|
+
}
|
|
1167
|
+
}), Sa = ["for"], Ta = {
|
|
1168
|
+
key: 0,
|
|
1169
|
+
class: "text-km-danger ml-0.5",
|
|
1170
|
+
"aria-hidden": "true"
|
|
1171
|
+
}, Ma = ["id", "value", "placeholder", "disabled", "required", "rows", "aria-invalid", "aria-describedby"], Pa = ["id"], Aa = ["id"], La = /* @__PURE__ */ z({
|
|
1172
|
+
__name: "KmTextarea",
|
|
1173
|
+
props: {
|
|
1174
|
+
id: {},
|
|
1175
|
+
modelValue: {},
|
|
1176
|
+
label: {},
|
|
1177
|
+
hint: {},
|
|
1178
|
+
error: {},
|
|
1179
|
+
placeholder: {},
|
|
1180
|
+
disabled: { type: Boolean, default: !1 },
|
|
1181
|
+
required: { type: Boolean, default: !1 },
|
|
1182
|
+
rows: { default: 4 }
|
|
1183
|
+
},
|
|
1184
|
+
emits: ["update:modelValue"],
|
|
1185
|
+
setup(e, { emit: t }) {
|
|
1186
|
+
const a = e, n = t, u = N("km-textarea"), d = m(() => a.id || u), c = _(), p = m(() => {
|
|
1187
|
+
if (a.error) return `${d.value}-error`;
|
|
1188
|
+
if (a.hint) return `${d.value}-hint`;
|
|
1189
|
+
});
|
|
1190
|
+
return (f, b) => (l(), r("label", {
|
|
1191
|
+
class: s(o(c).root()),
|
|
1192
|
+
for: d.value
|
|
1193
|
+
}, [
|
|
1194
|
+
e.label ? (l(), r("span", {
|
|
1195
|
+
key: 0,
|
|
1196
|
+
class: s(o(c).label())
|
|
1197
|
+
}, [
|
|
1198
|
+
j(y(e.label) + " ", 1),
|
|
1199
|
+
e.required ? (l(), r("span", Ta, "*")) : g("", !0)
|
|
1200
|
+
], 2)) : g("", !0),
|
|
1201
|
+
i("textarea", {
|
|
1202
|
+
id: d.value,
|
|
1203
|
+
class: s(o(Vt)()),
|
|
1204
|
+
value: e.modelValue,
|
|
1205
|
+
placeholder: e.placeholder,
|
|
1206
|
+
disabled: e.disabled,
|
|
1207
|
+
required: e.required,
|
|
1208
|
+
rows: e.rows,
|
|
1209
|
+
"aria-invalid": e.error ? "true" : void 0,
|
|
1210
|
+
"aria-describedby": p.value,
|
|
1211
|
+
onInput: b[0] || (b[0] = (M) => n("update:modelValue", M.target.value))
|
|
1212
|
+
}, null, 42, Ma),
|
|
1213
|
+
e.error ? (l(), r("div", {
|
|
1214
|
+
key: 1,
|
|
1215
|
+
id: `${d.value}-error`,
|
|
1216
|
+
class: s([o(c).error(), "flex items-center gap-1 mt-0.5 animate-fadeIn"])
|
|
1217
|
+
}, [
|
|
1218
|
+
b[1] || (b[1] = i("svg", {
|
|
1219
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1220
|
+
viewBox: "0 0 20 20",
|
|
1221
|
+
fill: "currentColor",
|
|
1222
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
1223
|
+
}, [
|
|
1224
|
+
i("path", {
|
|
1225
|
+
"fill-rule": "evenodd",
|
|
1226
|
+
d: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
1227
|
+
"clip-rule": "evenodd"
|
|
1228
|
+
})
|
|
1229
|
+
], -1)),
|
|
1230
|
+
i("span", null, y(e.error), 1)
|
|
1231
|
+
], 10, Pa)) : e.hint ? (l(), r("span", {
|
|
1232
|
+
key: 2,
|
|
1233
|
+
id: `${d.value}-hint`,
|
|
1234
|
+
class: s(o(c).hint())
|
|
1235
|
+
}, y(e.hint), 11, Aa)) : g("", !0)
|
|
1236
|
+
], 10, Sa));
|
|
1237
|
+
}
|
|
1238
|
+
}), Ia = { key: 0 }, ja = ["cx", "cy", "stroke-dasharray"], Za = ["cx", "cy", "stroke-dasharray"], Ha = ["onClick"], Ra = {
|
|
1239
|
+
key: 1,
|
|
1240
|
+
class: "flex flex-row items-center justify-between w-full gap-4"
|
|
1241
|
+
}, Oa = ["onClick"], qa = {
|
|
1242
|
+
key: 0,
|
|
1243
|
+
width: "20",
|
|
1244
|
+
height: "20",
|
|
1245
|
+
viewBox: "0 0 24 24",
|
|
1246
|
+
fill: "none",
|
|
1247
|
+
stroke: "currentColor",
|
|
1248
|
+
"stroke-width": "3",
|
|
1249
|
+
"stroke-linecap": "round",
|
|
1250
|
+
"stroke-linejoin": "round",
|
|
1251
|
+
class: "w-5 h-5"
|
|
1252
|
+
}, Ea = {
|
|
1253
|
+
key: 1,
|
|
1254
|
+
class: "text-sm font-bold"
|
|
1255
|
+
}, Da = { class: "flex flex-col" }, Na = {
|
|
1256
|
+
key: 0,
|
|
1257
|
+
class: "text-xs text-km-muted-foreground whitespace-nowrap max-w-[150px] truncate"
|
|
1258
|
+
}, Wa = ["onClick"], Ua = {
|
|
1259
|
+
key: 0,
|
|
1260
|
+
width: "20",
|
|
1261
|
+
height: "20",
|
|
1262
|
+
viewBox: "0 0 24 24",
|
|
1263
|
+
fill: "none",
|
|
1264
|
+
stroke: "currentColor",
|
|
1265
|
+
"stroke-width": "3",
|
|
1266
|
+
"stroke-linecap": "round",
|
|
1267
|
+
"stroke-linejoin": "round",
|
|
1268
|
+
class: "w-5 h-5"
|
|
1269
|
+
}, Fa = {
|
|
1270
|
+
key: 1,
|
|
1271
|
+
class: "text-sm font-bold"
|
|
1272
|
+
}, Q = 20, le = 5, se = 7, as = /* @__PURE__ */ z({
|
|
1273
|
+
__name: "KmStepper",
|
|
1274
|
+
props: {
|
|
1275
|
+
steps: {},
|
|
1276
|
+
currentStep: {},
|
|
1277
|
+
orientation: { default: "vertical" },
|
|
1278
|
+
mode: { default: "auto" },
|
|
1279
|
+
mobileLayout: { default: "circular" },
|
|
1280
|
+
mobileLabel: { default: "" }
|
|
1281
|
+
},
|
|
1282
|
+
emits: ["step-click", "update:currentStep"],
|
|
1283
|
+
setup(e, { emit: t }) {
|
|
1284
|
+
const a = e, n = t;
|
|
1285
|
+
function u($) {
|
|
1286
|
+
n("step-click", $ + 1), n("update:currentStep", $ + 1);
|
|
1287
|
+
}
|
|
1288
|
+
const d = E(!1), c = E(null);
|
|
1289
|
+
fe(() => {
|
|
1290
|
+
if (a.mode === "auto") {
|
|
1291
|
+
d.value = window.innerWidth < 640;
|
|
1292
|
+
const $ = () => {
|
|
1293
|
+
d.value = window.innerWidth < 640;
|
|
1294
|
+
};
|
|
1295
|
+
window.addEventListener("resize", $), be(() => {
|
|
1296
|
+
window.removeEventListener("resize", $);
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
const p = m(() => a.mode === "mobile" ? !0 : a.mode === "desktop" ? !1 : d.value), f = 2 * Math.PI * Q, b = (Q + le) * 2, M = m(() => {
|
|
1301
|
+
const $ = a.steps.length;
|
|
1302
|
+
return (f - $ * se) / $;
|
|
1303
|
+
}), w = m(() => {
|
|
1304
|
+
const $ = Math.min(Math.max(a.currentStep, 1), a.steps.length);
|
|
1305
|
+
return Array.from(
|
|
1306
|
+
{ length: $ },
|
|
1307
|
+
(L, P) => `${M.value} ${P < $ - 1 ? se : f}`
|
|
1308
|
+
).join(" ");
|
|
1309
|
+
}), v = m(() => {
|
|
1310
|
+
var L;
|
|
1311
|
+
const $ = Math.min(Math.max(a.currentStep - 1, 0), a.steps.length - 1);
|
|
1312
|
+
return ((L = a.steps[$]) == null ? void 0 : L.title) || "";
|
|
1313
|
+
}), x = m(() => a.mobileLabel ? a.mobileLabel : `Paso ${a.currentStep} de ${a.steps.length}`);
|
|
1314
|
+
function B($) {
|
|
1315
|
+
const L = $ + 1;
|
|
1316
|
+
return L < a.currentStep ? "completed" : L === a.currentStep ? "active" : "upcoming";
|
|
1317
|
+
}
|
|
1318
|
+
return ($, L) => (l(), r("div", {
|
|
1319
|
+
ref_key: "containerRef",
|
|
1320
|
+
ref: c,
|
|
1321
|
+
class: "w-full"
|
|
1322
|
+
}, [
|
|
1323
|
+
p.value ? (l(), r("div", Ia, [
|
|
1324
|
+
e.mobileLayout === "circular" ? (l(), r("div", {
|
|
1325
|
+
key: 0,
|
|
1326
|
+
class: s(o(I)().mobileRoot())
|
|
1327
|
+
}, [
|
|
1328
|
+
i("div", {
|
|
1329
|
+
class: s(o(I)().mobileInfo())
|
|
1330
|
+
}, [
|
|
1331
|
+
i("span", {
|
|
1332
|
+
class: s(o(I)().mobileTitle())
|
|
1333
|
+
}, y(v.value), 3),
|
|
1334
|
+
i("span", {
|
|
1335
|
+
class: s(o(I)().mobileLabel())
|
|
1336
|
+
}, y(x.value), 3)
|
|
1337
|
+
], 2),
|
|
1338
|
+
i("div", {
|
|
1339
|
+
class: s(o(I)().mobileProgress()),
|
|
1340
|
+
style: J({ width: `${b}px`, height: `${b}px` })
|
|
1341
|
+
}, [
|
|
1342
|
+
(l(), r("svg", {
|
|
1343
|
+
width: b,
|
|
1344
|
+
height: b,
|
|
1345
|
+
class: "-rotate-90"
|
|
1346
|
+
}, [
|
|
1347
|
+
i("circle", {
|
|
1348
|
+
cx: b / 2,
|
|
1349
|
+
cy: b / 2,
|
|
1350
|
+
r: Q,
|
|
1351
|
+
fill: "none",
|
|
1352
|
+
class: "stroke-km-border",
|
|
1353
|
+
"stroke-width": le,
|
|
1354
|
+
"stroke-dasharray": `${M.value} ${se}`,
|
|
1355
|
+
"stroke-linecap": "square"
|
|
1356
|
+
}, null, 8, ja),
|
|
1357
|
+
i("circle", {
|
|
1358
|
+
cx: b / 2,
|
|
1359
|
+
cy: b / 2,
|
|
1360
|
+
r: Q,
|
|
1361
|
+
fill: "none",
|
|
1362
|
+
class: "stroke-km-primary",
|
|
1363
|
+
"stroke-width": le,
|
|
1364
|
+
"stroke-dasharray": w.value,
|
|
1365
|
+
"stroke-linecap": "square"
|
|
1366
|
+
}, null, 8, Za)
|
|
1367
|
+
])),
|
|
1368
|
+
i("span", {
|
|
1369
|
+
class: s(o(I)().mobilePercentText())
|
|
1370
|
+
}, y(e.currentStep) + "/" + y(e.steps.length), 3)
|
|
1371
|
+
], 6)
|
|
1372
|
+
], 2)) : e.mobileLayout === "horizontal" ? (l(), r("div", {
|
|
1373
|
+
key: 1,
|
|
1374
|
+
class: s(o(I)().mobileHorizRoot())
|
|
1375
|
+
}, [
|
|
1376
|
+
i("div", {
|
|
1377
|
+
class: s(o(I)().mobileHorizHeader())
|
|
1378
|
+
}, [
|
|
1379
|
+
i("span", {
|
|
1380
|
+
class: s(o(I)().mobileHorizTitle())
|
|
1381
|
+
}, y(v.value), 3),
|
|
1382
|
+
i("span", {
|
|
1383
|
+
class: s(o(I)().mobileHorizSteps())
|
|
1384
|
+
}, y(e.currentStep) + "/" + y(e.steps.length), 3)
|
|
1385
|
+
], 2),
|
|
1386
|
+
i("div", {
|
|
1387
|
+
class: s(o(I)().mobileHorizTrack())
|
|
1388
|
+
}, [
|
|
1389
|
+
(l(!0), r(H, null, q(e.steps.length, (P) => (l(), r("div", {
|
|
1390
|
+
key: P,
|
|
1391
|
+
class: s(["cursor-pointer transition-all", [
|
|
1392
|
+
o(I)().mobileHorizBar(),
|
|
1393
|
+
P <= e.currentStep ? "bg-km-primary" : "bg-km-border"
|
|
1394
|
+
]]),
|
|
1395
|
+
onClick: (A) => u(P - 1)
|
|
1396
|
+
}, null, 10, Ha))), 128))
|
|
1397
|
+
], 2)
|
|
1398
|
+
], 2)) : g("", !0)
|
|
1399
|
+
])) : e.orientation === "horizontal" ? (l(), r("ol", Ra, [
|
|
1400
|
+
(l(!0), r(H, null, q(e.steps, (P, A) => (l(), r("li", {
|
|
1401
|
+
key: P.title,
|
|
1402
|
+
class: "flex items-center flex-1 last:flex-none gap-4"
|
|
1403
|
+
}, [
|
|
1404
|
+
i("div", {
|
|
1405
|
+
class: "flex items-center gap-3 shrink-0 cursor-pointer select-none transition-all group hover:opacity-85",
|
|
1406
|
+
onClick: (re) => u(A)
|
|
1407
|
+
}, [
|
|
1408
|
+
i("div", {
|
|
1409
|
+
class: s(o(I)({ state: B(A) }).stepCircle())
|
|
1410
|
+
}, [
|
|
1411
|
+
B(A) === "completed" ? (l(), r("svg", qa, [...L[0] || (L[0] = [
|
|
1412
|
+
i("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
1413
|
+
])])) : (l(), r("span", Ea, y(A + 1), 1))
|
|
1414
|
+
], 2),
|
|
1415
|
+
i("div", Da, [
|
|
1416
|
+
i("span", {
|
|
1417
|
+
class: s([o(I)({ state: B(A) }).title(), "text-sm font-bold whitespace-nowrap group-hover:text-km-primary transition-colors"])
|
|
1418
|
+
}, y(P.title), 3),
|
|
1419
|
+
P.description ? (l(), r("span", Na, y(P.description), 1)) : g("", !0)
|
|
1420
|
+
])
|
|
1421
|
+
], 8, Oa),
|
|
1422
|
+
A < e.steps.length - 1 ? (l(), r("div", {
|
|
1423
|
+
key: 0,
|
|
1424
|
+
class: s(["flex-1 h-[3px] rounded-full transition-all duration-300", [
|
|
1425
|
+
B(A) === "completed" ? "bg-km-success" : B(A) === "active" ? "bg-gradient-to-r from-km-primary to-km-border" : "bg-km-border"
|
|
1426
|
+
]])
|
|
1427
|
+
}, null, 2)) : g("", !0)
|
|
1428
|
+
]))), 128))
|
|
1429
|
+
])) : (l(), r("ol", {
|
|
1430
|
+
key: 2,
|
|
1431
|
+
class: s(o(I)({ orientation: "vertical" }).root())
|
|
1432
|
+
}, [
|
|
1433
|
+
(l(!0), r(H, null, q(e.steps, (P, A) => (l(), r("li", {
|
|
1434
|
+
key: P.title,
|
|
1435
|
+
class: s(o(I)().step())
|
|
1436
|
+
}, [
|
|
1437
|
+
i("div", {
|
|
1438
|
+
class: s([o(I)().stepContainer(), "cursor-pointer select-none transition-all hover:opacity-85"]),
|
|
1439
|
+
onClick: (re) => u(A)
|
|
1440
|
+
}, [
|
|
1441
|
+
i("div", {
|
|
1442
|
+
class: s(o(I)({ state: B(A) }).stepCircle())
|
|
1443
|
+
}, [
|
|
1444
|
+
B(A) === "completed" ? (l(), r("svg", Ua, [...L[1] || (L[1] = [
|
|
1445
|
+
i("polyline", { points: "20 6 9 17 4 12" }, null, -1)
|
|
1446
|
+
])])) : (l(), r("span", Fa, y(A + 1), 1))
|
|
1447
|
+
], 2),
|
|
1448
|
+
A < e.steps.length - 1 ? (l(), r("div", {
|
|
1449
|
+
key: 0,
|
|
1450
|
+
class: s([
|
|
1451
|
+
o(I)({ state: B(A), orientation: "vertical" }).connector(),
|
|
1452
|
+
B(A) === "active" ? "bg-gradient-to-b from-km-primary to-km-border" : ""
|
|
1453
|
+
])
|
|
1454
|
+
}, null, 2)) : g("", !0)
|
|
1455
|
+
], 10, Wa),
|
|
1456
|
+
i("div", {
|
|
1457
|
+
class: s(o(I)().content())
|
|
1458
|
+
}, [
|
|
1459
|
+
i("span", {
|
|
1460
|
+
class: s(o(I)({ state: B(A) }).title())
|
|
1461
|
+
}, y(P.title), 3),
|
|
1462
|
+
P.description ? (l(), r("span", {
|
|
1463
|
+
key: 0,
|
|
1464
|
+
class: s(o(I)().description())
|
|
1465
|
+
}, y(P.description), 3)) : g("", !0)
|
|
1466
|
+
], 2)
|
|
1467
|
+
], 2))), 128))
|
|
1468
|
+
], 2))
|
|
1469
|
+
], 512));
|
|
1470
|
+
}
|
|
1471
|
+
}), Qa = ["aria-checked", "aria-disabled", "onKeydown"], ls = /* @__PURE__ */ z({
|
|
1472
|
+
__name: "KmToggleSwitch",
|
|
1473
|
+
props: {
|
|
1474
|
+
modelValue: { type: Boolean, default: !1 },
|
|
1475
|
+
label: { default: "" },
|
|
1476
|
+
size: { default: "medium" },
|
|
1477
|
+
disabled: { type: Boolean, default: !1 }
|
|
1478
|
+
},
|
|
1479
|
+
emits: ["update:modelValue", "change"],
|
|
1480
|
+
setup(e, { emit: t }) {
|
|
1481
|
+
const a = e, n = t, u = m({
|
|
1482
|
+
get: () => a.modelValue,
|
|
1483
|
+
set: (p) => {
|
|
1484
|
+
a.disabled || (n("update:modelValue", p), n("change", p));
|
|
1485
|
+
}
|
|
1486
|
+
});
|
|
1487
|
+
function d() {
|
|
1488
|
+
a.disabled || (u.value = !u.value);
|
|
1489
|
+
}
|
|
1490
|
+
const c = m(
|
|
1491
|
+
() => Kt({
|
|
1492
|
+
size: a.size,
|
|
1493
|
+
checked: u.value,
|
|
1494
|
+
disabled: a.disabled
|
|
1495
|
+
})
|
|
1496
|
+
);
|
|
1497
|
+
return (p, f) => (l(), r("div", {
|
|
1498
|
+
class: s(c.value.root())
|
|
1499
|
+
}, [
|
|
1500
|
+
e.label ? (l(), r("span", {
|
|
1501
|
+
key: 0,
|
|
1502
|
+
class: s(c.value.label()),
|
|
1503
|
+
onClick: d
|
|
1504
|
+
}, y(e.label), 3)) : g("", !0),
|
|
1505
|
+
i("div", {
|
|
1506
|
+
class: s(c.value.track()),
|
|
1507
|
+
onClick: d,
|
|
1508
|
+
role: "checkbox",
|
|
1509
|
+
"aria-checked": u.value,
|
|
1510
|
+
"aria-disabled": e.disabled,
|
|
1511
|
+
tabindex: "0",
|
|
1512
|
+
onKeydown: U(D(d, ["prevent"]), ["space"])
|
|
1513
|
+
}, [
|
|
1514
|
+
i("div", {
|
|
1515
|
+
class: s(c.value.thumb())
|
|
1516
|
+
}, null, 2)
|
|
1517
|
+
], 42, Qa)
|
|
1518
|
+
], 2));
|
|
1519
|
+
}
|
|
1520
|
+
}), Ja = /* @__PURE__ */ z({
|
|
1521
|
+
__name: "KmScrollArea",
|
|
1522
|
+
props: {
|
|
1523
|
+
type: { default: "auto" },
|
|
1524
|
+
orientation: { default: "vertical" },
|
|
1525
|
+
maxHeight: {},
|
|
1526
|
+
height: {},
|
|
1527
|
+
maxWidth: {},
|
|
1528
|
+
viewportClass: {},
|
|
1529
|
+
class: {},
|
|
1530
|
+
size: { default: "thin" }
|
|
1531
|
+
},
|
|
1532
|
+
setup(e) {
|
|
1533
|
+
const t = e, a = m(() => {
|
|
1534
|
+
if (t.maxHeight)
|
|
1535
|
+
return typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight;
|
|
1536
|
+
}), n = m(() => {
|
|
1537
|
+
if (t.height)
|
|
1538
|
+
return typeof t.height == "number" ? `${t.height}px` : t.height;
|
|
1539
|
+
}), u = m(() => {
|
|
1540
|
+
if (t.maxWidth)
|
|
1541
|
+
return typeof t.maxWidth == "number" ? `${t.maxWidth}px` : t.maxWidth;
|
|
1542
|
+
}), d = m(() => {
|
|
1543
|
+
const f = {};
|
|
1544
|
+
return a.value && (f.maxHeight = a.value), n.value && (f.height = n.value), u.value && (f.maxWidth = u.value), f;
|
|
1545
|
+
}), c = m(() => {
|
|
1546
|
+
const f = {};
|
|
1547
|
+
return a.value && (f.maxHeight = a.value), n.value && (f.height = n.value), f;
|
|
1548
|
+
}), p = m(() => {
|
|
1549
|
+
switch (t.size) {
|
|
1550
|
+
case "thin":
|
|
1551
|
+
return {
|
|
1552
|
+
v: "w-2 data-[orientation=vertical]:w-2 p-0.5",
|
|
1553
|
+
h: "h-2 data-[orientation=horizontal]:h-2 data-[orientation=horizontal]:flex-col p-0.5"
|
|
1554
|
+
};
|
|
1555
|
+
case "wide":
|
|
1556
|
+
return {
|
|
1557
|
+
v: "w-3.5 data-[orientation=vertical]:w-3.5 p-1",
|
|
1558
|
+
h: "h-3.5 data-[orientation=horizontal]:h-3.5 data-[orientation=horizontal]:flex-col p-1"
|
|
1559
|
+
};
|
|
1560
|
+
case "normal":
|
|
1561
|
+
default:
|
|
1562
|
+
return {
|
|
1563
|
+
v: "w-2.5 data-[orientation=vertical]:w-2.5 p-0.5",
|
|
1564
|
+
h: "h-2.5 data-[orientation=horizontal]:h-2.5 data-[orientation=horizontal]:flex-col p-0.5"
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
});
|
|
1568
|
+
return (f, b) => (l(), S(o(Je), {
|
|
1569
|
+
type: e.type,
|
|
1570
|
+
"scroll-hide-delay": 600,
|
|
1571
|
+
class: s(["relative overflow-hidden flex flex-col", t.class]),
|
|
1572
|
+
style: J(d.value)
|
|
1573
|
+
}, {
|
|
1574
|
+
default: k(() => [
|
|
1575
|
+
T(o(Ge), {
|
|
1576
|
+
class: s(["h-full w-full max-h-[inherit] rounded-[inherit] outline-none", e.viewportClass]),
|
|
1577
|
+
style: J(c.value)
|
|
1578
|
+
}, {
|
|
1579
|
+
default: k(() => [
|
|
1580
|
+
h(f.$slots, "default")
|
|
1581
|
+
]),
|
|
1582
|
+
_: 3
|
|
1583
|
+
}, 8, ["class", "style"]),
|
|
1584
|
+
e.orientation === "vertical" || e.orientation === "both" ? (l(), S(o(de), {
|
|
1585
|
+
key: 0,
|
|
1586
|
+
orientation: "vertical",
|
|
1587
|
+
class: s(["flex select-none touch-none transition-colors duration-150 ease-out bg-transparent hover:bg-black/[0.03] dark:hover:bg-white/[0.04] z-20", p.value.v])
|
|
1588
|
+
}, {
|
|
1589
|
+
default: k(() => [
|
|
1590
|
+
T(o(ue), { class: "relative flex-1 rounded-full bg-slate-300/90 hover:bg-slate-400 active:bg-slate-500 dark:bg-slate-500/70 dark:hover:bg-slate-400 dark:active:bg-slate-300 transition-colors" })
|
|
1591
|
+
]),
|
|
1592
|
+
_: 1
|
|
1593
|
+
}, 8, ["class"])) : g("", !0),
|
|
1594
|
+
e.orientation === "horizontal" || e.orientation === "both" ? (l(), S(o(de), {
|
|
1595
|
+
key: 1,
|
|
1596
|
+
orientation: "horizontal",
|
|
1597
|
+
class: s(["flex select-none touch-none transition-colors duration-150 ease-out bg-transparent hover:bg-black/[0.03] dark:hover:bg-white/[0.04] z-20", p.value.h])
|
|
1598
|
+
}, {
|
|
1599
|
+
default: k(() => [
|
|
1600
|
+
T(o(ue), { class: "relative flex-1 rounded-full bg-slate-300/90 hover:bg-slate-400 active:bg-slate-500 dark:bg-slate-500/70 dark:hover:bg-slate-400 dark:active:bg-slate-300 transition-colors" })
|
|
1601
|
+
]),
|
|
1602
|
+
_: 1
|
|
1603
|
+
}, 8, ["class"])) : g("", !0),
|
|
1604
|
+
T(o(Xe), { class: "bg-transparent" })
|
|
1605
|
+
]),
|
|
1606
|
+
_: 3
|
|
1607
|
+
}, 8, ["type", "class", "style"]));
|
|
1608
|
+
}
|
|
1609
|
+
}), Ga = /* @__PURE__ */ z({
|
|
1610
|
+
__name: "KmPopover",
|
|
1611
|
+
props: {
|
|
1612
|
+
trigger: { default: "click" },
|
|
1613
|
+
placement: {},
|
|
1614
|
+
side: {},
|
|
1615
|
+
align: {},
|
|
1616
|
+
sideOffset: { default: 8 },
|
|
1617
|
+
alignOffset: { default: 0 },
|
|
1618
|
+
arrow: { type: Boolean, default: !0 },
|
|
1619
|
+
arrowPadding: { default: 10 },
|
|
1620
|
+
openDelay: { default: 150 },
|
|
1621
|
+
closeDelay: { default: 200 },
|
|
1622
|
+
disabled: { type: Boolean, default: !1 },
|
|
1623
|
+
modal: { type: Boolean, default: !1 },
|
|
1624
|
+
portal: { type: Boolean, default: !0 },
|
|
1625
|
+
to: {},
|
|
1626
|
+
contentClass: {},
|
|
1627
|
+
arrowClass: {},
|
|
1628
|
+
open: { type: Boolean },
|
|
1629
|
+
defaultOpen: { type: Boolean }
|
|
1630
|
+
},
|
|
1631
|
+
emits: ["update:open"],
|
|
1632
|
+
setup(e, { emit: t }) {
|
|
1633
|
+
const a = e, n = t, u = E(a.defaultOpen ?? !1);
|
|
1634
|
+
ce(
|
|
1635
|
+
() => a.open,
|
|
1636
|
+
(b) => {
|
|
1637
|
+
b !== void 0 && (u.value = b);
|
|
1638
|
+
},
|
|
1639
|
+
{ immediate: !0 }
|
|
1640
|
+
);
|
|
1641
|
+
const d = (b) => {
|
|
1642
|
+
u.value = b, n("update:open", b);
|
|
1643
|
+
}, c = () => {
|
|
1644
|
+
d(!1);
|
|
1645
|
+
}, p = m(() => a.side ? a.side : a.placement ? a.placement.split("-")[0] : "bottom"), f = m(() => {
|
|
1646
|
+
if (a.align) return a.align;
|
|
1647
|
+
if (a.placement) {
|
|
1648
|
+
const b = a.placement.split("-");
|
|
1649
|
+
if (b[1] === "start") return "start";
|
|
1650
|
+
if (b[1] === "end") return "end";
|
|
1651
|
+
}
|
|
1652
|
+
return "center";
|
|
1653
|
+
});
|
|
1654
|
+
return (b, M) => e.trigger === "hover" ? (l(), S(o(Ye), {
|
|
1655
|
+
key: 0,
|
|
1656
|
+
open: u.value,
|
|
1657
|
+
"default-open": e.defaultOpen,
|
|
1658
|
+
"open-delay": e.openDelay,
|
|
1659
|
+
"close-delay": e.closeDelay,
|
|
1660
|
+
"onUpdate:open": d
|
|
1661
|
+
}, {
|
|
1662
|
+
default: k(() => [
|
|
1663
|
+
T(o(_e), {
|
|
1664
|
+
"as-child": "",
|
|
1665
|
+
disabled: e.disabled
|
|
1666
|
+
}, {
|
|
1667
|
+
default: k(() => [
|
|
1668
|
+
h(b.$slots, "trigger", { open: u.value })
|
|
1669
|
+
]),
|
|
1670
|
+
_: 3
|
|
1671
|
+
}, 8, ["disabled"]),
|
|
1672
|
+
T(o(et), {
|
|
1673
|
+
to: e.to,
|
|
1674
|
+
disabled: !e.portal
|
|
1675
|
+
}, {
|
|
1676
|
+
default: k(() => [
|
|
1677
|
+
T(o(tt), {
|
|
1678
|
+
side: p.value,
|
|
1679
|
+
align: f.value,
|
|
1680
|
+
"side-offset": e.sideOffset,
|
|
1681
|
+
"align-offset": e.alignOffset,
|
|
1682
|
+
"arrow-padding": e.arrowPadding,
|
|
1683
|
+
class: s([
|
|
1684
|
+
"z-[9999] rounded-2xl bg-white border border-slate-200/80 p-3 shadow-xl shadow-slate-900/10 outline-none select-none text-slate-800",
|
|
1685
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1686
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1687
|
+
"duration-150",
|
|
1688
|
+
e.contentClass
|
|
1689
|
+
])
|
|
1690
|
+
}, {
|
|
1691
|
+
default: k(() => [
|
|
1692
|
+
h(b.$slots, "content", {
|
|
1693
|
+
close: c,
|
|
1694
|
+
open: u.value
|
|
1695
|
+
}),
|
|
1696
|
+
h(b.$slots, "default", {
|
|
1697
|
+
close: c,
|
|
1698
|
+
open: u.value
|
|
1699
|
+
}),
|
|
1700
|
+
e.arrow ? (l(), S(o(at), {
|
|
1701
|
+
key: 0,
|
|
1702
|
+
class: s([
|
|
1703
|
+
"fill-white stroke-slate-200/80 stroke-1",
|
|
1704
|
+
e.arrowClass
|
|
1705
|
+
]),
|
|
1706
|
+
width: 12,
|
|
1707
|
+
height: 6
|
|
1708
|
+
}, null, 8, ["class"])) : g("", !0)
|
|
1709
|
+
]),
|
|
1710
|
+
_: 3
|
|
1711
|
+
}, 8, ["side", "align", "side-offset", "align-offset", "arrow-padding", "class"])
|
|
1712
|
+
]),
|
|
1713
|
+
_: 3
|
|
1714
|
+
}, 8, ["to", "disabled"])
|
|
1715
|
+
]),
|
|
1716
|
+
_: 3
|
|
1717
|
+
}, 8, ["open", "default-open", "open-delay", "close-delay"])) : (l(), S(o(lt), {
|
|
1718
|
+
key: 1,
|
|
1719
|
+
open: u.value,
|
|
1720
|
+
"default-open": e.defaultOpen,
|
|
1721
|
+
modal: e.modal,
|
|
1722
|
+
"onUpdate:open": d
|
|
1723
|
+
}, {
|
|
1724
|
+
default: k(() => [
|
|
1725
|
+
T(o(st), {
|
|
1726
|
+
"as-child": "",
|
|
1727
|
+
disabled: e.disabled
|
|
1728
|
+
}, {
|
|
1729
|
+
default: k(() => [
|
|
1730
|
+
h(b.$slots, "trigger", { open: u.value })
|
|
1731
|
+
]),
|
|
1732
|
+
_: 3
|
|
1733
|
+
}, 8, ["disabled"]),
|
|
1734
|
+
T(o(nt), {
|
|
1735
|
+
to: e.to,
|
|
1736
|
+
disabled: !e.portal
|
|
1737
|
+
}, {
|
|
1738
|
+
default: k(() => [
|
|
1739
|
+
T(o(ot), {
|
|
1740
|
+
side: p.value,
|
|
1741
|
+
align: f.value,
|
|
1742
|
+
"side-offset": e.sideOffset,
|
|
1743
|
+
"align-offset": e.alignOffset,
|
|
1744
|
+
"arrow-padding": e.arrowPadding,
|
|
1745
|
+
class: s([
|
|
1746
|
+
"z-[9999] rounded-2xl bg-white border border-slate-200/80 p-3 shadow-xl shadow-slate-900/10 outline-none select-none text-slate-800",
|
|
1747
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1748
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1749
|
+
"duration-150",
|
|
1750
|
+
e.contentClass
|
|
1751
|
+
])
|
|
1752
|
+
}, {
|
|
1753
|
+
default: k(() => [
|
|
1754
|
+
h(b.$slots, "content", {
|
|
1755
|
+
close: c,
|
|
1756
|
+
open: u.value
|
|
1757
|
+
}),
|
|
1758
|
+
h(b.$slots, "default", {
|
|
1759
|
+
close: c,
|
|
1760
|
+
open: u.value
|
|
1761
|
+
}),
|
|
1762
|
+
e.arrow ? (l(), S(o(rt), {
|
|
1763
|
+
key: 0,
|
|
1764
|
+
class: s([
|
|
1765
|
+
"fill-white stroke-slate-200/80 stroke-1",
|
|
1766
|
+
e.arrowClass
|
|
1767
|
+
]),
|
|
1768
|
+
width: 12,
|
|
1769
|
+
height: 6
|
|
1770
|
+
}, null, 8, ["class"])) : g("", !0)
|
|
1771
|
+
]),
|
|
1772
|
+
_: 3
|
|
1773
|
+
}, 8, ["side", "align", "side-offset", "align-offset", "arrow-padding", "class"])
|
|
1774
|
+
]),
|
|
1775
|
+
_: 3
|
|
1776
|
+
}, 8, ["to", "disabled"])
|
|
1777
|
+
]),
|
|
1778
|
+
_: 3
|
|
1779
|
+
}, 8, ["open", "default-open", "modal"]));
|
|
1780
|
+
}
|
|
1781
|
+
}), Xa = /* @__PURE__ */ z({
|
|
1782
|
+
__name: "KmHeading",
|
|
1783
|
+
props: {
|
|
1784
|
+
as: { default: "h2" },
|
|
1785
|
+
size: { default: "xl" },
|
|
1786
|
+
tone: { default: "default" },
|
|
1787
|
+
weight: {},
|
|
1788
|
+
align: { default: "left" },
|
|
1789
|
+
tracking: {},
|
|
1790
|
+
truncate: { type: Boolean, default: !1 }
|
|
1791
|
+
},
|
|
1792
|
+
setup(e) {
|
|
1793
|
+
const t = e, a = m(
|
|
1794
|
+
() => Ce({
|
|
1795
|
+
size: t.size,
|
|
1796
|
+
tone: t.tone,
|
|
1797
|
+
weight: t.weight,
|
|
1798
|
+
align: t.align,
|
|
1799
|
+
tracking: t.tracking,
|
|
1800
|
+
truncate: t.truncate
|
|
1801
|
+
})
|
|
1802
|
+
);
|
|
1803
|
+
return (n, u) => (l(), S(R(e.as), {
|
|
1804
|
+
class: s(a.value)
|
|
1805
|
+
}, {
|
|
1806
|
+
default: k(() => [
|
|
1807
|
+
h(n.$slots, "default")
|
|
1808
|
+
]),
|
|
1809
|
+
_: 3
|
|
1810
|
+
}, 8, ["class"]));
|
|
1811
|
+
}
|
|
1812
|
+
}), Ya = /* @__PURE__ */ z({
|
|
1813
|
+
__name: "KmText",
|
|
1814
|
+
props: {
|
|
1815
|
+
as: { default: "p" },
|
|
1816
|
+
size: { default: "sm" },
|
|
1817
|
+
tone: { default: "default" },
|
|
1818
|
+
weight: {},
|
|
1819
|
+
align: { default: "left" },
|
|
1820
|
+
transform: {},
|
|
1821
|
+
italic: { type: Boolean, default: !1 },
|
|
1822
|
+
underline: { type: Boolean, default: !1 },
|
|
1823
|
+
strikethrough: { type: Boolean, default: !1 },
|
|
1824
|
+
mono: { type: Boolean, default: !1 },
|
|
1825
|
+
truncate: { type: Boolean, default: !1 },
|
|
1826
|
+
lineClamp: {}
|
|
1827
|
+
},
|
|
1828
|
+
setup(e) {
|
|
1829
|
+
const t = e, a = m(
|
|
1830
|
+
() => Be({
|
|
1831
|
+
size: t.size,
|
|
1832
|
+
tone: t.tone,
|
|
1833
|
+
weight: t.weight,
|
|
1834
|
+
align: t.align,
|
|
1835
|
+
transform: t.transform,
|
|
1836
|
+
italic: t.italic,
|
|
1837
|
+
underline: t.underline,
|
|
1838
|
+
strikethrough: t.strikethrough,
|
|
1839
|
+
mono: t.mono,
|
|
1840
|
+
truncate: t.truncate,
|
|
1841
|
+
lineClamp: t.lineClamp
|
|
1842
|
+
})
|
|
1843
|
+
);
|
|
1844
|
+
return (n, u) => (l(), S(R(e.as), {
|
|
1845
|
+
class: s(a.value)
|
|
1846
|
+
}, {
|
|
1847
|
+
default: k(() => [
|
|
1848
|
+
h(n.$slots, "default")
|
|
1849
|
+
]),
|
|
1850
|
+
_: 3
|
|
1851
|
+
}, 8, ["class"]));
|
|
1852
|
+
}
|
|
1853
|
+
}), _a = ["for", "data-disabled"], el = ["id", "name", "value", "checked", "disabled", "required"], tl = ["data-state", "data-disabled", "aria-checked", "aria-disabled", "onKeydown"], al = ["data-visible"], ll = {
|
|
1854
|
+
key: 0,
|
|
1855
|
+
class: "text-km-danger ml-0.5",
|
|
1856
|
+
"aria-hidden": "true"
|
|
1857
|
+
}, sl = /* @__PURE__ */ z({
|
|
1858
|
+
__name: "KmCheckbox",
|
|
1859
|
+
props: {
|
|
1860
|
+
modelValue: { type: [Boolean, Array] },
|
|
1861
|
+
value: {},
|
|
1862
|
+
label: {},
|
|
1863
|
+
description: {},
|
|
1864
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
1865
|
+
disabled: { type: Boolean, default: !1 },
|
|
1866
|
+
required: { type: Boolean, default: !1 },
|
|
1867
|
+
name: {},
|
|
1868
|
+
id: {},
|
|
1869
|
+
size: { default: "md" },
|
|
1870
|
+
tone: { default: "primary" }
|
|
1871
|
+
},
|
|
1872
|
+
emits: ["update:modelValue", "change"],
|
|
1873
|
+
setup(e, { emit: t }) {
|
|
1874
|
+
const a = e, n = t, u = N("km-checkbox"), d = m(() => a.id || u), c = m(() => Array.isArray(a.modelValue) ? a.modelValue.includes(a.value) : !!a.modelValue), p = m(() => a.indeterminate ? "indeterminate" : c.value ? "checked" : "unchecked"), f = ze({
|
|
1875
|
+
size: a.size,
|
|
1876
|
+
tone: a.tone
|
|
1877
|
+
}), b = (w) => {
|
|
1878
|
+
if (a.disabled) return;
|
|
1879
|
+
const v = w.target;
|
|
1880
|
+
if (Array.isArray(a.modelValue)) {
|
|
1881
|
+
const x = [...a.modelValue];
|
|
1882
|
+
if (v.checked)
|
|
1883
|
+
x.includes(a.value) || x.push(a.value);
|
|
1884
|
+
else {
|
|
1885
|
+
const B = x.indexOf(a.value);
|
|
1886
|
+
B !== -1 && x.splice(B, 1);
|
|
1887
|
+
}
|
|
1888
|
+
n("update:modelValue", x);
|
|
1889
|
+
} else
|
|
1890
|
+
n("update:modelValue", v.checked);
|
|
1891
|
+
n("change", w);
|
|
1892
|
+
}, M = () => {
|
|
1893
|
+
if (a.disabled) return;
|
|
1894
|
+
const w = !c.value;
|
|
1895
|
+
if (Array.isArray(a.modelValue)) {
|
|
1896
|
+
const v = [...a.modelValue];
|
|
1897
|
+
if (w)
|
|
1898
|
+
v.includes(a.value) || v.push(a.value);
|
|
1899
|
+
else {
|
|
1900
|
+
const x = v.indexOf(a.value);
|
|
1901
|
+
x !== -1 && v.splice(x, 1);
|
|
1902
|
+
}
|
|
1903
|
+
n("update:modelValue", v);
|
|
1904
|
+
} else
|
|
1905
|
+
n("update:modelValue", w);
|
|
1906
|
+
};
|
|
1907
|
+
return (w, v) => (l(), r("label", {
|
|
1908
|
+
for: d.value,
|
|
1909
|
+
class: s(o(f).root()),
|
|
1910
|
+
"data-disabled": e.disabled ? "true" : void 0
|
|
1911
|
+
}, [
|
|
1912
|
+
i("div", {
|
|
1913
|
+
class: s(o(f).controlWrapper())
|
|
1914
|
+
}, [
|
|
1915
|
+
i("input", {
|
|
1916
|
+
id: d.value,
|
|
1917
|
+
type: "checkbox",
|
|
1918
|
+
name: e.name,
|
|
1919
|
+
value: e.value,
|
|
1920
|
+
checked: c.value,
|
|
1921
|
+
disabled: e.disabled,
|
|
1922
|
+
required: e.required,
|
|
1923
|
+
class: "peer sr-only",
|
|
1924
|
+
onChange: b
|
|
1925
|
+
}, null, 40, el),
|
|
1926
|
+
i("div", {
|
|
1927
|
+
class: s(o(f).control()),
|
|
1928
|
+
"data-state": p.value,
|
|
1929
|
+
"data-disabled": e.disabled ? "true" : void 0,
|
|
1930
|
+
tabindex: "0",
|
|
1931
|
+
role: "checkbox",
|
|
1932
|
+
"aria-checked": e.indeterminate ? "mixed" : c.value,
|
|
1933
|
+
"aria-disabled": e.disabled,
|
|
1934
|
+
onKeydown: U(D(M, ["prevent"]), ["space"])
|
|
1935
|
+
}, [
|
|
1936
|
+
e.indeterminate ? (l(), r("svg", {
|
|
1937
|
+
key: 1,
|
|
1938
|
+
class: s(o(f).icon()),
|
|
1939
|
+
"data-visible": "true",
|
|
1940
|
+
viewBox: "0 0 16 16",
|
|
1941
|
+
fill: "none",
|
|
1942
|
+
stroke: "currentColor",
|
|
1943
|
+
"stroke-width": "2.5",
|
|
1944
|
+
"stroke-linecap": "round"
|
|
1945
|
+
}, [...v[1] || (v[1] = [
|
|
1946
|
+
i("line", {
|
|
1947
|
+
x1: "3.5",
|
|
1948
|
+
y1: "8",
|
|
1949
|
+
x2: "12.5",
|
|
1950
|
+
y2: "8"
|
|
1951
|
+
}, null, -1)
|
|
1952
|
+
])], 2)) : (l(), r("svg", {
|
|
1953
|
+
key: 0,
|
|
1954
|
+
class: s(o(f).icon()),
|
|
1955
|
+
"data-visible": c.value ? "true" : void 0,
|
|
1956
|
+
viewBox: "0 0 16 16",
|
|
1957
|
+
fill: "none",
|
|
1958
|
+
stroke: "currentColor",
|
|
1959
|
+
"stroke-width": "2.5",
|
|
1960
|
+
"stroke-linecap": "round",
|
|
1961
|
+
"stroke-linejoin": "round"
|
|
1962
|
+
}, [...v[0] || (v[0] = [
|
|
1963
|
+
i("polyline", { points: "3.5 8.5 6.5 11.5 12.5 4.5" }, null, -1)
|
|
1964
|
+
])], 10, al))
|
|
1965
|
+
], 42, tl)
|
|
1966
|
+
], 2),
|
|
1967
|
+
e.label || e.description || w.$slots.default || w.$slots.description ? (l(), r("div", {
|
|
1968
|
+
key: 0,
|
|
1969
|
+
class: s(o(f).labelWrapper())
|
|
1970
|
+
}, [
|
|
1971
|
+
e.label || w.$slots.default ? (l(), r("span", {
|
|
1972
|
+
key: 0,
|
|
1973
|
+
class: s(o(f).label())
|
|
1974
|
+
}, [
|
|
1975
|
+
h(w.$slots, "default", {}, () => [
|
|
1976
|
+
j(y(e.label), 1)
|
|
1977
|
+
]),
|
|
1978
|
+
e.required ? (l(), r("span", ll, "*")) : g("", !0)
|
|
1979
|
+
], 2)) : g("", !0),
|
|
1980
|
+
e.description || w.$slots.description ? (l(), r("span", {
|
|
1981
|
+
key: 1,
|
|
1982
|
+
class: s(o(f).description())
|
|
1983
|
+
}, [
|
|
1984
|
+
h(w.$slots, "description", {}, () => [
|
|
1985
|
+
j(y(e.description), 1)
|
|
1986
|
+
])
|
|
1987
|
+
], 2)) : g("", !0)
|
|
1988
|
+
], 2)) : g("", !0)
|
|
1989
|
+
], 10, _a));
|
|
1990
|
+
}
|
|
1991
|
+
}), nl = ["for", "data-state", "data-disabled"], ol = ["id", "name", "value", "checked", "disabled"], rl = ["data-state", "data-disabled", "aria-checked", "aria-disabled", "onKeydown"], il = ["data-visible"], dl = { class: "flex-1 min-w-0 flex flex-col gap-1 select-none" }, ul = { class: "flex items-center justify-between gap-2" }, cl = ["for", "data-disabled"], fl = ["id", "name", "value", "checked", "disabled"], ml = ["data-state", "data-disabled", "aria-checked", "aria-disabled", "onKeydown"], vl = ["data-visible"], hl = /* @__PURE__ */ z({
|
|
1992
|
+
__name: "KmRadio",
|
|
1993
|
+
props: {
|
|
1994
|
+
modelValue: {},
|
|
1995
|
+
value: {},
|
|
1996
|
+
label: {},
|
|
1997
|
+
description: {},
|
|
1998
|
+
disabled: { type: Boolean, default: !1 },
|
|
1999
|
+
name: {},
|
|
2000
|
+
id: {},
|
|
2001
|
+
size: { default: void 0 },
|
|
2002
|
+
tone: { default: void 0 },
|
|
2003
|
+
variant: { default: void 0 }
|
|
2004
|
+
},
|
|
2005
|
+
emits: ["update:modelValue", "change"],
|
|
2006
|
+
setup(e, { emit: t }) {
|
|
2007
|
+
const a = O("kmRadioGroup", null), n = e, u = t, d = N("km-radio"), c = m(() => n.id || d), p = m(() => n.name || o(a == null ? void 0 : a.name)), f = m(
|
|
2008
|
+
() => n.disabled || o(a == null ? void 0 : a.disabled) || !1
|
|
2009
|
+
), b = m(
|
|
2010
|
+
() => n.size || o(a == null ? void 0 : a.size) || "md"
|
|
2011
|
+
), M = m(
|
|
2012
|
+
() => n.tone || o(a == null ? void 0 : a.tone) || "primary"
|
|
2013
|
+
), w = m(
|
|
2014
|
+
() => n.variant || o(a == null ? void 0 : a.variant) || "default"
|
|
2015
|
+
), v = m(() => a ? o(a.modelValue) === n.value : n.modelValue === n.value), x = m(
|
|
2016
|
+
() => Ve({
|
|
2017
|
+
size: b.value,
|
|
2018
|
+
tone: M.value
|
|
2019
|
+
})
|
|
2020
|
+
), B = () => {
|
|
2021
|
+
f.value || (a ? a.updateValue(n.value) : u("update:modelValue", n.value), u("change", n.value));
|
|
2022
|
+
};
|
|
2023
|
+
return ($, L) => w.value === "card" ? (l(), r("label", {
|
|
2024
|
+
key: 0,
|
|
2025
|
+
for: c.value,
|
|
2026
|
+
class: s(o(Ke)()),
|
|
2027
|
+
"data-state": v.value ? "checked" : "unchecked",
|
|
2028
|
+
"data-disabled": f.value ? "true" : void 0
|
|
2029
|
+
}, [
|
|
2030
|
+
i("div", {
|
|
2031
|
+
class: s(x.value.controlWrapper())
|
|
2032
|
+
}, [
|
|
2033
|
+
i("input", {
|
|
2034
|
+
id: c.value,
|
|
2035
|
+
type: "radio",
|
|
2036
|
+
name: p.value,
|
|
2037
|
+
value: e.value,
|
|
2038
|
+
checked: v.value,
|
|
2039
|
+
disabled: f.value,
|
|
2040
|
+
class: "peer sr-only",
|
|
2041
|
+
onChange: B
|
|
2042
|
+
}, null, 40, ol),
|
|
2043
|
+
i("div", {
|
|
2044
|
+
class: s(x.value.control()),
|
|
2045
|
+
"data-state": v.value ? "checked" : "unchecked",
|
|
2046
|
+
"data-disabled": f.value ? "true" : void 0,
|
|
2047
|
+
tabindex: "0",
|
|
2048
|
+
role: "radio",
|
|
2049
|
+
"aria-checked": v.value,
|
|
2050
|
+
"aria-disabled": f.value,
|
|
2051
|
+
onKeydown: U(D(B, ["prevent"]), ["space"])
|
|
2052
|
+
}, [
|
|
2053
|
+
i("div", {
|
|
2054
|
+
class: s(x.value.indicator()),
|
|
2055
|
+
"data-visible": v.value ? "true" : void 0
|
|
2056
|
+
}, null, 10, il)
|
|
2057
|
+
], 42, rl)
|
|
2058
|
+
], 2),
|
|
2059
|
+
i("div", dl, [
|
|
2060
|
+
i("div", ul, [
|
|
2061
|
+
e.label || $.$slots.default ? (l(), r("span", {
|
|
2062
|
+
key: 0,
|
|
2063
|
+
class: s(x.value.label())
|
|
2064
|
+
}, [
|
|
2065
|
+
h($.$slots, "default", {}, () => [
|
|
2066
|
+
j(y(e.label), 1)
|
|
2067
|
+
])
|
|
2068
|
+
], 2)) : g("", !0),
|
|
2069
|
+
h($.$slots, "badge")
|
|
2070
|
+
]),
|
|
2071
|
+
e.description || $.$slots.description ? (l(), r("span", {
|
|
2072
|
+
key: 0,
|
|
2073
|
+
class: s(x.value.description())
|
|
2074
|
+
}, [
|
|
2075
|
+
h($.$slots, "description", {}, () => [
|
|
2076
|
+
j(y(e.description), 1)
|
|
2077
|
+
])
|
|
2078
|
+
], 2)) : g("", !0),
|
|
2079
|
+
h($.$slots, "extra")
|
|
2080
|
+
])
|
|
2081
|
+
], 10, nl)) : (l(), r("label", {
|
|
2082
|
+
key: 1,
|
|
2083
|
+
for: c.value,
|
|
2084
|
+
class: s(x.value.root()),
|
|
2085
|
+
"data-disabled": f.value ? "true" : void 0
|
|
2086
|
+
}, [
|
|
2087
|
+
i("div", {
|
|
2088
|
+
class: s(x.value.controlWrapper())
|
|
2089
|
+
}, [
|
|
2090
|
+
i("input", {
|
|
2091
|
+
id: c.value,
|
|
2092
|
+
type: "radio",
|
|
2093
|
+
name: p.value,
|
|
2094
|
+
value: e.value,
|
|
2095
|
+
checked: v.value,
|
|
2096
|
+
disabled: f.value,
|
|
2097
|
+
class: "peer sr-only",
|
|
2098
|
+
onChange: B
|
|
2099
|
+
}, null, 40, fl),
|
|
2100
|
+
i("div", {
|
|
2101
|
+
class: s(x.value.control()),
|
|
2102
|
+
"data-state": v.value ? "checked" : "unchecked",
|
|
2103
|
+
"data-disabled": f.value ? "true" : void 0,
|
|
2104
|
+
tabindex: "0",
|
|
2105
|
+
role: "radio",
|
|
2106
|
+
"aria-checked": v.value,
|
|
2107
|
+
"aria-disabled": f.value,
|
|
2108
|
+
onKeydown: U(D(B, ["prevent"]), ["space"])
|
|
2109
|
+
}, [
|
|
2110
|
+
i("div", {
|
|
2111
|
+
class: s(x.value.indicator()),
|
|
2112
|
+
"data-visible": v.value ? "true" : void 0
|
|
2113
|
+
}, null, 10, vl)
|
|
2114
|
+
], 42, ml)
|
|
2115
|
+
], 2),
|
|
2116
|
+
e.label || e.description || $.$slots.default || $.$slots.description ? (l(), r("div", {
|
|
2117
|
+
key: 0,
|
|
2118
|
+
class: s(x.value.labelWrapper())
|
|
2119
|
+
}, [
|
|
2120
|
+
e.label || $.$slots.default ? (l(), r("span", {
|
|
2121
|
+
key: 0,
|
|
2122
|
+
class: s(x.value.label())
|
|
2123
|
+
}, [
|
|
2124
|
+
h($.$slots, "default", {}, () => [
|
|
2125
|
+
j(y(e.label), 1)
|
|
2126
|
+
])
|
|
2127
|
+
], 2)) : g("", !0),
|
|
2128
|
+
e.description || $.$slots.description ? (l(), r("span", {
|
|
2129
|
+
key: 1,
|
|
2130
|
+
class: s(x.value.description())
|
|
2131
|
+
}, [
|
|
2132
|
+
h($.$slots, "description", {}, () => [
|
|
2133
|
+
j(y(e.description), 1)
|
|
2134
|
+
])
|
|
2135
|
+
], 2)) : g("", !0)
|
|
2136
|
+
], 2)) : g("", !0)
|
|
2137
|
+
], 10, cl));
|
|
2138
|
+
}
|
|
2139
|
+
}), gl = /* @__PURE__ */ z({
|
|
2140
|
+
__name: "KmRadioGroup",
|
|
2141
|
+
props: {
|
|
2142
|
+
modelValue: {},
|
|
2143
|
+
name: {},
|
|
2144
|
+
direction: { default: "column" },
|
|
2145
|
+
gap: { default: "md" },
|
|
2146
|
+
disabled: { type: Boolean, default: !1 },
|
|
2147
|
+
size: { default: "md" },
|
|
2148
|
+
tone: { default: "primary" },
|
|
2149
|
+
variant: { default: "default" }
|
|
2150
|
+
},
|
|
2151
|
+
emits: ["update:modelValue", "change"],
|
|
2152
|
+
setup(e, { emit: t }) {
|
|
2153
|
+
const a = e, n = t, u = N("km-radio-group"), d = m(() => a.name || u), c = (f) => {
|
|
2154
|
+
n("update:modelValue", f), n("change", f);
|
|
2155
|
+
};
|
|
2156
|
+
Y(
|
|
2157
|
+
"kmRadioGroup",
|
|
2158
|
+
pe({
|
|
2159
|
+
modelValue: F(a, "modelValue"),
|
|
2160
|
+
updateValue: c,
|
|
2161
|
+
name: d,
|
|
2162
|
+
disabled: F(a, "disabled"),
|
|
2163
|
+
size: F(a, "size"),
|
|
2164
|
+
tone: F(a, "tone"),
|
|
2165
|
+
variant: F(a, "variant")
|
|
2166
|
+
})
|
|
2167
|
+
);
|
|
2168
|
+
const p = m(() => {
|
|
2169
|
+
const f = a.direction === "row", b = {
|
|
2170
|
+
sm: "gap-2",
|
|
2171
|
+
md: "gap-3",
|
|
2172
|
+
lg: "gap-4"
|
|
2173
|
+
}[a.gap];
|
|
2174
|
+
return [
|
|
2175
|
+
"flex",
|
|
2176
|
+
f ? "flex-row flex-wrap" : "flex-col",
|
|
2177
|
+
b
|
|
2178
|
+
];
|
|
2179
|
+
});
|
|
2180
|
+
return (f, b) => (l(), r("div", {
|
|
2181
|
+
role: "radiogroup",
|
|
2182
|
+
class: s(p.value)
|
|
2183
|
+
}, [
|
|
2184
|
+
h(f.$slots, "default")
|
|
2185
|
+
], 2));
|
|
2186
|
+
}
|
|
2187
|
+
}), bl = ["data-disabled"], pl = ["for"], yl = {
|
|
2188
|
+
key: 0,
|
|
2189
|
+
class: "text-km-danger ml-0.5",
|
|
2190
|
+
"aria-hidden": "true"
|
|
2191
|
+
}, kl = ["id"], wl = ["id"], xl = /* @__PURE__ */ z({
|
|
2192
|
+
__name: "KmFormControl",
|
|
2193
|
+
props: {
|
|
2194
|
+
id: {},
|
|
2195
|
+
label: {},
|
|
2196
|
+
hint: {},
|
|
2197
|
+
error: {},
|
|
2198
|
+
required: { type: Boolean, default: !1 },
|
|
2199
|
+
disabled: { type: Boolean, default: !1 }
|
|
2200
|
+
},
|
|
2201
|
+
setup(e) {
|
|
2202
|
+
const t = e, a = N("km-form-control"), n = m(() => t.id || a), u = _(), d = m(() => `${n.value}-hint`), c = m(() => `${n.value}-error`), p = m(() => {
|
|
2203
|
+
if (t.error) return c.value;
|
|
2204
|
+
if (t.hint) return d.value;
|
|
2205
|
+
});
|
|
2206
|
+
return (f, b) => (l(), r("div", {
|
|
2207
|
+
class: s(o(u).root()),
|
|
2208
|
+
"data-disabled": e.disabled ? "true" : void 0
|
|
2209
|
+
}, [
|
|
2210
|
+
e.label || f.$slots.label ? (l(), r("label", {
|
|
2211
|
+
key: 0,
|
|
2212
|
+
for: n.value,
|
|
2213
|
+
class: s(o(u).label())
|
|
2214
|
+
}, [
|
|
2215
|
+
h(f.$slots, "label", {}, () => [
|
|
2216
|
+
j(y(e.label), 1)
|
|
2217
|
+
]),
|
|
2218
|
+
e.required ? (l(), r("span", yl, "*")) : g("", !0)
|
|
2219
|
+
], 10, pl)) : g("", !0),
|
|
2220
|
+
i("div", null, [
|
|
2221
|
+
h(f.$slots, "default", {
|
|
2222
|
+
id: n.value,
|
|
2223
|
+
error: e.error,
|
|
2224
|
+
disabled: e.disabled,
|
|
2225
|
+
describedBy: p.value
|
|
2226
|
+
})
|
|
2227
|
+
]),
|
|
2228
|
+
e.error || f.$slots.error ? (l(), r("div", {
|
|
2229
|
+
key: 1,
|
|
2230
|
+
id: c.value,
|
|
2231
|
+
class: s([o(u).error(), "flex items-center gap-1 mt-0.5 animate-fadeIn"]),
|
|
2232
|
+
role: "alert"
|
|
2233
|
+
}, [
|
|
2234
|
+
b[0] || (b[0] = i("svg", {
|
|
2235
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2236
|
+
viewBox: "0 0 20 20",
|
|
2237
|
+
fill: "currentColor",
|
|
2238
|
+
class: "w-3.5 h-3.5 shrink-0"
|
|
2239
|
+
}, [
|
|
2240
|
+
i("path", {
|
|
2241
|
+
"fill-rule": "evenodd",
|
|
2242
|
+
d: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
2243
|
+
"clip-rule": "evenodd"
|
|
2244
|
+
})
|
|
2245
|
+
], -1)),
|
|
2246
|
+
i("span", null, [
|
|
2247
|
+
h(f.$slots, "error", {}, () => [
|
|
2248
|
+
j(y(e.error), 1)
|
|
2249
|
+
])
|
|
2250
|
+
])
|
|
2251
|
+
], 10, kl)) : e.hint || f.$slots.hint ? (l(), r("span", {
|
|
2252
|
+
key: 2,
|
|
2253
|
+
id: d.value,
|
|
2254
|
+
class: s(o(u).hint())
|
|
2255
|
+
}, [
|
|
2256
|
+
h(f.$slots, "hint", {}, () => [
|
|
2257
|
+
j(y(e.hint), 1)
|
|
2258
|
+
])
|
|
2259
|
+
], 10, wl)) : g("", !0)
|
|
2260
|
+
], 10, bl));
|
|
2261
|
+
}
|
|
2262
|
+
}), $l = /* @__PURE__ */ z({
|
|
2263
|
+
__name: "KmHtml",
|
|
2264
|
+
props: {
|
|
2265
|
+
content: { default: "" },
|
|
2266
|
+
as: { default: "div" },
|
|
2267
|
+
size: { default: "sm" },
|
|
2268
|
+
tone: { default: "default" },
|
|
2269
|
+
lineClamp: { default: void 0 }
|
|
2270
|
+
},
|
|
2271
|
+
setup(e) {
|
|
2272
|
+
const t = e, a = m(() => !t.lineClamp || t.lineClamp === "none" ? "" : `line-clamp-${t.lineClamp}`), n = m(() => [
|
|
2273
|
+
Se({
|
|
2274
|
+
size: t.size,
|
|
2275
|
+
tone: t.tone
|
|
2276
|
+
}),
|
|
2277
|
+
a.value
|
|
2278
|
+
]);
|
|
2279
|
+
return (u, d) => e.content ? (l(), S(R(e.as), {
|
|
2280
|
+
key: 0,
|
|
2281
|
+
class: s(n.value),
|
|
2282
|
+
innerHTML: e.content
|
|
2283
|
+
}, null, 8, ["class", "innerHTML"])) : (l(), S(R(e.as), {
|
|
2284
|
+
key: 1,
|
|
2285
|
+
class: s(n.value)
|
|
2286
|
+
}, {
|
|
2287
|
+
default: k(() => [
|
|
2288
|
+
h(u.$slots, "default")
|
|
2289
|
+
]),
|
|
2290
|
+
_: 3
|
|
2291
|
+
}, 8, ["class"]));
|
|
2292
|
+
}
|
|
2293
|
+
}), Cl = /* @__PURE__ */ z({
|
|
2294
|
+
inheritAttrs: !1,
|
|
2295
|
+
__name: "KmSkeleton",
|
|
2296
|
+
props: {
|
|
2297
|
+
as: { default: "div" },
|
|
2298
|
+
variant: { default: "default" },
|
|
2299
|
+
tone: { default: "default" },
|
|
2300
|
+
animation: { default: "pulse" },
|
|
2301
|
+
width: {},
|
|
2302
|
+
height: {},
|
|
2303
|
+
rounded: {},
|
|
2304
|
+
count: { default: 1 },
|
|
2305
|
+
loading: { type: Boolean, default: !0 },
|
|
2306
|
+
class: {}
|
|
2307
|
+
},
|
|
2308
|
+
setup(e) {
|
|
2309
|
+
const t = e, a = ye(), n = m(
|
|
2310
|
+
() => St({
|
|
2311
|
+
variant: t.variant,
|
|
2312
|
+
tone: t.tone,
|
|
2313
|
+
animation: t.animation,
|
|
2314
|
+
class: [t.class, a.class]
|
|
2315
|
+
})
|
|
2316
|
+
), u = m(() => {
|
|
2317
|
+
const d = { ...a.style };
|
|
2318
|
+
return t.width && (d.width = typeof t.width == "number" ? `${t.width}px` : t.width), t.height && (d.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.rounded && (d.borderRadius = t.rounded), d;
|
|
2319
|
+
});
|
|
2320
|
+
return (d, c) => !e.loading && d.$slots.default ? h(d.$slots, "default", {}, void 0, void 0, 0) : e.count > 1 ? (l(!0), r(H, { key: 1 }, q(e.count, (p) => (l(), S(R(e.as), G({ key: p }, { ref_for: !0 }, o(a), {
|
|
2321
|
+
class: n.value,
|
|
2322
|
+
style: u.value,
|
|
2323
|
+
"aria-hidden": "true"
|
|
2324
|
+
}), null, 16, ["class", "style"]))), 128)) : (l(), S(R(e.as), G({ key: 2 }, o(a), {
|
|
2325
|
+
class: n.value,
|
|
2326
|
+
style: u.value,
|
|
2327
|
+
"aria-hidden": "true"
|
|
2328
|
+
}), null, 16, ["class", "style"]));
|
|
2329
|
+
}
|
|
2330
|
+
}), Bl = /* @__PURE__ */ z({
|
|
2331
|
+
__name: "KmTabs",
|
|
2332
|
+
props: /* @__PURE__ */ oe({
|
|
2333
|
+
defaultValue: {},
|
|
2334
|
+
variant: { default: "line" },
|
|
2335
|
+
orientation: { default: "horizontal" },
|
|
2336
|
+
size: { default: "md" },
|
|
2337
|
+
class: {}
|
|
2338
|
+
}, {
|
|
2339
|
+
modelValue: {},
|
|
2340
|
+
modelModifiers: {}
|
|
2341
|
+
}),
|
|
2342
|
+
emits: ["update:modelValue"],
|
|
2343
|
+
setup(e) {
|
|
2344
|
+
const t = e, a = X(e, "modelValue"), n = m(() => Te({
|
|
2345
|
+
variant: t.variant,
|
|
2346
|
+
orientation: t.orientation,
|
|
2347
|
+
size: t.size
|
|
2348
|
+
}));
|
|
2349
|
+
return Y("kmTabsContext", {
|
|
2350
|
+
get variant() {
|
|
2351
|
+
return t.variant;
|
|
2352
|
+
},
|
|
2353
|
+
get orientation() {
|
|
2354
|
+
return t.orientation;
|
|
2355
|
+
},
|
|
2356
|
+
get size() {
|
|
2357
|
+
return t.size;
|
|
2358
|
+
},
|
|
2359
|
+
get styles() {
|
|
2360
|
+
return n.value;
|
|
2361
|
+
}
|
|
2362
|
+
}), (u, d) => (l(), S(o(it), {
|
|
2363
|
+
modelValue: a.value,
|
|
2364
|
+
"onUpdate:modelValue": d[0] || (d[0] = (c) => a.value = c),
|
|
2365
|
+
"default-value": e.defaultValue,
|
|
2366
|
+
orientation: e.orientation,
|
|
2367
|
+
"activation-mode": u.activationMode,
|
|
2368
|
+
class: s(n.value.root({ class: t.class }))
|
|
2369
|
+
}, {
|
|
2370
|
+
default: k(() => [
|
|
2371
|
+
h(u.$slots, "default")
|
|
2372
|
+
]),
|
|
2373
|
+
_: 3
|
|
2374
|
+
}, 8, ["modelValue", "default-value", "orientation", "activation-mode", "class"]));
|
|
2375
|
+
}
|
|
2376
|
+
}), zl = /* @__PURE__ */ z({
|
|
2377
|
+
__name: "KmTabsList",
|
|
2378
|
+
props: {
|
|
2379
|
+
class: {}
|
|
2380
|
+
},
|
|
2381
|
+
setup(e) {
|
|
2382
|
+
const t = e, a = O("kmTabsContext", null);
|
|
2383
|
+
return (n, u) => {
|
|
2384
|
+
var d;
|
|
2385
|
+
return l(), S(o(dt), {
|
|
2386
|
+
loop: n.loop,
|
|
2387
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.list({ class: t.class })) ?? t.class)
|
|
2388
|
+
}, {
|
|
2389
|
+
default: k(() => [
|
|
2390
|
+
h(n.$slots, "default")
|
|
2391
|
+
]),
|
|
2392
|
+
_: 3
|
|
2393
|
+
}, 8, ["loop", "class"]);
|
|
2394
|
+
};
|
|
2395
|
+
}
|
|
2396
|
+
}), Vl = /* @__PURE__ */ z({
|
|
2397
|
+
__name: "KmTabsTrigger",
|
|
2398
|
+
props: {
|
|
2399
|
+
value: {},
|
|
2400
|
+
disabled: { type: Boolean, default: !1 },
|
|
2401
|
+
class: {}
|
|
2402
|
+
},
|
|
2403
|
+
setup(e) {
|
|
2404
|
+
const t = e, a = O("kmTabsContext", null);
|
|
2405
|
+
return (n, u) => {
|
|
2406
|
+
var d;
|
|
2407
|
+
return l(), S(o(ut), {
|
|
2408
|
+
value: e.value,
|
|
2409
|
+
disabled: e.disabled,
|
|
2410
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.trigger({ class: t.class })) ?? t.class)
|
|
2411
|
+
}, {
|
|
2412
|
+
default: k(() => [
|
|
2413
|
+
h(n.$slots, "default")
|
|
2414
|
+
]),
|
|
2415
|
+
_: 3
|
|
2416
|
+
}, 8, ["value", "disabled", "class"]);
|
|
2417
|
+
};
|
|
2418
|
+
}
|
|
2419
|
+
}), Kl = /* @__PURE__ */ z({
|
|
2420
|
+
__name: "KmTabsContent",
|
|
2421
|
+
props: {
|
|
2422
|
+
value: {},
|
|
2423
|
+
forceMount: { type: Boolean },
|
|
2424
|
+
class: {}
|
|
2425
|
+
},
|
|
2426
|
+
setup(e) {
|
|
2427
|
+
const t = e, a = O("kmTabsContext", null);
|
|
2428
|
+
return (n, u) => {
|
|
2429
|
+
var d;
|
|
2430
|
+
return l(), S(o(ct), {
|
|
2431
|
+
value: e.value,
|
|
2432
|
+
"force-mount": e.forceMount,
|
|
2433
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.content({ class: t.class })) ?? t.class)
|
|
2434
|
+
}, {
|
|
2435
|
+
default: k(() => [
|
|
2436
|
+
h(n.$slots, "default")
|
|
2437
|
+
]),
|
|
2438
|
+
_: 3
|
|
2439
|
+
}, 8, ["value", "force-mount", "class"]);
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
}), Sl = /* @__PURE__ */ z({
|
|
2443
|
+
__name: "KmTable",
|
|
2444
|
+
props: {
|
|
2445
|
+
dense: { type: Boolean, default: !1 },
|
|
2446
|
+
striped: { type: Boolean, default: !1 },
|
|
2447
|
+
hoverable: { type: Boolean, default: !0 },
|
|
2448
|
+
bordered: { type: Boolean, default: !1 },
|
|
2449
|
+
wrapperClass: {},
|
|
2450
|
+
class: {}
|
|
2451
|
+
},
|
|
2452
|
+
setup(e) {
|
|
2453
|
+
const t = e, a = m(() => Me({
|
|
2454
|
+
dense: t.dense,
|
|
2455
|
+
striped: t.striped,
|
|
2456
|
+
hoverable: t.hoverable,
|
|
2457
|
+
bordered: t.bordered
|
|
2458
|
+
}));
|
|
2459
|
+
return Y("kmTableContext", {
|
|
2460
|
+
get dense() {
|
|
2461
|
+
return t.dense;
|
|
2462
|
+
},
|
|
2463
|
+
get striped() {
|
|
2464
|
+
return t.striped;
|
|
2465
|
+
},
|
|
2466
|
+
get hoverable() {
|
|
2467
|
+
return t.hoverable;
|
|
2468
|
+
},
|
|
2469
|
+
get bordered() {
|
|
2470
|
+
return t.bordered;
|
|
2471
|
+
},
|
|
2472
|
+
get styles() {
|
|
2473
|
+
return a.value;
|
|
2474
|
+
}
|
|
2475
|
+
}), (n, u) => (l(), r("div", {
|
|
2476
|
+
class: s(a.value.root({ class: t.wrapperClass }))
|
|
2477
|
+
}, [
|
|
2478
|
+
i("table", {
|
|
2479
|
+
class: s(a.value.table({ class: t.class }))
|
|
2480
|
+
}, [
|
|
2481
|
+
h(n.$slots, "default")
|
|
2482
|
+
], 2)
|
|
2483
|
+
], 2));
|
|
2484
|
+
}
|
|
2485
|
+
}), Tl = /* @__PURE__ */ z({
|
|
2486
|
+
__name: "KmTableHeader",
|
|
2487
|
+
props: {
|
|
2488
|
+
class: {}
|
|
2489
|
+
},
|
|
2490
|
+
setup(e) {
|
|
2491
|
+
const t = e, a = O("kmTableContext", null);
|
|
2492
|
+
return (n, u) => {
|
|
2493
|
+
var d;
|
|
2494
|
+
return l(), r("thead", {
|
|
2495
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.header({ class: t.class })) ?? t.class)
|
|
2496
|
+
}, [
|
|
2497
|
+
h(n.$slots, "default")
|
|
2498
|
+
], 2);
|
|
2499
|
+
};
|
|
2500
|
+
}
|
|
2501
|
+
}), Ml = /* @__PURE__ */ z({
|
|
2502
|
+
__name: "KmTableBody",
|
|
2503
|
+
props: {
|
|
2504
|
+
class: {}
|
|
2505
|
+
},
|
|
2506
|
+
setup(e) {
|
|
2507
|
+
const t = e, a = O("kmTableContext", null);
|
|
2508
|
+
return (n, u) => {
|
|
2509
|
+
var d;
|
|
2510
|
+
return l(), r("tbody", {
|
|
2511
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.body({ class: t.class })) ?? t.class)
|
|
2512
|
+
}, [
|
|
2513
|
+
h(n.$slots, "default")
|
|
2514
|
+
], 2);
|
|
2515
|
+
};
|
|
2516
|
+
}
|
|
2517
|
+
}), Pl = /* @__PURE__ */ z({
|
|
2518
|
+
__name: "KmTableFooter",
|
|
2519
|
+
props: {
|
|
2520
|
+
class: {}
|
|
2521
|
+
},
|
|
2522
|
+
setup(e) {
|
|
2523
|
+
const t = e, a = O("kmTableContext", null);
|
|
2524
|
+
return (n, u) => {
|
|
2525
|
+
var d;
|
|
2526
|
+
return l(), r("tfoot", {
|
|
2527
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.footer({ class: t.class })) ?? t.class)
|
|
2528
|
+
}, [
|
|
2529
|
+
h(n.$slots, "default")
|
|
2530
|
+
], 2);
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
}), Al = ["data-state"], Ll = /* @__PURE__ */ z({
|
|
2534
|
+
__name: "KmTableRow",
|
|
2535
|
+
props: {
|
|
2536
|
+
selected: { type: Boolean, default: !1 },
|
|
2537
|
+
class: {}
|
|
2538
|
+
},
|
|
2539
|
+
setup(e) {
|
|
2540
|
+
const t = e, a = O("kmTableContext", null);
|
|
2541
|
+
return (n, u) => {
|
|
2542
|
+
var d;
|
|
2543
|
+
return l(), r("tr", {
|
|
2544
|
+
"data-state": e.selected ? "selected" : void 0,
|
|
2545
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.row({ class: t.class })) ?? t.class)
|
|
2546
|
+
}, [
|
|
2547
|
+
h(n.$slots, "default")
|
|
2548
|
+
], 10, Al);
|
|
2549
|
+
};
|
|
2550
|
+
}
|
|
2551
|
+
}), Il = /* @__PURE__ */ z({
|
|
2552
|
+
__name: "KmTableHead",
|
|
2553
|
+
props: {
|
|
2554
|
+
align: { default: "left" },
|
|
2555
|
+
class: {}
|
|
2556
|
+
},
|
|
2557
|
+
setup(e) {
|
|
2558
|
+
const t = e, a = O("kmTableContext", null), n = m(() => {
|
|
2559
|
+
switch (t.align) {
|
|
2560
|
+
case "center":
|
|
2561
|
+
return "text-center";
|
|
2562
|
+
case "right":
|
|
2563
|
+
return "text-right";
|
|
2564
|
+
case "left":
|
|
2565
|
+
default:
|
|
2566
|
+
return "text-left";
|
|
2567
|
+
}
|
|
2568
|
+
});
|
|
2569
|
+
return (u, d) => {
|
|
2570
|
+
var c;
|
|
2571
|
+
return l(), r("th", {
|
|
2572
|
+
class: s([((c = o(a)) == null ? void 0 : c.styles.head({ class: t.class })) ?? t.class, n.value])
|
|
2573
|
+
}, [
|
|
2574
|
+
h(u.$slots, "default")
|
|
2575
|
+
], 2);
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2578
|
+
}), jl = /* @__PURE__ */ z({
|
|
2579
|
+
__name: "KmTableCell",
|
|
2580
|
+
props: {
|
|
2581
|
+
align: {},
|
|
2582
|
+
numeric: { type: Boolean, default: !1 },
|
|
2583
|
+
class: {}
|
|
2584
|
+
},
|
|
2585
|
+
setup(e) {
|
|
2586
|
+
const t = e, a = O("kmTableContext", null), n = m(() => {
|
|
2587
|
+
const u = [];
|
|
2588
|
+
return t.numeric ? u.push("font-mono tabular-nums text-right") : t.align === "right" ? u.push("text-right") : t.align === "center" ? u.push("text-center") : u.push("text-left"), u.join(" ");
|
|
2589
|
+
});
|
|
2590
|
+
return (u, d) => {
|
|
2591
|
+
var c;
|
|
2592
|
+
return l(), r("td", {
|
|
2593
|
+
class: s([((c = o(a)) == null ? void 0 : c.styles.cell({ class: t.class })) ?? t.class, n.value])
|
|
2594
|
+
}, [
|
|
2595
|
+
h(u.$slots, "default")
|
|
2596
|
+
], 2);
|
|
2597
|
+
};
|
|
2598
|
+
}
|
|
2599
|
+
}), Zl = /* @__PURE__ */ z({
|
|
2600
|
+
__name: "KmTableCaption",
|
|
2601
|
+
props: {
|
|
2602
|
+
class: {}
|
|
2603
|
+
},
|
|
2604
|
+
setup(e) {
|
|
2605
|
+
const t = e, a = O("kmTableContext", null);
|
|
2606
|
+
return (n, u) => {
|
|
2607
|
+
var d;
|
|
2608
|
+
return l(), r("caption", {
|
|
2609
|
+
class: s(((d = o(a)) == null ? void 0 : d.styles.caption({ class: t.class })) ?? t.class)
|
|
2610
|
+
}, [
|
|
2611
|
+
h(n.$slots, "default")
|
|
2612
|
+
], 2);
|
|
2613
|
+
};
|
|
2614
|
+
}
|
|
2615
|
+
}), Hl = ["data-selected"], Rl = /* @__PURE__ */ z({
|
|
2616
|
+
__name: "KmPagination",
|
|
2617
|
+
props: /* @__PURE__ */ oe({
|
|
2618
|
+
total: {},
|
|
2619
|
+
itemsPerPage: { default: 10 },
|
|
2620
|
+
siblingCount: { default: 1 },
|
|
2621
|
+
showEdges: { type: Boolean, default: !1 },
|
|
2622
|
+
showInfo: { type: Boolean, default: !1 },
|
|
2623
|
+
disabled: { type: Boolean, default: !1 },
|
|
2624
|
+
size: { default: "md" },
|
|
2625
|
+
class: {},
|
|
2626
|
+
infoText: {}
|
|
2627
|
+
}, {
|
|
2628
|
+
modelValue: { default: 1 },
|
|
2629
|
+
modelModifiers: {}
|
|
2630
|
+
}),
|
|
2631
|
+
emits: ["update:modelValue"],
|
|
2632
|
+
setup(e) {
|
|
2633
|
+
const t = e, a = X(e, "modelValue"), n = m(() => Pe({
|
|
2634
|
+
size: t.size
|
|
2635
|
+
})), u = m(() => {
|
|
2636
|
+
if (t.infoText) return t.infoText;
|
|
2637
|
+
if (!t.total || t.total === 0) return "0 de 0 registros";
|
|
2638
|
+
const d = Math.min((a.value - 1) * t.itemsPerPage + 1, t.total), c = Math.min(a.value * t.itemsPerPage, t.total);
|
|
2639
|
+
return `Mostrando ${d} - ${c} de ${t.total}`;
|
|
2640
|
+
});
|
|
2641
|
+
return (d, c) => (l(), S(o(ft), {
|
|
2642
|
+
page: a.value,
|
|
2643
|
+
"onUpdate:page": c[0] || (c[0] = (p) => a.value = p),
|
|
2644
|
+
total: e.total,
|
|
2645
|
+
"items-per-page": e.itemsPerPage,
|
|
2646
|
+
"sibling-count": e.siblingCount,
|
|
2647
|
+
"show-edges": e.showEdges,
|
|
2648
|
+
disabled: e.disabled,
|
|
2649
|
+
class: s(n.value.root({ class: t.class }))
|
|
2650
|
+
}, {
|
|
2651
|
+
default: k(() => [
|
|
2652
|
+
e.showInfo ? (l(), r("div", {
|
|
2653
|
+
key: 0,
|
|
2654
|
+
class: s(n.value.info())
|
|
2655
|
+
}, [
|
|
2656
|
+
h(d.$slots, "info", {
|
|
2657
|
+
page: a.value,
|
|
2658
|
+
total: e.total,
|
|
2659
|
+
itemsPerPage: e.itemsPerPage
|
|
2660
|
+
}, () => [
|
|
2661
|
+
j(y(u.value), 1)
|
|
2662
|
+
])
|
|
2663
|
+
], 2)) : g("", !0),
|
|
2664
|
+
T(o(mt), {
|
|
2665
|
+
class: s(n.value.list())
|
|
2666
|
+
}, {
|
|
2667
|
+
default: k(({ items: p }) => [
|
|
2668
|
+
e.showEdges ? (l(), S(o(vt), {
|
|
2669
|
+
key: 0,
|
|
2670
|
+
class: s(n.value.controlButton()),
|
|
2671
|
+
"aria-label": "Primera página"
|
|
2672
|
+
}, {
|
|
2673
|
+
default: k(() => [
|
|
2674
|
+
h(d.$slots, "first-icon", {}, () => [
|
|
2675
|
+
c[1] || (c[1] = i("svg", {
|
|
2676
|
+
class: "size-4",
|
|
2677
|
+
fill: "none",
|
|
2678
|
+
viewBox: "0 0 24 24",
|
|
2679
|
+
stroke: "currentColor",
|
|
2680
|
+
"stroke-width": "2"
|
|
2681
|
+
}, [
|
|
2682
|
+
i("path", {
|
|
2683
|
+
"stroke-linecap": "round",
|
|
2684
|
+
"stroke-linejoin": "round",
|
|
2685
|
+
d: "M11 19l-7-7 7-7m8 14l-7-7 7-7"
|
|
2686
|
+
})
|
|
2687
|
+
], -1))
|
|
2688
|
+
])
|
|
2689
|
+
]),
|
|
2690
|
+
_: 3
|
|
2691
|
+
}, 8, ["class"])) : g("", !0),
|
|
2692
|
+
T(o(ht), {
|
|
2693
|
+
class: s(n.value.controlButton()),
|
|
2694
|
+
"aria-label": "Página anterior"
|
|
2695
|
+
}, {
|
|
2696
|
+
default: k(() => [
|
|
2697
|
+
h(d.$slots, "prev-icon", {}, () => [
|
|
2698
|
+
c[2] || (c[2] = i("svg", {
|
|
2699
|
+
class: "size-4",
|
|
2700
|
+
fill: "none",
|
|
2701
|
+
viewBox: "0 0 24 24",
|
|
2702
|
+
stroke: "currentColor",
|
|
2703
|
+
"stroke-width": "2"
|
|
2704
|
+
}, [
|
|
2705
|
+
i("path", {
|
|
2706
|
+
"stroke-linecap": "round",
|
|
2707
|
+
"stroke-linejoin": "round",
|
|
2708
|
+
d: "M15 19l-7-7 7-7"
|
|
2709
|
+
})
|
|
2710
|
+
], -1))
|
|
2711
|
+
])
|
|
2712
|
+
]),
|
|
2713
|
+
_: 3
|
|
2714
|
+
}, 8, ["class"]),
|
|
2715
|
+
(l(!0), r(H, null, q(p, (f, b) => (l(), r(H, { key: b }, [
|
|
2716
|
+
f.type === "page" ? (l(), S(o(gt), {
|
|
2717
|
+
key: 0,
|
|
2718
|
+
value: f.value,
|
|
2719
|
+
"as-child": ""
|
|
2720
|
+
}, {
|
|
2721
|
+
default: k(() => [
|
|
2722
|
+
i("button", {
|
|
2723
|
+
type: "button",
|
|
2724
|
+
class: s(n.value.button()),
|
|
2725
|
+
"data-selected": f.value === a.value ? "true" : void 0
|
|
2726
|
+
}, y(f.value), 11, Hl)
|
|
2727
|
+
]),
|
|
2728
|
+
_: 2
|
|
2729
|
+
}, 1032, ["value"])) : (l(), S(o(bt), {
|
|
2730
|
+
key: 1,
|
|
2731
|
+
index: b,
|
|
2732
|
+
class: s(n.value.ellipsis())
|
|
2733
|
+
}, {
|
|
2734
|
+
default: k(() => [...c[3] || (c[3] = [
|
|
2735
|
+
j(" … ", -1)
|
|
2736
|
+
])]),
|
|
2737
|
+
_: 1
|
|
2738
|
+
}, 8, ["index", "class"]))
|
|
2739
|
+
], 64))), 128)),
|
|
2740
|
+
T(o(pt), {
|
|
2741
|
+
class: s(n.value.controlButton()),
|
|
2742
|
+
"aria-label": "Página siguiente"
|
|
2743
|
+
}, {
|
|
2744
|
+
default: k(() => [
|
|
2745
|
+
h(d.$slots, "next-icon", {}, () => [
|
|
2746
|
+
c[4] || (c[4] = i("svg", {
|
|
2747
|
+
class: "size-4",
|
|
2748
|
+
fill: "none",
|
|
2749
|
+
viewBox: "0 0 24 24",
|
|
2750
|
+
stroke: "currentColor",
|
|
2751
|
+
"stroke-width": "2"
|
|
2752
|
+
}, [
|
|
2753
|
+
i("path", {
|
|
2754
|
+
"stroke-linecap": "round",
|
|
2755
|
+
"stroke-linejoin": "round",
|
|
2756
|
+
d: "M9 5l7 7-7 7"
|
|
2757
|
+
})
|
|
2758
|
+
], -1))
|
|
2759
|
+
])
|
|
2760
|
+
]),
|
|
2761
|
+
_: 3
|
|
2762
|
+
}, 8, ["class"]),
|
|
2763
|
+
e.showEdges ? (l(), S(o(yt), {
|
|
2764
|
+
key: 1,
|
|
2765
|
+
class: s(n.value.controlButton()),
|
|
2766
|
+
"aria-label": "Última página"
|
|
2767
|
+
}, {
|
|
2768
|
+
default: k(() => [
|
|
2769
|
+
h(d.$slots, "last-icon", {}, () => [
|
|
2770
|
+
c[5] || (c[5] = i("svg", {
|
|
2771
|
+
class: "size-4",
|
|
2772
|
+
fill: "none",
|
|
2773
|
+
viewBox: "0 0 24 24",
|
|
2774
|
+
stroke: "currentColor",
|
|
2775
|
+
"stroke-width": "2"
|
|
2776
|
+
}, [
|
|
2777
|
+
i("path", {
|
|
2778
|
+
"stroke-linecap": "round",
|
|
2779
|
+
"stroke-linejoin": "round",
|
|
2780
|
+
d: "M13 5l7 7-7 7M5 5l7 7-7 7"
|
|
2781
|
+
})
|
|
2782
|
+
], -1))
|
|
2783
|
+
])
|
|
2784
|
+
]),
|
|
2785
|
+
_: 3
|
|
2786
|
+
}, 8, ["class"])) : g("", !0)
|
|
2787
|
+
]),
|
|
2788
|
+
_: 3
|
|
2789
|
+
}, 8, ["class"])
|
|
2790
|
+
]),
|
|
2791
|
+
_: 3
|
|
2792
|
+
}, 8, ["page", "total", "items-per-page", "sibling-count", "show-edges", "disabled", "class"]));
|
|
2793
|
+
}
|
|
2794
|
+
}), Ol = ["aria-expanded", "aria-selected"], ql = ["data-selected", "data-disabled", "onKeydown"], El = ["data-expanded"], Dl = {
|
|
2795
|
+
key: 0,
|
|
2796
|
+
class: "font-mono text-xs font-semibold px-1.5 py-0.5 rounded bg-km-muted text-km-muted-foreground"
|
|
2797
|
+
}, me = /* @__PURE__ */ z({
|
|
2798
|
+
name: "KmTreeNode",
|
|
2799
|
+
__name: "KmTreeNode",
|
|
2800
|
+
props: {
|
|
2801
|
+
item: {},
|
|
2802
|
+
level: { default: 0 }
|
|
2803
|
+
},
|
|
2804
|
+
setup(e) {
|
|
2805
|
+
const t = e, a = O("kmTreeContext"), n = m(() => Array.isArray(t.item.children) && t.item.children.length > 0), u = m(() => (a == null ? void 0 : a.isExpanded(t.item.id)) ?? !1), d = m(() => (a == null ? void 0 : a.isSelected(t.item.id)) ?? !1), c = (b) => {
|
|
2806
|
+
t.item.disabled || (a != null && a.selectable ? a.selectItem(t.item) : n.value && (a == null || a.toggleExpand(t.item.id)));
|
|
2807
|
+
}, p = (b) => {
|
|
2808
|
+
b.stopPropagation(), !t.item.disabled && (a == null || a.toggleExpand(t.item.id));
|
|
2809
|
+
}, f = m(() => {
|
|
2810
|
+
switch (t.item.badgeTone) {
|
|
2811
|
+
case "success":
|
|
2812
|
+
return "bg-km-success-bg text-km-success";
|
|
2813
|
+
case "warning":
|
|
2814
|
+
return "bg-km-warning-bg text-km-warning";
|
|
2815
|
+
case "danger":
|
|
2816
|
+
return "bg-km-danger-bg text-km-danger";
|
|
2817
|
+
case "primary":
|
|
2818
|
+
return "bg-km-primary/10 text-km-primary";
|
|
2819
|
+
case "neutral":
|
|
2820
|
+
default:
|
|
2821
|
+
return "bg-km-muted text-km-muted-foreground";
|
|
2822
|
+
}
|
|
2823
|
+
});
|
|
2824
|
+
return (b, M) => {
|
|
2825
|
+
var v, x, B, $;
|
|
2826
|
+
const w = ke("KmTreeNode", !0);
|
|
2827
|
+
return l(), r("li", {
|
|
2828
|
+
role: "treeitem",
|
|
2829
|
+
"aria-expanded": n.value ? u.value : void 0,
|
|
2830
|
+
"aria-selected": d.value,
|
|
2831
|
+
class: "list-none"
|
|
2832
|
+
}, [
|
|
2833
|
+
i("div", {
|
|
2834
|
+
class: s((v = o(a)) == null ? void 0 : v.styles.item()),
|
|
2835
|
+
style: J({ paddingLeft: `${e.level * 18 + 8}px` }),
|
|
2836
|
+
"data-selected": d.value ? "true" : void 0,
|
|
2837
|
+
"data-disabled": e.item.disabled ? "true" : void 0,
|
|
2838
|
+
tabindex: "0",
|
|
2839
|
+
onClick: c,
|
|
2840
|
+
onKeydown: [
|
|
2841
|
+
U(D(c, ["prevent"]), ["enter"]),
|
|
2842
|
+
U(D(c, ["prevent"]), ["space"])
|
|
2843
|
+
]
|
|
2844
|
+
}, [
|
|
2845
|
+
n.value ? (l(), r("button", {
|
|
2846
|
+
key: 0,
|
|
2847
|
+
type: "button",
|
|
2848
|
+
tabindex: "-1",
|
|
2849
|
+
class: s((x = o(a)) == null ? void 0 : x.styles.toggle()),
|
|
2850
|
+
"data-expanded": u.value ? "true" : void 0,
|
|
2851
|
+
"aria-label": "Alternar nodo",
|
|
2852
|
+
onClick: p
|
|
2853
|
+
}, [...M[0] || (M[0] = [
|
|
2854
|
+
i("svg", {
|
|
2855
|
+
class: "size-3.5 transition-transform",
|
|
2856
|
+
fill: "none",
|
|
2857
|
+
viewBox: "0 0 24 24",
|
|
2858
|
+
stroke: "currentColor",
|
|
2859
|
+
"stroke-width": "2.5"
|
|
2860
|
+
}, [
|
|
2861
|
+
i("path", {
|
|
2862
|
+
"stroke-linecap": "round",
|
|
2863
|
+
"stroke-linejoin": "round",
|
|
2864
|
+
d: "M9 5l7 7-7 7"
|
|
2865
|
+
})
|
|
2866
|
+
], -1)
|
|
2867
|
+
])], 10, El)) : (l(), r("div", {
|
|
2868
|
+
key: 1,
|
|
2869
|
+
class: s((B = o(a)) == null ? void 0 : B.styles.togglePlaceholder())
|
|
2870
|
+
}, null, 2)),
|
|
2871
|
+
h(b.$slots, "node", {
|
|
2872
|
+
item: e.item,
|
|
2873
|
+
isExpanded: u.value,
|
|
2874
|
+
isSelected: d.value,
|
|
2875
|
+
level: e.level
|
|
2876
|
+
}, () => {
|
|
2877
|
+
var L, P;
|
|
2878
|
+
return [
|
|
2879
|
+
e.item.code ? (l(), r("span", Dl, y(e.item.code), 1)) : g("", !0),
|
|
2880
|
+
i("span", {
|
|
2881
|
+
class: s((L = o(a)) == null ? void 0 : L.styles.label())
|
|
2882
|
+
}, y(e.item.label), 3),
|
|
2883
|
+
e.item.badge ? (l(), r("span", {
|
|
2884
|
+
key: 1,
|
|
2885
|
+
class: s([(P = o(a)) == null ? void 0 : P.styles.badge(), f.value])
|
|
2886
|
+
}, y(e.item.badge), 3)) : g("", !0)
|
|
2887
|
+
];
|
|
2888
|
+
})
|
|
2889
|
+
], 46, ql),
|
|
2890
|
+
n.value && u.value ? (l(), r("ul", {
|
|
2891
|
+
key: 0,
|
|
2892
|
+
role: "group",
|
|
2893
|
+
class: s(($ = o(a)) == null ? void 0 : $.styles.list())
|
|
2894
|
+
}, [
|
|
2895
|
+
(l(!0), r(H, null, q(e.item.children, (L) => (l(), S(w, {
|
|
2896
|
+
key: L.id,
|
|
2897
|
+
item: L,
|
|
2898
|
+
level: e.level + 1
|
|
2899
|
+
}, {
|
|
2900
|
+
node: k((P) => [
|
|
2901
|
+
h(b.$slots, "node", G({ ref_for: !0 }, P))
|
|
2902
|
+
]),
|
|
2903
|
+
_: 3
|
|
2904
|
+
}, 8, ["item", "level"]))), 128))
|
|
2905
|
+
], 2)) : g("", !0)
|
|
2906
|
+
], 8, Ol);
|
|
2907
|
+
};
|
|
2908
|
+
}
|
|
2909
|
+
}), Nl = /* @__PURE__ */ z({
|
|
2910
|
+
__name: "KmTreeview",
|
|
2911
|
+
props: /* @__PURE__ */ oe({
|
|
2912
|
+
items: {},
|
|
2913
|
+
filterQuery: {},
|
|
2914
|
+
density: { default: "normal" },
|
|
2915
|
+
multiple: { type: Boolean, default: !1 },
|
|
2916
|
+
selectable: { type: Boolean, default: !0 },
|
|
2917
|
+
class: {}
|
|
2918
|
+
}, {
|
|
2919
|
+
modelValue: { default: () => [] },
|
|
2920
|
+
modelModifiers: {},
|
|
2921
|
+
expanded: { default: () => [] },
|
|
2922
|
+
expandedModifiers: {}
|
|
2923
|
+
}),
|
|
2924
|
+
emits: ["update:modelValue", "update:expanded"],
|
|
2925
|
+
setup(e) {
|
|
2926
|
+
const t = e, a = X(e, "modelValue"), n = X(e, "expanded"), u = m(() => Ae({
|
|
2927
|
+
density: t.density
|
|
2928
|
+
})), d = (w) => Array.isArray(a.value) ? a.value.includes(w) : a.value === w, c = (w) => t.filterQuery && t.filterQuery.trim() ? !0 : n.value.includes(w), p = (w) => {
|
|
2929
|
+
const v = [...n.value], x = v.indexOf(w);
|
|
2930
|
+
x > -1 ? v.splice(x, 1) : v.push(w), n.value = v;
|
|
2931
|
+
}, f = (w) => {
|
|
2932
|
+
if (t.multiple) {
|
|
2933
|
+
const v = Array.isArray(a.value) ? [...a.value] : [], x = v.indexOf(w.id);
|
|
2934
|
+
x > -1 ? v.splice(x, 1) : v.push(w.id), a.value = v;
|
|
2935
|
+
} else
|
|
2936
|
+
a.value = w.id;
|
|
2937
|
+
}, b = (w, v) => {
|
|
2938
|
+
const x = v.toLowerCase(), B = w.label.toLowerCase().includes(x), $ = w.code ? w.code.toLowerCase().includes(x) : !1, L = B || $;
|
|
2939
|
+
let P = [];
|
|
2940
|
+
return w.children && w.children.length > 0 && (P = w.children.map((A) => b(A, v)).filter((A) => A !== null)), L || P.length > 0 ? {
|
|
2941
|
+
...w,
|
|
2942
|
+
children: P.length > 0 ? P : w.children
|
|
2943
|
+
} : null;
|
|
2944
|
+
}, M = m(() => {
|
|
2945
|
+
if (!t.filterQuery || !t.filterQuery.trim())
|
|
2946
|
+
return t.items;
|
|
2947
|
+
const w = t.filterQuery.trim();
|
|
2948
|
+
return t.items.map((v) => b(v, w)).filter((v) => v !== null);
|
|
2949
|
+
});
|
|
2950
|
+
return Y("kmTreeContext", {
|
|
2951
|
+
isSelected: d,
|
|
2952
|
+
isExpanded: c,
|
|
2953
|
+
toggleExpand: p,
|
|
2954
|
+
selectItem: f,
|
|
2955
|
+
selectable: t.selectable,
|
|
2956
|
+
styles: u.value
|
|
2957
|
+
}), (w, v) => (l(), r("div", {
|
|
2958
|
+
class: s(u.value.root({ class: t.class }))
|
|
2959
|
+
}, [
|
|
2960
|
+
i("ul", {
|
|
2961
|
+
role: "tree",
|
|
2962
|
+
class: s(u.value.list())
|
|
2963
|
+
}, [
|
|
2964
|
+
(l(!0), r(H, null, q(M.value, (x) => (l(), S(me, {
|
|
2965
|
+
key: x.id,
|
|
2966
|
+
item: x,
|
|
2967
|
+
level: 0
|
|
2968
|
+
}, {
|
|
2969
|
+
node: k((B) => [
|
|
2970
|
+
h(w.$slots, "node", G({ ref_for: !0 }, B))
|
|
2971
|
+
]),
|
|
2972
|
+
_: 3
|
|
2973
|
+
}, 8, ["item"]))), 128))
|
|
2974
|
+
], 2)
|
|
2975
|
+
], 2));
|
|
2976
|
+
}
|
|
2977
|
+
}), Wl = {
|
|
2978
|
+
KmAlert: Tt,
|
|
2979
|
+
KmAvatar: Lt,
|
|
2980
|
+
KmBadge: It,
|
|
2981
|
+
KmButton: jt,
|
|
2982
|
+
KmCard: Zt,
|
|
2983
|
+
KmInput: _t,
|
|
2984
|
+
KmSelect: za,
|
|
2985
|
+
KmSpinner: Va,
|
|
2986
|
+
KmStack: Ka,
|
|
2987
|
+
KmTextarea: La,
|
|
2988
|
+
KmScrollArea: Ja,
|
|
2989
|
+
KmPopover: Ga,
|
|
2990
|
+
KmHeading: Xa,
|
|
2991
|
+
KmText: Ya,
|
|
2992
|
+
KmCheckbox: sl,
|
|
2993
|
+
KmRadio: hl,
|
|
2994
|
+
KmRadioGroup: gl,
|
|
2995
|
+
KmFormControl: xl,
|
|
2996
|
+
KmHtml: $l,
|
|
2997
|
+
KmSkeleton: Cl,
|
|
2998
|
+
KmTabs: Bl,
|
|
2999
|
+
KmTabsList: zl,
|
|
3000
|
+
KmTabsTrigger: Vl,
|
|
3001
|
+
KmTabsContent: Kl,
|
|
3002
|
+
KmTable: Sl,
|
|
3003
|
+
KmTableHeader: Tl,
|
|
3004
|
+
KmTableBody: Ml,
|
|
3005
|
+
KmTableFooter: Pl,
|
|
3006
|
+
KmTableRow: Ll,
|
|
3007
|
+
KmTableHead: Il,
|
|
3008
|
+
KmTableCell: jl,
|
|
3009
|
+
KmTableCaption: Zl,
|
|
3010
|
+
KmPagination: Rl,
|
|
3011
|
+
KmTreeview: Nl,
|
|
3012
|
+
KmTreeNode: me
|
|
3013
|
+
}, ss = {
|
|
3014
|
+
install(e) {
|
|
3015
|
+
Object.entries(Wl).forEach(([t, a]) => {
|
|
3016
|
+
e.component(t, a);
|
|
3017
|
+
});
|
|
3018
|
+
}
|
|
3019
|
+
};
|
|
3020
|
+
export {
|
|
3021
|
+
jl as A,
|
|
3022
|
+
Pl as B,
|
|
3023
|
+
Il as C,
|
|
3024
|
+
Tl as D,
|
|
3025
|
+
Ll as E,
|
|
3026
|
+
Bl as F,
|
|
3027
|
+
Kl as G,
|
|
3028
|
+
zl as H,
|
|
3029
|
+
Vl as I,
|
|
3030
|
+
Ya as J,
|
|
3031
|
+
Xl as K,
|
|
3032
|
+
La as L,
|
|
3033
|
+
ls as M,
|
|
3034
|
+
me as N,
|
|
3035
|
+
Nl as O,
|
|
3036
|
+
ss as P,
|
|
3037
|
+
Tt as _,
|
|
3038
|
+
Lt as a,
|
|
3039
|
+
It as b,
|
|
3040
|
+
jt as c,
|
|
3041
|
+
Zt as d,
|
|
3042
|
+
sl as e,
|
|
3043
|
+
Yl as f,
|
|
3044
|
+
es as g,
|
|
3045
|
+
ts as h,
|
|
3046
|
+
_l as i,
|
|
3047
|
+
xl as j,
|
|
3048
|
+
Xa as k,
|
|
3049
|
+
$l as l,
|
|
3050
|
+
_t as m,
|
|
3051
|
+
Rl as n,
|
|
3052
|
+
Ga as o,
|
|
3053
|
+
hl as p,
|
|
3054
|
+
gl as q,
|
|
3055
|
+
Ja as r,
|
|
3056
|
+
za as s,
|
|
3057
|
+
Cl as t,
|
|
3058
|
+
Va as u,
|
|
3059
|
+
Ka as v,
|
|
3060
|
+
as as w,
|
|
3061
|
+
Sl as x,
|
|
3062
|
+
Ml as y,
|
|
3063
|
+
Zl as z
|
|
3064
|
+
};
|