vlite3 0.9.6 → 0.9.7
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/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/DatePicker.vue.js +38 -32
- package/components/DateRangePicker.vue.js +28 -26
- package/components/Dropdown/DropdownBooleanItem.vue.js +12 -9
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +51 -51
- package/components/Form/CustomFields.vue.d.ts +4 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +147 -115
- package/components/Form/FormField.vue.d.ts +1 -0
- package/components/Form/FormField.vue.js +3 -0
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +38 -37
- package/components/Form/composables/useForm.d.ts +1 -1
- package/components/Form/composables/useForm.js +142 -125
- package/components/Form/types.d.ts +6 -0
- package/components/Form/utils/form.utils.js +115 -106
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/package.json +2 -2
- package/style.css +6 -1
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -6,8 +6,8 @@ import O from "../Input.vue.js";
|
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import y from "../Button.vue.js";
|
|
9
|
-
import E from "./ColorIro.
|
|
10
|
-
/* empty css
|
|
9
|
+
import E from "./ColorIro.vue.js";
|
|
10
|
+
/* empty css */
|
|
11
11
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
12
12
|
const I = {
|
|
13
13
|
key: 0,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as k, computed as o, openBlock as v, createBlock as h, unref as r, withCtx as m, createElementVNode as P, createVNode as u, renderSlot as V, mergeProps as b } from "vue";
|
|
2
|
+
import y from "./Button.vue.js";
|
|
3
|
+
import I from "./Dropdown/Dropdown.vue.js";
|
|
4
4
|
import "@iconify/vue";
|
|
5
|
-
import { $t as
|
|
5
|
+
import { $t as g } from "../utils/i18n.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
8
|
+
import z, { TimePicker as T } from "v-datepicker-lite";
|
|
9
9
|
import "v-datepicker-lite/style.css";
|
|
10
|
-
const
|
|
10
|
+
const $ = { class: "overflow-hidden min-w-[300px]" }, M = /* @__PURE__ */ k({
|
|
11
11
|
__name: "DatePicker",
|
|
12
12
|
props: {
|
|
13
13
|
placeholder: {},
|
|
@@ -29,19 +29,25 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
29
29
|
readonly: { type: Boolean }
|
|
30
30
|
},
|
|
31
31
|
emits: ["update:modelValue", "change"],
|
|
32
|
-
setup(e, { emit:
|
|
33
|
-
const l = e,
|
|
32
|
+
setup(e, { emit: D }) {
|
|
33
|
+
const l = e, s = D, a = o({
|
|
34
34
|
get: () => l.modelValue ?? l.value,
|
|
35
35
|
set: (t) => {
|
|
36
|
-
|
|
36
|
+
s("update:modelValue", t), s("change", t);
|
|
37
37
|
}
|
|
38
|
-
}),
|
|
38
|
+
}), x = (t) => t instanceof Date ? t.getHours() !== 0 || t.getMinutes() !== 0 : typeof t == "string" ? t.includes("T") || /\d{2}:\d{2}/.test(t) : !1, n = o(() => {
|
|
39
39
|
if (!a.value) return "";
|
|
40
40
|
if (l.mode === "time") return a.value;
|
|
41
41
|
try {
|
|
42
42
|
const t = new Date(a.value);
|
|
43
43
|
if (isNaN(t.getTime())) return String(a.value);
|
|
44
|
-
|
|
44
|
+
if (l.mode === "week") {
|
|
45
|
+
const i = new Date(t);
|
|
46
|
+
i.setDate(t.getDate() + 6);
|
|
47
|
+
const w = t.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }), S = i.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
48
|
+
return `${w} - ${S}`;
|
|
49
|
+
}
|
|
50
|
+
const d = l.mode === "dateTime" && x(a.value);
|
|
45
51
|
return t.toLocaleDateString("en-US", {
|
|
46
52
|
month: "short",
|
|
47
53
|
day: "numeric",
|
|
@@ -51,15 +57,15 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
51
57
|
} catch {
|
|
52
58
|
return String(a.value);
|
|
53
59
|
}
|
|
54
|
-
}),
|
|
55
|
-
if (l.placeholderI18n) return
|
|
60
|
+
}), c = o(() => {
|
|
61
|
+
if (l.placeholderI18n) return g(l.placeholderI18n);
|
|
56
62
|
if (l.placeholder !== void 0) return l.placeholder;
|
|
57
|
-
const t =
|
|
63
|
+
const t = g("vlite.datePicker.placeholder");
|
|
58
64
|
return t !== "vlite.datePicker.placeholder" ? t : "Select date";
|
|
59
|
-
}),
|
|
65
|
+
}), f = (t) => {
|
|
60
66
|
a.value = t;
|
|
61
67
|
};
|
|
62
|
-
return (t, d) => e.mode !== "time" ? (
|
|
68
|
+
return (t, d) => e.mode !== "time" ? (v(), h(r(I), {
|
|
63
69
|
key: 0,
|
|
64
70
|
position: "bottom-start",
|
|
65
71
|
class: "w-full",
|
|
@@ -67,13 +73,13 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
67
73
|
teleport: e.teleport,
|
|
68
74
|
disabled: e.disabled || e.readonly
|
|
69
75
|
}, {
|
|
70
|
-
trigger:
|
|
71
|
-
|
|
76
|
+
trigger: m(() => [
|
|
77
|
+
V(t.$slots, "default", {
|
|
72
78
|
value: a.value,
|
|
73
|
-
displayValue:
|
|
79
|
+
displayValue: n.value
|
|
74
80
|
}, () => [
|
|
75
|
-
|
|
76
|
-
text:
|
|
81
|
+
u(y, b({
|
|
82
|
+
text: n.value || c.value,
|
|
77
83
|
variant: e.variant || "outline",
|
|
78
84
|
size: e.size || "md",
|
|
79
85
|
icon: e.icon || "lucide:calendar",
|
|
@@ -81,9 +87,9 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
81
87
|
}, e.btnProps, { class: "w-full justify-start text-left font-normal" }), null, 16, ["text", "variant", "size", "icon", "disabled"])
|
|
82
88
|
])
|
|
83
89
|
]),
|
|
84
|
-
default:
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
default: m(() => [
|
|
91
|
+
P("div", $, [
|
|
92
|
+
u(r(z), {
|
|
87
93
|
value: a.value,
|
|
88
94
|
mode: e.mode,
|
|
89
95
|
"min-date": e.minDate,
|
|
@@ -94,17 +100,17 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
94
100
|
"time-format": "12h",
|
|
95
101
|
disabled: e.disabled,
|
|
96
102
|
readonly: e.readonly,
|
|
97
|
-
onChange:
|
|
103
|
+
onChange: f
|
|
98
104
|
}, null, 8, ["value", "mode", "min-date", "max-date", "disabled-dates", "minuteInterval", "disabled", "readonly"])
|
|
99
105
|
])
|
|
100
106
|
]),
|
|
101
107
|
_: 3
|
|
102
|
-
}, 8, ["teleport", "disabled"])) : (
|
|
108
|
+
}, 8, ["teleport", "disabled"])) : (v(), h(r(T), {
|
|
103
109
|
key: 1,
|
|
104
110
|
"model-value": a.value,
|
|
105
111
|
"onUpdate:modelValue": [
|
|
106
|
-
d[0] || (d[0] = (
|
|
107
|
-
|
|
112
|
+
d[0] || (d[0] = (i) => a.value = i),
|
|
113
|
+
f
|
|
108
114
|
],
|
|
109
115
|
mode: e.mode,
|
|
110
116
|
"min-date": e.minDate,
|
|
@@ -116,9 +122,9 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
116
122
|
disabled: e.disabled,
|
|
117
123
|
readonly: e.readonly
|
|
118
124
|
}, {
|
|
119
|
-
default:
|
|
120
|
-
|
|
121
|
-
text:
|
|
125
|
+
default: m(() => [
|
|
126
|
+
u(y, b({
|
|
127
|
+
text: n.value || c.value,
|
|
122
128
|
variant: e.variant || "outline",
|
|
123
129
|
size: e.size || "md",
|
|
124
130
|
icon: e.icon || (e.mode === "time" ? "lucide:clock" : "lucide:calendar"),
|
|
@@ -130,5 +136,5 @@ const S = { class: "overflow-hidden min-w-[300px]" }, E = /* @__PURE__ */ P({
|
|
|
130
136
|
}
|
|
131
137
|
});
|
|
132
138
|
export {
|
|
133
|
-
|
|
139
|
+
M as default
|
|
134
140
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, ref as w, watch as L, computed as u, openBlock as d, createBlock as m, unref as h, withCtx as y, createElementVNode as
|
|
1
|
+
import { defineComponent as V, ref as w, watch as L, computed as u, openBlock as d, createBlock as m, unref as h, withCtx as y, createElementVNode as r, createElementBlock as x, Fragment as z, renderList as B, createCommentVNode as E, createVNode as g, normalizeClass as k, toDisplayString as R } from "vue";
|
|
2
2
|
import T from "./Dropdown/Dropdown.vue.js";
|
|
3
3
|
import f from "./Icon.vue.js";
|
|
4
4
|
import { $t as l } from "../utils/i18n.js";
|
|
@@ -26,8 +26,8 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
|
|
|
26
26
|
triggerClass: {}
|
|
27
27
|
},
|
|
28
28
|
emits: ["update:modelValue", "change"],
|
|
29
|
-
setup(
|
|
30
|
-
const v =
|
|
29
|
+
setup(s, { emit: M }) {
|
|
30
|
+
const v = s, b = M, o = w(!1), c = w(0);
|
|
31
31
|
L(o, (t) => {
|
|
32
32
|
t && c.value++;
|
|
33
33
|
});
|
|
@@ -144,39 +144,39 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
|
|
|
144
144
|
isOpen: o.value,
|
|
145
145
|
"onUpdate:isOpen": e[0] || (e[0] = (a) => o.value = a),
|
|
146
146
|
position: "bottom-start",
|
|
147
|
-
disabled:
|
|
147
|
+
disabled: s.disabled || s.readonly,
|
|
148
148
|
class: "w-full sm:w-auto inline-block",
|
|
149
149
|
maxHeight: "none"
|
|
150
150
|
}, {
|
|
151
151
|
trigger: y(({ isOpen: a }) => [
|
|
152
152
|
g(P, {
|
|
153
153
|
icon: "lucide:calendar",
|
|
154
|
-
variant:
|
|
155
|
-
size:
|
|
156
|
-
disabled:
|
|
157
|
-
class: k(["w-max justify-between text-left font-normal", [
|
|
154
|
+
variant: s.variant || "outline",
|
|
155
|
+
size: s.size || "md",
|
|
156
|
+
disabled: s.disabled,
|
|
157
|
+
class: k(["w-max justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": a }]])
|
|
158
158
|
}, {
|
|
159
159
|
default: y(() => [
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
r("div", $, [
|
|
161
|
+
r("span", {
|
|
162
162
|
class: k({ "text-muted-foreground": !n.value.start })
|
|
163
|
-
}, R(n.value.start ? D(n.value.start) :
|
|
163
|
+
}, R(n.value.start ? D(n.value.start) : s.placeholderStart), 3),
|
|
164
164
|
g(f, {
|
|
165
165
|
icon: "lucide:arrow-right",
|
|
166
166
|
class: "w-4 h-4 text-muted-foreground opacity-60 shrink-0"
|
|
167
167
|
}),
|
|
168
|
-
|
|
168
|
+
r("span", {
|
|
169
169
|
class: k({ "text-muted-foreground": !n.value.end })
|
|
170
|
-
}, R(n.value.end ? D(n.value.end) :
|
|
170
|
+
}, R(n.value.end ? D(n.value.end) : s.placeholderEnd), 3)
|
|
171
171
|
])
|
|
172
172
|
]),
|
|
173
173
|
_: 1
|
|
174
174
|
}, 8, ["variant", "size", "disabled", "class"])
|
|
175
175
|
]),
|
|
176
176
|
menu: y(() => [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
e[1] || (e[1] =
|
|
177
|
+
r("div", j, [
|
|
178
|
+
s.showQuickRanges ? (d(), x("div", H, [
|
|
179
|
+
e[1] || (e[1] = r("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
|
|
180
180
|
(d(!0), x(z, null, B(N.value, (a) => (d(), m(P, {
|
|
181
181
|
key: a.value,
|
|
182
182
|
text: a.label,
|
|
@@ -187,20 +187,21 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
|
|
|
187
187
|
onClick: (i) => F(a)
|
|
188
188
|
}, null, 8, ["text", "icon", "onClick"]))), 128))
|
|
189
189
|
])) : E("", !0),
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
r("div", Q, [
|
|
191
|
+
r("div", O, [
|
|
192
192
|
(d(), m(h(p), {
|
|
193
193
|
key: "start-" + c.value,
|
|
194
194
|
value: n.value.start,
|
|
195
195
|
onChange: Y,
|
|
196
196
|
mode: "date",
|
|
197
197
|
"max-date": S.value,
|
|
198
|
-
"min-date":
|
|
199
|
-
disabled:
|
|
200
|
-
|
|
198
|
+
"min-date": s.minDate,
|
|
199
|
+
disabled: s.disabled,
|
|
200
|
+
class: "min-w-[270px]",
|
|
201
|
+
readonly: s.readonly
|
|
201
202
|
}, null, 8, ["value", "max-date", "min-date", "disabled", "readonly"]))
|
|
202
203
|
]),
|
|
203
|
-
|
|
204
|
+
r("div", I, [
|
|
204
205
|
g(f, {
|
|
205
206
|
icon: "lucide:arrow-right",
|
|
206
207
|
class: "w-5 h-5 text-muted-foreground hidden sm:block opacity-50"
|
|
@@ -210,16 +211,17 @@ const $ = { class: "flex items-center justify-between gap-2 w-full" }, j = { cla
|
|
|
210
211
|
class: "w-5 h-5 text-muted-foreground sm:hidden opacity-50"
|
|
211
212
|
})
|
|
212
213
|
]),
|
|
213
|
-
|
|
214
|
+
r("div", U, [
|
|
214
215
|
(d(), m(h(p), {
|
|
215
216
|
key: "end-" + c.value,
|
|
216
217
|
value: n.value.end,
|
|
217
218
|
onChange: _,
|
|
218
219
|
mode: "date",
|
|
219
220
|
"min-date": C.value,
|
|
220
|
-
"max-date":
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
"max-date": s.maxDate,
|
|
222
|
+
class: "min-w-[270px]",
|
|
223
|
+
disabled: s.disabled,
|
|
224
|
+
readonly: s.readonly
|
|
223
225
|
}, null, 8, ["value", "min-date", "max-date", "disabled", "readonly"]))
|
|
224
226
|
])
|
|
225
227
|
])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as r, computed as d, openBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as r, computed as d, openBlock as a, createElementBlock as u, withModifiers as p, normalizeClass as f, createElementVNode as l, createBlock as g, createCommentVNode as v, toDisplayString as h, createVNode as x } from "vue";
|
|
2
|
+
import b from "../Switch.vue.js";
|
|
3
|
+
import y from "../Icon.vue.js";
|
|
4
4
|
import { $t as k } from "../../utils/i18n.js";
|
|
5
5
|
const w = { class: "flex items-center gap-2 flex-1 min-w-0" }, B = { class: "truncate font-medium" }, N = /* @__PURE__ */ r({
|
|
6
6
|
__name: "DropdownBooleanItem",
|
|
@@ -11,26 +11,29 @@ const w = { class: "flex items-center gap-2 flex-1 min-w-0" }, B = { class: "tru
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["change"],
|
|
13
13
|
setup(e, { emit: c }) {
|
|
14
|
-
const o = e, s = c, m = d(
|
|
14
|
+
const o = e, s = c, m = d(
|
|
15
|
+
() => o.option.labelI18n ? k(o.option.labelI18n) : o.option.label
|
|
16
|
+
), t = (n) => {
|
|
15
17
|
s("change", n, o.option);
|
|
16
18
|
};
|
|
17
|
-
return (n, i) => (
|
|
19
|
+
return (n, i) => (a(), u("div", {
|
|
20
|
+
tabindex: "0",
|
|
18
21
|
"data-dropdown-item": "",
|
|
19
22
|
class: f(["relative flex cursor-pointer select-none items-center justify-between rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", [
|
|
20
23
|
e.focused ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground"
|
|
21
24
|
]]),
|
|
22
25
|
onClick: i[0] || (i[0] = p((j) => t(!e.value), ["stop"]))
|
|
23
26
|
}, [
|
|
24
|
-
|
|
25
|
-
e.option.icon || e.option.emoji ? (
|
|
27
|
+
l("div", w, [
|
|
28
|
+
e.option.icon || e.option.emoji ? (a(), g(y, {
|
|
26
29
|
key: 0,
|
|
27
30
|
icon: e.option.icon,
|
|
28
31
|
emoji: e.option.emoji,
|
|
29
32
|
class: "h-4 w-4 shrink-0 opacity-70"
|
|
30
33
|
}, null, 8, ["icon", "emoji"])) : v("", !0),
|
|
31
|
-
|
|
34
|
+
l("span", B, h(m.value), 1)
|
|
32
35
|
]),
|
|
33
|
-
x(
|
|
36
|
+
x(b, {
|
|
34
37
|
"model-value": e.value,
|
|
35
38
|
class: "ml-3 shrink-0 scale-75 origin-right",
|
|
36
39
|
"onUpdate:modelValue": t
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DropdownMenu.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c4c5d9e4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ee, ref as
|
|
1
|
+
import { defineComponent as ee, ref as C, computed as v, watch as j, onMounted as te, onBeforeUnmount as le, openBlock as o, createElementBlock as i, createVNode as T, createCommentVNode as d, renderSlot as b, unref as r, normalizeStyle as se, normalizeClass as E, toDisplayString as N, createBlock as m, Fragment as P, renderList as oe, withCtx as V, createElementVNode as S, createSlots as ne, mergeProps as re, nextTick as ae } from "vue";
|
|
2
2
|
import O from "../Icon.vue.js";
|
|
3
3
|
import ie from "../Input.vue.js";
|
|
4
4
|
/* empty css */
|
|
@@ -7,7 +7,7 @@ import de from "./DropdownBooleanItem.vue.js";
|
|
|
7
7
|
import ue from "./DropdownGroupedLayout.vue.js";
|
|
8
8
|
import { useDropdownNavigation as fe } from "./composables/useDropdownNavigation.js";
|
|
9
9
|
import { useDropdownIds as me } from "./composables/useDropdownIds.js";
|
|
10
|
-
import { $t as
|
|
10
|
+
import { $t as _ } from "../../utils/i18n.js";
|
|
11
11
|
import he from "./Dropdown.vue.js";
|
|
12
12
|
const ve = ["dir"], ye = {
|
|
13
13
|
key: 0,
|
|
@@ -15,19 +15,19 @@ const ve = ["dir"], ye = {
|
|
|
15
15
|
}, ge = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "shrink-0"
|
|
18
|
-
}, be = {
|
|
18
|
+
}, be = ["tabindex"], ke = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "px-2 py-6 text-center text-sm text-muted-foreground"
|
|
21
|
-
},
|
|
21
|
+
}, we = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "h-px bg-border my-1 mx-1"
|
|
24
|
-
},
|
|
24
|
+
}, xe = ["onMouseenter"], pe = { class: "flex items-center flex-1 min-w-0" }, Se = { class: "truncate" }, Oe = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "flex justify-center py-2"
|
|
27
|
-
},
|
|
27
|
+
}, _e = {
|
|
28
28
|
key: 3,
|
|
29
29
|
class: "shrink-0"
|
|
30
|
-
},
|
|
30
|
+
}, De = /* @__PURE__ */ ee({
|
|
31
31
|
__name: "DropdownMenu",
|
|
32
32
|
props: {
|
|
33
33
|
options: { default: () => [] },
|
|
@@ -49,16 +49,16 @@ const ve = ["dir"], ye = {
|
|
|
49
49
|
direction: { default: "ltr" }
|
|
50
50
|
},
|
|
51
51
|
emits: ["select", "close", "load-more", "search"],
|
|
52
|
-
setup(a, { emit:
|
|
53
|
-
const t = a, f =
|
|
54
|
-
const e =
|
|
52
|
+
setup(a, { emit: D }) {
|
|
53
|
+
const t = a, f = D, $ = C(null), h = C(""), { getMenuId: z, getAllRecursiveIds: H } = me(), L = v(() => {
|
|
54
|
+
const e = _("vlite.dropdown.empty");
|
|
55
55
|
return e !== "vlite.dropdown.empty" ? e : "No options found";
|
|
56
|
-
}),
|
|
57
|
-
const e =
|
|
56
|
+
}), R = v(() => {
|
|
57
|
+
const e = _("vlite.dropdown.search");
|
|
58
58
|
return e !== "vlite.dropdown.search" ? e : "Search...";
|
|
59
|
-
}), u = v(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []),
|
|
59
|
+
}), u = v(() => t.options ? t.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), I = v(() => t.remote ? t.searchable : t.searchable && (u.value.length || 0) > 9);
|
|
60
60
|
let k = null;
|
|
61
|
-
|
|
61
|
+
j(h, (e) => {
|
|
62
62
|
t.remote && (k && clearTimeout(k), k = setTimeout(() => {
|
|
63
63
|
e !== void 0 && f("search", e);
|
|
64
64
|
}, t.debounceTime));
|
|
@@ -70,16 +70,16 @@ const ve = ["dir"], ye = {
|
|
|
70
70
|
e.disabled || f("select", e);
|
|
71
71
|
}, {
|
|
72
72
|
focusedIndex: y,
|
|
73
|
-
isKeyboardMode:
|
|
73
|
+
isKeyboardMode: x,
|
|
74
74
|
filteredOptions: F,
|
|
75
|
-
handleKeyDown:
|
|
76
|
-
handleMouseMove:
|
|
77
|
-
onMouseEnterItem:
|
|
75
|
+
handleKeyDown: M,
|
|
76
|
+
handleMouseMove: B,
|
|
77
|
+
onMouseEnterItem: p,
|
|
78
78
|
scrollToIndex: K
|
|
79
79
|
} = fe({
|
|
80
80
|
options: u,
|
|
81
81
|
searchQuery: h,
|
|
82
|
-
containerRef:
|
|
82
|
+
containerRef: $,
|
|
83
83
|
emit: (e, ...s) => f(e, ...s),
|
|
84
84
|
handleSelect: (e, s) => w(e)
|
|
85
85
|
}), g = v(() => t.remote ? h.value ? u.value : t.cachedOptions.length ? t.cachedOptions : u.value : F.value), U = (e) => {
|
|
@@ -113,26 +113,26 @@ const ve = ["dir"], ye = {
|
|
|
113
113
|
let e = -1;
|
|
114
114
|
t.layout !== "grouped" && (t.selectedIndex !== null && t.selectedIndex >= 0 ? e = t.selectedIndex : t.selected !== void 0 && typeof t.selected != "object" && (e = u.value.findIndex((s) => s.value === t.selected)), e !== -1 && K(e));
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
j(
|
|
117
117
|
() => g.value,
|
|
118
118
|
() => {
|
|
119
119
|
y.value = -1;
|
|
120
120
|
}
|
|
121
121
|
), te(() => {
|
|
122
|
-
W(), window.addEventListener("keydown",
|
|
122
|
+
W(), window.addEventListener("keydown", M);
|
|
123
123
|
}), le(() => {
|
|
124
|
-
window.removeEventListener("keydown",
|
|
124
|
+
window.removeEventListener("keydown", M);
|
|
125
125
|
});
|
|
126
|
-
const X = (e) => e.labelI18n ?
|
|
126
|
+
const X = (e) => e.labelI18n ? _(e.labelI18n) : e.label, Y = (e) => e.showChevron !== !1;
|
|
127
127
|
return (e, s) => (o(), i("div", {
|
|
128
128
|
class: "dropdown-menu w-full min-w-[150px] flex flex-col",
|
|
129
129
|
dir: a.direction
|
|
130
130
|
}, [
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
I.value ? (o(), i("div", ye, [
|
|
132
|
+
T(ie, {
|
|
133
133
|
modelValue: h.value,
|
|
134
134
|
"onUpdate:modelValue": s[0] || (s[0] = (l) => h.value = l),
|
|
135
|
-
placeholder:
|
|
135
|
+
placeholder: R.value,
|
|
136
136
|
icon: "lucide:search",
|
|
137
137
|
size: "sm",
|
|
138
138
|
class: "font-medium!",
|
|
@@ -148,19 +148,19 @@ const ve = ["dir"], ye = {
|
|
|
148
148
|
u.value.length > 0 || e.$slots.menu ? (o(), i("div", {
|
|
149
149
|
key: 2,
|
|
150
150
|
ref_key: "containerRef",
|
|
151
|
-
ref:
|
|
152
|
-
tabindex:
|
|
151
|
+
ref: $,
|
|
152
|
+
tabindex: I.value ? -1 : 0,
|
|
153
153
|
role: "menu",
|
|
154
|
-
class:
|
|
154
|
+
class: E([
|
|
155
155
|
"w-full p-1 space-y-0.5 overflow-y-auto overflow-x-hidden focus:outline-none flex-1 scrollbar-thin",
|
|
156
156
|
t.class
|
|
157
157
|
]),
|
|
158
158
|
style: se({ maxHeight: t.maxHeight }),
|
|
159
159
|
onMousemove: s[1] || (s[1] = //@ts-ignore
|
|
160
|
-
(...l) => r(
|
|
160
|
+
(...l) => r(B) && r(B)(...l)),
|
|
161
161
|
onScroll: A
|
|
162
162
|
}, [
|
|
163
|
-
g.value.length === 0 && u.value.length > 0 && !a.loading ? (o(), i("div",
|
|
163
|
+
g.value.length === 0 && u.value.length > 0 && !a.loading ? (o(), i("div", ke, N(L.value), 1)) : d("", !0),
|
|
164
164
|
a.layout === "grouped" ? (o(), m(ue, {
|
|
165
165
|
key: 1,
|
|
166
166
|
options: g.value,
|
|
@@ -168,14 +168,14 @@ const ve = ["dir"], ye = {
|
|
|
168
168
|
selectable: a.selectable,
|
|
169
169
|
columns: a.columns,
|
|
170
170
|
onSelect: w
|
|
171
|
-
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), i(
|
|
172
|
-
l.label === "---" ? (o(), i("div",
|
|
171
|
+
}, null, 8, ["options", "selected", "selectable", "columns"])) : (o(!0), i(P, { key: 2 }, oe(g.value, (l, n) => (o(), i(P, { key: n }, [
|
|
172
|
+
l.label === "---" ? (o(), i("div", we)) : l.data?.isBoolean ? (o(), m(de, {
|
|
173
173
|
key: 1,
|
|
174
174
|
option: l,
|
|
175
175
|
value: G(l),
|
|
176
|
-
focused: r(
|
|
176
|
+
focused: r(x) && r(y) === n,
|
|
177
177
|
onChange: J,
|
|
178
|
-
onMouseenter: (c) => r(
|
|
178
|
+
onMouseenter: (c) => r(p)(n)
|
|
179
179
|
}, null, 8, ["option", "value", "focused", "onMouseenter"])) : l.children && l.children.length > 0 ? (o(), m(he, {
|
|
180
180
|
key: 2,
|
|
181
181
|
"is-nested": !0,
|
|
@@ -184,24 +184,24 @@ const ve = ["dir"], ye = {
|
|
|
184
184
|
class: "w-full",
|
|
185
185
|
options: l.children,
|
|
186
186
|
selected: U(l),
|
|
187
|
-
menuId: r(
|
|
187
|
+
menuId: r(z)(l),
|
|
188
188
|
nestedPosition: t.nestedPosition,
|
|
189
189
|
nestedOffset: t.nestedOffset,
|
|
190
190
|
selectable: t.selectable,
|
|
191
|
-
ignoreClickOutside: r(
|
|
191
|
+
ignoreClickOutside: r(H)(l.children),
|
|
192
192
|
direction: a.direction,
|
|
193
193
|
onOnSelect: (c) => Q(l, c)
|
|
194
194
|
}, {
|
|
195
|
-
trigger:
|
|
195
|
+
trigger: V(() => [
|
|
196
196
|
S("div", {
|
|
197
197
|
tabindex: 0,
|
|
198
198
|
"data-dropdown-item": "",
|
|
199
|
-
class:
|
|
200
|
-
r(
|
|
199
|
+
class: E(["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 focus-visible:bg-accent focus-visible:text-accent-foreground focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-offset-1", [
|
|
200
|
+
r(x) && r(y) === n ? "bg-accent text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground",
|
|
201
201
|
l.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
202
202
|
l.triggerClass || l.class || ""
|
|
203
203
|
]]),
|
|
204
|
-
onMouseenter: (c) => r(
|
|
204
|
+
onMouseenter: (c) => r(p)(n)
|
|
205
205
|
}, [
|
|
206
206
|
S("div", pe, [
|
|
207
207
|
l.icon || l.emoji ? (o(), m(O, {
|
|
@@ -210,14 +210,14 @@ const ve = ["dir"], ye = {
|
|
|
210
210
|
emoji: l.emoji,
|
|
211
211
|
class: "mr-2 h-4 w-4 shrink-0 mt-0.5"
|
|
212
212
|
}, null, 8, ["icon", "emoji"])) : d("", !0),
|
|
213
|
-
S("span",
|
|
213
|
+
S("span", Se, N(X(l)), 1)
|
|
214
214
|
]),
|
|
215
215
|
Y(l) ? (o(), m(O, {
|
|
216
216
|
key: 0,
|
|
217
217
|
icon: a.direction === "rtl" ? "lucide:chevron-left" : "lucide:chevron-right",
|
|
218
218
|
class: "h-4 w-4 text-muted-foreground shrink-0 ml-2"
|
|
219
219
|
}, null, 8, ["icon"])) : d("", !0)
|
|
220
|
-
], 42,
|
|
220
|
+
], 42, xe)
|
|
221
221
|
]),
|
|
222
222
|
_: 2
|
|
223
223
|
}, 1032, ["position", "offset", "options", "selected", "menuId", "nestedPosition", "nestedOffset", "selectable", "ignoreClickOutside", "direction", "onOnSelect"])) : (o(), m(ce, {
|
|
@@ -225,34 +225,34 @@ const ve = ["dir"], ye = {
|
|
|
225
225
|
option: l,
|
|
226
226
|
index: n,
|
|
227
227
|
selected: q(l),
|
|
228
|
-
focused: r(
|
|
228
|
+
focused: r(x) && r(y) === n,
|
|
229
229
|
selectable: a.selectable,
|
|
230
230
|
onClick: (c) => w(l),
|
|
231
|
-
onMouseenter: (c) => r(
|
|
231
|
+
onMouseenter: (c) => r(p)(n)
|
|
232
232
|
}, ne({ _: 2 }, [
|
|
233
233
|
e.$slots.item ? {
|
|
234
234
|
name: "default",
|
|
235
|
-
fn:
|
|
235
|
+
fn: V((c) => [
|
|
236
236
|
b(e.$slots, "item", re({ ref_for: !0 }, c), void 0, !0)
|
|
237
237
|
]),
|
|
238
238
|
key: "0"
|
|
239
239
|
} : void 0
|
|
240
240
|
]), 1032, ["option", "index", "selected", "focused", "selectable", "onClick", "onMouseenter"]))
|
|
241
241
|
], 64))), 128)),
|
|
242
|
-
a.loading ? (o(), i("div",
|
|
243
|
-
|
|
242
|
+
a.loading ? (o(), i("div", Oe, [
|
|
243
|
+
T(O, {
|
|
244
244
|
icon: "lucide:loader-2",
|
|
245
245
|
class: "w-4 h-4 animate-spin text-muted-foreground"
|
|
246
246
|
})
|
|
247
247
|
])) : d("", !0),
|
|
248
248
|
b(e.$slots, "menu", {}, void 0, !0)
|
|
249
|
-
],
|
|
250
|
-
e.$slots.footer ? (o(), i("div",
|
|
249
|
+
], 46, be)) : d("", !0),
|
|
250
|
+
e.$slots.footer ? (o(), i("div", _e, [
|
|
251
251
|
b(e.$slots, "footer", {}, void 0, !0)
|
|
252
252
|
])) : d("", !0)
|
|
253
253
|
], 8, ve));
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
256
|
export {
|
|
257
|
-
|
|
257
|
+
De as default
|
|
258
258
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IForm } from './types';
|
|
2
2
|
import { InputVariant, InputSize, InputRounded } from '../../types';
|
|
3
3
|
interface Props {
|
|
4
|
+
name?: string;
|
|
4
5
|
modelValue?: Record<string, any>[];
|
|
5
6
|
schema: IForm[];
|
|
6
7
|
headers?: string[];
|
|
@@ -18,6 +19,8 @@ interface Props {
|
|
|
18
19
|
showRowNumbers?: boolean;
|
|
19
20
|
/** All form values for context */
|
|
20
21
|
values?: Record<string, any>;
|
|
22
|
+
/** Form Validation errors passed down */
|
|
23
|
+
errors?: Record<string, string>;
|
|
21
24
|
isUpdate?: boolean;
|
|
22
25
|
}
|
|
23
26
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
@@ -38,5 +41,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
38
41
|
minRows: number;
|
|
39
42
|
addButtonText: string;
|
|
40
43
|
showRowNumbers: boolean;
|
|
44
|
+
errors: Record<string, string>;
|
|
41
45
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
42
46
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CustomFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3674ca13"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|