golden-logic-ui 1.2.343 → 1.2.344
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ref as m, shallowRef as X, onMounted as fe, onBeforeUnmount as ve, watch as M, createElementBlock as c, openBlock as f, Fragment as Y, createCommentVNode as
|
|
2
|
-
const
|
|
1
|
+
import { ref as m, shallowRef as X, onMounted as fe, onBeforeUnmount as ve, watch as M, createElementBlock as c, openBlock as f, Fragment as Y, createCommentVNode as h, normalizeClass as E, createElementVNode as s, toDisplayString as w, withDirectives as P, withModifiers as Z, vShow as ee, vModelText as me, renderList as ge, nextTick as pe } from "vue";
|
|
2
|
+
const he = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3 mb-4" }, xe = {
|
|
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
|
}, we = ["name", "id", "value"], be = {
|
|
@@ -111,16 +111,16 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
111
111
|
emits: ["update:modelValue", "selected", "selectionChanged"],
|
|
112
112
|
setup(r, { emit: te }) {
|
|
113
113
|
const o = r, b = te, a = m({}), R = m(!1), y = m(0), x = m(!1), v = m(""), g = m(""), B = m(!1), C = m(1), D = m(null), $ = m(1), i = X([]), L = X([]), T = m([]), le = m(null), F = m(null);
|
|
114
|
-
let O = !1,
|
|
114
|
+
let O = !1, p = null, U = 0, k = null;
|
|
115
115
|
const H = (e) => e?.name === "CanceledError" || e?.name === "AbortError" || typeof axios < "u" && axios.isCancel?.(e), V = async (e = "down") => {
|
|
116
116
|
if (B.value || !o.api_url) return;
|
|
117
|
-
|
|
117
|
+
p && p.abort(), p = new AbortController();
|
|
118
118
|
const t = ++U;
|
|
119
119
|
B.value = !0;
|
|
120
120
|
try {
|
|
121
121
|
const l = e === "up" ? Math.max(C.value - 1, $.value) : C.value, { data: n } = await axios.get(o.api_url, {
|
|
122
122
|
params: { search: v.value, page: l, per_page: 20 },
|
|
123
|
-
signal:
|
|
123
|
+
signal: p.signal
|
|
124
124
|
});
|
|
125
125
|
if (O || t !== U) return;
|
|
126
126
|
if (!n || !n.data) {
|
|
@@ -137,7 +137,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
137
137
|
if (H(l)) return;
|
|
138
138
|
console.error("Error fetching data:", l);
|
|
139
139
|
} finally {
|
|
140
|
-
!O && t === U && (B.value = !1,
|
|
140
|
+
!O && t === U && (B.value = !1, p = null);
|
|
141
141
|
}
|
|
142
142
|
}, ne = async (e) => {
|
|
143
143
|
if (!o.api_url || e === null || e === void 0 || e === "") return null;
|
|
@@ -179,7 +179,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
179
179
|
x.value = !1;
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
v.value = "", x.value = !0, o.api_url && i.value.length === 0 && V("down"),
|
|
182
|
+
v.value = "", x.value = !0, o.api_url && i.value.length === 0 && V("down"), pe(() => {
|
|
183
183
|
const e = document.getElementById(
|
|
184
184
|
`${o.field_name}search${g.value}`
|
|
185
185
|
);
|
|
@@ -207,7 +207,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
207
207
|
fe(() => {
|
|
208
208
|
g.value = se(), o.show || (document.body.addEventListener("click", K), document.addEventListener("focusin", z));
|
|
209
209
|
}), ve(() => {
|
|
210
|
-
O = !0,
|
|
210
|
+
O = !0, p && (p.abort(), p = null), k && (clearTimeout(k), k = null), document.body.removeEventListener("click", K), document.removeEventListener("focusin", z);
|
|
211
211
|
});
|
|
212
212
|
function re() {
|
|
213
213
|
const e = L.value, t = o.maxItem, l = v.value;
|
|
@@ -302,7 +302,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
302
302
|
}), M(
|
|
303
303
|
() => o.api_url,
|
|
304
304
|
() => {
|
|
305
|
-
|
|
305
|
+
p && (p.abort(), p = null), C.value = 1, D.value = null, $.value = 1, i.value = [];
|
|
306
306
|
},
|
|
307
307
|
{ immediate: !0 }
|
|
308
308
|
), M(
|
|
@@ -327,19 +327,22 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
327
327
|
L.value = l, i.value = l, a.value = j();
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
|
-
|
|
330
|
+
// deep so the list still updates when options load late by mutating the SAME
|
|
331
|
+
// array in place (e.g. column.options.push(...)) — a reference-only watch
|
|
332
|
+
// would miss that and leave the dropdown list empty.
|
|
333
|
+
{ immediate: !0, deep: !0 }
|
|
331
334
|
), (e, t) => (f(), c(Y, null, [
|
|
332
335
|
r.show ? (f(), c("div", {
|
|
333
336
|
key: 0,
|
|
334
337
|
class: E(r.field_name)
|
|
335
338
|
}, [
|
|
336
|
-
s("h3",
|
|
339
|
+
s("h3", he, w(r.label_name), 1),
|
|
337
340
|
s("p", ye, [
|
|
338
|
-
S(a.value) ? (f(), c("span", xe, w(a.value?.name), 1)) :
|
|
341
|
+
S(a.value) ? (f(), c("span", xe, w(a.value?.name), 1)) : h("", !0)
|
|
339
342
|
]),
|
|
340
343
|
t[6] || (t[6] = s("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
341
|
-
], 2)) :
|
|
342
|
-
r.show ?
|
|
344
|
+
], 2)) : h("", !0),
|
|
345
|
+
r.show ? h("", !0) : (f(), c("div", {
|
|
343
346
|
key: 1,
|
|
344
347
|
class: E(r.field_name)
|
|
345
348
|
}, [
|
|
@@ -357,7 +360,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
357
360
|
"gl-label-form-invalid": r.error_message !== "",
|
|
358
361
|
required: r.is_required
|
|
359
362
|
})
|
|
360
|
-
}, w(r.label_name), 3)) :
|
|
363
|
+
}, w(r.label_name), 3)) : h("", !0),
|
|
361
364
|
s("div", ke, [
|
|
362
365
|
s("div", Se, [
|
|
363
366
|
s("input", {
|
|
@@ -420,7 +423,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
420
423
|
]), 2))
|
|
421
424
|
]),
|
|
422
425
|
P(s("div", Ce, [
|
|
423
|
-
r.hide_search ?
|
|
426
|
+
r.hide_search ? h("", !0) : (f(), c("div", De, [
|
|
424
427
|
t[10] || (t[10] = s("label", {
|
|
425
428
|
for: "default-search",
|
|
426
429
|
class: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white"
|
|
@@ -456,7 +459,7 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
456
459
|
s("div", Be, [
|
|
457
460
|
s("span", null, w(r.custom_option_label) + ' "' + w(v.value) + '"', 1)
|
|
458
461
|
])
|
|
459
|
-
], 32)) :
|
|
462
|
+
], 32)) : h("", !0),
|
|
460
463
|
i.value.length ? (f(!0), c(Y, { key: 1 }, ge(i.value, (l, n) => (f(), c("div", {
|
|
461
464
|
class: E([
|
|
462
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",
|
|
@@ -476,21 +479,21 @@ const pe = { class: "font-bold ptext-lg dark:text-white" }, ye = { class: "mt-3
|
|
|
476
479
|
"stroke-width": "2",
|
|
477
480
|
d: "M1 5.917 5.724 10.5 15 1.5"
|
|
478
481
|
}, null, -1)
|
|
479
|
-
]))) :
|
|
482
|
+
]))) : h("", !0),
|
|
480
483
|
s("span", {
|
|
481
484
|
innerHTML: l.name || l.id || "-"
|
|
482
485
|
}, null, 8, Ie)
|
|
483
486
|
])
|
|
484
|
-
], 42, $e))), 128)) :
|
|
485
|
-
B.value ? (f(), c("div", Te, " Loading... ")) :
|
|
486
|
-
!B.value && i.value.length === 0 && !(r.allow_custom && v.value) ? (f(), c("div", Ue, w(r.no_results_found_placeholder), 1)) :
|
|
487
|
+
], 42, $e))), 128)) : h("", !0),
|
|
488
|
+
B.value ? (f(), c("div", Te, " Loading... ")) : h("", !0),
|
|
489
|
+
!B.value && i.value.length === 0 && !(r.allow_custom && v.value) ? (f(), c("div", Ue, w(r.no_results_found_placeholder), 1)) : h("", !0)
|
|
487
490
|
], 544)
|
|
488
491
|
], 512), [
|
|
489
492
|
[ee, x.value]
|
|
490
493
|
])
|
|
491
494
|
])
|
|
492
495
|
])
|
|
493
|
-
])) :
|
|
496
|
+
])) : h("", !0),
|
|
494
497
|
s("span", Ve, w(r.error_message), 1),
|
|
495
498
|
s("small", Ae, w(r.description), 1)
|
|
496
499
|
], 2))
|
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.2.
|
|
6
|
+
"version": "1.2.344",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/mrgiant/GoldenLogicUi.git"
|