@gct-paas/design-web 0.1.4-dev.11 → 0.1.4-dev.13
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/index.min.css +2 -1
- package/dist/loader.esm.min.js +778 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
- package/es/components/I18nSelect/index.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-modal.vue.mjs +5 -151
- package/es/components/I18nSelect/src/i18n-modal.vue_vue_type_script_setup_true_lang.mjs +128 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +7 -7
- package/es/components/I18nSelect/src/i18n-select-btn.vue_vue_type_script_setup_true_name_i18n-select-btn_lang.mjs +116 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +7 -7
- package/es/components/I18nSelect/src/i18n-select-container.vue_vue_type_script_setup_true_name_i18n-select-container_lang.mjs +217 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +5 -57
- package/es/components/I18nSelect/src/i18n-select-input-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs +56 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +7 -7
- package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +125 -0
- package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +5 -21
- package/es/components/I18nSelect/src/i18n-select-modal.vue_vue_type_script_setup_true_lang.mjs +19 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +5 -57
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs +56 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +7 -7
- package/es/components/I18nSelect/src/i18n-select-textarea.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +86 -0
- package/es/components/I18nSelect/src/useI18nSelect.mjs +43 -48
- package/es/components/index.mjs +8 -0
- package/es/index.mjs +14 -15
- package/es/loader.d.ts +1 -0
- package/package.json +9 -9
- package/dist/index.esm.min.mjs +0 -836
- package/dist/index.min.cjs +0 -1
- package/dist/index.system.min.js +0 -1
- package/es/components/I18nSelect/src/i18n-modal.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-btn.vue2.mjs +0 -138
- package/es/components/I18nSelect/src/i18n-select-container.vue2.mjs +0 -250
- package/es/components/I18nSelect/src/i18n-select-input-form.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-input.vue2.mjs +0 -129
- package/es/components/I18nSelect/src/i18n-select-modal.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue2.mjs +0 -5
- package/es/components/I18nSelect/src/i18n-select-textarea.vue2.mjs +0 -93
- /package/es/components/I18nSelect/src/{i18n-select-btn.css → i18n-select-btn.vue_vue_type_style_index_0_scoped_dc8ffb2c_lang.css} +0 -0
- /package/es/components/I18nSelect/src/{i18n-select-container.css → i18n-select-container.vue_vue_type_style_index_0_scoped_0160ed5e_lang.css} +0 -0
- /package/es/components/I18nSelect/src/{i18n-select-input.css → i18n-select-input.vue_vue_type_style_index_0_scoped_412e1309_lang.css} +0 -0
- /package/es/components/I18nSelect/src/{i18n-select-textarea.css → i18n-select-textarea.vue_vue_type_style_index_0_scoped_cd95c416_lang.css} +0 -0
|
@@ -0,0 +1,778 @@
|
|
|
1
|
+
import { ButtonSize as e, cssLoader as t, t as n } from "@gct-paas/core";
|
|
2
|
+
import { Fragment as r, computed as i, createApp as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, normalizeClass as m, onMounted as h, openBlock as g, reactive as _, ref as v, renderList as y, renderSlot as b, resolveComponent as x, toDisplayString as S, toRaw as C, toValue as w, unref as T, watch as E, withCtx as D } from "vue";
|
|
3
|
+
import { has as O, isEmpty as k, omit as A } from "lodash-es";
|
|
4
|
+
import { useModal as j, useModalInner as M } from "@gct-paas/core-web";
|
|
5
|
+
import { SearchOutlined as ee } from "@ant-design/icons-vue";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/components/I18nSelect/src/i18n-modal.vue
|
|
8
|
+
var N = /* @__PURE__ */ f({
|
|
9
|
+
__name: "i18n-modal",
|
|
10
|
+
props: {
|
|
11
|
+
lang: {},
|
|
12
|
+
getContainer: { type: Function }
|
|
13
|
+
},
|
|
14
|
+
emits: ["ok", "register"],
|
|
15
|
+
setup(e, { emit: t }) {
|
|
16
|
+
let i = e, a = t, s = v(), l = _({ id: "" }), u = v(!1), f = (e) => {
|
|
17
|
+
e && (u.value = !1);
|
|
18
|
+
}, [m, { closeModal: h }] = M((e) => {
|
|
19
|
+
e && b(e);
|
|
20
|
+
}), b = (e) => {
|
|
21
|
+
u.value = !0, l.id = e.key;
|
|
22
|
+
let { lang: t } = i;
|
|
23
|
+
console.log(t, "lang========");
|
|
24
|
+
for (let n of t) {
|
|
25
|
+
let t = n.dataIndex;
|
|
26
|
+
l[t] = e[t];
|
|
27
|
+
}
|
|
28
|
+
}, S = (e, t, r) => {
|
|
29
|
+
/^[a-zA-Z_.]*$/.test(t) || r(n("sys.i18n.validated18nKeyErrorMsg")), r();
|
|
30
|
+
}, w = async (e, t) => /^\s*$/g.test(t) ? Promise.reject(n("sys.notEmptySth", { sth: n("sys.i18n") })) : Promise.resolve(), E = () => {
|
|
31
|
+
s.value?.validate().then(() => {
|
|
32
|
+
a("ok", { ...C(l) }, u.value), h();
|
|
33
|
+
});
|
|
34
|
+
}, O = () => {
|
|
35
|
+
s.value?.resetFields();
|
|
36
|
+
};
|
|
37
|
+
return (t, a) => {
|
|
38
|
+
let h = x("a-input"), _ = x("a-form-item"), v = x("a-form"), b = x("BasicModal");
|
|
39
|
+
return g(), o(b, p(t.$attrs, {
|
|
40
|
+
title: u.value ? T(n)("sys.edit") : T(n)("sys.new"),
|
|
41
|
+
centered: "",
|
|
42
|
+
width: "640px",
|
|
43
|
+
"min-height": 100,
|
|
44
|
+
"mask-closable": !1,
|
|
45
|
+
"after-close": O,
|
|
46
|
+
"get-container": e.getContainer,
|
|
47
|
+
onRegister: T(m),
|
|
48
|
+
onOk: E,
|
|
49
|
+
onVisibleChange: f
|
|
50
|
+
}), {
|
|
51
|
+
default: D(() => [d(v, {
|
|
52
|
+
ref_key: "formRef",
|
|
53
|
+
ref: s,
|
|
54
|
+
model: l,
|
|
55
|
+
"label-col": { span: 6 },
|
|
56
|
+
"wrapper-col": { span: 16 },
|
|
57
|
+
autocomplete: "off",
|
|
58
|
+
layout: "horizontal"
|
|
59
|
+
}, {
|
|
60
|
+
default: D(() => [d(_, {
|
|
61
|
+
label: T(n)("sys.i18n.resourceIdentification"),
|
|
62
|
+
name: "id",
|
|
63
|
+
rules: [{
|
|
64
|
+
required: !0,
|
|
65
|
+
message: T(n)("sys.pleaseInputSth", { sth: T(n)("sys.i18n.resourceIdentification") })
|
|
66
|
+
}, { validator: S }]
|
|
67
|
+
}, {
|
|
68
|
+
default: D(() => [d(h, {
|
|
69
|
+
value: l.id,
|
|
70
|
+
"onUpdate:value": a[0] ||= (e) => l.id = e,
|
|
71
|
+
"show-count": "",
|
|
72
|
+
maxlength: 128,
|
|
73
|
+
disabled: u.value
|
|
74
|
+
}, null, 8, ["value", "disabled"])]),
|
|
75
|
+
_: 1
|
|
76
|
+
}, 8, ["label", "rules"]), (g(!0), c(r, null, y(i.lang, (e) => (g(), o(_, {
|
|
77
|
+
key: e.dataIndex,
|
|
78
|
+
label: e.title,
|
|
79
|
+
name: e.dataIndex,
|
|
80
|
+
rules: [{
|
|
81
|
+
required: !0,
|
|
82
|
+
message: T(n)("sys.pleaseInputSth", { sth: e.title })
|
|
83
|
+
}, { validator: w }]
|
|
84
|
+
}, {
|
|
85
|
+
default: D(() => [d(h, {
|
|
86
|
+
value: l[e.dataIndex],
|
|
87
|
+
"onUpdate:value": (t) => l[e.dataIndex] = t,
|
|
88
|
+
"show-count": "",
|
|
89
|
+
maxlength: 300
|
|
90
|
+
}, null, 8, ["value", "onUpdate:value"])]),
|
|
91
|
+
_: 2
|
|
92
|
+
}, 1032, [
|
|
93
|
+
"label",
|
|
94
|
+
"name",
|
|
95
|
+
"rules"
|
|
96
|
+
]))), 128))]),
|
|
97
|
+
_: 1
|
|
98
|
+
}, 8, ["model"])]),
|
|
99
|
+
_: 1
|
|
100
|
+
}, 16, [
|
|
101
|
+
"title",
|
|
102
|
+
"get-container",
|
|
103
|
+
"onRegister"
|
|
104
|
+
]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}), P = { class: "i18n-select-container" }, F = { class: "table-wrap" }, I = /* @__PURE__ */ f({
|
|
108
|
+
__name: "i18n-select-container",
|
|
109
|
+
props: {
|
|
110
|
+
i18nModalKey: {},
|
|
111
|
+
destroyCallback: { type: Function },
|
|
112
|
+
saveCallback: { type: Function }
|
|
113
|
+
},
|
|
114
|
+
setup(e) {
|
|
115
|
+
let [t, { closeModal: r }] = M(), [a, { openModal: s }] = j(), c = e, f = () => document.querySelector(`#${c.i18nModalKey}`), m = v(), y = _({ keywords: "" }), b = _({
|
|
116
|
+
current: 1,
|
|
117
|
+
pageSize: 5,
|
|
118
|
+
total: 0,
|
|
119
|
+
size: "small",
|
|
120
|
+
showTotal: (e) => n("sys.component.table.total", { total: e })
|
|
121
|
+
}), C = v([]), w = v(), E = v({
|
|
122
|
+
type: "radio",
|
|
123
|
+
hideSelectAll: !0,
|
|
124
|
+
selectedRowKeys: [],
|
|
125
|
+
onChange: B
|
|
126
|
+
}), O = v(!1), k = i(() => []), A = async (e, t) => {
|
|
127
|
+
O.value = !0;
|
|
128
|
+
let n = await _api.apaas.i18NInfo.getPageList({
|
|
129
|
+
pageNo: t ?? b.current,
|
|
130
|
+
pageSize: b.pageSize,
|
|
131
|
+
searchKey: e
|
|
132
|
+
});
|
|
133
|
+
if (O.value = !1, n && n.data) {
|
|
134
|
+
let e = n.data.map((e) => {
|
|
135
|
+
let t = JSON.parse(e?.info);
|
|
136
|
+
return {
|
|
137
|
+
key: e.key,
|
|
138
|
+
type: e.type,
|
|
139
|
+
...Object.fromEntries(t.map((e) => [e.locale, e.info]))
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
b.total = n.totalCount, C.value = e;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
h(A);
|
|
146
|
+
let I = () => {
|
|
147
|
+
m.value?.validate().then(async () => {
|
|
148
|
+
await A(y.keywords, 1);
|
|
149
|
+
});
|
|
150
|
+
}, L = (e) => {
|
|
151
|
+
let { current: t, total: n, pageSize: r } = e;
|
|
152
|
+
b.current = t, b.total = n, b.pageSize = r, A();
|
|
153
|
+
}, R = () => {
|
|
154
|
+
s();
|
|
155
|
+
}, z = async (e, t) => {
|
|
156
|
+
let n = k.value.map((t) => ({
|
|
157
|
+
locale: t.dataIndex,
|
|
158
|
+
info: e[t.dataIndex]
|
|
159
|
+
}));
|
|
160
|
+
O.value = !0;
|
|
161
|
+
try {
|
|
162
|
+
t ? await _api.apaas.i18NInfo.putKey({ key: e.id }, { info: JSON.stringify(n) }) : await _api.apaas.i18NInfo.post({
|
|
163
|
+
info: JSON.stringify(n),
|
|
164
|
+
key: e.id
|
|
165
|
+
}), A(), B([e.id], [_(e)]);
|
|
166
|
+
} catch {
|
|
167
|
+
O.value = !1;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
function B(e, t) {
|
|
171
|
+
E.value.selectedRowKeys = e, w.value = t;
|
|
172
|
+
}
|
|
173
|
+
let V = () => {
|
|
174
|
+
c.destroyCallback && typeof c.destroyCallback == "function" && c.destroyCallback();
|
|
175
|
+
}, H = async () => {
|
|
176
|
+
if (c.saveCallback && typeof c.saveCallback == "function") {
|
|
177
|
+
let e = E.value.selectedRowKeys, t = {};
|
|
178
|
+
if (e && e[0]) {
|
|
179
|
+
let n = w.value?.[0];
|
|
180
|
+
console.log("selectRow", n), Object.assign(t, { i18nKey: e[0] });
|
|
181
|
+
}
|
|
182
|
+
c.saveCallback(t);
|
|
183
|
+
}
|
|
184
|
+
r();
|
|
185
|
+
};
|
|
186
|
+
return (e, r) => {
|
|
187
|
+
let i = x("a-input"), s = x("a-form-item"), c = x("a-col"), h = x("a-button"), _ = x("plus-outlined"), v = x("a-row"), w = x("a-form"), A = x("a-table"), j = x("basic-modal");
|
|
188
|
+
return g(), o(j, p(e.$attrs, {
|
|
189
|
+
"min-height": 40,
|
|
190
|
+
title: T(n)("sys.i18n.i18nConfig"),
|
|
191
|
+
centered: "",
|
|
192
|
+
width: "640px",
|
|
193
|
+
"can-fullscreen": !1,
|
|
194
|
+
"mask-closable": !1,
|
|
195
|
+
"after-close": V,
|
|
196
|
+
"get-container": f,
|
|
197
|
+
onRegister: T(t),
|
|
198
|
+
onOk: H
|
|
199
|
+
}), {
|
|
200
|
+
default: D(() => [l("div", P, [d(w, {
|
|
201
|
+
ref_key: "formRef",
|
|
202
|
+
ref: m,
|
|
203
|
+
model: y,
|
|
204
|
+
autocomplete: "off",
|
|
205
|
+
layout: "horizontal"
|
|
206
|
+
}, {
|
|
207
|
+
default: D(() => [d(v, null, {
|
|
208
|
+
default: D(() => [d(c, { span: 12 }, {
|
|
209
|
+
default: D(() => [d(s, {
|
|
210
|
+
name: "keywords",
|
|
211
|
+
label: T(n)("sys.keywords")
|
|
212
|
+
}, {
|
|
213
|
+
default: D(() => [d(i, {
|
|
214
|
+
value: y.keywords,
|
|
215
|
+
"onUpdate:value": r[0] ||= (e) => y.keywords = e,
|
|
216
|
+
placeholder: T(n)("sys.keywordsPlaceholder"),
|
|
217
|
+
style: { display: "inline-flex" }
|
|
218
|
+
}, null, 8, ["value", "placeholder"])]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["label"])]),
|
|
221
|
+
_: 1
|
|
222
|
+
}), d(c, {
|
|
223
|
+
span: 12,
|
|
224
|
+
style: { "text-align": "right" }
|
|
225
|
+
}, {
|
|
226
|
+
default: D(() => [d(h, {
|
|
227
|
+
type: "primary",
|
|
228
|
+
onClick: I
|
|
229
|
+
}, {
|
|
230
|
+
icon: D(() => [d(T(ee))]),
|
|
231
|
+
default: D(() => [u(" " + S(T(n)("sys.queryText")), 1)]),
|
|
232
|
+
_: 1
|
|
233
|
+
}), d(h, {
|
|
234
|
+
style: { margin: "0 8px" },
|
|
235
|
+
type: "primary",
|
|
236
|
+
onClick: R
|
|
237
|
+
}, {
|
|
238
|
+
icon: D(() => [d(_)]),
|
|
239
|
+
default: D(() => [u(" " + S(T(n)("sys.new")), 1)]),
|
|
240
|
+
_: 1
|
|
241
|
+
})]),
|
|
242
|
+
_: 1
|
|
243
|
+
})]),
|
|
244
|
+
_: 1
|
|
245
|
+
})]),
|
|
246
|
+
_: 1
|
|
247
|
+
}, 8, ["model"]), l("div", F, [d(A, {
|
|
248
|
+
ref: "tableRef",
|
|
249
|
+
"data-source": C.value,
|
|
250
|
+
columns: k.value,
|
|
251
|
+
"show-index-column": !1,
|
|
252
|
+
pagination: b,
|
|
253
|
+
striped: !1,
|
|
254
|
+
bordered: !0,
|
|
255
|
+
"row-selection": E.value,
|
|
256
|
+
loading: O.value,
|
|
257
|
+
onChange: L
|
|
258
|
+
}, null, 8, [
|
|
259
|
+
"data-source",
|
|
260
|
+
"columns",
|
|
261
|
+
"pagination",
|
|
262
|
+
"row-selection",
|
|
263
|
+
"loading"
|
|
264
|
+
]), d(N, {
|
|
265
|
+
lang: k.value,
|
|
266
|
+
"get-container": f,
|
|
267
|
+
onRegister: T(a),
|
|
268
|
+
onOk: z
|
|
269
|
+
}, null, 8, ["lang", "onRegister"])])])]),
|
|
270
|
+
_: 1
|
|
271
|
+
}, 16, ["title", "onRegister"]);
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
}), L = (e, t) => {
|
|
275
|
+
let n = e.__vccOpts || e;
|
|
276
|
+
for (let [e, r] of t) n[e] = r;
|
|
277
|
+
return n;
|
|
278
|
+
}, R = /* @__PURE__ */ L(I, [["__scopeId", "data-v-0160ed5e"]]), z = /* @__PURE__ */ f({
|
|
279
|
+
__name: "i18n-select-modal",
|
|
280
|
+
setup(e, { expose: t }) {
|
|
281
|
+
let [n, { openModal: r }] = j();
|
|
282
|
+
return t({ open: () => {
|
|
283
|
+
r();
|
|
284
|
+
} }), (e, t) => (g(), o(R, { onRegister: T(n) }, null, 8, ["onRegister"]));
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/components/I18nSelect/src/useI18nSelect.ts
|
|
289
|
+
function B() {
|
|
290
|
+
let e = null, t = null, n = v("");
|
|
291
|
+
function r(r) {
|
|
292
|
+
let o, s = document.body;
|
|
293
|
+
if (O(r, "target") || O(r, "props")) {
|
|
294
|
+
let e = r;
|
|
295
|
+
o = e.props || {}, s = e.target || document.body;
|
|
296
|
+
} else o = r;
|
|
297
|
+
n.value = o.i18nModalKey || `i18n-select-modal-${Math.random().toString(16).substring(8)}`;
|
|
298
|
+
let c = {
|
|
299
|
+
...o,
|
|
300
|
+
destroyCallback: () => i(o?.destroyCallback),
|
|
301
|
+
i18nModalKey: T(n)
|
|
302
|
+
};
|
|
303
|
+
if (!e) {
|
|
304
|
+
let r = document.createElement("div");
|
|
305
|
+
r.id = T(n), T(s)?.appendChild(r), e = a(z, c), t = e.mount(r);
|
|
306
|
+
}
|
|
307
|
+
t?.open();
|
|
308
|
+
}
|
|
309
|
+
function i(t) {
|
|
310
|
+
typeof t == "function" && t(), document.querySelector(`#${T(n)}`).remove(), e &&= (e.unmount(), null);
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
open: r,
|
|
314
|
+
close: i
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/components/I18nSelect/src/i18n-select-btn.vue?vue&type=script&setup=true&name=i18n-select-btn&lang.ts
|
|
319
|
+
var V = { class: "i18n-tooltip-title" }, H = { style: { "margin-left": "4px" } }, U = /* @__PURE__ */ L(/* @__PURE__ */ f({
|
|
320
|
+
__name: "i18n-select-btn",
|
|
321
|
+
props: {
|
|
322
|
+
i18nValue: {},
|
|
323
|
+
buttonExtraProps: {},
|
|
324
|
+
size: {},
|
|
325
|
+
i18nModalKey: {},
|
|
326
|
+
simpleBtn: { type: Boolean },
|
|
327
|
+
btnHeight: {},
|
|
328
|
+
btnWidth: {}
|
|
329
|
+
},
|
|
330
|
+
emits: ["on-select-i18n", "closed"],
|
|
331
|
+
setup(e, { emit: t }) {
|
|
332
|
+
let n = v(), a = B(), s = e, u = t, f = _({}), h = i(() => !k(s.i18nValue)), b = async (e) => {
|
|
333
|
+
let t = await _api.apaas.i18NInfo.getPageList({
|
|
334
|
+
pageNo: 1,
|
|
335
|
+
pageSize: 20,
|
|
336
|
+
searchKey: e
|
|
337
|
+
});
|
|
338
|
+
if (t && t.data) {
|
|
339
|
+
let e = t.data.find((e) => e.key === s.i18nValue);
|
|
340
|
+
e && Object.assign(f, Object.fromEntries(Object.entries(JSON.parse(e.info)).map(([e, t]) => [t.locale, t.info])));
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
E(() => s.i18nValue, () => {
|
|
344
|
+
k(s.i18nValue) || b(s.i18nValue);
|
|
345
|
+
}, { immediate: !0 });
|
|
346
|
+
let C = () => {
|
|
347
|
+
a.open({
|
|
348
|
+
i18nModalKey: s.i18nModalKey,
|
|
349
|
+
saveCallback: (e) => {
|
|
350
|
+
u("on-select-i18n", { ...e });
|
|
351
|
+
},
|
|
352
|
+
destroyCallback: () => {
|
|
353
|
+
u("closed");
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
return (t, i) => {
|
|
358
|
+
let a = x("Icon"), s = x("a-button"), u = x("a-tooltip");
|
|
359
|
+
return e.simpleBtn ? (g(), o(a, {
|
|
360
|
+
key: 0,
|
|
361
|
+
class: m(["i18n-icon simple-btn", { "is-highlight": h.value }]),
|
|
362
|
+
icon: "ion:language",
|
|
363
|
+
onClick: C
|
|
364
|
+
}, null, 8, ["class"])) : h.value ? (g(), o(u, {
|
|
365
|
+
key: 1,
|
|
366
|
+
color: "#fff",
|
|
367
|
+
placement: "topRight"
|
|
368
|
+
}, {
|
|
369
|
+
title: D(() => [l("div", V, "语言标识:" + S(e.i18nValue), 1), (g(!0), c(r, null, y(n.value, (e) => (g(), c("div", {
|
|
370
|
+
key: e.id,
|
|
371
|
+
class: "i18n-tooltip-item"
|
|
372
|
+
}, [l("strong", null, S(e.language) + ": ", 1), l("span", H, S(f[e.languageTag]), 1)]))), 128))]),
|
|
373
|
+
default: D(() => [d(s, p(e.buttonExtraProps, {
|
|
374
|
+
class: { "is-highlight": h.value },
|
|
375
|
+
style: {
|
|
376
|
+
"--btn-width": e.btnWidth,
|
|
377
|
+
"--btn-height": e.btnHeight
|
|
378
|
+
},
|
|
379
|
+
size: e.size,
|
|
380
|
+
onClick: C
|
|
381
|
+
}), {
|
|
382
|
+
icon: D(() => [d(a, {
|
|
383
|
+
class: "i18n-icon",
|
|
384
|
+
icon: "ion:language"
|
|
385
|
+
})]),
|
|
386
|
+
_: 1
|
|
387
|
+
}, 16, [
|
|
388
|
+
"class",
|
|
389
|
+
"style",
|
|
390
|
+
"size"
|
|
391
|
+
])]),
|
|
392
|
+
_: 1
|
|
393
|
+
})) : (g(), o(s, p({ key: 2 }, e.buttonExtraProps, {
|
|
394
|
+
class: { "is-highlight": h.value },
|
|
395
|
+
style: {
|
|
396
|
+
"--btn-width": e.btnWidth,
|
|
397
|
+
"--btn-height": e.btnHeight
|
|
398
|
+
},
|
|
399
|
+
size: e.size,
|
|
400
|
+
onClick: C
|
|
401
|
+
}), {
|
|
402
|
+
icon: D(() => [d(a, {
|
|
403
|
+
class: "i18n-icon",
|
|
404
|
+
icon: "ion:language"
|
|
405
|
+
})]),
|
|
406
|
+
_: 1
|
|
407
|
+
}, 16, [
|
|
408
|
+
"class",
|
|
409
|
+
"style",
|
|
410
|
+
"size"
|
|
411
|
+
]));
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
}), [["__scopeId", "data-v-dc8ffb2c"]]), W = typeof window < "u" && typeof document < "u";
|
|
415
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
416
|
+
var G = Object.prototype.toString, te = (e) => G.call(e) === "[object Object]", K = () => {}, ne = /* @__PURE__ */ re();
|
|
417
|
+
function re() {
|
|
418
|
+
var e, t;
|
|
419
|
+
return W && !!(!((e = window) == null || (e = e.navigator) == null) && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
|
|
420
|
+
}
|
|
421
|
+
function q(e) {
|
|
422
|
+
return Array.isArray(e) ? e : [e];
|
|
423
|
+
}
|
|
424
|
+
function ie(e, t, n) {
|
|
425
|
+
return E(e, t, {
|
|
426
|
+
...n,
|
|
427
|
+
immediate: !0
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region ../../node_modules/.pnpm/@vueuse+core@14.2.1_vue@3.5.30_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
|
|
432
|
+
var J = W ? window : void 0;
|
|
433
|
+
W && window.document, W && window.navigator, W && window.location;
|
|
434
|
+
function Y(e) {
|
|
435
|
+
let t = w(e);
|
|
436
|
+
return t?.$el ?? t;
|
|
437
|
+
}
|
|
438
|
+
function X(...e) {
|
|
439
|
+
let t = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), n = i(() => {
|
|
440
|
+
let t = q(w(e[0])).filter((e) => e != null);
|
|
441
|
+
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
442
|
+
});
|
|
443
|
+
return ie(() => [
|
|
444
|
+
n.value?.map((e) => Y(e)) ?? [J].filter((e) => e != null),
|
|
445
|
+
q(w(n.value ? e[1] : e[0])),
|
|
446
|
+
q(T(n.value ? e[2] : e[1])),
|
|
447
|
+
w(n.value ? e[3] : e[2])
|
|
448
|
+
], ([e, n, r, i], a, o) => {
|
|
449
|
+
if (!e?.length || !n?.length || !r?.length) return;
|
|
450
|
+
let s = te(i) ? { ...i } : i, c = e.flatMap((e) => n.flatMap((n) => r.map((r) => t(e, n, r, s))));
|
|
451
|
+
o(() => {
|
|
452
|
+
c.forEach((e) => e());
|
|
453
|
+
});
|
|
454
|
+
}, { flush: "post" });
|
|
455
|
+
}
|
|
456
|
+
var Z = !1;
|
|
457
|
+
function ae(e, t, n = {}) {
|
|
458
|
+
let { window: r = J, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
|
|
459
|
+
if (!r) return s ? {
|
|
460
|
+
stop: K,
|
|
461
|
+
cancel: K,
|
|
462
|
+
trigger: K
|
|
463
|
+
} : K;
|
|
464
|
+
if (ne && !Z) {
|
|
465
|
+
Z = !0;
|
|
466
|
+
let e = { passive: !0 };
|
|
467
|
+
Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", K, e)), r.document.documentElement.addEventListener("click", K, e);
|
|
468
|
+
}
|
|
469
|
+
let c = !0, l = (e) => w(i).some((t) => {
|
|
470
|
+
if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
|
|
471
|
+
{
|
|
472
|
+
let n = Y(t);
|
|
473
|
+
return n && (e.target === n || e.composedPath().includes(n));
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
function u(e) {
|
|
477
|
+
let t = w(e);
|
|
478
|
+
return t && t.$.subTree.shapeFlag === 16;
|
|
479
|
+
}
|
|
480
|
+
function d(e, t) {
|
|
481
|
+
let n = w(e), r = n.$.subTree && n.$.subTree.children;
|
|
482
|
+
return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
|
|
483
|
+
}
|
|
484
|
+
let f = (n) => {
|
|
485
|
+
let r = Y(e);
|
|
486
|
+
if (n.target != null && !(!(r instanceof Element) && u(e) && d(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
|
|
487
|
+
if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
|
|
488
|
+
c = !0;
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
t(n);
|
|
492
|
+
}
|
|
493
|
+
}, p = !1, m = [
|
|
494
|
+
X(r, "click", (e) => {
|
|
495
|
+
p || (p = !0, setTimeout(() => {
|
|
496
|
+
p = !1;
|
|
497
|
+
}, 0), f(e));
|
|
498
|
+
}, {
|
|
499
|
+
passive: !0,
|
|
500
|
+
capture: a
|
|
501
|
+
}),
|
|
502
|
+
X(r, "pointerdown", (t) => {
|
|
503
|
+
let n = Y(e);
|
|
504
|
+
c = !l(t) && !!(n && !t.composedPath().includes(n));
|
|
505
|
+
}, { passive: !0 }),
|
|
506
|
+
o && X(r, "blur", (n) => {
|
|
507
|
+
setTimeout(() => {
|
|
508
|
+
let i = Y(e);
|
|
509
|
+
r.document.activeElement?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
|
|
510
|
+
}, 0);
|
|
511
|
+
}, { passive: !0 })
|
|
512
|
+
].filter(Boolean), h = () => m.forEach((e) => e());
|
|
513
|
+
return s ? {
|
|
514
|
+
stop: h,
|
|
515
|
+
cancel: () => {
|
|
516
|
+
c = !1;
|
|
517
|
+
},
|
|
518
|
+
trigger: (e) => {
|
|
519
|
+
c = !0, f(e), c = !1;
|
|
520
|
+
}
|
|
521
|
+
} : h;
|
|
522
|
+
}
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/components/I18nSelect/src/i18n-select-input.vue
|
|
525
|
+
var Q = /* @__PURE__ */ L(/* @__PURE__ */ f({
|
|
526
|
+
__name: "i18n-select-input",
|
|
527
|
+
props: {
|
|
528
|
+
attr: {},
|
|
529
|
+
inputExtraProps: {},
|
|
530
|
+
i18nConfig: {},
|
|
531
|
+
i18nText: {},
|
|
532
|
+
placeholderText: {},
|
|
533
|
+
size: {},
|
|
534
|
+
i18nModalKey: {},
|
|
535
|
+
forceUpdate: { type: Boolean },
|
|
536
|
+
btnHeight: {},
|
|
537
|
+
btnWidth: {}
|
|
538
|
+
},
|
|
539
|
+
emits: [
|
|
540
|
+
"update:i18nText",
|
|
541
|
+
"update:i18nConfig",
|
|
542
|
+
"on-i18n-select",
|
|
543
|
+
"clickOutside",
|
|
544
|
+
"focus",
|
|
545
|
+
"blur"
|
|
546
|
+
],
|
|
547
|
+
setup(t, { emit: n }) {
|
|
548
|
+
let r = i(() => !!_gct.store.appInfo.id), a = t, c = n, l = i({
|
|
549
|
+
get() {
|
|
550
|
+
return a.i18nText ?? "";
|
|
551
|
+
},
|
|
552
|
+
set(e) {
|
|
553
|
+
e !== a.i18nText && c("update:i18nText", e);
|
|
554
|
+
}
|
|
555
|
+
}), u = i(() => k(a.i18nConfig) ? {} : typeof a.i18nConfig == "string" ? JSON.parse(a.i18nConfig) ?? {} : a.i18nConfig ?? {}), f = i(() => u.value?.[a.attr]), m = (e) => {
|
|
556
|
+
console.log("emit", e), e && ((k(l.value) || a.forceUpdate === !0) && c("update:i18nText", e.i18nTitle), c("update:i18nConfig", JSON.stringify(k(e) ? A(u.value, a.attr) : {
|
|
557
|
+
...u.value,
|
|
558
|
+
[a.attr]: e.i18nKey
|
|
559
|
+
})), c("on-i18n-select", e));
|
|
560
|
+
}, h = v(), _ = () => {
|
|
561
|
+
c("focus", h.value);
|
|
562
|
+
}, y = () => {
|
|
563
|
+
c("blur", h.value);
|
|
564
|
+
}, S = v();
|
|
565
|
+
return ae(S, () => {
|
|
566
|
+
c("clickOutside");
|
|
567
|
+
}), (n, i) => {
|
|
568
|
+
let a = x("a-input"), u = x("a-input-group");
|
|
569
|
+
return g(), o(u, {
|
|
570
|
+
id: "i18nInputGroup",
|
|
571
|
+
ref_key: "i18nInputGroup",
|
|
572
|
+
ref: S,
|
|
573
|
+
compact: ""
|
|
574
|
+
}, {
|
|
575
|
+
default: D(() => [b(n.$slots, "i18n-input", {}, () => [d(a, p({
|
|
576
|
+
ref_key: "inputRef",
|
|
577
|
+
ref: h
|
|
578
|
+
}, t.inputExtraProps, {
|
|
579
|
+
value: l.value,
|
|
580
|
+
"onUpdate:value": i[0] ||= (e) => l.value = e,
|
|
581
|
+
valueModifiers: { trim: !0 },
|
|
582
|
+
style: {
|
|
583
|
+
height: t.btnHeight ? t.btnHeight : t.size === T(e).SMALL ? "26px" : "32px",
|
|
584
|
+
width: r.value ? `calc(100% - ${t.btnWidth ? t.btnWidth : t.size === T(e).SMALL ? "26px" : "32px"}` : "100%"
|
|
585
|
+
},
|
|
586
|
+
placeholder: t.placeholderText,
|
|
587
|
+
size: t.size,
|
|
588
|
+
"allow-clear": "",
|
|
589
|
+
onFocus: _,
|
|
590
|
+
onBlur: y
|
|
591
|
+
}), null, 16, [
|
|
592
|
+
"value",
|
|
593
|
+
"style",
|
|
594
|
+
"placeholder",
|
|
595
|
+
"size"
|
|
596
|
+
])], !0), r.value ? (g(), o(U, {
|
|
597
|
+
key: 0,
|
|
598
|
+
"btn-height": t.btnHeight,
|
|
599
|
+
"btn-width": t.btnWidth,
|
|
600
|
+
"i18n-value": f.value,
|
|
601
|
+
size: t.size,
|
|
602
|
+
"i18n-modal-key": t.i18nModalKey,
|
|
603
|
+
onOnSelectI18n: m,
|
|
604
|
+
onClosed: i[1] ||= (e) => c("clickOutside")
|
|
605
|
+
}, null, 8, [
|
|
606
|
+
"btn-height",
|
|
607
|
+
"btn-width",
|
|
608
|
+
"i18n-value",
|
|
609
|
+
"size",
|
|
610
|
+
"i18n-modal-key"
|
|
611
|
+
])) : s("", !0)]),
|
|
612
|
+
_: 3
|
|
613
|
+
}, 512);
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
}), [["__scopeId", "data-v-412e1309"]]), oe = /* @__PURE__ */ f({
|
|
617
|
+
__name: "i18n-select-input-form",
|
|
618
|
+
props: {
|
|
619
|
+
formItemName: {},
|
|
620
|
+
fromItemExtraProps: {},
|
|
621
|
+
inputExtraProps: {},
|
|
622
|
+
i18nConfig: {},
|
|
623
|
+
text: {},
|
|
624
|
+
formRef: {}
|
|
625
|
+
},
|
|
626
|
+
emits: ["update:text"],
|
|
627
|
+
setup(e, { emit: t }) {
|
|
628
|
+
let n = e, a = t, o = i({
|
|
629
|
+
get() {
|
|
630
|
+
return n.text ?? "";
|
|
631
|
+
},
|
|
632
|
+
set(e) {
|
|
633
|
+
a("update:text", e), n.formRef?.validateFields([n.formItemName]);
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
return (t, n) => {
|
|
637
|
+
let i = x("a-form-item");
|
|
638
|
+
return g(), c(r, null, [d(i, p({ name: e.formItemName }, e.fromItemExtraProps), {
|
|
639
|
+
default: D(() => [d(Q, p(t.$attrs, {
|
|
640
|
+
"i18n-text": o.value,
|
|
641
|
+
"onUpdate:i18nText": n[0] ||= (e) => o.value = e,
|
|
642
|
+
"input-extra-props": e.inputExtraProps,
|
|
643
|
+
"i18n-config": e.i18nConfig,
|
|
644
|
+
attr: Array.isArray(e.formItemName) ? e.formItemName.join(".") : e.formItemName,
|
|
645
|
+
"placeholder-text": t.$t("sys.inputText")
|
|
646
|
+
}), null, 16, [
|
|
647
|
+
"i18n-text",
|
|
648
|
+
"input-extra-props",
|
|
649
|
+
"i18n-config",
|
|
650
|
+
"attr",
|
|
651
|
+
"placeholder-text"
|
|
652
|
+
])]),
|
|
653
|
+
_: 1
|
|
654
|
+
}, 16, ["name"]), d(i, {
|
|
655
|
+
name: "i18nConfig",
|
|
656
|
+
hidden: ""
|
|
657
|
+
}, {
|
|
658
|
+
default: D(() => [l("span", null, S(e.i18nConfig), 1)]),
|
|
659
|
+
_: 1
|
|
660
|
+
})], 64);
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
}), se = { class: "inline-block w100% relative" }, $ = /* @__PURE__ */ L(/* @__PURE__ */ f({
|
|
664
|
+
__name: "i18n-select-textarea",
|
|
665
|
+
props: {
|
|
666
|
+
attr: {},
|
|
667
|
+
inputExtraProps: {},
|
|
668
|
+
i18nConfig: {},
|
|
669
|
+
i18nText: {},
|
|
670
|
+
placeholderText: {},
|
|
671
|
+
rows: {},
|
|
672
|
+
style: {}
|
|
673
|
+
},
|
|
674
|
+
emits: [
|
|
675
|
+
"update:i18nText",
|
|
676
|
+
"update:i18nConfig",
|
|
677
|
+
"on-i18n-select",
|
|
678
|
+
"clickOutside",
|
|
679
|
+
"focus"
|
|
680
|
+
],
|
|
681
|
+
setup(e, { emit: t }) {
|
|
682
|
+
let n = e, r = t, a = i({
|
|
683
|
+
get() {
|
|
684
|
+
return n.i18nText ?? "";
|
|
685
|
+
},
|
|
686
|
+
set(e) {
|
|
687
|
+
r("update:i18nText", e);
|
|
688
|
+
}
|
|
689
|
+
}), o = i(() => k(n.i18nConfig) ? {} : typeof n.i18nConfig == "string" ? JSON.parse(n.i18nConfig) ?? {} : n.i18nConfig ?? {}), s = i(() => o.value?.[n.attr]), l = (e) => {
|
|
690
|
+
e && (k(a.value) && r("update:i18nText", e.i18nTitle), r("update:i18nConfig", JSON.stringify(k(e) ? A(o.value, n.attr) : {
|
|
691
|
+
...o.value,
|
|
692
|
+
[n.attr]: e.i18nKey
|
|
693
|
+
})), r("on-i18n-select", e));
|
|
694
|
+
}, u = v(), f = () => {
|
|
695
|
+
r("focus", u.value);
|
|
696
|
+
};
|
|
697
|
+
return (t, n) => {
|
|
698
|
+
let i = x("a-textarea");
|
|
699
|
+
return g(), c("div", se, [d(i, p({
|
|
700
|
+
ref_key: "inputRef",
|
|
701
|
+
ref: u,
|
|
702
|
+
value: a.value,
|
|
703
|
+
"onUpdate:value": n[0] ||= (e) => a.value = e,
|
|
704
|
+
placeholder: e.placeholderText
|
|
705
|
+
}, e.inputExtraProps, {
|
|
706
|
+
style: {
|
|
707
|
+
resize: "none",
|
|
708
|
+
...e.style
|
|
709
|
+
},
|
|
710
|
+
onFocus: f
|
|
711
|
+
}), null, 16, [
|
|
712
|
+
"value",
|
|
713
|
+
"placeholder",
|
|
714
|
+
"style"
|
|
715
|
+
]), d(U, {
|
|
716
|
+
"i18n-value": s.value,
|
|
717
|
+
"simple-btn": !0,
|
|
718
|
+
type: "text",
|
|
719
|
+
onOnSelectI18n: l,
|
|
720
|
+
onClosed: n[1] ||= (e) => r("clickOutside")
|
|
721
|
+
}, null, 8, ["i18n-value"])]);
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
}), [["__scopeId", "data-v-cd95c416"]]), ce = /* @__PURE__ */ f({
|
|
725
|
+
__name: "i18n-select-textarea-form",
|
|
726
|
+
props: {
|
|
727
|
+
formItemName: {},
|
|
728
|
+
fromItemExtraProps: {},
|
|
729
|
+
inputExtraProps: {},
|
|
730
|
+
i18nConfig: {},
|
|
731
|
+
text: {},
|
|
732
|
+
formRef: {}
|
|
733
|
+
},
|
|
734
|
+
emits: ["update:text"],
|
|
735
|
+
setup(e, { emit: t }) {
|
|
736
|
+
let n = e, a = t, o = i({
|
|
737
|
+
get() {
|
|
738
|
+
return n.text ?? "";
|
|
739
|
+
},
|
|
740
|
+
set(e) {
|
|
741
|
+
a("update:text", e), n.formRef?.validateFields([n.formItemName]);
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
return (t, n) => {
|
|
745
|
+
let i = x("a-form-item");
|
|
746
|
+
return g(), c(r, null, [d(i, p({ name: e.formItemName }, e.fromItemExtraProps), {
|
|
747
|
+
default: D(() => [d($, p(t.$attrs, {
|
|
748
|
+
"i18n-text": o.value,
|
|
749
|
+
"onUpdate:i18nText": n[0] ||= (e) => o.value = e,
|
|
750
|
+
"placeholder-text": t.$t("sys.inputText"),
|
|
751
|
+
"input-extra-props": e.inputExtraProps,
|
|
752
|
+
"i18n-config": e.i18nConfig,
|
|
753
|
+
attr: Array.isArray(e.formItemName) ? e.formItemName.join(".") : e.formItemName
|
|
754
|
+
}), null, 16, [
|
|
755
|
+
"i18n-text",
|
|
756
|
+
"placeholder-text",
|
|
757
|
+
"input-extra-props",
|
|
758
|
+
"i18n-config",
|
|
759
|
+
"attr"
|
|
760
|
+
])]),
|
|
761
|
+
_: 1
|
|
762
|
+
}, 16, ["name"]), d(i, {
|
|
763
|
+
name: "i18nConfig",
|
|
764
|
+
hidden: ""
|
|
765
|
+
}, {
|
|
766
|
+
default: D(() => [l("span", null, S(e.i18nConfig), 1)]),
|
|
767
|
+
_: 1
|
|
768
|
+
})], 64);
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
}), le = new URL(
|
|
772
|
+
/* @vite-ignore */
|
|
773
|
+
"./index.min.css",
|
|
774
|
+
import.meta.url
|
|
775
|
+
);
|
|
776
|
+
t.load(le.href);
|
|
777
|
+
//#endregion
|
|
778
|
+
export { N as I18Modal, U as I18nSelectBtn, Q as I18nSelectInput, oe as I18nSelectInputForm, $ as I18nSelectTextarea, ce as I18nSelectTextareaForm, B as useI18nSelect };
|