@gct-paas/design-web 0.1.4-dev.1 → 0.1.4-dev.11

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.
Files changed (48) hide show
  1. package/dist/index.esm.min.mjs +836 -0
  2. package/dist/index.min.cjs +1 -1
  3. package/dist/index.min.css +1 -0
  4. package/dist/index.system.min.js +1 -1
  5. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  6. package/es/components/I18nSelect/index.d.ts +7 -0
  7. package/es/components/I18nSelect/src/i18n-modal.vue.d.ts +21 -0
  8. package/es/components/I18nSelect/src/i18n-modal.vue.mjs +151 -0
  9. package/es/components/I18nSelect/src/i18n-modal.vue2.mjs +5 -0
  10. package/es/components/I18nSelect/src/i18n-select-btn.css +58 -0
  11. package/es/components/I18nSelect/src/i18n-select-btn.vue.d.ts +17 -0
  12. package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +7 -0
  13. package/es/components/I18nSelect/src/i18n-select-btn.vue2.mjs +138 -0
  14. package/es/components/I18nSelect/src/i18n-select-container.css +6 -0
  15. package/es/components/I18nSelect/src/i18n-select-container.vue.d.ts +10 -0
  16. package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +7 -0
  17. package/es/components/I18nSelect/src/i18n-select-container.vue2.mjs +250 -0
  18. package/es/components/I18nSelect/src/i18n-select-input-form.vue.d.ts +15 -0
  19. package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +57 -0
  20. package/es/components/I18nSelect/src/i18n-select-input-form.vue2.mjs +5 -0
  21. package/es/components/I18nSelect/src/i18n-select-input.css +3 -0
  22. package/es/components/I18nSelect/src/i18n-select-input.vue.d.ts +51 -0
  23. package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +7 -0
  24. package/es/components/I18nSelect/src/i18n-select-input.vue2.mjs +129 -0
  25. package/es/components/{test-com/test-com.d.ts → I18nSelect/src/i18n-select-modal.vue.d.ts} +3 -2
  26. package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +21 -0
  27. package/es/components/I18nSelect/src/i18n-select-modal.vue2.mjs +5 -0
  28. package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.d.ts +15 -0
  29. package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +57 -0
  30. package/es/components/I18nSelect/src/i18n-select-textarea-form.vue2.mjs +5 -0
  31. package/es/components/I18nSelect/src/i18n-select-textarea.css +17 -0
  32. package/es/components/I18nSelect/src/i18n-select-textarea.vue.d.ts +26 -0
  33. package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +7 -0
  34. package/es/components/I18nSelect/src/i18n-select-textarea.vue2.mjs +93 -0
  35. package/es/components/I18nSelect/src/useI18nSelect.d.ts +13 -0
  36. package/es/components/I18nSelect/src/useI18nSelect.mjs +51 -0
  37. package/es/components/index.d.ts +1 -3
  38. package/es/index.d.ts +1 -0
  39. package/es/index.mjs +9 -7
  40. package/es/types/index.d.ts +4 -2
  41. package/package.json +17 -12
  42. package/dist/design-web.css +0 -1
  43. package/es/components/index.mjs +0 -4
  44. package/es/components/test-com/test-com.mjs +0 -21
  45. package/es/components/test-com/test-com.scss +0 -3
  46. package/es/components/test-vue-com/test-vue-com.vue +0 -15
  47. package/es/components/test-vue-com/test-vue-com.vue.d.ts +0 -2
  48. package/es/vite-env.d.ts +0 -1
