@gct-paas/design-web 0.1.4-dev.12 → 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.
@@ -1,775 +0,0 @@
1
- import { Fragment as e, computed as t, createApp as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, onMounted as f, openBlock as p, reactive as m, ref as h, renderList as g, renderSlot as _, resolveComponent as v, toDisplayString as y, toRaw as b, toValue as x, unref as S, watch as C, withCtx as w } from "vue";
2
- import { has as T, isEmpty as E, omit as D } from "lodash-es";
3
- import { useModal as O, useModalInner as k } from "@gct-paas/core-web";
4
- import { SearchOutlined as A } from "@ant-design/icons-vue";
5
- import { ButtonSize as j, t as M } from "@gct-paas/core";
6
- //#endregion
7
- //#region src/components/I18nSelect/src/i18n-modal.vue
8
- var N = /* @__PURE__ */ l({
9
- __name: "i18n-modal",
10
- props: {
11
- lang: {},
12
- getContainer: { type: Function }
13
- },
14
- emits: ["ok", "register"],
15
- setup(t, { emit: n }) {
16
- let i = t, o = n, s = h(), l = m({ id: "" }), d = h(!1), f = (e) => {
17
- e && (d.value = !1);
18
- }, [_, { closeModal: y }] = k((e) => {
19
- e && x(e);
20
- }), x = (e) => {
21
- d.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
- }, C = (e, t, n) => {
29
- /^[a-zA-Z_.]*$/.test(t) || n(M("sys.i18n.validated18nKeyErrorMsg")), n();
30
- }, T = async (e, t) => /^\s*$/g.test(t) ? Promise.reject(M("sys.notEmptySth", { sth: M("sys.i18n") })) : Promise.resolve(), E = () => {
31
- s.value?.validate().then(() => {
32
- o("ok", { ...b(l) }, d.value), y();
33
- });
34
- }, D = () => {
35
- s.value?.resetFields();
36
- };
37
- return (n, o) => {
38
- let m = v("a-input"), h = v("a-form-item"), y = v("a-form"), b = v("BasicModal");
39
- return p(), r(b, u(n.$attrs, {
40
- title: d.value ? S(M)("sys.edit") : S(M)("sys.new"),
41
- centered: "",
42
- width: "640px",
43
- "min-height": 100,
44
- "mask-closable": !1,
45
- "after-close": D,
46
- "get-container": t.getContainer,
47
- onRegister: S(_),
48
- onOk: E,
49
- onVisibleChange: f
50
- }), {
51
- default: w(() => [c(y, {
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: w(() => [c(h, {
61
- label: S(M)("sys.i18n.resourceIdentification"),
62
- name: "id",
63
- rules: [{
64
- required: !0,
65
- message: S(M)("sys.pleaseInputSth", { sth: S(M)("sys.i18n.resourceIdentification") })
66
- }, { validator: C }]
67
- }, {
68
- default: w(() => [c(m, {
69
- value: l.id,
70
- "onUpdate:value": o[0] ||= (e) => l.id = e,
71
- "show-count": "",
72
- maxlength: 128,
73
- disabled: d.value
74
- }, null, 8, ["value", "disabled"])]),
75
- _: 1
76
- }, 8, ["label", "rules"]), (p(!0), a(e, null, g(i.lang, (e) => (p(), r(h, {
77
- key: e.dataIndex,
78
- label: e.title,
79
- name: e.dataIndex,
80
- rules: [{
81
- required: !0,
82
- message: S(M)("sys.pleaseInputSth", { sth: e.title })
83
- }, { validator: T }]
84
- }, {
85
- default: w(() => [c(m, {
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" }, ee = { class: "table-wrap" }, F = /* @__PURE__ */ l({
108
- __name: "i18n-select-container",
109
- props: {
110
- i18nModalKey: {},
111
- destroyCallback: { type: Function },
112
- saveCallback: { type: Function }
113
- },
114
- setup(e) {
115
- let [n, { closeModal: i }] = k(), [a, { openModal: l }] = O(), d = e, g = () => document.querySelector(`#${d.i18nModalKey}`), _ = h(), b = m({ keywords: "" }), x = m({
116
- current: 1,
117
- pageSize: 5,
118
- total: 0,
119
- size: "small",
120
- showTotal: (e) => M("sys.component.table.total", { total: e })
121
- }), C = h([]), T = h(), E = h({
122
- type: "radio",
123
- hideSelectAll: !0,
124
- selectedRowKeys: [],
125
- onChange: B
126
- }), D = h(!1), j = t(() => []), F = async (e, t) => {
127
- D.value = !0;
128
- let n = await _api.apaas.i18NInfo.getPageList({
129
- pageNo: t ?? x.current,
130
- pageSize: x.pageSize,
131
- searchKey: e
132
- });
133
- if (D.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
- x.total = n.totalCount, C.value = e;
143
- }
144
- };
145
- f(F);
146
- let I = () => {
147
- _.value?.validate().then(async () => {
148
- await F(b.keywords, 1);
149
- });
150
- }, L = (e) => {
151
- let { current: t, total: n, pageSize: r } = e;
152
- x.current = t, x.total = n, x.pageSize = r, F();
153
- }, R = () => {
154
- l();
155
- }, z = async (e, t) => {
156
- let n = j.value.map((t) => ({
157
- locale: t.dataIndex,
158
- info: e[t.dataIndex]
159
- }));
160
- D.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
- }), F(), B([e.id], [m(e)]);
166
- } catch {
167
- D.value = !1;
168
- }
169
- };
170
- function B(e, t) {
171
- E.value.selectedRowKeys = e, T.value = t;
172
- }
173
- let V = () => {
174
- d.destroyCallback && typeof d.destroyCallback == "function" && d.destroyCallback();
175
- }, H = async () => {
176
- if (d.saveCallback && typeof d.saveCallback == "function") {
177
- let e = E.value.selectedRowKeys, t = {};
178
- if (e && e[0]) {
179
- let n = T.value?.[0];
180
- console.log("selectRow", n), Object.assign(t, { i18nKey: e[0] });
181
- }
182
- d.saveCallback(t);
183
- }
184
- i();
185
- };
186
- return (e, t) => {
187
- let i = v("a-input"), l = v("a-form-item"), d = v("a-col"), f = v("a-button"), m = v("plus-outlined"), h = v("a-row"), T = v("a-form"), O = v("a-table"), k = v("basic-modal");
188
- return p(), r(k, u(e.$attrs, {
189
- "min-height": 40,
190
- title: S(M)("sys.i18n.i18nConfig"),
191
- centered: "",
192
- width: "640px",
193
- "can-fullscreen": !1,
194
- "mask-closable": !1,
195
- "after-close": V,
196
- "get-container": g,
197
- onRegister: S(n),
198
- onOk: H
199
- }), {
200
- default: w(() => [o("div", P, [c(T, {
201
- ref_key: "formRef",
202
- ref: _,
203
- model: b,
204
- autocomplete: "off",
205
- layout: "horizontal"
206
- }, {
207
- default: w(() => [c(h, null, {
208
- default: w(() => [c(d, { span: 12 }, {
209
- default: w(() => [c(l, {
210
- name: "keywords",
211
- label: S(M)("sys.keywords")
212
- }, {
213
- default: w(() => [c(i, {
214
- value: b.keywords,
215
- "onUpdate:value": t[0] ||= (e) => b.keywords = e,
216
- placeholder: S(M)("sys.keywordsPlaceholder"),
217
- style: { display: "inline-flex" }
218
- }, null, 8, ["value", "placeholder"])]),
219
- _: 1
220
- }, 8, ["label"])]),
221
- _: 1
222
- }), c(d, {
223
- span: 12,
224
- style: { "text-align": "right" }
225
- }, {
226
- default: w(() => [c(f, {
227
- type: "primary",
228
- onClick: I
229
- }, {
230
- icon: w(() => [c(S(A))]),
231
- default: w(() => [s(" " + y(S(M)("sys.queryText")), 1)]),
232
- _: 1
233
- }), c(f, {
234
- style: { margin: "0 8px" },
235
- type: "primary",
236
- onClick: R
237
- }, {
238
- icon: w(() => [c(m)]),
239
- default: w(() => [s(" " + y(S(M)("sys.new")), 1)]),
240
- _: 1
241
- })]),
242
- _: 1
243
- })]),
244
- _: 1
245
- })]),
246
- _: 1
247
- }, 8, ["model"]), o("div", ee, [c(O, {
248
- ref: "tableRef",
249
- "data-source": C.value,
250
- columns: j.value,
251
- "show-index-column": !1,
252
- pagination: x,
253
- striped: !1,
254
- bordered: !0,
255
- "row-selection": E.value,
256
- loading: D.value,
257
- onChange: L
258
- }, null, 8, [
259
- "data-source",
260
- "columns",
261
- "pagination",
262
- "row-selection",
263
- "loading"
264
- ]), c(N, {
265
- lang: j.value,
266
- "get-container": g,
267
- onRegister: S(a),
268
- onOk: z
269
- }, null, 8, ["lang", "onRegister"])])])]),
270
- _: 1
271
- }, 16, ["title", "onRegister"]);
272
- };
273
- }
274
- }), I = (e, t) => {
275
- let n = e.__vccOpts || e;
276
- for (let [e, r] of t) n[e] = r;
277
- return n;
278
- }, L = /* @__PURE__ */ I(F, [["__scopeId", "data-v-0160ed5e"]]), R = /* @__PURE__ */ l({
279
- __name: "i18n-select-modal",
280
- setup(e, { expose: t }) {
281
- let [n, { openModal: i }] = O();
282
- return t({ open: () => {
283
- i();
284
- } }), (e, t) => (p(), r(L, { onRegister: S(n) }, null, 8, ["onRegister"]));
285
- }
286
- });
287
- //#endregion
288
- //#region src/components/I18nSelect/src/useI18nSelect.ts
289
- function z() {
290
- let e = null, t = null, r = h("");
291
- function i(i) {
292
- let o, s = document.body;
293
- if (T(i, "target") || T(i, "props")) {
294
- let e = i;
295
- o = e.props || {}, s = e.target || document.body;
296
- } else o = i;
297
- r.value = o.i18nModalKey || `i18n-select-modal-${Math.random().toString(16).substring(8)}`;
298
- let c = {
299
- ...o,
300
- destroyCallback: () => a(o?.destroyCallback),
301
- i18nModalKey: S(r)
302
- };
303
- if (!e) {
304
- let i = document.createElement("div");
305
- i.id = S(r), S(s)?.appendChild(i), e = n(R, c), t = e.mount(i);
306
- }
307
- t?.open();
308
- }
309
- function a(t) {
310
- typeof t == "function" && t(), document.querySelector(`#${S(r)}`).remove(), e &&= (e.unmount(), null);
311
- }
312
- return {
313
- open: i,
314
- close: a
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 B = { class: "i18n-tooltip-title" }, V = { style: { "margin-left": "4px" } }, H = /* @__PURE__ */ I(/* @__PURE__ */ l({
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(n, { emit: i }) {
332
- let s = h(), l = z(), f = n, _ = i, b = m({}), x = t(() => !E(f.i18nValue)), S = 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 === f.i18nValue);
340
- e && Object.assign(b, Object.fromEntries(Object.entries(JSON.parse(e.info)).map(([e, t]) => [t.locale, t.info])));
341
- }
342
- };
343
- C(() => f.i18nValue, () => {
344
- E(f.i18nValue) || S(f.i18nValue);
345
- }, { immediate: !0 });
346
- let T = () => {
347
- l.open({
348
- i18nModalKey: f.i18nModalKey,
349
- saveCallback: (e) => {
350
- _("on-select-i18n", { ...e });
351
- },
352
- destroyCallback: () => {
353
- _("closed");
354
- }
355
- });
356
- };
357
- return (t, i) => {
358
- let l = v("Icon"), f = v("a-button"), m = v("a-tooltip");
359
- return n.simpleBtn ? (p(), r(l, {
360
- key: 0,
361
- class: d(["i18n-icon simple-btn", { "is-highlight": x.value }]),
362
- icon: "ion:language",
363
- onClick: T
364
- }, null, 8, ["class"])) : x.value ? (p(), r(m, {
365
- key: 1,
366
- color: "#fff",
367
- placement: "topRight"
368
- }, {
369
- title: w(() => [o("div", B, "语言标识:" + y(n.i18nValue), 1), (p(!0), a(e, null, g(s.value, (e) => (p(), a("div", {
370
- key: e.id,
371
- class: "i18n-tooltip-item"
372
- }, [o("strong", null, y(e.language) + ": ", 1), o("span", V, y(b[e.languageTag]), 1)]))), 128))]),
373
- default: w(() => [c(f, u(n.buttonExtraProps, {
374
- class: { "is-highlight": x.value },
375
- style: {
376
- "--btn-width": n.btnWidth,
377
- "--btn-height": n.btnHeight
378
- },
379
- size: n.size,
380
- onClick: T
381
- }), {
382
- icon: w(() => [c(l, {
383
- class: "i18n-icon",
384
- icon: "ion:language"
385
- })]),
386
- _: 1
387
- }, 16, [
388
- "class",
389
- "style",
390
- "size"
391
- ])]),
392
- _: 1
393
- })) : (p(), r(f, u({ key: 2 }, n.buttonExtraProps, {
394
- class: { "is-highlight": x.value },
395
- style: {
396
- "--btn-width": n.btnWidth,
397
- "--btn-height": n.btnHeight
398
- },
399
- size: n.size,
400
- onClick: T
401
- }), {
402
- icon: w(() => [c(l, {
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"]]), U = typeof window < "u" && typeof document < "u";
415
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
416
- var W = Object.prototype.toString, G = (e) => W.call(e) === "[object Object]", K = () => {}, te = /* @__PURE__ */ ne();
417
- function ne() {
418
- var e, t;
419
- return U && !!(!((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 re(e, t, n) {
425
- return C(e, t, {
426
- ...n,
427
- immediate: !0
428
- });
429
- }
430
- //#endregion
431
- //#region ../../node_modules/.pnpm/@vueuse+core@14.2.1_vue@3.5.29_typescript@5.9.3_/node_modules/@vueuse/core/dist/index.js
432
- var J = U ? window : void 0;
433
- U && window.document, U && window.navigator, U && window.location;
434
- function Y(e) {
435
- let t = x(e);
436
- return t?.$el ?? t;
437
- }
438
- function X(...e) {
439
- let n = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), r = t(() => {
440
- let t = q(x(e[0])).filter((e) => e != null);
441
- return t.every((e) => typeof e != "string") ? t : void 0;
442
- });
443
- return re(() => [
444
- r.value?.map((e) => Y(e)) ?? [J].filter((e) => e != null),
445
- q(x(r.value ? e[1] : e[0])),
446
- q(S(r.value ? e[2] : e[1])),
447
- x(r.value ? e[3] : e[2])
448
- ], ([e, t, r, i], a, o) => {
449
- if (!e?.length || !t?.length || !r?.length) return;
450
- let s = G(i) ? { ...i } : i, c = e.flatMap((e) => t.flatMap((t) => r.map((r) => n(e, t, r, s))));
451
- o(() => {
452
- c.forEach((e) => e());
453
- });
454
- }, { flush: "post" });
455
- }
456
- var Z = !1;
457
- function ie(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 (te && !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) => x(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 = x(e);
478
- return t && t.$.subTree.shapeFlag === 16;
479
- }
480
- function d(e, t) {
481
- let n = x(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__ */ I(/* @__PURE__ */ l({
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(e, { emit: n }) {
548
- let a = t(() => !!_gct.store.appInfo.id), o = e, s = n, l = t({
549
- get() {
550
- return o.i18nText ?? "";
551
- },
552
- set(e) {
553
- e !== o.i18nText && s("update:i18nText", e);
554
- }
555
- }), d = t(() => E(o.i18nConfig) ? {} : typeof o.i18nConfig == "string" ? JSON.parse(o.i18nConfig) ?? {} : o.i18nConfig ?? {}), f = t(() => d.value?.[o.attr]), m = (e) => {
556
- console.log("emit", e), e && ((E(l.value) || o.forceUpdate === !0) && s("update:i18nText", e.i18nTitle), s("update:i18nConfig", JSON.stringify(E(e) ? D(d.value, o.attr) : {
557
- ...d.value,
558
- [o.attr]: e.i18nKey
559
- })), s("on-i18n-select", e));
560
- }, g = h(), y = () => {
561
- s("focus", g.value);
562
- }, b = () => {
563
- s("blur", g.value);
564
- }, x = h();
565
- return ie(x, () => {
566
- s("clickOutside");
567
- }), (t, n) => {
568
- let o = v("a-input"), d = v("a-input-group");
569
- return p(), r(d, {
570
- id: "i18nInputGroup",
571
- ref_key: "i18nInputGroup",
572
- ref: x,
573
- compact: ""
574
- }, {
575
- default: w(() => [_(t.$slots, "i18n-input", {}, () => [c(o, u({
576
- ref_key: "inputRef",
577
- ref: g
578
- }, e.inputExtraProps, {
579
- value: l.value,
580
- "onUpdate:value": n[0] ||= (e) => l.value = e,
581
- valueModifiers: { trim: !0 },
582
- style: {
583
- height: e.btnHeight ? e.btnHeight : e.size === S(j).SMALL ? "26px" : "32px",
584
- width: a.value ? `calc(100% - ${e.btnWidth ? e.btnWidth : e.size === S(j).SMALL ? "26px" : "32px"}` : "100%"
585
- },
586
- placeholder: e.placeholderText,
587
- size: e.size,
588
- "allow-clear": "",
589
- onFocus: y,
590
- onBlur: b
591
- }), null, 16, [
592
- "value",
593
- "style",
594
- "placeholder",
595
- "size"
596
- ])], !0), a.value ? (p(), r(H, {
597
- key: 0,
598
- "btn-height": e.btnHeight,
599
- "btn-width": e.btnWidth,
600
- "i18n-value": f.value,
601
- size: e.size,
602
- "i18n-modal-key": e.i18nModalKey,
603
- onOnSelectI18n: m,
604
- onClosed: n[1] ||= (e) => s("clickOutside")
605
- }, null, 8, [
606
- "btn-height",
607
- "btn-width",
608
- "i18n-value",
609
- "size",
610
- "i18n-modal-key"
611
- ])) : i("", !0)]),
612
- _: 3
613
- }, 512);
614
- };
615
- }
616
- }), [["__scopeId", "data-v-412e1309"]]), ae = /* @__PURE__ */ l({
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(n, { emit: r }) {
628
- let i = n, s = r, l = t({
629
- get() {
630
- return i.text ?? "";
631
- },
632
- set(e) {
633
- s("update:text", e), i.formRef?.validateFields([i.formItemName]);
634
- }
635
- });
636
- return (t, r) => {
637
- let i = v("a-form-item");
638
- return p(), a(e, null, [c(i, u({ name: n.formItemName }, n.fromItemExtraProps), {
639
- default: w(() => [c(Q, u(t.$attrs, {
640
- "i18n-text": l.value,
641
- "onUpdate:i18nText": r[0] ||= (e) => l.value = e,
642
- "input-extra-props": n.inputExtraProps,
643
- "i18n-config": n.i18nConfig,
644
- attr: Array.isArray(n.formItemName) ? n.formItemName.join(".") : n.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"]), c(i, {
655
- name: "i18nConfig",
656
- hidden: ""
657
- }, {
658
- default: w(() => [o("span", null, y(n.i18nConfig), 1)]),
659
- _: 1
660
- })], 64);
661
- };
662
- }
663
- }), oe = { class: "inline-block w100% relative" }, $ = /* @__PURE__ */ I(/* @__PURE__ */ l({
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: n }) {
682
- let r = e, i = n, o = t({
683
- get() {
684
- return r.i18nText ?? "";
685
- },
686
- set(e) {
687
- i("update:i18nText", e);
688
- }
689
- }), s = t(() => E(r.i18nConfig) ? {} : typeof r.i18nConfig == "string" ? JSON.parse(r.i18nConfig) ?? {} : r.i18nConfig ?? {}), l = t(() => s.value?.[r.attr]), d = (e) => {
690
- e && (E(o.value) && i("update:i18nText", e.i18nTitle), i("update:i18nConfig", JSON.stringify(E(e) ? D(s.value, r.attr) : {
691
- ...s.value,
692
- [r.attr]: e.i18nKey
693
- })), i("on-i18n-select", e));
694
- }, f = h(), m = () => {
695
- i("focus", f.value);
696
- };
697
- return (t, n) => {
698
- let r = v("a-textarea");
699
- return p(), a("div", oe, [c(r, u({
700
- ref_key: "inputRef",
701
- ref: f,
702
- value: o.value,
703
- "onUpdate:value": n[0] ||= (e) => o.value = e,
704
- placeholder: e.placeholderText
705
- }, e.inputExtraProps, {
706
- style: {
707
- resize: "none",
708
- ...e.style
709
- },
710
- onFocus: m
711
- }), null, 16, [
712
- "value",
713
- "placeholder",
714
- "style"
715
- ]), c(H, {
716
- "i18n-value": l.value,
717
- "simple-btn": !0,
718
- type: "text",
719
- onOnSelectI18n: d,
720
- onClosed: n[1] ||= (e) => i("clickOutside")
721
- }, null, 8, ["i18n-value"])]);
722
- };
723
- }
724
- }), [["__scopeId", "data-v-cd95c416"]]), se = /* @__PURE__ */ l({
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(n, { emit: r }) {
736
- let i = n, s = r, l = t({
737
- get() {
738
- return i.text ?? "";
739
- },
740
- set(e) {
741
- s("update:text", e), i.formRef?.validateFields([i.formItemName]);
742
- }
743
- });
744
- return (t, r) => {
745
- let i = v("a-form-item");
746
- return p(), a(e, null, [c(i, u({ name: n.formItemName }, n.fromItemExtraProps), {
747
- default: w(() => [c($, u(t.$attrs, {
748
- "i18n-text": l.value,
749
- "onUpdate:i18nText": r[0] ||= (e) => l.value = e,
750
- "placeholder-text": t.$t("sys.inputText"),
751
- "input-extra-props": n.inputExtraProps,
752
- "i18n-config": n.i18nConfig,
753
- attr: Array.isArray(n.formItemName) ? n.formItemName.join(".") : n.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"]), c(i, {
763
- name: "i18nConfig",
764
- hidden: ""
765
- }, {
766
- default: w(() => [o("span", null, y(n.i18nConfig), 1)]),
767
- _: 1
768
- })], 64);
769
- };
770
- }
771
- }), ce = { install(e) {
772
- console.log("Design Web install", e);
773
- } };
774
- //#endregion
775
- export { N as I18Modal, H as I18nSelectBtn, Q as I18nSelectInput, ae as I18nSelectInputForm, $ as I18nSelectTextarea, se as I18nSelectTextareaForm, ce as default, z as useI18nSelect };