vlite3 0.1.8 → 0.1.10
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 +1 -0
- package/components/ConfirmationModal.vue.js +17 -14
- package/components/Dropdown/Dropdown.vue.d.ts +1 -1
- package/components/Dropdown/Dropdown.vue.js +28 -22
- package/components/Dropdown/DropdownMenu.vue.js +54 -51
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +1 -1
- package/components/Form/FormField.vue.js +29 -28
- package/components/Form/composables/useFileUpload.js +1 -0
- package/components/Form/composables/useForm.js +81 -73
- package/components/Modal.vue.js +17 -17
- package/components/Navbar/Navbar.vue.d.ts +12 -1
- package/components/Navbar/Navbar.vue.js +151 -131
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +56 -52
- package/components/SidebarMenu/SidebarMenuItem.vue.js +1 -1
- package/components/Textarea.vue.js +1 -1
- package/components/ToastNotification.vue.js +2 -2
- package/components/ToastNotification.vue2.js +97 -95
- package/package.json +1 -1
- package/style.css +16 -13
- package/types/navbar.type.d.ts +4 -0
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ You can customize these colors in your CSS by overriding the variables in `:root
|
|
|
73
73
|
| `--secondary` | `bg-secondary` | Secondary background | Used for secondary actions or muted sections. |
|
|
74
74
|
| `--secondary-foreground` | `text-secondary-foreground` | Secondary text color | Text color for content on top of secondary background. |
|
|
75
75
|
| `--muted` | `bg-muted` | Muted background | Subtle backgrounds (e.g., table headers, disabled states). |
|
|
76
|
+
| `--muted` | `text-muted` | Muted Text | Secondary text, Unactive Link, description. |
|
|
76
77
|
| `--muted-foreground` | `text-muted-foreground` | Muted text color | Secondary text, hints, placeholders. |
|
|
77
78
|
| `--accent` | `bg-accent` | Accent background | Used for hover states, selection highlights. |
|
|
78
79
|
| `--accent-foreground` | `text-accent-foreground` | Accent text color | Text color on accent backgrounds. |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as f, openBlock as m, createBlock as u, withCtx as a, createElementVNode as x, createVNode as
|
|
1
|
+
import { defineComponent as f, openBlock as m, createBlock as u, withCtx as a, createElementVNode as x, createVNode as r, renderSlot as d } from "vue";
|
|
2
2
|
import g from "./Modal.vue.js";
|
|
3
|
-
import
|
|
4
|
-
const w = { class: "flex w-full items-center justify-end space-x-2
|
|
3
|
+
import c from "./Button.vue.js";
|
|
4
|
+
const w = { class: "flex w-full items-center justify-end space-x-2" }, k = /* @__PURE__ */ f({
|
|
5
5
|
__name: "ConfirmationModal",
|
|
6
6
|
props: {
|
|
7
7
|
show: { type: Boolean, default: !1 },
|
|
@@ -13,36 +13,39 @@ const w = { class: "flex w-full items-center justify-end space-x-2 pt-4" }, p =
|
|
|
13
13
|
variant: { default: "danger" }
|
|
14
14
|
},
|
|
15
15
|
emits: ["cancel", "confirm"],
|
|
16
|
-
setup(e, { emit:
|
|
17
|
-
const i =
|
|
16
|
+
setup(e, { emit: s }) {
|
|
17
|
+
const i = s, n = () => {
|
|
18
18
|
i("cancel");
|
|
19
19
|
};
|
|
20
20
|
return (l, t) => (m(), u(g, {
|
|
21
21
|
show: e.show,
|
|
22
22
|
title: e.title,
|
|
23
23
|
description: e.description,
|
|
24
|
+
footerClass: "border-t-0! pt-0! pb-3.5!",
|
|
24
25
|
"max-width": "max-w-[400px]",
|
|
25
26
|
onClose: n,
|
|
26
27
|
"onUpdate:show": t[1] || (t[1] = (o) => !o && n())
|
|
27
28
|
}, {
|
|
28
29
|
trigger: a(() => [
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
d(l.$slots, "trigger", {}, () => [
|
|
31
|
+
d(l.$slots, "default")
|
|
31
32
|
])
|
|
32
33
|
]),
|
|
33
|
-
|
|
34
|
+
footer: a(({ close: o }) => [
|
|
34
35
|
x("div", w, [
|
|
35
|
-
|
|
36
|
+
r(c, {
|
|
36
37
|
variant: "outline",
|
|
37
38
|
text: e.cancelText,
|
|
38
39
|
disabled: e.loading,
|
|
39
|
-
onClick:
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
onClick: () => {
|
|
41
|
+
o?.(), n?.();
|
|
42
|
+
}
|
|
43
|
+
}, null, 8, ["text", "disabled", "onClick"]),
|
|
44
|
+
r(c, {
|
|
42
45
|
variant: e.variant,
|
|
43
46
|
text: e.confirmText,
|
|
44
47
|
loading: e.loading,
|
|
45
|
-
onClick: t[0] || (t[0] = (
|
|
48
|
+
onClick: t[0] || (t[0] = (C) => i("confirm"))
|
|
46
49
|
}, null, 8, ["variant", "text", "loading"])
|
|
47
50
|
])
|
|
48
51
|
]),
|
|
@@ -51,5 +54,5 @@ const w = { class: "flex w-full items-center justify-end space-x-2 pt-4" }, p =
|
|
|
51
54
|
}
|
|
52
55
|
});
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
k as default
|
|
55
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as z, ref as d, computed as C, watch as $, reactive as D, toRefs as R, openBlock as
|
|
1
|
+
import { defineComponent as z, ref as d, computed as C, watch as $, reactive as D, toRefs as R, openBlock as k, createElementBlock as j, normalizeStyle as E, createVNode as h, unref as v, withCtx as r, renderSlot as c, createBlock as U, normalizeClass as q, createSlots as F, normalizeProps as S, guardReactiveProps as w, createCommentVNode as G } from "vue";
|
|
2
2
|
import J from "v-tooltip-lite";
|
|
3
3
|
import "v-tooltip-lite/style.css";
|
|
4
4
|
import K from "./DropdownMenu.vue.js";
|
|
@@ -48,15 +48,15 @@ const se = /* @__PURE__ */ z({
|
|
|
48
48
|
confirmText: "Confirm",
|
|
49
49
|
cancelText: "Cancel",
|
|
50
50
|
variant: "primary"
|
|
51
|
-
}), I = C(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), T = C(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"),
|
|
51
|
+
}), I = C(() => l.position ? l.position : l.direction === "rtl" ? "bottom-end" : "bottom-start"), T = C(() => l.nestedPosition ? l.nestedPosition : l.direction === "rtl" ? "left-start" : "right-start"), y = d(l.isOpen || !1);
|
|
52
52
|
$(
|
|
53
53
|
() => l.isOpen,
|
|
54
54
|
(e) => {
|
|
55
|
-
e !== void 0 && (
|
|
55
|
+
e !== void 0 && (y.value = e);
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
const O = (e) => {
|
|
59
|
-
|
|
59
|
+
y.value = e, f("update:isOpen", e), f(e ? "onOpen" : "onClose");
|
|
60
60
|
}, s = d([]);
|
|
61
61
|
$(
|
|
62
62
|
() => l.options,
|
|
@@ -95,17 +95,17 @@ const se = /* @__PURE__ */ z({
|
|
|
95
95
|
confirmText: "Confirm",
|
|
96
96
|
cancelText: "Cancel",
|
|
97
97
|
variant: "primary"
|
|
98
|
-
}, m.value = !0,
|
|
98
|
+
}, m.value = !0, p()) : (b(e), l.closeOnSelect && p());
|
|
99
99
|
}, b = (e) => {
|
|
100
100
|
M(e);
|
|
101
101
|
}, A = () => {
|
|
102
102
|
u.value && (b(u.value), u.value = null, m.value = !1);
|
|
103
103
|
}, V = () => {
|
|
104
104
|
u.value = null, m.value = !1;
|
|
105
|
-
},
|
|
105
|
+
}, p = () => {
|
|
106
106
|
O(!1);
|
|
107
107
|
};
|
|
108
|
-
return (e, n) => (
|
|
108
|
+
return (e, n) => (k(), j("div", {
|
|
109
109
|
class: "relative inline-block text-left",
|
|
110
110
|
style: E({ direction: t.direction })
|
|
111
111
|
}, [
|
|
@@ -116,7 +116,7 @@ const se = /* @__PURE__ */ z({
|
|
|
116
116
|
teleport: t.teleport,
|
|
117
117
|
offset: t.offset,
|
|
118
118
|
placement: I.value,
|
|
119
|
-
isOpen:
|
|
119
|
+
isOpen: y.value,
|
|
120
120
|
menuId: t.menuId,
|
|
121
121
|
ignoreClickOutside: H.value,
|
|
122
122
|
class: "w-full",
|
|
@@ -128,7 +128,7 @@ const se = /* @__PURE__ */ z({
|
|
|
128
128
|
styles: { padding: "0" }
|
|
129
129
|
}, {
|
|
130
130
|
trigger: r(({ isOpen: o }) => [
|
|
131
|
-
c(e.$slots, "trigger",
|
|
131
|
+
c(e.$slots, "trigger", S(w({ selectedLabel: v(g), isOpen: o })), () => [
|
|
132
132
|
h(Q, {
|
|
133
133
|
"selected-label": v(g),
|
|
134
134
|
"is-open": o,
|
|
@@ -139,7 +139,7 @@ const se = /* @__PURE__ */ z({
|
|
|
139
139
|
]),
|
|
140
140
|
default: r(() => [
|
|
141
141
|
c(e.$slots, "default"),
|
|
142
|
-
t.options?.length || s.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable ? (
|
|
142
|
+
t.options?.length || s.value.length || e.$slots.menu || e.$slots.item || t.remote || t.searchable ? (k(), U(K, {
|
|
143
143
|
key: 0,
|
|
144
144
|
options: t.options,
|
|
145
145
|
cachedOptions: s.value,
|
|
@@ -158,31 +158,37 @@ const se = /* @__PURE__ */ z({
|
|
|
158
158
|
searchable: t.searchable,
|
|
159
159
|
remote: t.remote,
|
|
160
160
|
onSelect: L,
|
|
161
|
-
onClose:
|
|
161
|
+
onClose: p,
|
|
162
162
|
onLoadMore: n[0] || (n[0] = (o) => e.$emit("load-more")),
|
|
163
163
|
onSearch: n[1] || (n[1] = (o) => e.$emit("search", o))
|
|
164
|
-
}, F({
|
|
165
|
-
menu
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
164
|
+
}, F({ _: 2 }, [
|
|
165
|
+
e.$slots.menu ? {
|
|
166
|
+
name: "menu",
|
|
167
|
+
fn: r(() => [
|
|
168
|
+
c(e.$slots, "menu")
|
|
169
|
+
]),
|
|
170
|
+
key: "0"
|
|
171
|
+
} : void 0,
|
|
172
|
+
e.$slots.item ? {
|
|
173
|
+
name: "item",
|
|
174
|
+
fn: r((o) => [
|
|
175
|
+
c(e.$slots, "item", S(w(o)))
|
|
176
|
+
]),
|
|
177
|
+
key: "1"
|
|
178
|
+
} : void 0,
|
|
173
179
|
e.$slots.header ? {
|
|
174
180
|
name: "header",
|
|
175
181
|
fn: r(() => [
|
|
176
182
|
c(e.$slots, "header")
|
|
177
183
|
]),
|
|
178
|
-
key: "
|
|
184
|
+
key: "2"
|
|
179
185
|
} : void 0,
|
|
180
186
|
e.$slots.footer ? {
|
|
181
187
|
name: "footer",
|
|
182
188
|
fn: r(() => [
|
|
183
189
|
c(e.$slots, "footer")
|
|
184
190
|
]),
|
|
185
|
-
key: "
|
|
191
|
+
key: "3"
|
|
186
192
|
} : void 0
|
|
187
193
|
]), 1032, ["options", "cachedOptions", "class", "selected", "selectedIndex", "maxHeight", "nestedPosition", "nestedOffset", "selectable", "direction", "layout", "columns", "loading", "hasMore", "searchable", "remote"])) : G("", !0)
|
|
188
194
|
]),
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as G, defineAsyncComponent as J, ref as B, computed as I, watch as C, toRef as Q, onMounted as W, onBeforeUnmount as X, openBlock as o, createElementBlock as c, createVNode as p, createCommentVNode as u, renderSlot as v, createElementVNode as g, unref as n, normalizeStyle as Y, normalizeClass as T, createBlock as m, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { useDropdownNavigation as
|
|
8
|
-
import { useDropdownIds as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as G, defineAsyncComponent as J, ref as B, computed as I, watch as C, toRef as Q, onMounted as W, onBeforeUnmount as X, openBlock as o, createElementBlock as c, createVNode as p, createCommentVNode as u, renderSlot as v, createElementVNode as g, unref as n, normalizeStyle as Y, normalizeClass as T, createBlock as m, Fragment as N, renderList as Z, withCtx as V, toDisplayString as ee, createSlots as te, mergeProps as le, nextTick as se } from "vue";
|
|
2
|
+
import S from "../Icon.vue.js";
|
|
3
|
+
import oe from "../Input.vue.js";
|
|
4
|
+
import ne from "./DropdownItem.vue.js";
|
|
5
|
+
import re from "./DropdownBooleanItem.vue.js";
|
|
6
|
+
import de from "./DropdownGroupedLayout.vue.js";
|
|
7
|
+
import { useDropdownNavigation as ce } from "./composables/useDropdownNavigation.js";
|
|
8
|
+
import { useDropdownIds as ae } from "./composables/useDropdownIds.js";
|
|
9
|
+
const ie = ["dir"], ue = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "bg-body border-b mb-1 z-10 rounded-t-md shrink-0"
|
|
12
|
-
},
|
|
12
|
+
}, fe = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "shrink-0"
|
|
15
|
-
},
|
|
15
|
+
}, me = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "px-2 py-6 text-center text-sm text-muted-foreground"
|
|
18
|
-
},
|
|
18
|
+
}, he = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "h-px bg-border my-1 mx-1"
|
|
21
|
-
},
|
|
21
|
+
}, ye = ["onMouseenter"], ve = { class: "flex items-center gap-2 flex-1 min-w-0" }, ge = { class: "truncate" }, ke = {
|
|
22
22
|
key: 3,
|
|
23
23
|
class: "flex justify-center py-2"
|
|
24
|
-
},
|
|
24
|
+
}, be = {
|
|
25
25
|
key: 2,
|
|
26
26
|
class: "shrink-0 border-t mt-1 pt-1"
|
|
27
|
-
},
|
|
27
|
+
}, Ie = /* @__PURE__ */ G({
|
|
28
28
|
__name: "DropdownMenu",
|
|
29
29
|
props: {
|
|
30
30
|
options: { default: () => [] },
|
|
@@ -45,8 +45,8 @@ const ae = ["dir"], ie = {
|
|
|
45
45
|
direction: { default: "ltr" }
|
|
46
46
|
},
|
|
47
47
|
emits: ["select", "close", "load-more", "search"],
|
|
48
|
-
setup(r, { emit:
|
|
49
|
-
const j = J(() => import("./Dropdown.vue2.js")), t = r, i =
|
|
48
|
+
setup(r, { emit: _ }) {
|
|
49
|
+
const j = J(() => import("./Dropdown.vue2.js")), t = r, i = _, M = B(null), f = B(""), { getMenuId: D, getAllRecursiveIds: E } = ae(), P = I(() => t.remote ? t.searchable : t.searchable && (t.options?.length || 0) > 9);
|
|
50
50
|
let k = null;
|
|
51
51
|
C(f, (e) => {
|
|
52
52
|
t.remote && (k && clearTimeout(k), k = setTimeout(() => {
|
|
@@ -63,14 +63,14 @@ const ae = ["dir"], ie = {
|
|
|
63
63
|
isKeyboardMode: w,
|
|
64
64
|
filteredOptions: R,
|
|
65
65
|
// rename
|
|
66
|
-
handleKeyDown:
|
|
67
|
-
handleMouseMove:
|
|
66
|
+
handleKeyDown: $,
|
|
67
|
+
handleMouseMove: O,
|
|
68
68
|
onMouseEnterItem: x,
|
|
69
69
|
scrollToIndex: z
|
|
70
|
-
} =
|
|
70
|
+
} = ce({
|
|
71
71
|
options: Q(t, "options"),
|
|
72
72
|
searchQuery: f,
|
|
73
|
-
containerRef:
|
|
73
|
+
containerRef: M,
|
|
74
74
|
emit: (e, ...s) => i(e, ...s),
|
|
75
75
|
handleSelect: (e, s) => b(e)
|
|
76
76
|
}), y = I(() => t.remote ? f.value ? t.options : t.cachedOptions.length ? t.cachedOptions : t.options : R.value), A = (e) => {
|
|
@@ -96,7 +96,7 @@ const ae = ["dir"], ie = {
|
|
|
96
96
|
};
|
|
97
97
|
i("select", d);
|
|
98
98
|
}, q = async () => {
|
|
99
|
-
await
|
|
99
|
+
await se();
|
|
100
100
|
let e = -1;
|
|
101
101
|
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = t.options.findIndex((s) => s.value === t.selected)), e !== -1 && z(e));
|
|
102
102
|
};
|
|
@@ -106,15 +106,15 @@ const ae = ["dir"], ie = {
|
|
|
106
106
|
h.value = -1;
|
|
107
107
|
}
|
|
108
108
|
), W(() => {
|
|
109
|
-
q(), window.addEventListener("keydown",
|
|
109
|
+
q(), window.addEventListener("keydown", $);
|
|
110
110
|
}), X(() => {
|
|
111
|
-
window.removeEventListener("keydown",
|
|
111
|
+
window.removeEventListener("keydown", $);
|
|
112
112
|
}), (e, s) => (o(), c("div", {
|
|
113
113
|
class: "dropdown-menu w-full min-w-[150px] flex flex-col",
|
|
114
114
|
dir: r.direction
|
|
115
115
|
}, [
|
|
116
|
-
P.value ? (o(), c("div",
|
|
117
|
-
p(
|
|
116
|
+
P.value ? (o(), c("div", ue, [
|
|
117
|
+
p(oe, {
|
|
118
118
|
modelValue: f.value,
|
|
119
119
|
"onUpdate:modelValue": s[0] || (s[0] = (l) => f.value = l),
|
|
120
120
|
placeholder: "Search...",
|
|
@@ -125,12 +125,12 @@ const ae = ["dir"], ie = {
|
|
|
125
125
|
"show-clear-button": !1
|
|
126
126
|
}, null, 8, ["modelValue"])
|
|
127
127
|
])) : u("", !0),
|
|
128
|
-
e.$slots.header ? (o(), c("div",
|
|
128
|
+
e.$slots.header ? (o(), c("div", fe, [
|
|
129
129
|
v(e.$slots, "header")
|
|
130
130
|
])) : u("", !0),
|
|
131
131
|
g("div", {
|
|
132
132
|
ref_key: "containerRef",
|
|
133
|
-
ref:
|
|
133
|
+
ref: M,
|
|
134
134
|
tabindex: "0",
|
|
135
135
|
role: "menu",
|
|
136
136
|
class: T([
|
|
@@ -139,19 +139,19 @@ const ae = ["dir"], ie = {
|
|
|
139
139
|
]),
|
|
140
140
|
style: Y({ maxHeight: t.maxHeight }),
|
|
141
141
|
onMousemove: s[1] || (s[1] = //@ts-ignore
|
|
142
|
-
(...l) => n(
|
|
142
|
+
(...l) => n(O) && n(O)(...l)),
|
|
143
143
|
onScroll: H
|
|
144
144
|
}, [
|
|
145
|
-
y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div",
|
|
146
|
-
r.layout === "grouped" ? (o(), m(
|
|
145
|
+
y.value.length === 0 && r.options?.length > 0 && !r.loading ? (o(), c("div", me, " No options found ")) : u("", !0),
|
|
146
|
+
r.layout === "grouped" ? (o(), m(de, {
|
|
147
147
|
key: 1,
|
|
148
148
|
options: y.value,
|
|
149
149
|
selected: r.selected,
|
|
150
150
|
selectable: r.selectable,
|
|
151
151
|
columns: r.columns,
|
|
152
152
|
onSelect: b
|
|
153
|
-
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(
|
|
154
|
-
l.label === "---" ? (o(), c("div",
|
|
153
|
+
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), c(N, { key: 2 }, Z(y.value, (l, d) => (o(), c(N, { key: d }, [
|
|
154
|
+
l.label === "---" ? (o(), c("div", he)) : l.data?.isBoolean ? (o(), m(re, {
|
|
155
155
|
key: 1,
|
|
156
156
|
option: l,
|
|
157
157
|
value: F(l),
|
|
@@ -173,7 +173,7 @@ const ae = ["dir"], ie = {
|
|
|
173
173
|
direction: r.direction,
|
|
174
174
|
onOnSelect: (a) => U(l, a)
|
|
175
175
|
}, {
|
|
176
|
-
trigger:
|
|
176
|
+
trigger: V(() => [
|
|
177
177
|
g("div", {
|
|
178
178
|
"data-dropdown-item": "",
|
|
179
179
|
class: T(["relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm font-medium outline-none transition-colors justify-between w-full", [
|
|
@@ -182,22 +182,22 @@ const ae = ["dir"], ie = {
|
|
|
182
182
|
]]),
|
|
183
183
|
onMouseenter: (a) => n(x)(d)
|
|
184
184
|
}, [
|
|
185
|
-
g("div",
|
|
186
|
-
l.icon ? (o(), m(
|
|
185
|
+
g("div", ve, [
|
|
186
|
+
l.icon ? (o(), m(S, {
|
|
187
187
|
key: 0,
|
|
188
188
|
icon: l.icon,
|
|
189
189
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
190
190
|
}, null, 8, ["icon"])) : u("", !0),
|
|
191
|
-
g("span",
|
|
191
|
+
g("span", ge, ee(l.label), 1)
|
|
192
192
|
]),
|
|
193
|
-
p(
|
|
193
|
+
p(S, {
|
|
194
194
|
icon: r.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
|
|
195
195
|
class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
|
|
196
196
|
}, null, 8, ["icon"])
|
|
197
|
-
], 42,
|
|
197
|
+
], 42, ye)
|
|
198
198
|
]),
|
|
199
199
|
_: 2
|
|
200
|
-
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(
|
|
200
|
+
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ne, {
|
|
201
201
|
key: 3,
|
|
202
202
|
option: l,
|
|
203
203
|
index: d,
|
|
@@ -206,27 +206,30 @@ const ae = ["dir"], ie = {
|
|
|
206
206
|
selectable: r.selectable,
|
|
207
207
|
onClick: (a) => b(l),
|
|
208
208
|
onMouseenter: (a) => n(x)(d)
|
|
209
|
-
}, {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
209
|
+
}, te({ _: 2 }, [
|
|
210
|
+
e.$slots.item ? {
|
|
211
|
+
name: "default",
|
|
212
|
+
fn: V((a) => [
|
|
213
|
+
v(e.$slots, "item", le({ ref_for: !0 }, a))
|
|
214
|
+
]),
|
|
215
|
+
key: "0"
|
|
216
|
+
} : void 0
|
|
217
|
+
]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
|
|
215
218
|
], 64))), 128)),
|
|
216
|
-
r.loading ? (o(), c("div",
|
|
217
|
-
p(
|
|
219
|
+
r.loading ? (o(), c("div", ke, [
|
|
220
|
+
p(S, {
|
|
218
221
|
icon: "lucide:loader-2",
|
|
219
222
|
class: "w-4 h-4 animate-spin text-muted-foreground"
|
|
220
223
|
})
|
|
221
224
|
])) : u("", !0),
|
|
222
225
|
v(e.$slots, "menu")
|
|
223
226
|
], 38),
|
|
224
|
-
e.$slots.footer ? (o(), c("div",
|
|
227
|
+
e.$slots.footer ? (o(), c("div", be, [
|
|
225
228
|
v(e.$slots, "footer")
|
|
226
229
|
])) : u("", !0)
|
|
227
|
-
], 8,
|
|
230
|
+
], 8, ie));
|
|
228
231
|
}
|
|
229
232
|
});
|
|
230
233
|
export {
|
|
231
|
-
|
|
234
|
+
Ie as default
|
|
232
235
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Form.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-353f6094"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -204,7 +204,7 @@ const le = {
|
|
|
204
204
|
class: h([
|
|
205
205
|
"form-footer flex items-center justify-end gap-3",
|
|
206
206
|
e.footerClass,
|
|
207
|
-
$.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border -mx-4 px-4 mt-4" : "mt-6"
|
|
207
|
+
$.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border/40 -mx-4 px-4 mt-4" : "mt-6"
|
|
208
208
|
])
|
|
209
209
|
}, [
|
|
210
210
|
G.value ? (s(), p(N, {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as b, defineAsyncComponent as t, computed as i, markRaw as k, openBlock as V, createBlock as x, resolveDynamicComponent as w, mergeProps as C, toHandlers as P } from "vue";
|
|
2
2
|
import { isComponent as o } from "./utils/form.utils.js";
|
|
3
3
|
import d from "../Input.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
4
|
+
import U from "../Switch.vue.js";
|
|
5
|
+
import z from "../CheckBox.vue.js";
|
|
6
|
+
import S from "../Textarea.vue.js";
|
|
7
|
+
import F from "../FilePicker/FilePicker.vue.js";
|
|
8
|
+
import $ from "../AvatarUploader/AvatarUploader.vue.js";
|
|
9
|
+
import A from "../Dropdown/Dropdown.vue.js";
|
|
10
|
+
const O = /* @__PURE__ */ b({
|
|
10
11
|
__name: "FormField",
|
|
11
12
|
props: {
|
|
12
13
|
field: {},
|
|
@@ -22,14 +23,14 @@ const M = /* @__PURE__ */ k({
|
|
|
22
23
|
},
|
|
23
24
|
emits: ["change"],
|
|
24
25
|
setup(n, { emit: c }) {
|
|
25
|
-
const u = t(() => import("../
|
|
26
|
+
const u = t(() => import("../MultiSelect/MultiSelect.vue2.js")), f = t(() => import("../DatePicker.vue2.js")), m = t(() => import("../ColorPicker/ColorPicker.vue2.js")), p = t(() => import("../IconPicker.vue2.js")), h = t(() => import("./CustomFields.vue.js")), r = n, s = c, l = (e, a) => {
|
|
26
27
|
s("change", { value: e, data: a });
|
|
27
|
-
},
|
|
28
|
+
}, v = (e) => {
|
|
28
29
|
s("change", { value: e });
|
|
29
|
-
},
|
|
30
|
+
}, _ = i(() => {
|
|
30
31
|
const e = r.field.type;
|
|
31
32
|
if (o(e))
|
|
32
|
-
return
|
|
33
|
+
return k(e);
|
|
33
34
|
switch (e) {
|
|
34
35
|
case "text":
|
|
35
36
|
case "email":
|
|
@@ -40,33 +41,33 @@ const M = /* @__PURE__ */ k({
|
|
|
40
41
|
case "search":
|
|
41
42
|
return d;
|
|
42
43
|
case "textarea":
|
|
43
|
-
return
|
|
44
|
+
return S;
|
|
44
45
|
case "switch":
|
|
45
|
-
return
|
|
46
|
+
return U;
|
|
46
47
|
case "check":
|
|
47
|
-
return
|
|
48
|
+
return z;
|
|
48
49
|
case "select":
|
|
49
|
-
return
|
|
50
|
+
return A;
|
|
50
51
|
case "multiSelect":
|
|
51
|
-
return
|
|
52
|
+
return u;
|
|
52
53
|
case "date":
|
|
53
54
|
case "time":
|
|
54
|
-
return
|
|
55
|
+
return f;
|
|
55
56
|
case "file":
|
|
56
57
|
case "fileUploader":
|
|
57
|
-
return
|
|
58
|
+
return F;
|
|
58
59
|
case "avatarUpload":
|
|
59
|
-
return
|
|
60
|
+
return $;
|
|
60
61
|
case "color":
|
|
61
62
|
return m;
|
|
62
63
|
case "iconPicker":
|
|
63
|
-
return
|
|
64
|
+
return p;
|
|
64
65
|
case "customFields":
|
|
65
|
-
return
|
|
66
|
+
return h;
|
|
66
67
|
default:
|
|
67
68
|
return d;
|
|
68
69
|
}
|
|
69
|
-
}),
|
|
70
|
+
}), y = i(() => {
|
|
70
71
|
const e = r.field.type, a = {
|
|
71
72
|
disabled: r.disabled || r.field.disabled === !0,
|
|
72
73
|
...r.field.props || {}
|
|
@@ -155,10 +156,10 @@ const M = /* @__PURE__ */ k({
|
|
|
155
156
|
value: r.value,
|
|
156
157
|
values: r.values
|
|
157
158
|
} : a;
|
|
158
|
-
}),
|
|
159
|
+
}), g = i(() => {
|
|
159
160
|
const e = r.field.type;
|
|
160
161
|
return e === "text" || e === "email" || e === "password" || e === "number" || e === "tel" || e === "url" || e === "search" || e === "textarea" || e === "switch" || e === "check" || !e ? {
|
|
161
|
-
"update:modelValue":
|
|
162
|
+
"update:modelValue": v
|
|
162
163
|
} : e === "select" ? {
|
|
163
164
|
onSelect: (a) => {
|
|
164
165
|
l(a.value, a.data);
|
|
@@ -187,12 +188,12 @@ const M = /* @__PURE__ */ k({
|
|
|
187
188
|
}
|
|
188
189
|
} : {};
|
|
189
190
|
});
|
|
190
|
-
return (e, a) => (
|
|
191
|
-
...
|
|
191
|
+
return (e, a) => (V(), x(w(_.value), C({
|
|
192
|
+
...y.value,
|
|
192
193
|
...n.field?.props || {}
|
|
193
|
-
},
|
|
194
|
+
}, P(g.value)), null, 16));
|
|
194
195
|
}
|
|
195
196
|
});
|
|
196
197
|
export {
|
|
197
|
-
|
|
198
|
+
O as default
|
|
198
199
|
};
|