golden-logic-ui 1.3.16 → 1.3.17
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,4 +1,4 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as m, shallowRef as Y, onMounted as ve, onBeforeUnmount as me, watch as I, createElementBlock as c, openBlock as f, Fragment as Z, createCommentVNode as h, normalizeClass as O, createElementVNode as s, toDisplayString as w, withDirectives as F, withModifiers as ee, vShow as te, vModelText as ge, renderList as he, nextTick as pe } from "vue";
|
|
2
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"
|
|
@@ -127,7 +127,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
127
127
|
},
|
|
128
128
|
emits: ["update:modelValue", "selected", "selectionChanged"],
|
|
129
129
|
setup(o, { emit: le }) {
|
|
130
|
-
const r = o, k = le, a =
|
|
130
|
+
const r = o, k = le, a = m({}), T = m(!1), y = m(0), x = m(!1), v = m(""), g = m(""), $ = m(!1), S = m(1), _ = m(null), L = m(1), i = Y([]), E = m(!1), j = Y([]), U = m([]), ne = m(null), H = m(null);
|
|
131
131
|
let B = !1, p = null, A = 0, C = null;
|
|
132
132
|
const z = (e) => e?.name === "CanceledError" || e?.name === "AbortError" || typeof axios < "u" && axios.isCancel?.(e), q = async (e = "down") => {
|
|
133
133
|
if ($.value || !r.api_url) return;
|
|
@@ -136,7 +136,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
136
136
|
$.value = !0;
|
|
137
137
|
try {
|
|
138
138
|
const l = e === "up" ? Math.max(S.value - 1, L.value) : S.value, { data: n } = await axios.get(r.api_url, {
|
|
139
|
-
params: { search:
|
|
139
|
+
params: { search: v.value, page: l, per_page: 20 },
|
|
140
140
|
signal: p.signal
|
|
141
141
|
});
|
|
142
142
|
if (B || t !== A) return;
|
|
@@ -147,7 +147,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
147
147
|
const u = W(n.data);
|
|
148
148
|
if (e === "down") {
|
|
149
149
|
const d = i.value.length ? i.value.concat(u) : u, D = a.value;
|
|
150
|
-
b(D) && D.id !== void 0 && D.name && !d.some((M) => String(M.id) === String(D.id)) && d.unshift(D), i.value = d, S.value++, _.value = n.last_page, E.value = !0;
|
|
150
|
+
!v.value && b(D) && D.id !== void 0 && D.name && !d.some((M) => String(M.id) === String(D.id)) && d.unshift(D), i.value = d, S.value++, _.value = n.last_page, E.value = !0;
|
|
151
151
|
}
|
|
152
152
|
_.value || (_.value = n.last_page), L.value || (L.value = 1);
|
|
153
153
|
} catch (l) {
|
|
@@ -196,7 +196,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
196
196
|
x.value = !1;
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
v.value = "", x.value = !0, r.api_url && (!E.value || i.value.length === 0) && (S.value = 1, _.value = null, i.value = [], E.value = !1, q("down")), pe(() => {
|
|
200
200
|
const e = document.getElementById(
|
|
201
201
|
`${r.field_name}search${g.value}`
|
|
202
202
|
);
|
|
@@ -227,7 +227,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
227
227
|
B = !0, p && (p.abort(), p = null), C && (clearTimeout(C), C = null), document.body.removeEventListener("click", G), document.removeEventListener("focusin", K);
|
|
228
228
|
});
|
|
229
229
|
function ie() {
|
|
230
|
-
const e = j.value, t = r.maxItem, l =
|
|
230
|
+
const e = j.value, t = r.maxItem, l = v.value;
|
|
231
231
|
if (!l)
|
|
232
232
|
return e.length > t ? e.slice(0, t) : e;
|
|
233
233
|
const n = l.toLowerCase(), u = [];
|
|
@@ -294,19 +294,19 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
294
294
|
return t;
|
|
295
295
|
}
|
|
296
296
|
function X() {
|
|
297
|
-
const e =
|
|
297
|
+
const e = v.value, t = { id: e, name: e }, l = String(e);
|
|
298
298
|
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], j.value = [...j.value, t]), P(t);
|
|
299
299
|
}
|
|
300
300
|
function P(e) {
|
|
301
301
|
T.value = !0, a.value = e, x.value = !1, k("update:modelValue", a.value.id), k("selected", a.value), k("selectionChanged", a.value);
|
|
302
302
|
}
|
|
303
303
|
function fe() {
|
|
304
|
-
r.show || (a.value = {},
|
|
304
|
+
r.show || (a.value = {}, v.value = "", k("update:modelValue", ""), k("selected", a.value), k("selectionChanged", a.value), V());
|
|
305
305
|
}
|
|
306
306
|
function R() {
|
|
307
|
-
(!a.value || !a.value.id) && (a.value = {},
|
|
307
|
+
(!a.value || !a.value.id) && (a.value = {}, v.value = "");
|
|
308
308
|
}
|
|
309
|
-
return I(
|
|
309
|
+
return I(v, () => {
|
|
310
310
|
if (!r.api_url) {
|
|
311
311
|
i.value = ie(), i.value.length === 0 && (a.value = {});
|
|
312
312
|
return;
|
|
@@ -455,7 +455,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
455
455
|
t[9] || (t[9] = s("div", { class: "absolute inset-y-0 flex items-center pointer-events-none start-0 ps-3" }, null, -1)),
|
|
456
456
|
F(s("input", {
|
|
457
457
|
type: "search",
|
|
458
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) =>
|
|
458
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => v.value = l),
|
|
459
459
|
id: `${o.field_name}search${g.value}`,
|
|
460
460
|
onKeydown: se,
|
|
461
461
|
onBlur: t[3] || (t[3] = (l) => R()),
|
|
@@ -463,7 +463,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
463
463
|
class: "block w-full p-2 text-sm text-gray-900 outline-hidden dark:bg-gray-800 dark:text-white",
|
|
464
464
|
placeholder: o.search_input_placeholder
|
|
465
465
|
}, null, 40, Ee), [
|
|
466
|
-
[ge,
|
|
466
|
+
[ge, v.value]
|
|
467
467
|
])
|
|
468
468
|
])
|
|
469
469
|
])),
|
|
@@ -473,14 +473,14 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
473
473
|
ref_key: "dropdownRef",
|
|
474
474
|
ref: H
|
|
475
475
|
}, [
|
|
476
|
-
o.allow_custom &&
|
|
476
|
+
o.allow_custom && v.value && !i.value.find((l) => String(l.name) === String(v.value)) ? (f(), c("div", {
|
|
477
477
|
key: 0,
|
|
478
478
|
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",
|
|
479
479
|
onClick: t[4] || (t[4] = (l) => X()),
|
|
480
480
|
onMousedown: t[5] || (t[5] = (l) => X())
|
|
481
481
|
}, [
|
|
482
482
|
s("div", Be, [
|
|
483
|
-
s("span", null, w(o.custom_option_label) + ' "' + w(
|
|
483
|
+
s("span", null, w(o.custom_option_label) + ' "' + w(v.value) + '"', 1)
|
|
484
484
|
])
|
|
485
485
|
], 32)) : h("", !0),
|
|
486
486
|
i.value.length ? (f(!0), c(Z, { key: 1 }, he(i.value, (l, n) => (f(), c("div", {
|
|
@@ -512,7 +512,7 @@ const ye = { class: "font-bold ptext-lg dark:text-white" }, xe = { class: "mt-3
|
|
|
512
512
|
])
|
|
513
513
|
], 42, $e))), 128)) : h("", !0),
|
|
514
514
|
$.value ? (f(), c("div", Ue, " Loading... ")) : h("", !0),
|
|
515
|
-
!$.value && i.value.length === 0 && !(o.allow_custom &&
|
|
515
|
+
!$.value && i.value.length === 0 && !(o.allow_custom && v.value) ? (f(), c("div", Ae, w(o.no_results_found_placeholder), 1)) : h("", !0)
|
|
516
516
|
], 544)
|
|
517
517
|
], 2), [
|
|
518
518
|
[te, x.value]
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "golden-logic-ui",
|
|
3
|
-
"description": "The most popular library of interactive components built with Vuejs && Tailwind CSS",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"private": false,
|
|
6
|
-
"version": "1.3.
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/mrgiant/GoldenLogicUi.git"
|
|
10
|
-
},
|
|
11
|
-
"author": "Mohamed Al Wahaibi",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
|
-
"main": "./dist/main.js",
|
|
17
|
-
"module": "./dist/main.js",
|
|
18
|
-
"style": "./dist/golden-logic-ui.css",
|
|
19
|
-
"sideEffects": [
|
|
20
|
-
"**/*.css"
|
|
21
|
-
],
|
|
22
|
-
"exports": {
|
|
23
|
-
".": {
|
|
24
|
-
"import": "./dist/main.js"
|
|
25
|
-
},
|
|
26
|
-
"./style.css": "./dist/golden-logic-ui.css",
|
|
27
|
-
"./dist/golden-logic-ui.css": "./dist/golden-logic-ui.css",
|
|
28
|
-
"./*": "./dist/*"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"dev": "vite",
|
|
32
|
-
"build": "vite build",
|
|
33
|
-
"preview": "vite preview"
|
|
34
|
-
},
|
|
35
|
-
"peerDependencies": {
|
|
36
|
-
"vue": "^3.4.x"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@codemirror/autocomplete": "^6.18.4",
|
|
40
|
-
"@codemirror/lang-html": "^6.2.2",
|
|
41
|
-
"@codemirror/lang-javascript": "^6.2.2",
|
|
42
|
-
"@codemirror/state": "^6.5.0",
|
|
43
|
-
"@codemirror/theme-one-dark": "^6.1.2",
|
|
44
|
-
"@codemirror/view": "^6.36.1",
|
|
45
|
-
"@tailwindcss/vite": "^4.1.18",
|
|
46
|
-
"codemirror": "^6.0.1",
|
|
47
|
-
"tinymce": "^7.6.0",
|
|
48
|
-
"vue3-print-nb": "^0.1.4",
|
|
49
|
-
"xlsx": "^0.18.5"
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"@vitejs/plugin-vue": "^6.0.0",
|
|
53
|
-
"sass": "^1.75.0",
|
|
54
|
-
"tailwindcss": "^4.1.18",
|
|
55
|
-
"vite": "^7.0.0"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "golden-logic-ui",
|
|
3
|
+
"description": "The most popular library of interactive components built with Vuejs && Tailwind CSS",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": false,
|
|
6
|
+
"version": "1.3.17",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/mrgiant/GoldenLogicUi.git"
|
|
10
|
+
},
|
|
11
|
+
"author": "Mohamed Al Wahaibi",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"main": "./dist/main.js",
|
|
17
|
+
"module": "./dist/main.js",
|
|
18
|
+
"style": "./dist/golden-logic-ui.css",
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"**/*.css"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/main.js"
|
|
25
|
+
},
|
|
26
|
+
"./style.css": "./dist/golden-logic-ui.css",
|
|
27
|
+
"./dist/golden-logic-ui.css": "./dist/golden-logic-ui.css",
|
|
28
|
+
"./*": "./dist/*"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite",
|
|
32
|
+
"build": "vite build",
|
|
33
|
+
"preview": "vite preview"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"vue": "^3.4.x"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@codemirror/autocomplete": "^6.18.4",
|
|
40
|
+
"@codemirror/lang-html": "^6.2.2",
|
|
41
|
+
"@codemirror/lang-javascript": "^6.2.2",
|
|
42
|
+
"@codemirror/state": "^6.5.0",
|
|
43
|
+
"@codemirror/theme-one-dark": "^6.1.2",
|
|
44
|
+
"@codemirror/view": "^6.36.1",
|
|
45
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
46
|
+
"codemirror": "^6.0.1",
|
|
47
|
+
"tinymce": "^7.6.0",
|
|
48
|
+
"vue3-print-nb": "^0.1.4",
|
|
49
|
+
"xlsx": "^0.18.5"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
53
|
+
"sass": "^1.75.0",
|
|
54
|
+
"tailwindcss": "^4.1.18",
|
|
55
|
+
"vite": "^7.0.0"
|
|
56
|
+
}
|
|
57
|
+
}
|