golden-logic-ui 1.2.375 → 1.3.0
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/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/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,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
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useSlots as
|
|
2
|
-
const
|
|
1
|
+
import { useSlots as C, ref as f, Comment as _, provide as S, watch as m, onMounted as L, onBeforeUnmount as H, createElementBlock as o, openBlock as n, Fragment as b, createElementVNode as s, withDirectives as B, normalizeClass as l, renderList as D, createCommentVNode as E, createTextVNode as F, toDisplayString as I, renderSlot as M, vShow as N } from "vue";
|
|
2
|
+
const U = ["onClick"], V = ["innerHTML"], W = { class: "relative flex flex-col w-full min-w-0 mb-6 wrap-break-word rounded-[20px] border border-gray-200 dark:border-gray-700" }, R = { class: "flex-auto px-4 py-5" }, $ = { class: "tab-content tab-space" }, A = {
|
|
3
3
|
__name: "GlTabsWrapper",
|
|
4
4
|
props: {
|
|
5
5
|
autoFlexTabs: {
|
|
@@ -16,14 +16,16 @@ const N = ["onClick"], U = ["innerHTML"], V = { class: "relative flex flex-col w
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
emits: ["TabChange"],
|
|
19
|
-
setup(i, { expose: v, emit:
|
|
20
|
-
const c = i,
|
|
21
|
-
(
|
|
22
|
-
), k = (e) => typeof e == "string" && /<\s*(svg|path|g|circle|rect)\b/i.test(e), a =
|
|
23
|
-
|
|
24
|
-
const g = (e) => e.trim().toLowerCase().replace(/\s+/g, "-")
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
setup(i, { expose: v, emit: y }) {
|
|
20
|
+
const c = i, x = y, w = C(), d = f(
|
|
21
|
+
(w.default?.() ?? []).filter((e) => e.type !== _ && e.props !== null).map((e) => e.props)
|
|
22
|
+
), k = (e) => typeof e == "string" && /<\s*(svg|path|g|circle|rect)\b/i.test(e), a = f("");
|
|
23
|
+
S("selectedTitle", a);
|
|
24
|
+
const g = (e) => e.trim().toLowerCase().replace(/\s+/g, "-");
|
|
25
|
+
let u = !1;
|
|
26
|
+
const T = (e) => {
|
|
27
|
+
const r = g(e), t = encodeURIComponent(r);
|
|
28
|
+
window.location.hash.replace("#", "") !== t && (u = !0, window.location.hash = t), x("TabChange", e);
|
|
27
29
|
}, p = (e) => {
|
|
28
30
|
if (typeof e != "string") return;
|
|
29
31
|
d.value.find((t) => t.title === e) && (a.value = e);
|
|
@@ -31,25 +33,29 @@ const N = ["onClick"], U = ["innerHTML"], V = { class: "relative flex flex-col w
|
|
|
31
33
|
v({
|
|
32
34
|
setActiveTab: p
|
|
33
35
|
});
|
|
34
|
-
const
|
|
36
|
+
const h = () => {
|
|
37
|
+
if (u) {
|
|
38
|
+
u = !1;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
35
41
|
const e = decodeURIComponent(window.location.hash.replace("#", "")), r = d.value.find((t) => g(t.title) === e);
|
|
36
42
|
r && (a.value = r.title);
|
|
37
43
|
};
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
}),
|
|
44
|
+
return m(a, (e) => {
|
|
45
|
+
T(e);
|
|
46
|
+
}), m(() => c.activeTab, (e) => {
|
|
41
47
|
e && e !== a.value && p(e);
|
|
42
|
-
}), S(() => {
|
|
43
|
-
u(), !a.value && c.activeTab && p(c.activeTab), window.addEventListener("hashchange", u);
|
|
44
48
|
}), L(() => {
|
|
45
|
-
window.
|
|
46
|
-
}), (
|
|
49
|
+
h(), !a.value && c.activeTab && p(c.activeTab), window.addEventListener("hashchange", h);
|
|
50
|
+
}), H(() => {
|
|
51
|
+
window.removeEventListener("hashchange", h);
|
|
52
|
+
}), (e, r) => (n(), o(b, null, [
|
|
47
53
|
s("ul", {
|
|
48
54
|
class: l(["flex flex-row flex-wrap gap-2 pt-3 pb-4 mb-0 list-none text-gray-500 dark:text-gray-400", i.tabsWrapperClass])
|
|
49
55
|
}, [
|
|
50
|
-
(n(!0), o(
|
|
56
|
+
(n(!0), o(b, null, D(d.value, (t) => (n(), o("li", {
|
|
51
57
|
key: t.title,
|
|
52
|
-
onClick: (
|
|
58
|
+
onClick: (j) => a.value = t.title,
|
|
53
59
|
class: l(["-mb-px text-center", {
|
|
54
60
|
"flex-auto ": i.autoFlexTabs
|
|
55
61
|
}])
|
|
@@ -61,26 +67,26 @@ const N = ["onClick"], U = ["innerHTML"], V = { class: "relative flex flex-col w
|
|
|
61
67
|
key: 0,
|
|
62
68
|
class: "inline-flex items-center justify-center me-2 align-middle",
|
|
63
69
|
innerHTML: t.icon
|
|
64
|
-
}, null, 8,
|
|
70
|
+
}, null, 8, V)) : t.icon ? (n(), o("i", {
|
|
65
71
|
key: 1,
|
|
66
72
|
class: l([t.icon, "me-2 text-sm"])
|
|
67
73
|
}, null, 2)) : E("", !0),
|
|
68
|
-
F(
|
|
74
|
+
F(I(t.title), 1)
|
|
69
75
|
], 2)
|
|
70
|
-
], 10,
|
|
76
|
+
], 10, U))), 128))
|
|
71
77
|
], 2),
|
|
72
|
-
B(s("div",
|
|
73
|
-
s("div",
|
|
74
|
-
s("div",
|
|
75
|
-
|
|
78
|
+
B(s("div", W, [
|
|
79
|
+
s("div", R, [
|
|
80
|
+
s("div", $, [
|
|
81
|
+
M(e.$slots, "default")
|
|
76
82
|
])
|
|
77
83
|
])
|
|
78
84
|
], 512), [
|
|
79
|
-
[
|
|
85
|
+
[N, a.value]
|
|
80
86
|
])
|
|
81
87
|
], 64));
|
|
82
88
|
}
|
|
83
89
|
};
|
|
84
90
|
export {
|
|
85
|
-
|
|
91
|
+
A as default
|
|
86
92
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
1
|
+
import { ref as v, createElementBlock as s, openBlock as d, Fragment as w, createCommentVNode as f, normalizeClass as i, createElementVNode as t, toDisplayString as a, unref as l } from "vue";
|
|
2
|
+
import { glLocale as S } from "../../localeStore.js";
|
|
3
|
+
import { useTranslations as p } from "../../useTranslations.js";
|
|
4
|
+
const q = { class: "font-bold ptext-lg dark:text-white" }, T = ["name", "id", "value"], V = ["id"], _ = ["for"], B = { 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" }, j = ["name", "id", "value"], C = ["required", "name", "id", "type", "value"], N = { class: "gl-span-form-error" }, E = { class: "block mt-1 text-sm font-normal leading-5 text-gray-500" }, D = {
|
|
3
5
|
__name: "GlTextTranslate",
|
|
4
6
|
props: {
|
|
5
7
|
is_required: {
|
|
@@ -48,77 +50,69 @@ const x = { class: "font-bold ptext-lg dark:text-white" }, p = ["name", "id"], T
|
|
|
48
50
|
}
|
|
49
51
|
},
|
|
50
52
|
emits: ["update:modelValue", "update:modelValueTranslate", "keydown"],
|
|
51
|
-
setup(e, { expose:
|
|
52
|
-
const
|
|
53
|
-
|
|
53
|
+
setup(e, { expose: g, emit: c }) {
|
|
54
|
+
const y = e, b = c, u = v(null), { asJson: o, currentText: m, setCurrent: x } = p(y, b), h = (r) => {
|
|
55
|
+
x(r.target.value);
|
|
54
56
|
};
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
}), c({ focus: () => a.value.focus() }), (o, l) => (y(), g(h, null, [
|
|
58
|
-
e.show ? (y(), g("div", {
|
|
57
|
+
return g({ focus: () => u.value?.focus() }), (r, n) => (d(), s(w, null, [
|
|
58
|
+
e.show ? (d(), s("div", {
|
|
59
59
|
key: 0,
|
|
60
|
-
class:
|
|
60
|
+
class: i(e.field_name)
|
|
61
61
|
}, [
|
|
62
|
-
t("h3",
|
|
62
|
+
t("h3", q, a(e.label_name), 1),
|
|
63
63
|
t("input", {
|
|
64
64
|
type: "hidden",
|
|
65
|
-
"data-i18n": "true",
|
|
66
65
|
name: e.field_name + "_i18n",
|
|
67
66
|
id: e.field_name + "_i18n",
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}, null, 8, p),
|
|
67
|
+
value: l(o)()
|
|
68
|
+
}, null, 8, T),
|
|
71
69
|
t("p", {
|
|
72
|
-
ref_key: "output_translate",
|
|
73
|
-
ref: r,
|
|
74
70
|
id: e.field_name,
|
|
75
|
-
class: "mb-4 text-base text-gray-900 input_tr_show dark:text-white"
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
], 2)) :
|
|
79
|
-
e.show ?
|
|
71
|
+
class: "mb-4 text-base text-gray-900 gl-multilanguage input_tr_show dark:text-white"
|
|
72
|
+
}, a(l(m)), 9, V),
|
|
73
|
+
n[1] || (n[1] = t("hr", { class: "opacity-100! bg-gray-200 border-0 dark:bg-gray-700" }, null, -1))
|
|
74
|
+
], 2)) : f("", !0),
|
|
75
|
+
e.show ? f("", !0) : (d(), s("div", {
|
|
80
76
|
key: 1,
|
|
81
|
-
class:
|
|
77
|
+
class: i(["mb-4", e.field_name])
|
|
82
78
|
}, [
|
|
83
79
|
t("label", {
|
|
84
|
-
class:
|
|
80
|
+
class: i({
|
|
85
81
|
"gl-label-translation-form": e.error_message == "",
|
|
86
82
|
"gl-label-translation-form-invalid": e.error_message !== "",
|
|
87
83
|
required: e.is_required
|
|
88
84
|
}),
|
|
89
85
|
for: e.field_name
|
|
90
|
-
},
|
|
91
|
-
|
|
86
|
+
}, a(e.label_name), 11, _),
|
|
87
|
+
t("span", B, a(l(S).current), 1),
|
|
92
88
|
t("input", {
|
|
93
89
|
class: "mb-4",
|
|
94
90
|
type: "hidden",
|
|
95
|
-
"data-i18n": "true",
|
|
96
91
|
name: e.field_name + "_i18n",
|
|
97
92
|
id: e.field_name + "_i18n",
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
ref: u
|
|
101
|
-
}, null, 40, S),
|
|
93
|
+
value: l(o)()
|
|
94
|
+
}, null, 8, j),
|
|
102
95
|
t("input", {
|
|
103
96
|
required: e.is_required,
|
|
104
97
|
name: e.field_name,
|
|
105
98
|
id: e.field_name,
|
|
106
|
-
class:
|
|
99
|
+
class: i(["mt-2 form-input-translation gl-multilanguage", {
|
|
107
100
|
" gl-input-form": e.error_message == "",
|
|
108
101
|
" gl-input-form-invalid": e.error_message !== ""
|
|
109
102
|
}]),
|
|
110
103
|
type: e.type,
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
value: l(m),
|
|
105
|
+
onInput: h,
|
|
106
|
+
onKeydown: n[0] || (n[0] = (k) => r.$emit("keydown", k)),
|
|
113
107
|
ref_key: "input",
|
|
114
|
-
ref:
|
|
115
|
-
}, null, 42,
|
|
116
|
-
t("span",
|
|
117
|
-
t("small",
|
|
108
|
+
ref: u
|
|
109
|
+
}, null, 42, C),
|
|
110
|
+
t("span", N, a(e.error_message), 1),
|
|
111
|
+
t("small", E, a(e.description), 1)
|
|
118
112
|
], 2))
|
|
119
113
|
], 64));
|
|
120
114
|
}
|
|
121
115
|
};
|
|
122
116
|
export {
|
|
123
|
-
|
|
117
|
+
D as default
|
|
124
118
|
};
|