@gct-paas/design-web 0.1.4-dev.10 → 0.1.4-dev.12
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.esm.min.js +775 -0
- package/dist/index.min.css +2 -1
- 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.d.ts +1 -2
- 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-btn.css → i18n-select-btn.vue_vue_type_style_index_0_scoped_dc8ffb2c_lang.css} +13 -13
- 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/package.json +9 -9
- package/dist/index.esm.min.mjs +0 -1606
- package/dist/index.min.cjs +0 -57
- package/dist/index.system.min.js +0 -57
- 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-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
package/dist/index.min.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
.i18n-select-container[data-v-0160ed5e]{padding:4px}[data-v-0160ed5e] .ant-form-horizontal .ant-form-item{flex-direction:row}.ant-btn[data-v-
|
|
1
|
+
.i18n-select-container[data-v-0160ed5e]{padding:4px}[data-v-0160ed5e] .ant-form-horizontal .ant-form-item{flex-direction:row}.ant-btn[data-v-dc8ffb2c]{background-color:#fff!important}.ant-btn.ant-btn-icon-only[data-v-dc8ffb2c]{width:var(--btn-width,32px);height:var(--btn-height,32px)}.ant-btn.ant-btn-icon-only.ant-btn-sm[data-v-dc8ffb2c]{width:26px;height:26px}.ant-btn:hover .i18n-icon[data-v-dc8ffb2c]{color:var(--ant-primary-color);transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-btn.is-highlight[data-v-dc8ffb2c]{color:var(--ant-primary-color);border-color:var(--ant-primary-color)}.ant-btn.is-highlight .i18n-icon[data-v-dc8ffb2c]{color:var(--ant-primary-color)}.i18n-icon[data-v-dc8ffb2c]{color:#7f8695;display:flex!important}.simple-btn[data-v-dc8ffb2c]:hover,.simple-btn.is-highlight[data-v-dc8ffb2c]{color:var(--ant-primary-color)}.i18n-tooltip-title[data-v-dc8ffb2c]{color:#303133;margin-bottom:12px;font-size:16px;line-height:1}.i18n-tooltip-item[data-v-dc8ffb2c]{color:#606266;font-size:14px}.custom-i18n-btn[data-v-dc8ffb2c]{vertical-align:middle;color:#303133;background:#fff;border:none;justify-content:center;align-items:center;padding:0;font-size:14px;display:inline-flex}.custom-i18n-btn.reg-i18n[data-v-dc8ffb2c]{position:absolute;bottom:0;right:-32px}[data-v-412e1309] .ant-form-item-has-error .ant-btn{border-color:var(--ant-error-color)!important}[data-v-cd95c416] .i18n-icon{color:#212528;cursor:pointer;font-size:16px;position:absolute;bottom:12px;right:16px}[data-v-cd95c416] div.ant-input-textarea.ant-input-textarea-show-count.ant-input-textarea-show-count:after{right:33px}[data-v-cd95c416] .ant-input{background:0 0;border:2px dashed #dbdbdb}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return target;
|
|
1
|
+
//#region \0plugin-vue:export-helper
|
|
2
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
3
|
+
const target = sfc.__vccOpts || sfc;
|
|
4
|
+
for (const [key, val] of props) target[key] = val;
|
|
5
|
+
return target;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
export {
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _plugin_vue_export_helper_default as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "./src/i18n-modal.vue.mjs";
|
|
2
|
+
import "./src/useI18nSelect.mjs";
|
|
3
|
+
import "./src/i18n-select-btn.vue.mjs";
|
|
4
|
+
import "./src/i18n-select-input.vue.mjs";
|
|
5
|
+
import "./src/i18n-select-input-form.vue.mjs";
|
|
6
|
+
import "./src/i18n-select-textarea.vue.mjs";
|
|
7
|
+
import "./src/i18n-select-textarea-form.vue.mjs";
|
|
@@ -1,151 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
__name: "i18n-modal",
|
|
7
|
-
props: {
|
|
8
|
-
lang: {},
|
|
9
|
-
getContainer: { type: Function }
|
|
10
|
-
},
|
|
11
|
-
emits: ["ok", "register"],
|
|
12
|
-
setup(__props, { emit: __emit }) {
|
|
13
|
-
const props = __props;
|
|
14
|
-
const emit = __emit;
|
|
15
|
-
const formRef = ref();
|
|
16
|
-
const i18nState = reactive({
|
|
17
|
-
id: ""
|
|
18
|
-
});
|
|
19
|
-
const isEdit = ref(false);
|
|
20
|
-
const handleShow = (visible) => {
|
|
21
|
-
if (visible) {
|
|
22
|
-
isEdit.value = false;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
const [registerInner, { closeModal }] = useModalInner((data) => {
|
|
26
|
-
data && onDataReceive(data);
|
|
27
|
-
});
|
|
28
|
-
const onDataReceive = (data) => {
|
|
29
|
-
isEdit.value = true;
|
|
30
|
-
i18nState.id = data.key;
|
|
31
|
-
const { lang } = props;
|
|
32
|
-
console.log(lang, "lang========");
|
|
33
|
-
for (const item of lang) {
|
|
34
|
-
const key = item.dataIndex;
|
|
35
|
-
i18nState[key] = data[key];
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const validateSpecialCharacters = (_, value, callback) => {
|
|
39
|
-
const reg = /^[a-zA-Z_.]*$/;
|
|
40
|
-
if (!reg.test(value)) {
|
|
41
|
-
callback(t("sys.i18n.validated18nKeyErrorMsg"));
|
|
42
|
-
}
|
|
43
|
-
callback();
|
|
44
|
-
};
|
|
45
|
-
const validateLang = async (_rule, value) => {
|
|
46
|
-
const reg = /^\s*$/g;
|
|
47
|
-
if (reg.test(value)) {
|
|
48
|
-
return Promise.reject(t("sys.notEmptySth", { sth: t("sys.i18n") }));
|
|
49
|
-
} else {
|
|
50
|
-
return Promise.resolve();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const handleOk = () => {
|
|
54
|
-
formRef.value?.validate().then(() => {
|
|
55
|
-
emit("ok", { ...toRaw(i18nState) }, isEdit.value);
|
|
56
|
-
closeModal();
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const handleClose = () => {
|
|
60
|
-
formRef.value?.resetFields();
|
|
61
|
-
return void 0;
|
|
62
|
-
};
|
|
63
|
-
return (_ctx, _cache) => {
|
|
64
|
-
const _component_a_input = resolveComponent("a-input");
|
|
65
|
-
const _component_a_form_item = resolveComponent("a-form-item");
|
|
66
|
-
const _component_a_form = resolveComponent("a-form");
|
|
67
|
-
const _component_BasicModal = resolveComponent("BasicModal");
|
|
68
|
-
return openBlock(), createBlock(_component_BasicModal, mergeProps(_ctx.$attrs, {
|
|
69
|
-
title: isEdit.value ? unref(t)("sys.edit") : unref(t)("sys.new"),
|
|
70
|
-
centered: "",
|
|
71
|
-
width: "640px",
|
|
72
|
-
"min-height": 100,
|
|
73
|
-
"mask-closable": false,
|
|
74
|
-
"after-close": handleClose,
|
|
75
|
-
"get-container": __props.getContainer,
|
|
76
|
-
onRegister: unref(registerInner),
|
|
77
|
-
onOk: handleOk,
|
|
78
|
-
onVisibleChange: handleShow
|
|
79
|
-
}), {
|
|
80
|
-
default: withCtx(() => [
|
|
81
|
-
createVNode(_component_a_form, {
|
|
82
|
-
ref_key: "formRef",
|
|
83
|
-
ref: formRef,
|
|
84
|
-
model: i18nState,
|
|
85
|
-
"label-col": { span: 6 },
|
|
86
|
-
"wrapper-col": { span: 16 },
|
|
87
|
-
autocomplete: "off",
|
|
88
|
-
layout: "horizontal"
|
|
89
|
-
}, {
|
|
90
|
-
default: withCtx(() => [
|
|
91
|
-
createVNode(_component_a_form_item, {
|
|
92
|
-
label: unref(t)("sys.i18n.resourceIdentification"),
|
|
93
|
-
name: "id",
|
|
94
|
-
rules: [
|
|
95
|
-
{
|
|
96
|
-
required: true,
|
|
97
|
-
message: unref(t)("sys.pleaseInputSth", {
|
|
98
|
-
sth: unref(t)("sys.i18n.resourceIdentification")
|
|
99
|
-
})
|
|
100
|
-
},
|
|
101
|
-
{ validator: validateSpecialCharacters }
|
|
102
|
-
]
|
|
103
|
-
}, {
|
|
104
|
-
default: withCtx(() => [
|
|
105
|
-
createVNode(_component_a_input, {
|
|
106
|
-
value: i18nState.id,
|
|
107
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => i18nState.id = $event),
|
|
108
|
-
"show-count": "",
|
|
109
|
-
maxlength: 128,
|
|
110
|
-
disabled: isEdit.value
|
|
111
|
-
}, null, 8, ["value", "disabled"])
|
|
112
|
-
]),
|
|
113
|
-
_: 1
|
|
114
|
-
}, 8, ["label", "rules"]),
|
|
115
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.lang, (item) => {
|
|
116
|
-
return openBlock(), createBlock(_component_a_form_item, {
|
|
117
|
-
key: item.dataIndex,
|
|
118
|
-
label: item.title,
|
|
119
|
-
name: item.dataIndex,
|
|
120
|
-
rules: [
|
|
121
|
-
{
|
|
122
|
-
required: true,
|
|
123
|
-
message: unref(t)("sys.pleaseInputSth", { sth: item.title })
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
validator: validateLang
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
}, {
|
|
130
|
-
default: withCtx(() => [
|
|
131
|
-
createVNode(_component_a_input, {
|
|
132
|
-
value: i18nState[item.dataIndex],
|
|
133
|
-
"onUpdate:value": ($event) => i18nState[item.dataIndex] = $event,
|
|
134
|
-
"show-count": "",
|
|
135
|
-
maxlength: 300
|
|
136
|
-
}, null, 8, ["value", "onUpdate:value"])
|
|
137
|
-
]),
|
|
138
|
-
_: 2
|
|
139
|
-
}, 1032, ["label", "name", "rules"]);
|
|
140
|
-
}), 128))
|
|
141
|
-
]),
|
|
142
|
-
_: 1
|
|
143
|
-
}, 8, ["model"])
|
|
144
|
-
]),
|
|
145
|
-
_: 1
|
|
146
|
-
}, 16, ["title", "get-container", "onRegister"]);
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
export { _sfc_main as default };
|
|
1
|
+
import i18n_modal_vue_vue_type_script_setup_true_lang_default from "./i18n-modal.vue_vue_type_script_setup_true_lang.mjs";
|
|
2
|
+
//#region src/components/I18nSelect/src/i18n-modal.vue
|
|
3
|
+
var i18n_modal_default = i18n_modal_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { i18n_modal_default as default };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, reactive, ref, renderList, resolveComponent, toRaw, unref, withCtx } from "vue";
|
|
2
|
+
import { useModalInner } from "@gct-paas/core-web";
|
|
3
|
+
import { t } from "@gct-paas/core";
|
|
4
|
+
//#region src/components/I18nSelect/src/i18n-modal.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var i18n_modal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "i18n-modal",
|
|
7
|
+
props: {
|
|
8
|
+
lang: {},
|
|
9
|
+
getContainer: { type: Function }
|
|
10
|
+
},
|
|
11
|
+
emits: ["ok", "register"],
|
|
12
|
+
setup(__props, { emit: __emit }) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const emit = __emit;
|
|
15
|
+
const formRef = ref();
|
|
16
|
+
const i18nState = reactive({ id: "" });
|
|
17
|
+
const isEdit = ref(false);
|
|
18
|
+
const handleShow = (visible) => {
|
|
19
|
+
if (visible) isEdit.value = false;
|
|
20
|
+
};
|
|
21
|
+
const [registerInner, { closeModal }] = useModalInner((data) => {
|
|
22
|
+
data && onDataReceive(data);
|
|
23
|
+
});
|
|
24
|
+
const onDataReceive = (data) => {
|
|
25
|
+
isEdit.value = true;
|
|
26
|
+
i18nState.id = data.key;
|
|
27
|
+
const { lang } = props;
|
|
28
|
+
console.log(lang, "lang========");
|
|
29
|
+
for (const item of lang) {
|
|
30
|
+
const key = item.dataIndex;
|
|
31
|
+
i18nState[key] = data[key];
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const validateSpecialCharacters = (_, value, callback) => {
|
|
35
|
+
if (!/^[a-zA-Z_.]*$/.test(value)) callback(t("sys.i18n.validated18nKeyErrorMsg"));
|
|
36
|
+
callback();
|
|
37
|
+
};
|
|
38
|
+
const validateLang = async (_rule, value) => {
|
|
39
|
+
if (/^\s*$/g.test(value)) return Promise.reject(t("sys.notEmptySth", { sth: t("sys.i18n") }));
|
|
40
|
+
else return Promise.resolve();
|
|
41
|
+
};
|
|
42
|
+
const handleOk = () => {
|
|
43
|
+
formRef.value?.validate().then(() => {
|
|
44
|
+
emit("ok", { ...toRaw(i18nState) }, isEdit.value);
|
|
45
|
+
closeModal();
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const handleClose = () => {
|
|
49
|
+
formRef.value?.resetFields();
|
|
50
|
+
};
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
const _component_a_input = resolveComponent("a-input");
|
|
53
|
+
const _component_a_form_item = resolveComponent("a-form-item");
|
|
54
|
+
const _component_a_form = resolveComponent("a-form");
|
|
55
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
56
|
+
return openBlock(), createBlock(_component_BasicModal, mergeProps(_ctx.$attrs, {
|
|
57
|
+
title: isEdit.value ? unref(t)("sys.edit") : unref(t)("sys.new"),
|
|
58
|
+
centered: "",
|
|
59
|
+
width: "640px",
|
|
60
|
+
"min-height": 100,
|
|
61
|
+
"mask-closable": false,
|
|
62
|
+
"after-close": handleClose,
|
|
63
|
+
"get-container": __props.getContainer,
|
|
64
|
+
onRegister: unref(registerInner),
|
|
65
|
+
onOk: handleOk,
|
|
66
|
+
onVisibleChange: handleShow
|
|
67
|
+
}), {
|
|
68
|
+
default: withCtx(() => [createVNode(_component_a_form, {
|
|
69
|
+
ref_key: "formRef",
|
|
70
|
+
ref: formRef,
|
|
71
|
+
model: i18nState,
|
|
72
|
+
"label-col": { span: 6 },
|
|
73
|
+
"wrapper-col": { span: 16 },
|
|
74
|
+
autocomplete: "off",
|
|
75
|
+
layout: "horizontal"
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [createVNode(_component_a_form_item, {
|
|
78
|
+
label: unref(t)("sys.i18n.resourceIdentification"),
|
|
79
|
+
name: "id",
|
|
80
|
+
rules: [{
|
|
81
|
+
required: true,
|
|
82
|
+
message: unref(t)("sys.pleaseInputSth", { sth: unref(t)("sys.i18n.resourceIdentification") })
|
|
83
|
+
}, { validator: validateSpecialCharacters }]
|
|
84
|
+
}, {
|
|
85
|
+
default: withCtx(() => [createVNode(_component_a_input, {
|
|
86
|
+
value: i18nState.id,
|
|
87
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => i18nState.id = $event),
|
|
88
|
+
"show-count": "",
|
|
89
|
+
maxlength: 128,
|
|
90
|
+
disabled: isEdit.value
|
|
91
|
+
}, null, 8, ["value", "disabled"])]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["label", "rules"]), (openBlock(true), createElementBlock(Fragment, null, renderList(props.lang, (item) => {
|
|
94
|
+
return openBlock(), createBlock(_component_a_form_item, {
|
|
95
|
+
key: item.dataIndex,
|
|
96
|
+
label: item.title,
|
|
97
|
+
name: item.dataIndex,
|
|
98
|
+
rules: [{
|
|
99
|
+
required: true,
|
|
100
|
+
message: unref(t)("sys.pleaseInputSth", { sth: item.title })
|
|
101
|
+
}, { validator: validateLang }]
|
|
102
|
+
}, {
|
|
103
|
+
default: withCtx(() => [createVNode(_component_a_input, {
|
|
104
|
+
value: i18nState[item.dataIndex],
|
|
105
|
+
"onUpdate:value": ($event) => i18nState[item.dataIndex] = $event,
|
|
106
|
+
"show-count": "",
|
|
107
|
+
maxlength: 300
|
|
108
|
+
}, null, 8, ["value", "onUpdate:value"])]),
|
|
109
|
+
_: 2
|
|
110
|
+
}, 1032, [
|
|
111
|
+
"label",
|
|
112
|
+
"name",
|
|
113
|
+
"rules"
|
|
114
|
+
]);
|
|
115
|
+
}), 128))]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["model"])]),
|
|
118
|
+
_: 1
|
|
119
|
+
}, 16, [
|
|
120
|
+
"title",
|
|
121
|
+
"get-container",
|
|
122
|
+
"onRegister"
|
|
123
|
+
]);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
//#endregion
|
|
128
|
+
export { i18n_modal_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
1
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
2
|
+
import i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default from "./i18n-select-btn.vue_vue_type_script_setup_true_name_i18n-select-btn_lang.mjs";
|
|
3
|
+
import './i18n-select-btn.vue_vue_type_style_index_0_scoped_dc8ffb2c_lang.css';/* empty css */
|
|
4
|
+
//#region src/components/I18nSelect/src/i18n-select-btn.vue
|
|
5
|
+
var i18n_select_btn_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default, [["__scopeId", "data-v-dc8ffb2c"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { i18n_select_btn_default as default };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useI18nSelect } from "./useI18nSelect.mjs";
|
|
2
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, normalizeClass, openBlock, reactive, ref, renderList, resolveComponent, toDisplayString, watch, withCtx } from "vue";
|
|
3
|
+
import { isEmpty } from "lodash-es";
|
|
4
|
+
//#region src/components/I18nSelect/src/i18n-select-btn.vue?vue&type=script&setup=true&name=i18n-select-btn&lang.ts
|
|
5
|
+
var _hoisted_1 = { class: "i18n-tooltip-title" };
|
|
6
|
+
var _hoisted_2 = { style: { "margin-left": "4px" } };
|
|
7
|
+
var i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "i18n-select-btn",
|
|
9
|
+
props: {
|
|
10
|
+
i18nValue: {},
|
|
11
|
+
buttonExtraProps: {},
|
|
12
|
+
size: {},
|
|
13
|
+
i18nModalKey: {},
|
|
14
|
+
simpleBtn: { type: Boolean },
|
|
15
|
+
btnHeight: {},
|
|
16
|
+
btnWidth: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["on-select-i18n", "closed"],
|
|
19
|
+
setup(__props, { emit: __emit }) {
|
|
20
|
+
const getEnableLocaleList = ref();
|
|
21
|
+
const i18nInstance = useI18nSelect();
|
|
22
|
+
const props = __props;
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
const i18nMap = reactive({});
|
|
25
|
+
const isHighlight = computed(() => {
|
|
26
|
+
return !isEmpty(props.i18nValue);
|
|
27
|
+
});
|
|
28
|
+
const getTableData = async (keyword) => {
|
|
29
|
+
const result = await _api.apaas.i18NInfo.getPageList({
|
|
30
|
+
pageNo: 1,
|
|
31
|
+
pageSize: 20,
|
|
32
|
+
searchKey: keyword
|
|
33
|
+
});
|
|
34
|
+
if (result && result.data) {
|
|
35
|
+
const row = result.data.find((item) => item.key === props.i18nValue);
|
|
36
|
+
if (row) Object.assign(i18nMap, Object.fromEntries(Object.entries(JSON.parse(row.info)).map(([_, item]) => [item.locale, item.info])));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
watch(() => props.i18nValue, () => {
|
|
40
|
+
if (!isEmpty(props.i18nValue)) getTableData(props.i18nValue);
|
|
41
|
+
}, { immediate: true });
|
|
42
|
+
const handleOpenI18nSelectModal = () => {
|
|
43
|
+
i18nInstance.open({
|
|
44
|
+
i18nModalKey: props.i18nModalKey,
|
|
45
|
+
saveCallback: (params) => {
|
|
46
|
+
emit("on-select-i18n", { ...params });
|
|
47
|
+
},
|
|
48
|
+
destroyCallback: () => {
|
|
49
|
+
emit("closed");
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
return (_ctx, _cache) => {
|
|
54
|
+
const _component_Icon = resolveComponent("Icon");
|
|
55
|
+
const _component_a_button = resolveComponent("a-button");
|
|
56
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
57
|
+
return __props.simpleBtn ? (openBlock(), createBlock(_component_Icon, {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: normalizeClass(["i18n-icon simple-btn", { "is-highlight": isHighlight.value }]),
|
|
60
|
+
icon: "ion:language",
|
|
61
|
+
onClick: handleOpenI18nSelectModal
|
|
62
|
+
}, null, 8, ["class"])) : isHighlight.value ? (openBlock(), createBlock(_component_a_tooltip, {
|
|
63
|
+
key: 1,
|
|
64
|
+
color: "#fff",
|
|
65
|
+
placement: "topRight"
|
|
66
|
+
}, {
|
|
67
|
+
title: withCtx(() => [createElementVNode("div", _hoisted_1, "语言标识:" + toDisplayString(__props.i18nValue), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(getEnableLocaleList.value, (item) => {
|
|
68
|
+
return openBlock(), createElementBlock("div", {
|
|
69
|
+
key: item.id,
|
|
70
|
+
class: "i18n-tooltip-item"
|
|
71
|
+
}, [createElementVNode("strong", null, toDisplayString(item.language) + ": ", 1), createElementVNode("span", _hoisted_2, toDisplayString(i18nMap[item.languageTag]), 1)]);
|
|
72
|
+
}), 128))]),
|
|
73
|
+
default: withCtx(() => [createVNode(_component_a_button, mergeProps(__props.buttonExtraProps, {
|
|
74
|
+
class: { "is-highlight": isHighlight.value },
|
|
75
|
+
style: {
|
|
76
|
+
"--btn-width": __props.btnWidth,
|
|
77
|
+
"--btn-height": __props.btnHeight
|
|
78
|
+
},
|
|
79
|
+
size: __props.size,
|
|
80
|
+
onClick: handleOpenI18nSelectModal
|
|
81
|
+
}), {
|
|
82
|
+
icon: withCtx(() => [createVNode(_component_Icon, {
|
|
83
|
+
class: "i18n-icon",
|
|
84
|
+
icon: "ion:language"
|
|
85
|
+
})]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 16, [
|
|
88
|
+
"class",
|
|
89
|
+
"style",
|
|
90
|
+
"size"
|
|
91
|
+
])]),
|
|
92
|
+
_: 1
|
|
93
|
+
})) : (openBlock(), createBlock(_component_a_button, mergeProps({ key: 2 }, __props.buttonExtraProps, {
|
|
94
|
+
class: { "is-highlight": isHighlight.value },
|
|
95
|
+
style: {
|
|
96
|
+
"--btn-width": __props.btnWidth,
|
|
97
|
+
"--btn-height": __props.btnHeight
|
|
98
|
+
},
|
|
99
|
+
size: __props.size,
|
|
100
|
+
onClick: handleOpenI18nSelectModal
|
|
101
|
+
}), {
|
|
102
|
+
icon: withCtx(() => [createVNode(_component_Icon, {
|
|
103
|
+
class: "i18n-icon",
|
|
104
|
+
icon: "ion:language"
|
|
105
|
+
})]),
|
|
106
|
+
_: 1
|
|
107
|
+
}, 16, [
|
|
108
|
+
"class",
|
|
109
|
+
"style",
|
|
110
|
+
"size"
|
|
111
|
+
]));
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
//#endregion
|
|
116
|
+
export { i18n_select_btn_vue_vue_type_script_setup_true_name_i18n_select_btn_lang_default as default };
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
.ant-btn[data-v-
|
|
1
|
+
.ant-btn[data-v-dc8ffb2c] {
|
|
2
2
|
background-color: #fff !important;
|
|
3
3
|
}
|
|
4
|
-
.ant-btn.ant-btn-icon-only[data-v-
|
|
4
|
+
.ant-btn.ant-btn-icon-only[data-v-dc8ffb2c] {
|
|
5
5
|
width: var(--btn-width, 32px);
|
|
6
6
|
height: var(--btn-height, 32px);
|
|
7
7
|
}
|
|
8
|
-
.ant-btn.ant-btn-icon-only.ant-btn-sm[data-v-
|
|
8
|
+
.ant-btn.ant-btn-icon-only.ant-btn-sm[data-v-dc8ffb2c] {
|
|
9
9
|
width: 26px;
|
|
10
10
|
height: 26px;
|
|
11
11
|
}
|
|
12
|
-
.ant-btn:hover .i18n-icon[data-v-
|
|
12
|
+
.ant-btn:hover .i18n-icon[data-v-dc8ffb2c] {
|
|
13
13
|
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
14
14
|
color: var(--ant-primary-color);
|
|
15
15
|
}
|
|
16
|
-
.ant-btn.is-highlight[data-v-
|
|
16
|
+
.ant-btn.is-highlight[data-v-dc8ffb2c] {
|
|
17
17
|
color: var(--ant-primary-color);
|
|
18
18
|
border-color: var(--ant-primary-color);
|
|
19
19
|
}
|
|
20
|
-
.ant-btn.is-highlight .i18n-icon[data-v-
|
|
20
|
+
.ant-btn.is-highlight .i18n-icon[data-v-dc8ffb2c] {
|
|
21
21
|
color: var(--ant-primary-color);
|
|
22
22
|
}
|
|
23
|
-
.i18n-icon[data-v-
|
|
23
|
+
.i18n-icon[data-v-dc8ffb2c] {
|
|
24
24
|
color: #7f8695;
|
|
25
25
|
display: flex !important;
|
|
26
26
|
}
|
|
27
|
-
.simple-btn[data-v-
|
|
27
|
+
.simple-btn[data-v-dc8ffb2c]:hover {
|
|
28
28
|
color: var(--ant-primary-color);
|
|
29
29
|
}
|
|
30
|
-
.simple-btn.is-highlight[data-v-
|
|
30
|
+
.simple-btn.is-highlight[data-v-dc8ffb2c] {
|
|
31
31
|
color: var(--ant-primary-color);
|
|
32
32
|
}
|
|
33
|
-
.i18n-tooltip-title[data-v-
|
|
33
|
+
.i18n-tooltip-title[data-v-dc8ffb2c] {
|
|
34
34
|
color: #303133;
|
|
35
35
|
font-size: 16px;
|
|
36
36
|
line-height: 1;
|
|
37
37
|
margin-bottom: 12px;
|
|
38
38
|
}
|
|
39
|
-
.i18n-tooltip-item[data-v-
|
|
39
|
+
.i18n-tooltip-item[data-v-dc8ffb2c] {
|
|
40
40
|
color: #606266;
|
|
41
41
|
font-size: 14px;
|
|
42
42
|
}
|
|
43
|
-
.custom-i18n-btn[data-v-
|
|
43
|
+
.custom-i18n-btn[data-v-dc8ffb2c] {
|
|
44
44
|
vertical-align: middle;
|
|
45
45
|
background: #fff;
|
|
46
46
|
color: #303133;
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
align-items: center;
|
|
52
52
|
padding: 0;
|
|
53
53
|
}
|
|
54
|
-
.custom-i18n-btn.reg-i18n[data-v-
|
|
54
|
+
.custom-i18n-btn.reg-i18n[data-v-dc8ffb2c] {
|
|
55
55
|
position: absolute;
|
|
56
56
|
right: -32px;
|
|
57
57
|
bottom: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import './i18n-select-container.css';/* empty css
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
1
|
+
import i18n_select_container_vue_vue_type_script_setup_true_name_i18n_select_container_lang_default from "./i18n-select-container.vue_vue_type_script_setup_true_name_i18n-select-container_lang.mjs";
|
|
2
|
+
import './i18n-select-container.vue_vue_type_style_index_0_scoped_0160ed5e_lang.css';/* empty css */
|
|
3
|
+
import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
//#region src/components/I18nSelect/src/i18n-select-container.vue
|
|
5
|
+
var i18n_select_container_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_container_vue_vue_type_script_setup_true_name_i18n_select_container_lang_default, [["__scopeId", "data-v-0160ed5e"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { i18n_select_container_default as default };
|