@@ -0,0 +1,250 @@
1
+ import { defineComponent, ref, reactive, computed, onMounted, resolveComponent, openBlock, createBlock, mergeProps, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString } from 'vue';
2
+ import { SearchOutlined } from '@ant-design/icons-vue';
3
+ import _sfc_main$1 from './i18n-modal.vue.mjs';
4
+ import { t } from '@gct-paas/core';
5
+ import { useModalInner, useModal } from '@gct-paas/core-web';
6
+
7
+ const _hoisted_1 = { class: "i18n-select-container" };
8
+ const _hoisted_2 = { class: "table-wrap" };
9
+ const _sfc_main = /* @__PURE__ */ defineComponent({
10
+ __name: "i18n-select-container",
11
+ props: {
12
+ i18nModalKey: {},
13
+ destroyCallback: { type: Function },
14
+ saveCallback: { type: Function }
15
+ },
16
+ setup(__props) {
17
+ const [registerInner, { closeModal }] = useModalInner();
18
+ const [userRegister, { openModal }] = useModal();
19
+ const props = __props;
20
+ const getContainer = () => document.querySelector(`#${props.i18nModalKey}`);
21
+ const formRef = ref();
22
+ const formState = reactive({ keywords: "" });
23
+ const pagination = reactive({
24
+ current: 1,
25
+ pageSize: 5,
26
+ total: 0,
27
+ size: "small",
28
+ showTotal: (total) => t("sys.component.table.total", { total })
29
+ });
30
+ const tableData = ref([]);
31
+ const selectRows = ref();
32
+ const rowSelection = ref({
33
+ type: "radio",
34
+ hideSelectAll: true,
35
+ selectedRowKeys: [],
36
+ onChange: handleRowChange
37
+ });
38
+ const loading = ref(false);
39
+ const columns = computed(() => {
40
+ return [];
41
+ });
42
+ const getTableData = async (keyword, current) => {
43
+ loading.value = true;
44
+ const result = await _api.apaas.i18NInfo.getPageList({
45
+ pageNo: current ?? pagination.current,
46
+ pageSize: pagination.pageSize,
47
+ searchKey: keyword
48
+ });
49
+ loading.value = false;
50
+ if (result && result.data) {
51
+ const rows = result.data.map((item) => {
52
+ const infos = JSON.parse(item?.info);
53
+ return {
54
+ key: item.key,
55
+ type: item.type,
56
+ ...Object.fromEntries(infos.map((i) => [i.locale, i.info]))
57
+ };
58
+ });
59
+ pagination.total = result.totalCount;
60
+ tableData.value = rows;
61
+ }
62
+ };
63
+ onMounted(getTableData);
64
+ const handleSearch = () => {
65
+ formRef.value?.validate().then(async () => {
66
+ await getTableData(formState.keywords, 1);
67
+ });
68
+ };
69
+ const handleTableChange = (paginationInfo) => {
70
+ const { current, total, pageSize } = paginationInfo;
71
+ pagination.current = current;
72
+ pagination.total = total;
73
+ pagination.pageSize = pageSize;
74
+ getTableData();
75
+ };
76
+ const handleAddI18n = () => {
77
+ openModal();
78
+ };
79
+ const handleModalOk = async (data, isEdit) => {
80
+ const langInfos = columns.value.map((item) => {
81
+ return {
82
+ locale: item.dataIndex,
83
+ info: data[item.dataIndex]
84
+ };
85
+ });
86
+ loading.value = true;
87
+ try {
88
+ if (isEdit) {
89
+ await _api.apaas.i18NInfo.putKey(
90
+ { key: data.id },
91
+ { info: JSON.stringify(langInfos) }
92
+ );
93
+ } else {
94
+ await _api.apaas.i18NInfo.post({
95
+ info: JSON.stringify(langInfos),
96
+ key: data.id
97
+ });
98
+ }
99
+ getTableData();
100
+ handleRowChange([data.id], [reactive(data)]);
101
+ } catch (error) {
102
+ loading.value = false;
103
+ }
104
+ };
105
+ function handleRowChange(selectedRowKeys, selectedRows) {
106
+ rowSelection.value.selectedRowKeys = selectedRowKeys;
107
+ selectRows.value = selectedRows;
108
+ }
109
+ const handleClose = () => {
110
+ if (props.destroyCallback && typeof props.destroyCallback === "function") {
111
+ props.destroyCallback();
112
+ }
113
+ };
114
+ const handleOk = async () => {
115
+ if (props.saveCallback && typeof props.saveCallback === "function") {
116
+ const selectRowKey = rowSelection.value.selectedRowKeys;
117
+ const params = {};
118
+ if (selectRowKey && selectRowKey[0]) {
119
+ const selectRow = selectRows.value?.[0];
120
+ console.log("selectRow", selectRow);
121
+ Object.assign(params, {
122
+ i18nKey: selectRowKey[0]
123
+ // i18nTitle: selectRow[getLocale],
124
+ });
125
+ }
126
+ props.saveCallback(params);
127
+ }
128
+ closeModal();
129
+ };
130
+ return (_ctx, _cache) => {
131
+ const _component_a_input = resolveComponent("a-input");
132
+ const _component_a_form_item = resolveComponent("a-form-item");
133
+ const _component_a_col = resolveComponent("a-col");
134
+ const _component_a_button = resolveComponent("a-button");
135
+ const _component_plus_outlined = resolveComponent("plus-outlined");
136
+ const _component_a_row = resolveComponent("a-row");
137
+ const _component_a_form = resolveComponent("a-form");
138
+ const _component_a_table = resolveComponent("a-table");
139
+ const _component_basic_modal = resolveComponent("basic-modal");
140
+ return openBlock(), createBlock(_component_basic_modal, mergeProps(_ctx.$attrs, {
141
+ "min-height": 40,
142
+ title: unref(t)("sys.i18n.i18nConfig"),
143
+ centered: "",
144
+ width: "640px",
145
+ "can-fullscreen": false,
146
+ "mask-closable": false,
147
+ "after-close": handleClose,
148
+ "get-container": getContainer,
149
+ onRegister: unref(registerInner),
150
+ onOk: handleOk
151
+ }), {
152
+ default: withCtx(() => [
153
+ createElementVNode("div", _hoisted_1, [
154
+ createVNode(_component_a_form, {
155
+ ref_key: "formRef",
156
+ ref: formRef,
157
+ model: formState,
158
+ autocomplete: "off",
159
+ layout: "horizontal"
160
+ }, {
161
+ default: withCtx(() => [
162
+ createVNode(_component_a_row, null, {
163
+ default: withCtx(() => [
164
+ createVNode(_component_a_col, { span: 12 }, {
165
+ default: withCtx(() => [
166
+ createVNode(_component_a_form_item, {
167
+ name: "keywords",
168
+ label: unref(t)("sys.keywords")
169
+ }, {
170
+ default: withCtx(() => [
171
+ createVNode(_component_a_input, {
172
+ value: formState.keywords,
173
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => formState.keywords = $event),
174
+ placeholder: unref(t)("sys.keywordsPlaceholder"),
175
+ style: { "display": "inline-flex" }
176
+ }, null, 8, ["value", "placeholder"])
177
+ ]),
178
+ _: 1
179
+ }, 8, ["label"])
180
+ ]),
181
+ _: 1
182
+ }),
183
+ createVNode(_component_a_col, {
184
+ span: 12,
185
+ style: { "text-align": "right" }
186
+ }, {
187
+ default: withCtx(() => [
188
+ createVNode(_component_a_button, {
189
+ type: "primary",
190
+ onClick: handleSearch
191
+ }, {
192
+ icon: withCtx(() => [
193
+ createVNode(unref(SearchOutlined))
194
+ ]),
195
+ default: withCtx(() => [
196
+ createTextVNode(" " + toDisplayString(unref(t)("sys.queryText")), 1)
197
+ ]),
198
+ _: 1
199
+ }),
200
+ createVNode(_component_a_button, {
201
+ style: { "margin": "0 8px" },
202
+ type: "primary",
203
+ onClick: handleAddI18n
204
+ }, {
205
+ icon: withCtx(() => [
206
+ createVNode(_component_plus_outlined)
207
+ ]),
208
+ default: withCtx(() => [
209
+ createTextVNode(" " + toDisplayString(unref(t)("sys.new")), 1)
210
+ ]),
211
+ _: 1
212
+ })
213
+ ]),
214
+ _: 1
215
+ })
216
+ ]),
217
+ _: 1
218
+ })
219
+ ]),
220
+ _: 1
221
+ }, 8, ["model"]),
222
+ createElementVNode("div", _hoisted_2, [
223
+ createVNode(_component_a_table, {
224
+ ref: "tableRef",
225
+ "data-source": tableData.value,
226
+ columns: columns.value,
227
+ "show-index-column": false,
228
+ pagination,
229
+ striped: false,
230
+ bordered: true,
231
+ "row-selection": rowSelection.value,
232
+ loading: loading.value,
233
+ onChange: handleTableChange
234
+ }, null, 8, ["data-source", "columns", "pagination", "row-selection", "loading"]),
235
+ createVNode(_sfc_main$1, {
236
+ lang: columns.value,
237
+ "get-container": getContainer,
238
+ onRegister: unref(userRegister),
239
+ onOk: handleModalOk
240
+ }, null, 8, ["lang", "onRegister"])
241
+ ])
242
+ ])
243
+ ]),
244
+ _: 1
245
+ }, 16, ["title", "onRegister"]);
246
+ };
247
+ }
248
+ });
249
+
250
+ export { _sfc_main as default };
@@ -0,0 +1,15 @@
1
+ import { FormInstance, FormItemProps, InputProps } from 'ant-design-vue';
2
+ interface Props {
3
+ formItemName: string | string[];
4
+ fromItemExtraProps?: FormItemProps;
5
+ inputExtraProps?: InputProps;
6
+ i18nConfig?: string;
7
+ text?: string;
8
+ formRef?: FormInstance;
9
+ }
10
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ "update:text": (...args: any[]) => void;
12
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
13
+ "onUpdate:text"?: ((...args: any[]) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ export default _default;
@@ -0,0 +1,57 @@
1
+ import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, mergeProps, withCtx, createElementVNode, toDisplayString } from 'vue';
2
+ import I18nSelectInput from './i18n-select-input.vue.mjs';
3
+
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "i18n-select-input-form",
6
+ props: {
7
+ formItemName: {},
8
+ fromItemExtraProps: {},
9
+ inputExtraProps: {},
10
+ i18nConfig: {},
11
+ text: {},
12
+ formRef: {}
13
+ },
14
+ emits: ["update:text"],
15
+ setup(__props, { emit: __emit }) {
16
+ const props = __props;
17
+ const emit = __emit;
18
+ const i18nText = computed({
19
+ get() {
20
+ return props.text ?? "";
21
+ },
22
+ set(value) {
23
+ emit("update:text", value);
24
+ props.formRef?.validateFields([props.formItemName]);
25
+ }
26
+ });
27
+ return (_ctx, _cache) => {
28
+ const _component_a_form_item = resolveComponent("a-form-item");
29
+ return openBlock(), createElementBlock(Fragment, null, [
30
+ createVNode(_component_a_form_item, mergeProps({ name: __props.formItemName }, __props.fromItemExtraProps), {
31
+ default: withCtx(() => [
32
+ createVNode(I18nSelectInput, mergeProps(_ctx.$attrs, {
33
+ "i18n-text": i18nText.value,
34
+ "onUpdate:i18nText": _cache[0] || (_cache[0] = ($event) => i18nText.value = $event),
35
+ "input-extra-props": __props.inputExtraProps,
36
+ "i18n-config": __props.i18nConfig,
37
+ attr: Array.isArray(__props.formItemName) ? __props.formItemName.join(".") : __props.formItemName,
38
+ "placeholder-text": _ctx.$t("sys.inputText")
39
+ }), null, 16, ["i18n-text", "input-extra-props", "i18n-config", "attr", "placeholder-text"])
40
+ ]),
41
+ _: 1
42
+ }, 16, ["name"]),
43
+ createVNode(_component_a_form_item, {
44
+ name: "i18nConfig",
45
+ hidden: ""
46
+ }, {
47
+ default: withCtx(() => [
48
+ createElementVNode("span", null, toDisplayString(__props.i18nConfig), 1)
49
+ ]),
50
+ _: 1
51
+ })
52
+ ], 64);
53
+ };
54
+ }
55
+ });
56
+
57
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './i18n-select-input-form.vue.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,3 @@
1
+ [data-v-412e1309] .ant-form-item-has-error .ant-btn {
2
+ border-color: var(--ant-error-color) !important;
3
+ }
@@ -0,0 +1,51 @@
1
+ import { InputProps } from 'ant-design-vue';
2
+ import { ButtonSize } from '@gct-paas/core';
3
+ interface Props {
4
+ attr: string | IObject;
5
+ inputExtraProps?: InputProps;
6
+ i18nConfig?: string | Record<string, string>;
7
+ i18nText?: string;
8
+ placeholderText?: string;
9
+ size?: ButtonSize;
10
+ i18nModalKey?: string;
11
+ forceUpdate?: boolean;
12
+ btnHeight?: string;
13
+ btnWidth?: string;
14
+ }
15
+ declare function __VLS_template(): {
16
+ attrs: Partial<{}>;
17
+ slots: {
18
+ 'i18n-input'?(_: {}): any;
19
+ };
20
+ refs: {
21
+ i18nInputGroup: unknown;
22
+ inputRef: unknown;
23
+ };
24
+ rootEl: any;
25
+ };
26
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
27
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
+ "update:i18nText": (...args: any[]) => void;
29
+ "update:i18nConfig": (...args: any[]) => void;
30
+ "on-i18n-select": (...args: any[]) => void;
31
+ clickOutside: (...args: any[]) => void;
32
+ focus: (...args: any[]) => void;
33
+ blur: (...args: any[]) => void;
34
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
35
+ "onUpdate:i18nText"?: ((...args: any[]) => any) | undefined;
36
+ "onUpdate:i18nConfig"?: ((...args: any[]) => any) | undefined;
37
+ "onOn-i18n-select"?: ((...args: any[]) => any) | undefined;
38
+ onClickOutside?: ((...args: any[]) => any) | undefined;
39
+ onFocus?: ((...args: any[]) => any) | undefined;
40
+ onBlur?: ((...args: any[]) => any) | undefined;
41
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
42
+ i18nInputGroup: unknown;
43
+ inputRef: unknown;
44
+ }, any>;
45
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
46
+ export default _default;
47
+ type __VLS_WithTemplateSlots<T, S> = T & {
48
+ new (): {
49
+ $slots: S;
50
+ };
51
+ };
@@ -0,0 +1,7 @@
1
+ import _sfc_main from './i18n-select-input.vue2.mjs';
2
+ import './i18n-select-input.css';/* empty css */
3
+ import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
4
+
5
+ const I18nSelectInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-412e1309"]]);
6
+
7
+ export { I18nSelectInput as default };
@@ -0,0 +1,129 @@
1
+ import { defineComponent, computed, ref, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createVNode, mergeProps, unref, createCommentVNode } from 'vue';
2
+ import I18nSelectBtn from './i18n-select-btn.vue.mjs';
3
+ import { isEmpty, omit } from 'lodash-es';
4
+ import { onClickOutside } from '@vueuse/core';
5
+ import { ButtonSize } from '@gct-paas/core';
6
+
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "i18n-select-input",
9
+ props: {
10
+ attr: {},
11
+ inputExtraProps: {},
12
+ i18nConfig: {},
13
+ i18nText: {},
14
+ placeholderText: {},
15
+ size: {},
16
+ i18nModalKey: {},
17
+ forceUpdate: { type: Boolean },
18
+ btnHeight: {},
19
+ btnWidth: {}
20
+ },
21
+ emits: [
22
+ "update:i18nText",
23
+ "update:i18nConfig",
24
+ "on-i18n-select",
25
+ "clickOutside",
26
+ "focus",
27
+ "blur"
28
+ ],
29
+ setup(__props, { emit: __emit }) {
30
+ const isApp = computed(() => {
31
+ return !!_gct.store.appInfo.id;
32
+ });
33
+ const props = __props;
34
+ const emit = __emit;
35
+ const inputValue = computed({
36
+ get() {
37
+ return props.i18nText ?? "";
38
+ },
39
+ set(value) {
40
+ if (value !== props.i18nText) {
41
+ emit("update:i18nText", value);
42
+ }
43
+ }
44
+ });
45
+ const i18nConfigState = computed(() => {
46
+ if (isEmpty(props.i18nConfig)) {
47
+ return {};
48
+ }
49
+ if (typeof props.i18nConfig === "string") {
50
+ return JSON.parse(props.i18nConfig) ?? {};
51
+ }
52
+ return props.i18nConfig ?? {};
53
+ });
54
+ const i18nValue = computed(() => {
55
+ return i18nConfigState.value?.[props.attr];
56
+ });
57
+ const handleSelectI18n = (params) => {
58
+ console.log("emit", params);
59
+ if (params) {
60
+ if (isEmpty(inputValue.value) || props.forceUpdate === true) {
61
+ emit("update:i18nText", params.i18nTitle);
62
+ }
63
+ emit(
64
+ "update:i18nConfig",
65
+ JSON.stringify(
66
+ isEmpty(params) ? omit(i18nConfigState.value, props.attr) : { ...i18nConfigState.value, [props.attr]: params.i18nKey }
67
+ )
68
+ );
69
+ emit("on-i18n-select", params);
70
+ }
71
+ };
72
+ const inputRef = ref();
73
+ const handleFocus = () => {
74
+ emit("focus", inputRef.value);
75
+ };
76
+ const handleBlur = () => {
77
+ emit("blur", inputRef.value);
78
+ };
79
+ const i18nInputGroup = ref();
80
+ onClickOutside(i18nInputGroup, () => {
81
+ emit("clickOutside");
82
+ });
83
+ return (_ctx, _cache) => {
84
+ const _component_a_input = resolveComponent("a-input");
85
+ const _component_a_input_group = resolveComponent("a-input-group");
86
+ return openBlock(), createBlock(_component_a_input_group, {
87
+ id: "i18nInputGroup",
88
+ ref_key: "i18nInputGroup",
89
+ ref: i18nInputGroup,
90
+ compact: ""
91
+ }, {
92
+ default: withCtx(() => [
93
+ renderSlot(_ctx.$slots, "i18n-input", {}, () => [
94
+ createVNode(_component_a_input, mergeProps({
95
+ ref_key: "inputRef",
96
+ ref: inputRef
97
+ }, __props.inputExtraProps, {
98
+ value: inputValue.value,
99
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
100
+ valueModifiers: { trim: true },
101
+ style: {
102
+ height: __props.btnHeight ? __props.btnHeight : __props.size === unref(ButtonSize).SMALL ? "26px" : "32px",
103
+ width: !isApp.value ? "100%" : `calc(100% - ${__props.btnWidth ? __props.btnWidth : __props.size === unref(ButtonSize).SMALL ? "26px" : "32px"}`
104
+ },
105
+ placeholder: __props.placeholderText,
106
+ size: __props.size,
107
+ "allow-clear": "",
108
+ onFocus: handleFocus,
109
+ onBlur: handleBlur
110
+ }), null, 16, ["value", "style", "placeholder", "size"])
111
+ ], true),
112
+ isApp.value ? (openBlock(), createBlock(I18nSelectBtn, {
113
+ key: 0,
114
+ "btn-height": __props.btnHeight,
115
+ "btn-width": __props.btnWidth,
116
+ "i18n-value": i18nValue.value,
117
+ size: __props.size,
118
+ "i18n-modal-key": __props.i18nModalKey,
119
+ onOnSelectI18n: handleSelectI18n,
120
+ onClosed: _cache[1] || (_cache[1] = ($event) => emit("clickOutside"))
121
+ }, null, 8, ["btn-height", "btn-width", "i18n-value", "size", "i18n-modal-key"])) : createCommentVNode("", true)
122
+ ]),
123
+ _: 3
124
+ }, 512);
125
+ };
126
+ }
127
+ });
128
+
129
+ export { _sfc_main as default };
@@ -1,3 +1,4 @@
1
- export declare const TestCom: import('vue').DefineComponent<{}, {
2
- ns: import('@gct-paas/core').Namespace;
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ open: () => void;
3
3
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
4
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { defineComponent, openBlock, createBlock, unref } from 'vue';
2
+ import { useModal } from '@gct-paas/core-web';
3
+ import I18nSelectContainer from './i18n-select-container.vue.mjs';
4
+
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "i18n-select-modal",
7
+ setup(__props, { expose: __expose }) {
8
+ const [register, { openModal }] = useModal();
9
+ const open = () => {
10
+ openModal();
11
+ };
12
+ __expose({
13
+ open
14
+ });
15
+ return (_ctx, _cache) => {
16
+ return openBlock(), createBlock(I18nSelectContainer, { onRegister: unref(register) }, null, 8, ["onRegister"]);
17
+ };
18
+ }
19
+ });
20
+
21
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './i18n-select-modal.vue.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,15 @@
1
+ import { FormInstance, FormItemProps, InputProps } from 'ant-design-vue';
2
+ interface Props {
3
+ formItemName: string | string[];
4
+ fromItemExtraProps?: FormItemProps;
5
+ inputExtraProps?: InputProps;
6
+ i18nConfig?: string;
7
+ text?: string;
8
+ formRef?: FormInstance;
9
+ }
10
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ "update:text": (...args: any[]) => void;
12
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
13
+ "onUpdate:text"?: ((...args: any[]) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ export default _default;
@@ -0,0 +1,57 @@
1
+ import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, mergeProps, withCtx, createElementVNode, toDisplayString } from 'vue';
2
+ import I18nSelectTextarea from './i18n-select-textarea.vue.mjs';
3
+
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "i18n-select-textarea-form",
6
+ props: {
7
+ formItemName: {},
8
+ fromItemExtraProps: {},
9
+ inputExtraProps: {},
10
+ i18nConfig: {},
11
+ text: {},
12
+ formRef: {}
13
+ },
14
+ emits: ["update:text"],
15
+ setup(__props, { emit: __emit }) {
16
+ const props = __props;
17
+ const emit = __emit;
18
+ const i18nText = computed({
19
+ get() {
20
+ return props.text ?? "";
21
+ },
22
+ set(value) {
23
+ emit("update:text", value);
24
+ props.formRef?.validateFields([props.formItemName]);
25
+ }
26
+ });
27
+ return (_ctx, _cache) => {
28
+ const _component_a_form_item = resolveComponent("a-form-item");
29
+ return openBlock(), createElementBlock(Fragment, null, [
30
+ createVNode(_component_a_form_item, mergeProps({ name: __props.formItemName }, __props.fromItemExtraProps), {
31
+ default: withCtx(() => [
32
+ createVNode(I18nSelectTextarea, mergeProps(_ctx.$attrs, {
33
+ "i18n-text": i18nText.value,
34
+ "onUpdate:i18nText": _cache[0] || (_cache[0] = ($event) => i18nText.value = $event),
35
+ "placeholder-text": _ctx.$t("sys.inputText"),
36
+ "input-extra-props": __props.inputExtraProps,
37
+ "i18n-config": __props.i18nConfig,
38
+ attr: Array.isArray(__props.formItemName) ? __props.formItemName.join(".") : __props.formItemName
39
+ }), null, 16, ["i18n-text", "placeholder-text", "input-extra-props", "i18n-config", "attr"])
40
+ ]),
41
+ _: 1
42
+ }, 16, ["name"]),
43
+ createVNode(_component_a_form_item, {
44
+ name: "i18nConfig",
45
+ hidden: ""
46
+ }, {
47
+ default: withCtx(() => [
48
+ createElementVNode("span", null, toDisplayString(__props.i18nConfig), 1)
49
+ ]),
50
+ _: 1
51
+ })
52
+ ], 64);
53
+ };
54
+ }
55
+ });
56
+
57
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './i18n-select-textarea-form.vue.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,17 @@
1
+ [data-v-cd95c416] .i18n-icon {
2
+ position: absolute;
3
+ right: 16px;
4
+ bottom: 12px;
5
+ color: #212528;
6
+ font-size: 16px;
7
+ cursor: pointer;
8
+ }
9
+ [data-v-cd95c416]
10
+ div.ant-input-textarea.ant-input-textarea-show-count.ant-input-textarea-show-count::after
11
+ {
12
+ right: 33px;
13
+ }
14
+ [data-v-cd95c416] .ant-input {
15
+ border: 2px dashed #dbdbdb;
16
+ background: transparent;
17
+ }