golden-logic-ui 1.2.375 → 1.3.1
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/GlCodeMirrorTranslate.vue.js +98 -114
- package/dist/components/GeneralComponents/GlLanguageSelector.vue.js +32 -33
- package/dist/components/GeneralComponents/GlTabsWrapper.vue.js +35 -29
- package/dist/components/GeneralComponents/GlTextInput.vue.js +38 -30
- package/dist/components/GeneralComponents/GlTextTranslate.vue.js +33 -39
- package/dist/components/GeneralComponents/GlTextareaTranslate.vue.js +38 -45
- package/dist/components/GeneralComponents/GlTinymceTranslate.vue.js +67 -69
- package/dist/golden-logic-ui.css +1 -1
- package/dist/localeStore.js +16 -0
- package/dist/main.js +24 -21
- package/dist/multilingual.js +115 -76
- package/dist/useTranslations.js +45 -0
- 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,13 +1,15 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { ref as q, watch as S, onMounted as D, onUnmounted as F, createElementBlock as g, openBlock as h, Fragment as G, createCommentVNode as E, normalizeClass as s, createElementVNode as n, toDisplayString as r, unref as u } from "vue";
|
|
2
|
+
import { glLocale as b } from "../../localeStore.js";
|
|
3
|
+
import { useTranslations as M } from "../../useTranslations.js";
|
|
4
|
+
import { EditorState as z, StateEffect as H } from "../../node_modules/@codemirror/state/dist/index.js";
|
|
5
|
+
import { highlightActiveLineGutter as L, keymap as J, EditorView as y, lineNumbers as K } from "../../node_modules/@codemirror/view/dist/index.js";
|
|
6
|
+
import { defaultKeymap as O } from "../../node_modules/@codemirror/commands/dist/index.js";
|
|
7
|
+
import { javascript as U } from "../../node_modules/@codemirror/lang-javascript/dist/index.js";
|
|
8
|
+
import { html as W } from "../../node_modules/@codemirror/lang-html/dist/index.js";
|
|
9
|
+
import { oneDark as _ } from "../../node_modules/@codemirror/theme-one-dark/dist/index.js";
|
|
10
|
+
import { autocompletion as I } from "../../node_modules/@codemirror/autocomplete/dist/index.js";
|
|
9
11
|
/* empty css */
|
|
10
|
-
const
|
|
12
|
+
const P = { class: "font-bold ptext-lg dark:text-white" }, Q = ["id"], R = ["name", "id", "value"], X = ["for"], Y = { class: "language-label js-language-label bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-sm dark:bg-blue-900 dark:text-blue-300" }, Z = ["name", "id", "value"], $ = ["name", "id"], ee = { class: "gl-span-form-error" }, te = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, fe = {
|
|
11
13
|
__name: "GlCodeMirrorTranslate",
|
|
12
14
|
props: {
|
|
13
15
|
modelValue: {
|
|
@@ -43,152 +45,134 @@ const H = { class: "font-bold ptext-lg dark:text-white" }, I = ["id"], K = ["nam
|
|
|
43
45
|
default: !0
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
|
-
emits: ["update:modelValue", "change"],
|
|
47
|
-
setup(e, { emit:
|
|
48
|
-
const
|
|
49
|
-
let i = null;
|
|
50
|
-
const
|
|
48
|
+
emits: ["update:modelValue", "update:modelValueTranslate", "change"],
|
|
49
|
+
setup(e, { emit: C }) {
|
|
50
|
+
const a = e, p = C, d = q(null);
|
|
51
|
+
let i = null, m = !1;
|
|
52
|
+
const v = () => {
|
|
53
|
+
if (!i)
|
|
54
|
+
return;
|
|
55
|
+
const t = i.state.doc.toString();
|
|
56
|
+
t !== o.value && (m = !0, i.dispatch({
|
|
57
|
+
changes: { from: 0, to: t.length, insert: o.value }
|
|
58
|
+
}), m = !1);
|
|
59
|
+
}, { asJson: x, currentText: o, setCurrent: N } = M(
|
|
60
|
+
a,
|
|
61
|
+
p,
|
|
62
|
+
v
|
|
63
|
+
), V = (t) => {
|
|
64
|
+
m || !b.current || o.value !== t && (N(t), p("change", t));
|
|
65
|
+
};
|
|
66
|
+
S(
|
|
67
|
+
() => b.current,
|
|
68
|
+
() => {
|
|
69
|
+
v();
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
const B = (t) => {
|
|
51
73
|
switch (t) {
|
|
52
74
|
case "javascript":
|
|
53
|
-
return
|
|
75
|
+
return U();
|
|
54
76
|
case "html":
|
|
55
|
-
return
|
|
77
|
+
return W();
|
|
56
78
|
// Add more languages here
|
|
57
79
|
default:
|
|
58
80
|
return [];
|
|
59
81
|
}
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
]
|
|
82
|
+
}, T = (t) => t === "one-dark" ? _ : document.body.classList.contains("dark") ? _ : [], j = (t) => t ? [K()] : [], A = (t) => t ? [L()] : [], w = (t, l, c, f) => [
|
|
83
|
+
...j(c),
|
|
84
|
+
...A(f),
|
|
85
|
+
L(),
|
|
86
|
+
J.of(O),
|
|
87
|
+
B(t),
|
|
88
|
+
...T(l),
|
|
89
|
+
I(),
|
|
90
|
+
y.updateListener.of((k) => {
|
|
91
|
+
k.docChanged && V(k.state.doc.toString());
|
|
92
|
+
}),
|
|
93
|
+
y.lineWrapping
|
|
94
|
+
];
|
|
95
|
+
return D(() => {
|
|
96
|
+
if (d.value) {
|
|
97
|
+
const t = z.create({
|
|
98
|
+
doc: o.value,
|
|
99
|
+
extensions: w(
|
|
100
|
+
a.language,
|
|
101
|
+
a.theme,
|
|
102
|
+
a.showLineNumbers,
|
|
103
|
+
a.highlightActiveLine
|
|
104
|
+
)
|
|
84
105
|
});
|
|
85
|
-
i = new
|
|
106
|
+
i = new y({
|
|
86
107
|
state: t,
|
|
87
|
-
parent:
|
|
108
|
+
parent: d.value
|
|
88
109
|
});
|
|
89
110
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
() =>
|
|
93
|
-
(t) => {
|
|
94
|
-
if (i) {
|
|
95
|
-
const a = i.state.doc.toString();
|
|
96
|
-
t !== a && i.dispatch({
|
|
97
|
-
changes: {
|
|
98
|
-
from: 0,
|
|
99
|
-
to: a.length,
|
|
100
|
-
insert: t
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
), w(
|
|
106
|
-
() => [n.language, n.theme, n.showLineNumbers, n.highlightActiveLine],
|
|
107
|
-
([t, a, o, _]) => {
|
|
111
|
+
}), S(
|
|
112
|
+
() => [a.language, a.theme, a.showLineNumbers, a.highlightActiveLine],
|
|
113
|
+
([t, l, c, f]) => {
|
|
108
114
|
i && i.dispatch({
|
|
109
|
-
effects:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
h(),
|
|
113
|
-
// Ensure it's included if highlightActiveLine is true
|
|
114
|
-
L.of([...T]),
|
|
115
|
-
p(t),
|
|
116
|
-
...y(a),
|
|
117
|
-
C(),
|
|
118
|
-
u.updateListener.of((V) => {
|
|
119
|
-
if (V.docChanged) {
|
|
120
|
-
const x = V.state.doc.toString();
|
|
121
|
-
r("update:modelValue", x), r("change", x);
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
u.lineWrapping
|
|
125
|
-
])
|
|
115
|
+
effects: H.reconfigure.of(
|
|
116
|
+
w(t, l, c, f)
|
|
117
|
+
)
|
|
126
118
|
});
|
|
127
119
|
}
|
|
128
|
-
),
|
|
120
|
+
), F(() => {
|
|
129
121
|
i && i.destroy();
|
|
130
|
-
}), (t,
|
|
131
|
-
e.show ? (
|
|
122
|
+
}), (t, l) => (h(), g(G, null, [
|
|
123
|
+
e.show ? (h(), g("div", {
|
|
132
124
|
key: 0,
|
|
133
|
-
class:
|
|
125
|
+
class: s(e.field_name)
|
|
134
126
|
}, [
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
n("h3", P, r(e.label_name), 1),
|
|
128
|
+
n("p", {
|
|
137
129
|
id: e.field_name,
|
|
138
|
-
class: "mb-4 text-base text-gray-900 input_tr_show dark:text-white"
|
|
139
|
-
},
|
|
140
|
-
|
|
130
|
+
class: "mb-4 text-base text-gray-900 gl-multilanguage input_tr_show dark:text-white"
|
|
131
|
+
}, r(u(o)), 9, Q),
|
|
132
|
+
n("input", {
|
|
141
133
|
type: "hidden",
|
|
142
|
-
"data-i18n": "true",
|
|
143
134
|
name: e.field_name + "_i18n",
|
|
144
135
|
id: e.field_name + "_i18n",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
]),
|
|
151
|
-
a[1] || (a[1] = l("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
152
|
-
], 2)) : S("", !0),
|
|
153
|
-
e.show ? S("", !0) : (c(), g("div", {
|
|
136
|
+
value: u(x)()
|
|
137
|
+
}, null, 8, R),
|
|
138
|
+
l[0] || (l[0] = n("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
139
|
+
], 2)) : E("", !0),
|
|
140
|
+
e.show ? E("", !0) : (h(), g("div", {
|
|
154
141
|
key: 1,
|
|
155
|
-
class:
|
|
142
|
+
class: s(["mb-4", e.field_name])
|
|
156
143
|
}, [
|
|
157
|
-
|
|
158
|
-
class:
|
|
144
|
+
n("label", {
|
|
145
|
+
class: s({
|
|
159
146
|
"gl-label-translation-form": e.error_message == "",
|
|
160
147
|
"gl-label-translation-form-invalid": e.error_message !== "",
|
|
161
148
|
required: e.is_required
|
|
162
149
|
}),
|
|
163
150
|
for: e.field_name
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
|
|
151
|
+
}, r(e.label_name), 11, X),
|
|
152
|
+
n("span", Y, r(u(b).current), 1),
|
|
153
|
+
n("input", {
|
|
167
154
|
class: "mb-4",
|
|
168
155
|
type: "hidden",
|
|
169
|
-
"data-i18n": "true",
|
|
170
156
|
name: e.field_name + "_i18n",
|
|
171
157
|
id: e.field_name + "_i18n",
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}, null, 40, J),
|
|
176
|
-
l("div", {
|
|
158
|
+
value: u(x)()
|
|
159
|
+
}, null, 8, Z),
|
|
160
|
+
n("div", {
|
|
177
161
|
ref_key: "editor",
|
|
178
|
-
ref:
|
|
179
|
-
class:
|
|
162
|
+
ref: d,
|
|
163
|
+
class: s(["CodeEditor custom-editor form-input-translation gl-multilanguage", {
|
|
180
164
|
"gl-input-form": e.error_message == "",
|
|
181
165
|
"gl-input-form-invalid ": e.error_message !== ""
|
|
182
166
|
}]),
|
|
183
167
|
name: e.field_name,
|
|
184
168
|
id: e.field_name
|
|
185
|
-
}, null, 10,
|
|
186
|
-
|
|
187
|
-
|
|
169
|
+
}, null, 10, $),
|
|
170
|
+
n("span", ee, r(e.error_message), 1),
|
|
171
|
+
n("small", te, r(e.description), 1)
|
|
188
172
|
], 2))
|
|
189
173
|
], 64));
|
|
190
174
|
}
|
|
191
175
|
};
|
|
192
176
|
export {
|
|
193
|
-
|
|
177
|
+
fe as default
|
|
194
178
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import _ from "
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { glLocale as n, setGlLocales as i } from "../../localeStore.js";
|
|
2
|
+
import { createElementBlock as a, openBlock as c, normalizeClass as s, Fragment as m, renderList as f, withDirectives as _, createElementVNode as g, vModelRadio as p, toDisplayString as b } from "vue";
|
|
3
|
+
import h from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const y = {
|
|
5
5
|
props: {
|
|
6
6
|
field_name: {
|
|
7
7
|
type: String,
|
|
@@ -11,6 +11,9 @@ const m = {
|
|
|
11
11
|
type: String,
|
|
12
12
|
default: "i18n_selector"
|
|
13
13
|
},
|
|
14
|
+
// Kept on the element from first render (it used to be added only after
|
|
15
|
+
// the locales request returned): consuming apps count elements carrying
|
|
16
|
+
// it to decide when a modal has finished loading.
|
|
14
17
|
selectorClass: {
|
|
15
18
|
type: String,
|
|
16
19
|
default: "gl-multilanguage"
|
|
@@ -18,17 +21,13 @@ const m = {
|
|
|
18
21
|
},
|
|
19
22
|
data() {
|
|
20
23
|
return {
|
|
21
|
-
|
|
22
|
-
default_language: ""
|
|
24
|
+
glLocale: n
|
|
23
25
|
};
|
|
24
26
|
},
|
|
25
27
|
methods: {
|
|
26
28
|
getLocals() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
axios.get("/admin/get_locals", { params: d }).then((e) => {
|
|
31
|
-
this.locals = e.data.locals, this.default_language = e.data.default_language, this.$refs.language_selector.classList.add(this.selectorClass);
|
|
29
|
+
n.locals.length > 0 || axios.get("/admin/get_locals").then((e) => {
|
|
30
|
+
i(e.data.locals, e.data.default_language);
|
|
32
31
|
}).catch((e) => {
|
|
33
32
|
console.error(e);
|
|
34
33
|
});
|
|
@@ -36,37 +35,37 @@ const m = {
|
|
|
36
35
|
},
|
|
37
36
|
created() {
|
|
38
37
|
this.getLocals();
|
|
39
|
-
},
|
|
40
|
-
mounted() {
|
|
41
38
|
}
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
|
|
39
|
+
}, k = ["name", "value", "id"], L = ["for"];
|
|
40
|
+
function v(e, d, l, x, r, S) {
|
|
41
|
+
return c(), a("ul", {
|
|
42
|
+
class: s(["grid w-full gap-1 mt-5 mb-5 md:gap-0 md:grid-cols-10 language-selector", l.selectorClass]),
|
|
43
|
+
ref: "language_selector"
|
|
44
|
+
}, [
|
|
45
|
+
(c(!0), a(m, null, f(r.glLocale.locals, (t, o) => (c(), a("li", { key: t }, [
|
|
46
|
+
_(g("input", {
|
|
50
47
|
type: "radio",
|
|
51
48
|
name: l.trans_selector_name,
|
|
52
49
|
value: t,
|
|
53
50
|
class: "hidden! peer",
|
|
54
51
|
id: t + "_" + l.field_name,
|
|
55
52
|
autocomplete: "off",
|
|
56
|
-
|
|
57
|
-
}, null, 8,
|
|
58
|
-
|
|
53
|
+
"onUpdate:modelValue": d[0] || (d[0] = (u) => r.glLocale.current = u)
|
|
54
|
+
}, null, 8, k), [
|
|
55
|
+
[p, r.glLocale.current]
|
|
56
|
+
]),
|
|
57
|
+
g("label", {
|
|
59
58
|
for: t + "_" + l.field_name,
|
|
60
|
-
class:
|
|
61
|
-
"border md:rounded-s-lg!":
|
|
62
|
-
"border md:rounded-e-lg!":
|
|
63
|
-
"border-t border-b":
|
|
59
|
+
class: s([{
|
|
60
|
+
"border md:rounded-s-lg!": o === 0,
|
|
61
|
+
"border md:rounded-e-lg!": o === r.glLocale.locals.length - 1,
|
|
62
|
+
"border-t border-b": o !== 0 && o !== r.glLocale.locals.length - 1
|
|
64
63
|
}, "block w-full p-1 font-bold text-center text-gray-500 uppercase bg-white border-gray-200 rounded-lg cursor-pointer md:rounded-none dark:hover:text-gray-300 dark:border-gray-700 dark:peer-checked:text-blue-500 peer-checked:border-blue-600 peer-checked:text-blue-600 hover:text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:bg-gray-800 dark:hover:bg-gray-700"])
|
|
65
|
-
},
|
|
66
|
-
]))),
|
|
67
|
-
],
|
|
64
|
+
}, b(t), 11, L)
|
|
65
|
+
]))), 128))
|
|
66
|
+
], 2);
|
|
68
67
|
}
|
|
69
|
-
const
|
|
68
|
+
const D = /* @__PURE__ */ h(y, [["render", v]]);
|
|
70
69
|
export {
|
|
71
|
-
|
|
70
|
+
D as default
|
|
72
71
|
};
|