golden-logic-ui 1.3.0 → 1.3.2
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/dist/components/GeneralComponents/DataTable/DatatableDeleteAction.vue.js +32 -28
- package/dist/components/GeneralComponents/DataTable/DatatableDeleteEditAction.vue.js +35 -31
- package/dist/components/GeneralComponents/GlDropdown.vue.js +136 -136
- package/dist/components/GeneralComponents/GlTextInput.vue.js +38 -30
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ref as c, resolveDirective as x, createElementBlock as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ref as c, resolveDirective as x, createElementBlock as d, openBlock as n, Fragment as k, createVNode as D, withDirectives as u, createCommentVNode as p, createElementVNode as e, withModifiers as _, createTextVNode as C, vShow as A } from "vue";
|
|
2
|
+
import M from "../DeleteConfirmationModal.vue.js";
|
|
3
|
+
import g from "../../../Stores/toast.js";
|
|
4
4
|
const O = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex lg:justify-center"
|
|
7
7
|
}, j = { class: "absolute z-10 mt-5 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600" }, B = {
|
|
8
8
|
class: "py-2 text-sm text-gray-700 dark:text-gray-200",
|
|
9
9
|
"aria-labelledby": "dropdownDividerButton"
|
|
10
|
-
}, N = { key: 0 },
|
|
10
|
+
}, N = { key: 0 }, T = {
|
|
11
11
|
__name: "DatatableDeleteAction",
|
|
12
12
|
props: {
|
|
13
13
|
field: {
|
|
@@ -32,37 +32,41 @@ const O = {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
emits: ["deleteAction"],
|
|
35
|
-
setup(t, { emit:
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
}, f = () => {
|
|
39
|
-
a.value = !0;
|
|
40
|
-
}, d = () => {
|
|
41
|
-
l.value = !1;
|
|
35
|
+
setup(t, { emit: m }) {
|
|
36
|
+
const a = t, s = c(!1), l = c(!1), f = () => {
|
|
37
|
+
s.value = !1;
|
|
42
38
|
}, y = () => {
|
|
39
|
+
s.value = !0;
|
|
40
|
+
}, i = () => {
|
|
41
|
+
l.value = !1;
|
|
42
|
+
}, h = () => {
|
|
43
43
|
l.value = !0;
|
|
44
|
-
}, v =
|
|
45
|
-
axios.delete(`${
|
|
46
|
-
|
|
44
|
+
}, v = m, w = () => {
|
|
45
|
+
axios.delete(`${a.xprops.route}/${a.row.id}`).then(() => {
|
|
46
|
+
i(), v("deleteAction"), g.methods.add({
|
|
47
47
|
message: "Item deleted successfully.",
|
|
48
48
|
type: "success",
|
|
49
49
|
duration: 5e3
|
|
50
50
|
});
|
|
51
51
|
}).catch((o) => {
|
|
52
|
-
|
|
52
|
+
i(), g.methods.add({
|
|
53
|
+
message: o.response?.data?.message ?? a.language?.delete_failed ?? "That item could not be deleted.",
|
|
54
|
+
type: "error",
|
|
55
|
+
duration: 5e3
|
|
56
|
+
});
|
|
53
57
|
});
|
|
54
58
|
};
|
|
55
59
|
return (o, r) => {
|
|
56
|
-
const
|
|
57
|
-
return
|
|
58
|
-
|
|
60
|
+
const b = x("click-outside");
|
|
61
|
+
return n(), d(k, null, [
|
|
62
|
+
D(M, {
|
|
59
63
|
isOpen: l.value,
|
|
60
|
-
onConfirmDelete:
|
|
61
|
-
onCancelDelete:
|
|
64
|
+
onConfirmDelete: w,
|
|
65
|
+
onCancelDelete: i
|
|
62
66
|
}, null, 8, ["isOpen"]),
|
|
63
|
-
t.row && o.can(`delete_${t.xprops.permission}`) ? u((
|
|
67
|
+
t.row && o.can(`delete_${t.xprops.permission}`) ? u((n(), d("div", O, [
|
|
64
68
|
e("button", {
|
|
65
|
-
onClick:
|
|
69
|
+
onClick: y,
|
|
66
70
|
class: "inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-hidden dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",
|
|
67
71
|
type: "button"
|
|
68
72
|
}, r[0] || (r[0] = [
|
|
@@ -78,27 +82,27 @@ const O = {
|
|
|
78
82
|
])),
|
|
79
83
|
u(e("div", j, [
|
|
80
84
|
e("ul", B, [
|
|
81
|
-
o.can(`delete_${t.xprops.permission}`) ? (
|
|
85
|
+
o.can(`delete_${t.xprops.permission}`) ? (n(), d("li", N, [
|
|
82
86
|
e("a", {
|
|
83
87
|
href: "#",
|
|
84
|
-
onClick:
|
|
88
|
+
onClick: _(h, ["prevent"]),
|
|
85
89
|
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
86
90
|
}, r[1] || (r[1] = [
|
|
87
91
|
e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
|
|
88
|
-
|
|
92
|
+
C(" Remove")
|
|
89
93
|
]))
|
|
90
94
|
])) : p("", !0)
|
|
91
95
|
])
|
|
92
96
|
], 512), [
|
|
93
|
-
[
|
|
97
|
+
[A, s.value]
|
|
94
98
|
])
|
|
95
99
|
])), [
|
|
96
|
-
[
|
|
100
|
+
[b, f]
|
|
97
101
|
]) : p("", !0)
|
|
98
102
|
], 64);
|
|
99
103
|
};
|
|
100
104
|
}
|
|
101
105
|
};
|
|
102
106
|
export {
|
|
103
|
-
|
|
107
|
+
T as default
|
|
104
108
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as g, resolveDirective as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { ref as g, resolveDirective as C, createElementBlock as l, openBlock as i, Fragment as $, createVNode as O, withDirectives as m, createCommentVNode as c, createElementVNode as t, withModifiers as p, createTextVNode as f, toDisplayString as y, vShow as j } from "vue";
|
|
2
|
+
import M from "../DeleteConfirmationModal.vue.js";
|
|
3
|
+
import v from "../../../Stores/toast.js";
|
|
4
4
|
const B = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex lg:justify-center"
|
|
@@ -38,40 +38,44 @@ const B = {
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
emits: ["deleteAction", "editAction"],
|
|
41
|
-
setup(e, { emit:
|
|
42
|
-
const
|
|
41
|
+
setup(e, { emit: h }) {
|
|
42
|
+
const a = e, s = g(!1), n = g(!1), d = () => {
|
|
43
43
|
n.value = !1;
|
|
44
|
-
}, h = () => {
|
|
45
|
-
n.value = !0;
|
|
46
44
|
}, x = () => {
|
|
47
|
-
|
|
45
|
+
n.value = !0;
|
|
48
46
|
}, k = () => {
|
|
47
|
+
s.value = !1;
|
|
48
|
+
}, w = () => {
|
|
49
49
|
s.value = !0;
|
|
50
|
-
}, u =
|
|
50
|
+
}, u = h, b = (o) => {
|
|
51
51
|
u("editAction", o);
|
|
52
|
-
},
|
|
53
|
-
axios.delete(`${
|
|
54
|
-
|
|
55
|
-
message:
|
|
52
|
+
}, D = () => {
|
|
53
|
+
axios.delete(`${a.xprops.route}/${a.row.id}`).then(() => {
|
|
54
|
+
d(), u("deleteAction"), v.methods.add({
|
|
55
|
+
message: a.language?.item_deleted_successfully ?? "Item deleted successfully.",
|
|
56
56
|
type: "success",
|
|
57
57
|
duration: 5e3
|
|
58
58
|
});
|
|
59
59
|
}).catch((o) => {
|
|
60
|
-
|
|
60
|
+
d(), v.methods.add({
|
|
61
|
+
message: o.response?.data?.message ?? a.language?.delete_failed ?? "That item could not be deleted.",
|
|
62
|
+
type: "error",
|
|
63
|
+
duration: 5e3
|
|
64
|
+
});
|
|
61
65
|
});
|
|
62
66
|
};
|
|
63
67
|
return (o, r) => {
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
|
|
68
|
+
const A = C("click-outside");
|
|
69
|
+
return i(), l($, null, [
|
|
70
|
+
O(M, {
|
|
67
71
|
language: e.language,
|
|
68
72
|
isOpen: n.value,
|
|
69
|
-
onConfirmDelete:
|
|
70
|
-
onCancelDelete:
|
|
73
|
+
onConfirmDelete: D,
|
|
74
|
+
onCancelDelete: d
|
|
71
75
|
}, null, 8, ["language", "isOpen"]),
|
|
72
|
-
e.row && (o.can(`delete_${e.xprops.permission}`) || o.can(`access_${e.xprops.permission}`)) ?
|
|
76
|
+
e.row && (o.can(`delete_${e.xprops.permission}`) || o.can(`access_${e.xprops.permission}`)) ? m((i(), l("div", B, [
|
|
73
77
|
t("button", {
|
|
74
|
-
onClick:
|
|
78
|
+
onClick: w,
|
|
75
79
|
class: "inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-hidden dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",
|
|
76
80
|
type: "button"
|
|
77
81
|
}, r[1] || (r[1] = [
|
|
@@ -85,35 +89,35 @@ const B = {
|
|
|
85
89
|
t("path", { d: "M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" })
|
|
86
90
|
], -1)
|
|
87
91
|
])),
|
|
88
|
-
|
|
92
|
+
m(t("div", E, [
|
|
89
93
|
t("ul", N, [
|
|
90
|
-
o.can(`access_${e.xprops.permission}`) ? (
|
|
94
|
+
o.can(`access_${e.xprops.permission}`) ? (i(), l("li", S, [
|
|
91
95
|
t("a", {
|
|
92
96
|
href: "#",
|
|
93
|
-
onClick: r[0] || (r[0] =
|
|
97
|
+
onClick: r[0] || (r[0] = p((T) => b(e.row), ["prevent"])),
|
|
94
98
|
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
95
99
|
}, [
|
|
96
100
|
r[2] || (r[2] = t("i", { class: "mr-1 fa-solid fa-pen-to-square opacity-80" }, null, -1)),
|
|
97
101
|
f(" " + y(e.language?.edit ?? "Edit"), 1)
|
|
98
102
|
])
|
|
99
|
-
])) :
|
|
100
|
-
o.can(`delete_${e.xprops.permission}`) ? (
|
|
103
|
+
])) : c("", !0),
|
|
104
|
+
o.can(`delete_${e.xprops.permission}`) ? (i(), l("li", V, [
|
|
101
105
|
t("a", {
|
|
102
106
|
href: "#",
|
|
103
|
-
onClick:
|
|
107
|
+
onClick: p(x, ["prevent"]),
|
|
104
108
|
class: "block px-4 py-2 text-red-600 hover:text-white hover:bg-red-600 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600"
|
|
105
109
|
}, [
|
|
106
110
|
r[3] || (r[3] = t("i", { class: "mr-1 fa-solid fa-trash-can opacity-80" }, null, -1)),
|
|
107
111
|
f(" " + y(e.language?.remove ?? "Remove"), 1)
|
|
108
112
|
])
|
|
109
|
-
])) :
|
|
113
|
+
])) : c("", !0)
|
|
110
114
|
])
|
|
111
115
|
], 512), [
|
|
112
|
-
[
|
|
116
|
+
[j, s.value]
|
|
113
117
|
])
|
|
114
118
|
])), [
|
|
115
|
-
[
|
|
116
|
-
]) :
|
|
119
|
+
[A, k]
|
|
120
|
+
]) : c("", !0)
|
|
117
121
|
], 64);
|
|
118
122
|
};
|
|
119
123
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
1
|
+
import { ref as c, shallowRef as Y, onMounted as ve, onBeforeUnmount as me, watch as M, createElementBlock as f, openBlock as v, Fragment as Z, createCommentVNode as p, normalizeClass as B, createElementVNode as s, toDisplayString as w, withDirectives as R, withModifiers as ee, vShow as te, vModelText as ge, renderList as he, nextTick as pe } from "vue";
|
|
2
|
+
const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3 mb-4" }, we = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "bg-blue-100 text-blue-800 text-sm font-medium mb-2 mt-2 me-2 px-2.5 py-0.5 rounded-sm dark:bg-blue-900 dark:text-blue-300"
|
|
5
|
-
},
|
|
5
|
+
}, be = ["name", "id", "value"], ke = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "dropdown"
|
|
8
|
-
},
|
|
8
|
+
}, Se = { class: "relative focus:ring-blue-500 focus:border-blue-500 dark:border-gray-600 dark:focus:ring-blue-500 dark:focus:border-blue-500" }, _e = { class: "relative showOptions" }, Ce = ["value", "placeholder"], De = { class: "text-gray-700 bg-white border dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 absolute w-full z-999999999 rounded-md mt-1 pt-1" }, Oe = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "border-b border-gray-200 dark:border-gray-700"
|
|
11
|
-
},
|
|
11
|
+
}, Ee = { class: "relative" }, Be = ["id", "placeholder"], $e = { class: "flex items-center py-2 pr-4" }, Le = ["onClick", "onMousedown", "id"], Me = { class: "flex justify-between items-center py-2" }, Ie = ["innerHTML"], Te = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "flex items-center shrink-0 w-4 h-4 text-green-500 ltr:right-2 rtl:left-2 dark:text-green-400",
|
|
14
14
|
"aria-hidden": "true",
|
|
15
15
|
xmlns: "http://www.w3.org/2000/svg",
|
|
16
16
|
fill: "none",
|
|
17
17
|
viewBox: "0 0 16 12"
|
|
18
|
-
},
|
|
18
|
+
}, Ue = {
|
|
19
19
|
key: 2,
|
|
20
20
|
class: "p-2 text-center text-gray-500"
|
|
21
|
-
},
|
|
21
|
+
}, Ve = {
|
|
22
22
|
key: 3,
|
|
23
23
|
class: "p-2 text-gray-500"
|
|
24
|
-
},
|
|
24
|
+
}, je = { class: "block mt-1 text-sm font-normal leading-5 text-red-500" }, Ae = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, Ne = {
|
|
25
25
|
__name: "GlDropdown",
|
|
26
26
|
props: {
|
|
27
27
|
modelValue: {
|
|
@@ -109,51 +109,51 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
emits: ["update:modelValue", "selected", "selectionChanged"],
|
|
112
|
-
setup(r, { emit:
|
|
113
|
-
const o = r, b =
|
|
114
|
-
let
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
112
|
+
setup(r, { emit: le }) {
|
|
113
|
+
const o = r, b = le, a = c({}), F = c(!1), y = c(0), x = c(!1), m = c(""), g = c(""), $ = c(!1), k = c(1), S = c(null), L = c(1), i = Y([]), O = c(!1), I = Y([]), U = c([]), ne = c(null), H = c(null);
|
|
114
|
+
let E = !1, h = null, V = 0, _ = null;
|
|
115
|
+
const z = (e) => e?.name === "CanceledError" || e?.name === "AbortError" || typeof axios < "u" && axios.isCancel?.(e), j = async (e = "down") => {
|
|
116
|
+
if ($.value || !o.api_url) return;
|
|
117
117
|
h && h.abort(), h = new AbortController();
|
|
118
|
-
const t = ++
|
|
119
|
-
|
|
118
|
+
const t = ++V;
|
|
119
|
+
$.value = !0;
|
|
120
120
|
try {
|
|
121
|
-
const l = e === "up" ? Math.max(
|
|
122
|
-
params: { search:
|
|
121
|
+
const l = e === "up" ? Math.max(k.value - 1, L.value) : k.value, { data: n } = await axios.get(o.api_url, {
|
|
122
|
+
params: { search: m.value, page: l, per_page: 20 },
|
|
123
123
|
signal: h.signal
|
|
124
124
|
});
|
|
125
|
-
if (
|
|
125
|
+
if (E || t !== V) return;
|
|
126
126
|
if (!n || !n.data) {
|
|
127
|
-
i.value = [];
|
|
127
|
+
i.value = [], O.value = !1;
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
const u =
|
|
130
|
+
const u = W(n.data);
|
|
131
131
|
if (e === "down") {
|
|
132
|
-
const d = i.value.length ? i.value.concat(u) : u,
|
|
133
|
-
|
|
132
|
+
const d = i.value.length ? i.value.concat(u) : u, D = a.value;
|
|
133
|
+
C(D) && D.id !== void 0 && D.name && !d.some((T) => String(T.id) === String(D.id)) && d.unshift(D), i.value = d, k.value++, S.value = n.last_page, O.value = !0;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
S.value || (S.value = n.last_page), L.value || (L.value = 1);
|
|
136
136
|
} catch (l) {
|
|
137
|
-
if (
|
|
137
|
+
if (z(l)) return;
|
|
138
138
|
console.error("Error fetching data:", l);
|
|
139
139
|
} finally {
|
|
140
|
-
!
|
|
140
|
+
!E && t === V && ($.value = !1, h = null);
|
|
141
141
|
}
|
|
142
|
-
},
|
|
142
|
+
}, ae = async (e) => {
|
|
143
143
|
if (!o.api_url || e === null || e === void 0 || e === "") return null;
|
|
144
144
|
try {
|
|
145
145
|
const { data: t } = await axios.get(o.api_url, {
|
|
146
146
|
params: { search: e, per_page: 20 }
|
|
147
147
|
});
|
|
148
|
-
if (
|
|
148
|
+
if (E) return null;
|
|
149
149
|
const l = t?.data;
|
|
150
150
|
if (!l || !l.length) return null;
|
|
151
151
|
const n = String(e);
|
|
152
|
-
return
|
|
152
|
+
return W(l).find((u) => String(u.id) === n) || null;
|
|
153
153
|
} catch (t) {
|
|
154
|
-
return
|
|
154
|
+
return z(t) || console.error("Error fetching option by id:", t), null;
|
|
155
155
|
}
|
|
156
|
-
},
|
|
156
|
+
}, oe = async (e) => {
|
|
157
157
|
const t = typeof e == "object" && e !== null ? e.id : e;
|
|
158
158
|
if (t == null || t === "") {
|
|
159
159
|
a.value = {};
|
|
@@ -166,27 +166,27 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
166
166
|
a.value = n;
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
const u = await
|
|
170
|
-
|
|
171
|
-
},
|
|
169
|
+
const u = await ae(t);
|
|
170
|
+
E || (u ? (a.value = u, i.value.some((d) => String(d.id) === String(u.id)) || (i.value = [u, ...i.value])) : o.allow_custom ? a.value = { id: t, name: t } : a.value = { id: t, name: "" });
|
|
171
|
+
}, re = (e) => {
|
|
172
172
|
const t = e.target;
|
|
173
|
-
t && t.scrollHeight - t.clientHeight <= t.scrollTop + 10 &&
|
|
174
|
-
},
|
|
175
|
-
e.target && (document.activeElement.classList.contains("showOptions" + g.value) ? x.value ||
|
|
176
|
-
},
|
|
173
|
+
t && t.scrollHeight - t.clientHeight <= t.scrollTop + 10 && k.value <= S.value && j("down");
|
|
174
|
+
}, K = (e) => {
|
|
175
|
+
e.target && (document.activeElement.classList.contains("showOptions" + g.value) ? x.value || A() : e.target.id != o.field_name + "search" + g.value && e.target.id != o.field_name && !e.target.classList.contains("showOptions" + g.value) && (P(), y.value = 0, x.value = !1));
|
|
176
|
+
}, A = () => {
|
|
177
177
|
if (!o.show) {
|
|
178
178
|
if (x.value) {
|
|
179
179
|
x.value = !1;
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
m.value = "", x.value = !0, o.api_url && (!O.value || i.value.length === 0) && (k.value = 1, S.value = null, i.value = [], O.value = !1, j("down")), pe(() => {
|
|
183
183
|
const e = document.getElementById(
|
|
184
184
|
`${o.field_name}search${g.value}`
|
|
185
185
|
);
|
|
186
186
|
e && e.focus();
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
},
|
|
189
|
+
}, q = () => {
|
|
190
190
|
const e = (t) => {
|
|
191
191
|
if (o.allow_custom && t) {
|
|
192
192
|
const l = typeof t == "object" ? t.id : t;
|
|
@@ -194,7 +194,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
194
194
|
}
|
|
195
195
|
return {};
|
|
196
196
|
};
|
|
197
|
-
return
|
|
197
|
+
return C(a.value) ? typeof a.value == "object" ? i.value.find(
|
|
198
198
|
(t) => String(t.id) === String(a.value.id)
|
|
199
199
|
) || e(a.value) : i.value.find(
|
|
200
200
|
(t) => String(t.id) === String(a.value)
|
|
@@ -204,34 +204,34 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
204
204
|
(t) => String(t.id) === String(o.modelValue)
|
|
205
205
|
) || e(o.modelValue) : {};
|
|
206
206
|
};
|
|
207
|
-
|
|
208
|
-
g.value =
|
|
209
|
-
}),
|
|
210
|
-
|
|
207
|
+
ve(() => {
|
|
208
|
+
g.value = ue(), o.show || (document.body.addEventListener("click", G), document.addEventListener("focusin", K));
|
|
209
|
+
}), me(() => {
|
|
210
|
+
E = !0, h && (h.abort(), h = null), _ && (clearTimeout(_), _ = null), document.body.removeEventListener("click", G), document.removeEventListener("focusin", K);
|
|
211
211
|
});
|
|
212
|
-
function
|
|
213
|
-
const e =
|
|
212
|
+
function ie() {
|
|
213
|
+
const e = I.value, t = o.maxItem, l = m.value;
|
|
214
214
|
if (!l)
|
|
215
215
|
return e.length > t ? e.slice(0, t) : e;
|
|
216
216
|
const n = l.toLowerCase(), u = [];
|
|
217
|
-
for (let d = 0,
|
|
218
|
-
const
|
|
219
|
-
String(
|
|
217
|
+
for (let d = 0, D = e.length; d < D && u.length < t; d++) {
|
|
218
|
+
const T = e[d];
|
|
219
|
+
String(T.name).toLowerCase().includes(n) && u.push(T);
|
|
220
220
|
}
|
|
221
221
|
return u;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function se(e) {
|
|
224
224
|
switch (e.key) {
|
|
225
225
|
case "ArrowUp":
|
|
226
226
|
case "ArrowDown":
|
|
227
|
-
e.preventDefault(),
|
|
227
|
+
e.preventDefault(), Q(e.key);
|
|
228
228
|
break;
|
|
229
229
|
case "Enter":
|
|
230
|
-
|
|
230
|
+
Q(e.key);
|
|
231
231
|
break;
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function ue() {
|
|
235
235
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
236
236
|
return crypto.randomUUID();
|
|
237
237
|
let e = Date.now();
|
|
@@ -240,27 +240,27 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
240
240
|
return e = Math.floor(e / 16), (t === "x" ? l : l & 3 | 8).toString(16);
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function C(e) {
|
|
244
244
|
return e && typeof e == "object" && Object.keys(e).length > 0;
|
|
245
245
|
}
|
|
246
|
-
function K(e) {
|
|
247
|
-
e.target.id != o.field_name + "search" + g.value && e.target.id != o.field_name && !e.target.classList.contains("showOptions" + g.value) && (N(), y.value = 0, x.value = !1);
|
|
248
|
-
}
|
|
249
246
|
function G(e) {
|
|
250
|
-
|
|
247
|
+
e.target.id != o.field_name + "search" + g.value && e.target.id != o.field_name && !e.target.classList.contains("showOptions" + g.value) && (P(), y.value = 0, x.value = !1);
|
|
248
|
+
}
|
|
249
|
+
function J(e) {
|
|
250
|
+
const t = `${e}${g.value}`, l = document.getElementById(t), n = H.value;
|
|
251
251
|
if (l && n) {
|
|
252
252
|
const u = l.getBoundingClientRect(), d = n.getBoundingClientRect();
|
|
253
253
|
u.top < d.top ? n.scrollTop -= d.top - u.top : u.bottom > d.bottom && (n.scrollTop += u.bottom - d.bottom);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function de(e) {
|
|
257
257
|
const t = `${e}${g.value}`, l = document.getElementById(t);
|
|
258
258
|
l && l.click();
|
|
259
259
|
}
|
|
260
|
-
function J(e) {
|
|
261
|
-
e === "ArrowDown" && y.value < i.value.length && (y.value++, G(y.value)), e === "ArrowUp" && y.value > 1 && (y.value--, G(y.value)), e === "Enter" && ue(y.value);
|
|
262
|
-
}
|
|
263
260
|
function Q(e) {
|
|
261
|
+
e === "ArrowDown" && y.value < i.value.length && (y.value++, J(y.value)), e === "ArrowUp" && y.value > 1 && (y.value--, J(y.value)), e === "Enter" && de(y.value);
|
|
262
|
+
}
|
|
263
|
+
function W(e) {
|
|
264
264
|
const t = new Array(e.length);
|
|
265
265
|
for (let l = 0; l < e.length; l++) {
|
|
266
266
|
const n = e[l];
|
|
@@ -268,7 +268,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
268
268
|
}
|
|
269
269
|
return t;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function ce() {
|
|
272
272
|
const e = o.options, t = new Array(e.length);
|
|
273
273
|
for (let l = 0; l < e.length; l++) {
|
|
274
274
|
const n = e[l];
|
|
@@ -276,33 +276,33 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
276
276
|
}
|
|
277
277
|
return t;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const e =
|
|
281
|
-
|
|
279
|
+
function X() {
|
|
280
|
+
const e = m.value, t = { id: e, name: e }, l = String(e);
|
|
281
|
+
U.value.some((n) => String(n.id) === l) || U.value.push(t), i.value.some((n) => String(n.id) === l) || (i.value = [...i.value, t], I.value = [...I.value, t]), N(t);
|
|
282
282
|
}
|
|
283
|
-
function
|
|
284
|
-
|
|
283
|
+
function N(e) {
|
|
284
|
+
F.value = !0, a.value = e, x.value = !1, b("update:modelValue", a.value.id), b("selected", a.value), b("selectionChanged", a.value);
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
o.show || (a.value = {},
|
|
286
|
+
function fe() {
|
|
287
|
+
o.show || (a.value = {}, m.value = "", b("update:modelValue", ""), b("selected", a.value), b("selectionChanged", a.value), A());
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
(!a.value || !a.value.id) && (a.value = {},
|
|
289
|
+
function P() {
|
|
290
|
+
(!a.value || !a.value.id) && (a.value = {}, m.value = "");
|
|
291
291
|
}
|
|
292
|
-
return M(
|
|
292
|
+
return M(m, () => {
|
|
293
293
|
if (!o.api_url) {
|
|
294
|
-
i.value =
|
|
294
|
+
i.value = ie(), i.value.length === 0 && (a.value = {});
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
_ && clearTimeout(_), _ = setTimeout(() => {
|
|
298
|
+
_ = null, !E && (k.value = 1, S.value = null, L.value = 1, i.value = [], O.value = !1, j("down"));
|
|
299
299
|
}, 250);
|
|
300
300
|
}), M(a, (e) => {
|
|
301
|
-
|
|
301
|
+
C(e) && e.id !== o.modelValue && b("update:modelValue", e.id);
|
|
302
302
|
}), M(
|
|
303
303
|
() => o.api_url,
|
|
304
304
|
() => {
|
|
305
|
-
h && (h.abort(), h = null),
|
|
305
|
+
h && (h.abort(), h = null), k.value = 1, S.value = null, L.value = 1, i.value = [], O.value = !1;
|
|
306
306
|
},
|
|
307
307
|
{ immediate: !0 }
|
|
308
308
|
), M(
|
|
@@ -312,74 +312,74 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
312
312
|
a.value = {};
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
-
o.api_url ?
|
|
315
|
+
o.api_url ? F.value ? a.value = q() : await oe(e) : a.value = q();
|
|
316
316
|
},
|
|
317
317
|
{ immediate: !0 }
|
|
318
318
|
), M(
|
|
319
319
|
() => o.options,
|
|
320
320
|
() => {
|
|
321
321
|
if (!o.api_url) {
|
|
322
|
-
const e =
|
|
323
|
-
for (const n of
|
|
322
|
+
const e = ce(), t = new Set(e.map((n) => String(n.id))), l = e;
|
|
323
|
+
for (const n of U.value) {
|
|
324
324
|
const u = String(n.id);
|
|
325
325
|
t.has(u) || (l.push(n), t.add(u));
|
|
326
326
|
}
|
|
327
|
-
|
|
327
|
+
I.value = l, i.value = l, a.value = q();
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
330
|
// deep so the list still updates when options load late by mutating the SAME
|
|
331
331
|
// array in place (e.g. column.options.push(...)) — a reference-only watch
|
|
332
332
|
// would miss that and leave the dropdown list empty.
|
|
333
333
|
{ immediate: !0, deep: !0 }
|
|
334
|
-
), (e, t) => (
|
|
335
|
-
r.show ? (
|
|
334
|
+
), (e, t) => (v(), f(Z, null, [
|
|
335
|
+
r.show ? (v(), f("div", {
|
|
336
336
|
key: 0,
|
|
337
|
-
class:
|
|
337
|
+
class: B(r.field_name)
|
|
338
338
|
}, [
|
|
339
|
-
s("h3",
|
|
340
|
-
s("p",
|
|
341
|
-
|
|
339
|
+
s("h3", ye, w(r.label_name), 1),
|
|
340
|
+
s("p", xe, [
|
|
341
|
+
C(a.value) ? (v(), f("span", we, w(a.value?.name), 1)) : p("", !0)
|
|
342
342
|
]),
|
|
343
343
|
t[6] || (t[6] = s("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
344
344
|
], 2)) : p("", !0),
|
|
345
|
-
r.show ? p("", !0) : (
|
|
345
|
+
r.show ? p("", !0) : (v(), f("div", {
|
|
346
346
|
key: 1,
|
|
347
|
-
class:
|
|
347
|
+
class: B(r.field_name)
|
|
348
348
|
}, [
|
|
349
349
|
s("input", {
|
|
350
350
|
type: "hidden",
|
|
351
351
|
name: r.field_name,
|
|
352
352
|
id: r.field_name,
|
|
353
353
|
value: a.value?.id
|
|
354
|
-
}, null, 8,
|
|
355
|
-
r.options ? (
|
|
356
|
-
r.label_name ? (
|
|
354
|
+
}, null, 8, be),
|
|
355
|
+
r.options ? (v(), f("div", ke, [
|
|
356
|
+
r.label_name ? (v(), f("label", {
|
|
357
357
|
key: 0,
|
|
358
|
-
class:
|
|
358
|
+
class: B({
|
|
359
359
|
"gl-label-form": r.error_message == "",
|
|
360
360
|
"gl-label-form-invalid": r.error_message !== "",
|
|
361
361
|
required: r.is_required
|
|
362
362
|
})
|
|
363
363
|
}, w(r.label_name), 3)) : p("", !0),
|
|
364
|
-
s("div",
|
|
365
|
-
s("div",
|
|
364
|
+
s("div", Se, [
|
|
365
|
+
s("div", _e, [
|
|
366
366
|
s("input", {
|
|
367
367
|
ref_key: "myDivDropDown",
|
|
368
|
-
ref:
|
|
369
|
-
class:
|
|
368
|
+
ref: ne,
|
|
369
|
+
class: B([{
|
|
370
370
|
"gl-input-form": r.error_message == "",
|
|
371
371
|
"gl-input-form-invalid": r.error_message !== "",
|
|
372
372
|
[`showOptions${g.value}`]: !0,
|
|
373
|
-
"pr-14!":
|
|
374
|
-
"pr-8!": !(
|
|
373
|
+
"pr-14!": C(a.value) && r.has_cancel,
|
|
374
|
+
"pr-8!": !(C(a.value) && r.has_cancel)
|
|
375
375
|
}, "truncate showOptions1"]),
|
|
376
376
|
value: a.value?.name,
|
|
377
377
|
placeholder: r.placeholder,
|
|
378
378
|
autocomplete: "off",
|
|
379
379
|
readonly: ""
|
|
380
|
-
}, null, 10,
|
|
381
|
-
|
|
382
|
-
onClick: t[0] || (t[0] =
|
|
380
|
+
}, null, 10, Ce),
|
|
381
|
+
R(s("i", {
|
|
382
|
+
onClick: t[0] || (t[0] = ee((l) => fe(), ["stop"])),
|
|
383
383
|
class: "absolute text-gray-500 cursor-pointer pointer-events-auto ltr:right-8 rtl:left-8 hover:text-red-600 dark:hover:text-red-400",
|
|
384
384
|
style: { top: "13px" }
|
|
385
385
|
}, t[7] || (t[7] = [
|
|
@@ -399,15 +399,15 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
399
399
|
})
|
|
400
400
|
], -1)
|
|
401
401
|
]), 512), [
|
|
402
|
-
[
|
|
402
|
+
[te, C(a.value) && r.has_cancel]
|
|
403
403
|
]),
|
|
404
404
|
s("i", {
|
|
405
|
-
onClick: t[1] || (t[1] =
|
|
405
|
+
onClick: t[1] || (t[1] = ee((l) => A(), ["stop"])),
|
|
406
406
|
class: "absolute text-xl text-gray-500 cursor-pointer ltr:right-2 rtl:left-2 hover:text-gray-700 dark:hover:text-gray-700 showOptions",
|
|
407
407
|
style: { top: "14px" }
|
|
408
408
|
}, [
|
|
409
|
-
(
|
|
410
|
-
class:
|
|
409
|
+
(v(), f("svg", {
|
|
410
|
+
class: B([x.value ? "" : "rotate-180", "w-3 h-3 shrink-0"]),
|
|
411
411
|
"aria-hidden": "true",
|
|
412
412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
413
413
|
fill: "none",
|
|
@@ -422,59 +422,59 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
422
422
|
}, null, -1)
|
|
423
423
|
]), 2))
|
|
424
424
|
]),
|
|
425
|
-
|
|
426
|
-
r.hide_search ? p("", !0) : (
|
|
425
|
+
R(s("div", De, [
|
|
426
|
+
r.hide_search ? p("", !0) : (v(), f("div", Oe, [
|
|
427
427
|
t[10] || (t[10] = s("label", {
|
|
428
428
|
for: "default-search",
|
|
429
429
|
class: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
|
|
430
430
|
}, "Search", -1)),
|
|
431
|
-
s("div",
|
|
431
|
+
s("div", Ee, [
|
|
432
432
|
t[9] || (t[9] = s("div", { class: "absolute inset-y-0 flex items-center pointer-events-none start-0 ps-3" }, null, -1)),
|
|
433
|
-
|
|
433
|
+
R(s("input", {
|
|
434
434
|
type: "search",
|
|
435
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) =>
|
|
435
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => m.value = l),
|
|
436
436
|
id: `${r.field_name}search${g.value}`,
|
|
437
|
-
onKeydown:
|
|
438
|
-
onBlur: t[3] || (t[3] = (l) =>
|
|
437
|
+
onKeydown: se,
|
|
438
|
+
onBlur: t[3] || (t[3] = (l) => P()),
|
|
439
439
|
autocomplete: "off",
|
|
440
440
|
class: "block w-full p-2 text-sm text-gray-900 outline-hidden dark:bg-gray-800 dark:text-white",
|
|
441
441
|
placeholder: r.search_input_placeholder
|
|
442
|
-
}, null, 40,
|
|
443
|
-
[
|
|
442
|
+
}, null, 40, Be), [
|
|
443
|
+
[ge, m.value]
|
|
444
444
|
])
|
|
445
445
|
])
|
|
446
446
|
])),
|
|
447
447
|
s("div", {
|
|
448
448
|
class: "overflow-y-auto max-h-64 px-1 py-1",
|
|
449
|
-
onScroll:
|
|
449
|
+
onScroll: re,
|
|
450
450
|
ref_key: "dropdownRef",
|
|
451
|
-
ref:
|
|
451
|
+
ref: H
|
|
452
452
|
}, [
|
|
453
|
-
r.allow_custom &&
|
|
453
|
+
r.allow_custom && m.value && !i.value.find((l) => String(l.name) === String(m.value)) ? (v(), f("div", {
|
|
454
454
|
key: 0,
|
|
455
455
|
class: "relative px-2 py-0.5 text-xs leading-4 text-gray-700 no-underline cursor-pointer dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-white hover:rounded-sm",
|
|
456
|
-
onClick: t[4] || (t[4] = (l) =>
|
|
457
|
-
onMousedown: t[5] || (t[5] = (l) =>
|
|
456
|
+
onClick: t[4] || (t[4] = (l) => X()),
|
|
457
|
+
onMousedown: t[5] || (t[5] = (l) => X())
|
|
458
458
|
}, [
|
|
459
|
-
s("div",
|
|
460
|
-
s("span", null, w(r.custom_option_label) + ' "' + w(
|
|
459
|
+
s("div", $e, [
|
|
460
|
+
s("span", null, w(r.custom_option_label) + ' "' + w(m.value) + '"', 1)
|
|
461
461
|
])
|
|
462
462
|
], 32)) : p("", !0),
|
|
463
|
-
i.value.length ? (
|
|
464
|
-
class:
|
|
463
|
+
i.value.length ? (v(!0), f(Z, { key: 1 }, he(i.value, (l, n) => (v(), f("div", {
|
|
464
|
+
class: B([
|
|
465
465
|
"relative px-2 py-0.5 text-xs leading-4 text-gray-700 no-underline cursor-pointer dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-white hover:rounded-sm",
|
|
466
466
|
n + 1 == y.value ? "bg-gray-100 dark:bg-gray-700 rounded-sm" : ""
|
|
467
467
|
]),
|
|
468
|
-
onClick: (u) =>
|
|
469
|
-
onMousedown: (u) =>
|
|
468
|
+
onClick: (u) => N(l),
|
|
469
|
+
onMousedown: (u) => N(l),
|
|
470
470
|
key: n,
|
|
471
471
|
id: `${n + 1}${g.value}`
|
|
472
472
|
}, [
|
|
473
473
|
s("div", Me, [
|
|
474
474
|
s("span", {
|
|
475
475
|
innerHTML: l.name || l.id || "-"
|
|
476
|
-
}, null, 8,
|
|
477
|
-
a.value?.id === l.id ? (
|
|
476
|
+
}, null, 8, Ie),
|
|
477
|
+
a.value?.id === l.id ? (v(), f("svg", Te, t[11] || (t[11] = [
|
|
478
478
|
s("path", {
|
|
479
479
|
stroke: "currentColor",
|
|
480
480
|
"stroke-linecap": "round",
|
|
@@ -484,22 +484,22 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
484
484
|
}, null, -1)
|
|
485
485
|
]))) : p("", !0)
|
|
486
486
|
])
|
|
487
|
-
], 42,
|
|
488
|
-
|
|
489
|
-
|
|
487
|
+
], 42, Le))), 128)) : p("", !0),
|
|
488
|
+
$.value ? (v(), f("div", Ue, " Loading... ")) : p("", !0),
|
|
489
|
+
!$.value && i.value.length === 0 && !(r.allow_custom && m.value) ? (v(), f("div", Ve, w(r.no_results_found_placeholder), 1)) : p("", !0)
|
|
490
490
|
], 544)
|
|
491
491
|
], 512), [
|
|
492
|
-
[
|
|
492
|
+
[te, x.value]
|
|
493
493
|
])
|
|
494
494
|
])
|
|
495
495
|
])
|
|
496
496
|
])) : p("", !0),
|
|
497
|
-
s("span",
|
|
498
|
-
s("small",
|
|
497
|
+
s("span", je, w(r.error_message), 1),
|
|
498
|
+
s("small", Ae, w(r.description), 1)
|
|
499
499
|
], 2))
|
|
500
500
|
], 64));
|
|
501
501
|
}
|
|
502
502
|
};
|
|
503
503
|
export {
|
|
504
|
-
|
|
504
|
+
Ne as default
|
|
505
505
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as x, onMounted as h, computed as v, createElementBlock as a, openBlock as i, Fragment as T, createCommentVNode as r, normalizeClass as
|
|
2
|
-
const
|
|
1
|
+
import { ref as x, onMounted as h, computed as v, createElementBlock as a, openBlock as i, Fragment as T, createCommentVNode as r, normalizeClass as o, createElementVNode as u, toDisplayString as m, withDirectives as g, vModelDynamic as y } from "vue";
|
|
2
|
+
const w = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "gl-label-form"
|
|
5
|
-
},
|
|
5
|
+
}, S = { class: "mt-1 text-gray-900 dark:text-white" }, G = ["for"], V = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "flex items-center"
|
|
8
|
-
},
|
|
8
|
+
}, q = ["innerHTML"], $ = { class: "relative w-full" }, B = ["minlength", "maxlength", "required", "name", "id", "disabled", "type", "placeholder"], M = ["innerHTML"], p = ["minlength", "maxlength", "required", "name", "id", "disabled", "type", "placeholder"], H = { class: "gl-span-form-error" }, K = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, z = {
|
|
9
9
|
__name: "GlTextInput",
|
|
10
10
|
props: {
|
|
11
11
|
is_required: {
|
|
@@ -67,67 +67,73 @@ const S = {
|
|
|
67
67
|
inputGroupText: {
|
|
68
68
|
type: String,
|
|
69
69
|
default: ""
|
|
70
|
+
},
|
|
71
|
+
disabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: !1
|
|
70
74
|
}
|
|
71
75
|
},
|
|
72
76
|
emits: ["update:modelValue", "keydown", "blur-sm", "keyup", "input"],
|
|
73
77
|
setup(e, { expose: f, emit: b }) {
|
|
74
|
-
const
|
|
78
|
+
const c = e, k = b, d = x(null);
|
|
75
79
|
h(() => {
|
|
76
|
-
|
|
80
|
+
d.value !== null && d.value.hasAttribute("autofocus") && d.value.focus();
|
|
77
81
|
});
|
|
78
82
|
const s = v({
|
|
79
83
|
get() {
|
|
80
|
-
return
|
|
84
|
+
return c.modelValue;
|
|
81
85
|
},
|
|
82
86
|
set(n) {
|
|
83
|
-
|
|
87
|
+
k("update:modelValue", n);
|
|
84
88
|
}
|
|
85
89
|
});
|
|
86
|
-
return f({ focus: () =>
|
|
90
|
+
return f({ focus: () => d.value.focus() }), (n, t) => (i(), a(T, null, [
|
|
87
91
|
e.show ? (i(), a("div", {
|
|
88
92
|
key: 0,
|
|
89
|
-
class:
|
|
93
|
+
class: o(e.field_name)
|
|
90
94
|
}, [
|
|
91
|
-
e.label_name ? (i(), a("label",
|
|
92
|
-
|
|
93
|
-
t[10] || (t[10] =
|
|
95
|
+
e.label_name ? (i(), a("label", w, m(e.label_name), 1)) : r("", !0),
|
|
96
|
+
u("p", S, m(e.type == "password" ? e.modelValue.replace(/./g, "*") : e.modelValue), 1),
|
|
97
|
+
t[10] || (t[10] = u("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
94
98
|
], 2)) : r("", !0),
|
|
95
99
|
e.show ? r("", !0) : (i(), a("div", {
|
|
96
100
|
key: 1,
|
|
97
|
-
class:
|
|
101
|
+
class: o({
|
|
98
102
|
[e.field_name]: e.field_name && e.field_name !== "",
|
|
99
103
|
[e.container_class]: e.container_class && e.container_class !== ""
|
|
100
104
|
})
|
|
101
105
|
}, [
|
|
102
106
|
e.label_name ? (i(), a("label", {
|
|
103
107
|
key: 0,
|
|
104
|
-
class:
|
|
108
|
+
class: o({
|
|
105
109
|
"gl-label-form": e.error_message == "",
|
|
106
110
|
"gl-label-form-invalid": e.error_message !== "",
|
|
107
111
|
required: e.is_required
|
|
108
112
|
}),
|
|
109
113
|
for: e.field_name
|
|
110
|
-
},
|
|
114
|
+
}, m(e.label_name), 11, G)) : r("", !0),
|
|
111
115
|
e.inputGroupType ? (i(), a("div", V, [
|
|
112
116
|
e.inputGroupType == "prepend" ? (i(), a("label", {
|
|
113
117
|
key: 0,
|
|
114
118
|
innerHTML: e.inputGroupText,
|
|
115
119
|
class: "h-10 z-10 inline-flex items-center shrink-0 px-4 text-sm font-medium text-center text-gray-500 bg-gray-100 border border-gray-300 dark:text-gray-400 rounded-s-lg focus:outline-hidden dark:bg-gray-700 dark:border-gray-600"
|
|
116
|
-
}, null, 8,
|
|
117
|
-
|
|
118
|
-
g(
|
|
120
|
+
}, null, 8, q)) : r("", !0),
|
|
121
|
+
u("div", $, [
|
|
122
|
+
g(u("input", {
|
|
119
123
|
minlength: e.minlength,
|
|
120
124
|
maxlength: e.maxlength,
|
|
121
|
-
class:
|
|
125
|
+
class: o(["rtl:text-right rounded-none!", {
|
|
122
126
|
"gl-input-form": e.error_message == "",
|
|
123
127
|
"gl-input-form-invalid": e.error_message !== "",
|
|
124
128
|
[e.input_class]: e.input_class && e.input_class !== "",
|
|
125
129
|
"border-e-0! rounded-s-lg!": e.inputGroupType == "append",
|
|
126
|
-
"border-s-0! rounded-e-lg!": e.inputGroupType == "prepend"
|
|
130
|
+
"border-s-0! rounded-e-lg!": e.inputGroupType == "prepend",
|
|
131
|
+
"opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-700": e.disabled
|
|
127
132
|
}]),
|
|
128
133
|
required: e.is_required,
|
|
129
134
|
name: e.field_name,
|
|
130
135
|
id: e.field_name,
|
|
136
|
+
disabled: e.disabled,
|
|
131
137
|
type: e.type,
|
|
132
138
|
"onUpdate:modelValue": t[0] || (t[0] = (l) => s.value = l),
|
|
133
139
|
onKeydown: t[1] || (t[1] = (l) => n.$emit("keydown", l)),
|
|
@@ -135,9 +141,9 @@ const S = {
|
|
|
135
141
|
onBlur: t[3] || (t[3] = (l) => n.$emit("blur-sm", l)),
|
|
136
142
|
onInput: t[4] || (t[4] = (l) => n.$emit("input", l)),
|
|
137
143
|
ref_key: "input",
|
|
138
|
-
ref:
|
|
144
|
+
ref: d,
|
|
139
145
|
placeholder: e.placeholder
|
|
140
|
-
}, null, 42,
|
|
146
|
+
}, null, 42, B), [
|
|
141
147
|
[y, s.value]
|
|
142
148
|
])
|
|
143
149
|
]),
|
|
@@ -145,20 +151,22 @@ const S = {
|
|
|
145
151
|
key: 1,
|
|
146
152
|
innerHTML: e.inputGroupText,
|
|
147
153
|
class: "h-10 z-10 inline-flex items-center shrink-0 px-4 text-sm font-medium text-center text-gray-500 bg-gray-100 border border-gray-300 dark:text-gray-400 rounded-e-lg focus:outline-hidden dark:bg-gray-700 dark:border-gray-600"
|
|
148
|
-
}, null, 8,
|
|
154
|
+
}, null, 8, M)) : r("", !0)
|
|
149
155
|
])) : r("", !0),
|
|
150
156
|
e.inputGroupType == "" ? g((i(), a("input", {
|
|
151
157
|
key: 2,
|
|
152
158
|
minlength: e.minlength,
|
|
153
159
|
maxlength: e.maxlength,
|
|
154
|
-
class:
|
|
160
|
+
class: o(["rtl:text-right", {
|
|
155
161
|
"gl-input-form": e.error_message == "",
|
|
156
162
|
"gl-input-form-invalid": e.error_message !== "",
|
|
157
|
-
[e.input_class]: e.input_class && e.input_class !== ""
|
|
163
|
+
[e.input_class]: e.input_class && e.input_class !== "",
|
|
164
|
+
"opacity-70 cursor-not-allowed bg-gray-100 dark:bg-gray-700": e.disabled
|
|
158
165
|
}]),
|
|
159
166
|
required: e.is_required,
|
|
160
167
|
name: e.field_name,
|
|
161
168
|
id: e.field_name,
|
|
169
|
+
disabled: e.disabled,
|
|
162
170
|
type: e.type,
|
|
163
171
|
"onUpdate:modelValue": t[5] || (t[5] = (l) => s.value = l),
|
|
164
172
|
onKeydown: t[6] || (t[6] = (l) => n.$emit("keydown", l)),
|
|
@@ -166,13 +174,13 @@ const S = {
|
|
|
166
174
|
onBlur: t[8] || (t[8] = (l) => n.$emit("blur-sm", l)),
|
|
167
175
|
onInput: t[9] || (t[9] = (l) => n.$emit("input", l)),
|
|
168
176
|
ref_key: "input",
|
|
169
|
-
ref:
|
|
177
|
+
ref: d,
|
|
170
178
|
placeholder: e.placeholder
|
|
171
|
-
}, null, 42,
|
|
179
|
+
}, null, 42, p)), [
|
|
172
180
|
[y, s.value]
|
|
173
181
|
]) : r("", !0),
|
|
174
|
-
|
|
175
|
-
|
|
182
|
+
u("span", H, m(e.error_message), 1),
|
|
183
|
+
u("small", K, m(e.description), 1)
|
|
176
184
|
], 2))
|
|
177
185
|
], 64));
|
|
178
186
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "The most popular library of interactive components built with Vuejs && Tailwind CSS",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
|
-
"version": "1.3.
|
|
6
|
+
"version": "1.3.2",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/mrgiant/GoldenLogicUi.git"
|