@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.
Files changed (40) hide show
  1. package/dist/index.min.css +2 -1
  2. package/dist/loader.esm.min.js +778 -0
  3. package/es/_virtual/_plugin-vue_export-helper.mjs +7 -8
  4. package/es/components/I18nSelect/index.mjs +7 -0
  5. package/es/components/I18nSelect/src/i18n-modal.vue.mjs +5 -151
  6. package/es/components/I18nSelect/src/i18n-modal.vue_vue_type_script_setup_true_lang.mjs +128 -0
  7. package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +7 -7
  8. package/es/components/I18nSelect/src/i18n-select-btn.vue_vue_type_script_setup_true_name_i18n-select-btn_lang.mjs +116 -0
  9. package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +7 -7
  10. package/es/components/I18nSelect/src/i18n-select-container.vue_vue_type_script_setup_true_name_i18n-select-container_lang.mjs +217 -0
  11. package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +5 -57
  12. package/es/components/I18nSelect/src/i18n-select-input-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs +56 -0
  13. package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +7 -7
  14. package/es/components/I18nSelect/src/i18n-select-input.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +125 -0
  15. package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +5 -21
  16. package/es/components/I18nSelect/src/i18n-select-modal.vue_vue_type_script_setup_true_lang.mjs +19 -0
  17. package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +5 -57
  18. package/es/components/I18nSelect/src/i18n-select-textarea-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs +56 -0
  19. package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +7 -7
  20. package/es/components/I18nSelect/src/i18n-select-textarea.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs +86 -0
  21. package/es/components/I18nSelect/src/useI18nSelect.mjs +43 -48
  22. package/es/components/index.mjs +8 -0
  23. package/es/index.mjs +14 -15
  24. package/es/loader.d.ts +1 -0
  25. package/package.json +9 -9
  26. package/dist/index.esm.min.mjs +0 -836
  27. package/dist/index.min.cjs +0 -1
  28. package/dist/index.system.min.js +0 -1
  29. package/es/components/I18nSelect/src/i18n-modal.vue2.mjs +0 -5
  30. package/es/components/I18nSelect/src/i18n-select-btn.vue2.mjs +0 -138
  31. package/es/components/I18nSelect/src/i18n-select-container.vue2.mjs +0 -250
  32. package/es/components/I18nSelect/src/i18n-select-input-form.vue2.mjs +0 -5
  33. package/es/components/I18nSelect/src/i18n-select-input.vue2.mjs +0 -129
  34. package/es/components/I18nSelect/src/i18n-select-modal.vue2.mjs +0 -5
  35. package/es/components/I18nSelect/src/i18n-select-textarea-form.vue2.mjs +0 -5
  36. package/es/components/I18nSelect/src/i18n-select-textarea.vue2.mjs +0 -93
  37. /package/es/components/I18nSelect/src/{i18n-select-btn.css → i18n-select-btn.vue_vue_type_style_index_0_scoped_dc8ffb2c_lang.css} +0 -0
  38. /package/es/components/I18nSelect/src/{i18n-select-container.css → i18n-select-container.vue_vue_type_style_index_0_scoped_0160ed5e_lang.css} +0 -0
  39. /package/es/components/I18nSelect/src/{i18n-select-input.css → i18n-select-input.vue_vue_type_style_index_0_scoped_412e1309_lang.css} +0 -0
  40. /package/es/components/I18nSelect/src/{i18n-select-textarea.css → i18n-select-textarea.vue_vue_type_style_index_0_scoped_cd95c416_lang.css} +0 -0
@@ -1,57 +1,5 @@
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 };
1
+ import i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default from "./i18n-select-input-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs";
2
+ //#region src/components/I18nSelect/src/i18n-select-input-form.vue
3
+ var i18n_select_input_form_default = i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default;
4
+ //#endregion
5
+ export { i18n_select_input_form_default as default };
@@ -0,0 +1,56 @@
1
+ import i18n_select_input_default from "./i18n-select-input.vue.mjs";
2
+ import { Fragment, computed, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, resolveComponent, toDisplayString, withCtx } from "vue";
3
+ //#region src/components/I18nSelect/src/i18n-select-input-form.vue?vue&type=script&setup=true&name=i18n-select-input-form&lang.ts
4
+ var i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default = /* @__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, [createVNode(_component_a_form_item, mergeProps({ name: __props.formItemName }, __props.fromItemExtraProps), {
30
+ default: withCtx(() => [createVNode(i18n_select_input_default, mergeProps(_ctx.$attrs, {
31
+ "i18n-text": i18nText.value,
32
+ "onUpdate:i18nText": _cache[0] || (_cache[0] = ($event) => i18nText.value = $event),
33
+ "input-extra-props": __props.inputExtraProps,
34
+ "i18n-config": __props.i18nConfig,
35
+ attr: Array.isArray(__props.formItemName) ? __props.formItemName.join(".") : __props.formItemName,
36
+ "placeholder-text": _ctx.$t("sys.inputText")
37
+ }), null, 16, [
38
+ "i18n-text",
39
+ "input-extra-props",
40
+ "i18n-config",
41
+ "attr",
42
+ "placeholder-text"
43
+ ])]),
44
+ _: 1
45
+ }, 16, ["name"]), createVNode(_component_a_form_item, {
46
+ name: "i18nConfig",
47
+ hidden: ""
48
+ }, {
49
+ default: withCtx(() => [createElementVNode("span", null, toDisplayString(__props.i18nConfig), 1)]),
50
+ _: 1
51
+ })], 64);
52
+ };
53
+ }
54
+ });
55
+ //#endregion
56
+ export { i18n_select_input_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default as default };
@@ -1,7 +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 };
1
+ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
2
+ import i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default from "./i18n-select-input.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs";
3
+ import './i18n-select-input.vue_vue_type_style_index_0_scoped_412e1309_lang.css';/* empty css */
4
+ //#region src/components/I18nSelect/src/i18n-select-input.vue
5
+ var i18n_select_input_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default, [["__scopeId", "data-v-412e1309"]]);
6
+ //#endregion
7
+ export { i18n_select_input_default as default };
@@ -0,0 +1,125 @@
1
+ import i18n_select_btn_default from "./i18n-select-btn.vue.mjs";
2
+ import { computed, createBlock, createCommentVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderSlot, resolveComponent, unref, withCtx } from "vue";
3
+ import { isEmpty, omit } from "lodash-es";
4
+ import { ButtonSize } from "@gct-paas/core";
5
+ import { onClickOutside } from "@vueuse/core";
6
+ //#region src/components/I18nSelect/src/i18n-select-input.vue?vue&type=script&setup=true&name=i18n-select-input&lang.ts
7
+ var i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default = /* @__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) emit("update:i18nText", value);
41
+ }
42
+ });
43
+ const i18nConfigState = computed(() => {
44
+ if (isEmpty(props.i18nConfig)) return {};
45
+ if (typeof props.i18nConfig === "string") return JSON.parse(props.i18nConfig) ?? {};
46
+ return props.i18nConfig ?? {};
47
+ });
48
+ const i18nValue = computed(() => {
49
+ return i18nConfigState.value?.[props.attr];
50
+ });
51
+ const handleSelectI18n = (params) => {
52
+ console.log("emit", params);
53
+ if (params) {
54
+ if (isEmpty(inputValue.value) || props.forceUpdate === true) emit("update:i18nText", params.i18nTitle);
55
+ emit("update:i18nConfig", JSON.stringify(isEmpty(params) ? omit(i18nConfigState.value, props.attr) : {
56
+ ...i18nConfigState.value,
57
+ [props.attr]: params.i18nKey
58
+ }));
59
+ emit("on-i18n-select", params);
60
+ }
61
+ };
62
+ const inputRef = ref();
63
+ const handleFocus = () => {
64
+ emit("focus", inputRef.value);
65
+ };
66
+ const handleBlur = () => {
67
+ emit("blur", inputRef.value);
68
+ };
69
+ const i18nInputGroup = ref();
70
+ onClickOutside(i18nInputGroup, () => {
71
+ emit("clickOutside");
72
+ });
73
+ return (_ctx, _cache) => {
74
+ const _component_a_input = resolveComponent("a-input");
75
+ const _component_a_input_group = resolveComponent("a-input-group");
76
+ return openBlock(), createBlock(_component_a_input_group, {
77
+ id: "i18nInputGroup",
78
+ ref_key: "i18nInputGroup",
79
+ ref: i18nInputGroup,
80
+ compact: ""
81
+ }, {
82
+ default: withCtx(() => [renderSlot(_ctx.$slots, "i18n-input", {}, () => [createVNode(_component_a_input, mergeProps({
83
+ ref_key: "inputRef",
84
+ ref: inputRef
85
+ }, __props.inputExtraProps, {
86
+ value: inputValue.value,
87
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
88
+ valueModifiers: { trim: true },
89
+ style: {
90
+ height: __props.btnHeight ? __props.btnHeight : __props.size === unref(ButtonSize).SMALL ? "26px" : "32px",
91
+ width: !isApp.value ? "100%" : `calc(100% - ${__props.btnWidth ? __props.btnWidth : __props.size === unref(ButtonSize).SMALL ? "26px" : "32px"}`
92
+ },
93
+ placeholder: __props.placeholderText,
94
+ size: __props.size,
95
+ "allow-clear": "",
96
+ onFocus: handleFocus,
97
+ onBlur: handleBlur
98
+ }), null, 16, [
99
+ "value",
100
+ "style",
101
+ "placeholder",
102
+ "size"
103
+ ])], true), isApp.value ? (openBlock(), createBlock(i18n_select_btn_default, {
104
+ key: 0,
105
+ "btn-height": __props.btnHeight,
106
+ "btn-width": __props.btnWidth,
107
+ "i18n-value": i18nValue.value,
108
+ size: __props.size,
109
+ "i18n-modal-key": __props.i18nModalKey,
110
+ onOnSelectI18n: handleSelectI18n,
111
+ onClosed: _cache[1] || (_cache[1] = ($event) => emit("clickOutside"))
112
+ }, null, 8, [
113
+ "btn-height",
114
+ "btn-width",
115
+ "i18n-value",
116
+ "size",
117
+ "i18n-modal-key"
118
+ ])) : createCommentVNode("", true)]),
119
+ _: 3
120
+ }, 512);
121
+ };
122
+ }
123
+ });
124
+ //#endregion
125
+ export { i18n_select_input_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default as default };
@@ -1,21 +1,5 @@
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 };
1
+ import i18n_select_modal_vue_vue_type_script_setup_true_lang_default from "./i18n-select-modal.vue_vue_type_script_setup_true_lang.mjs";
2
+ //#region src/components/I18nSelect/src/i18n-select-modal.vue
3
+ var i18n_select_modal_default = i18n_select_modal_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { i18n_select_modal_default as default };
@@ -0,0 +1,19 @@
1
+ import i18n_select_container_default from "./i18n-select-container.vue.mjs";
2
+ import { createBlock, defineComponent, openBlock, unref } from "vue";
3
+ import { useModal } from "@gct-paas/core-web";
4
+ //#region src/components/I18nSelect/src/i18n-select-modal.vue?vue&type=script&setup=true&lang.ts
5
+ var i18n_select_modal_vue_vue_type_script_setup_true_lang_default = /* @__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({ open });
13
+ return (_ctx, _cache) => {
14
+ return openBlock(), createBlock(i18n_select_container_default, { onRegister: unref(register) }, null, 8, ["onRegister"]);
15
+ };
16
+ }
17
+ });
18
+ //#endregion
19
+ export { i18n_select_modal_vue_vue_type_script_setup_true_lang_default as default };
@@ -1,57 +1,5 @@
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 };
1
+ import i18n_select_textarea_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default from "./i18n-select-textarea-form.vue_vue_type_script_setup_true_name_i18n-select-input-form_lang.mjs";
2
+ //#region src/components/I18nSelect/src/i18n-select-textarea-form.vue
3
+ var i18n_select_textarea_form_default = i18n_select_textarea_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default;
4
+ //#endregion
5
+ export { i18n_select_textarea_form_default as default };
@@ -0,0 +1,56 @@
1
+ import i18n_select_textarea_default from "./i18n-select-textarea.vue.mjs";
2
+ import { Fragment, computed, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, resolveComponent, toDisplayString, withCtx } from "vue";
3
+ //#region src/components/I18nSelect/src/i18n-select-textarea-form.vue?vue&type=script&setup=true&name=i18n-select-input-form&lang.ts
4
+ var i18n_select_textarea_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default = /* @__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, [createVNode(_component_a_form_item, mergeProps({ name: __props.formItemName }, __props.fromItemExtraProps), {
30
+ default: withCtx(() => [createVNode(i18n_select_textarea_default, mergeProps(_ctx.$attrs, {
31
+ "i18n-text": i18nText.value,
32
+ "onUpdate:i18nText": _cache[0] || (_cache[0] = ($event) => i18nText.value = $event),
33
+ "placeholder-text": _ctx.$t("sys.inputText"),
34
+ "input-extra-props": __props.inputExtraProps,
35
+ "i18n-config": __props.i18nConfig,
36
+ attr: Array.isArray(__props.formItemName) ? __props.formItemName.join(".") : __props.formItemName
37
+ }), null, 16, [
38
+ "i18n-text",
39
+ "placeholder-text",
40
+ "input-extra-props",
41
+ "i18n-config",
42
+ "attr"
43
+ ])]),
44
+ _: 1
45
+ }, 16, ["name"]), createVNode(_component_a_form_item, {
46
+ name: "i18nConfig",
47
+ hidden: ""
48
+ }, {
49
+ default: withCtx(() => [createElementVNode("span", null, toDisplayString(__props.i18nConfig), 1)]),
50
+ _: 1
51
+ })], 64);
52
+ };
53
+ }
54
+ });
55
+ //#endregion
56
+ export { i18n_select_textarea_form_vue_vue_type_script_setup_true_name_i18n_select_input_form_lang_default as default };
@@ -1,7 +1,7 @@
1
- import _sfc_main from './i18n-select-textarea.vue2.mjs';
2
- import './i18n-select-textarea.css';/* empty css */
3
- import _export_sfc from '../../../_virtual/_plugin-vue_export-helper.mjs';
4
-
5
- const I18nSelectTextarea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-cd95c416"]]);
6
-
7
- export { I18nSelectTextarea as default };
1
+ import _plugin_vue_export_helper_default from "../../../_virtual/_plugin-vue_export-helper.mjs";
2
+ import i18n_select_textarea_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default from "./i18n-select-textarea.vue_vue_type_script_setup_true_name_i18n-select-input_lang.mjs";
3
+ import './i18n-select-textarea.vue_vue_type_style_index_0_scoped_cd95c416_lang.css';/* empty css */
4
+ //#region src/components/I18nSelect/src/i18n-select-textarea.vue
5
+ var i18n_select_textarea_default = /* @__PURE__ */ _plugin_vue_export_helper_default(i18n_select_textarea_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default, [["__scopeId", "data-v-cd95c416"]]);
6
+ //#endregion
7
+ export { i18n_select_textarea_default as default };
@@ -0,0 +1,86 @@
1
+ import i18n_select_btn_default from "./i18n-select-btn.vue.mjs";
2
+ import { computed, createElementBlock, createVNode, defineComponent, mergeProps, openBlock, ref, resolveComponent } from "vue";
3
+ import { isEmpty, omit } from "lodash-es";
4
+ //#region src/components/I18nSelect/src/i18n-select-textarea.vue?vue&type=script&setup=true&name=i18n-select-input&lang.ts
5
+ var _hoisted_1 = { class: "inline-block w100% relative" };
6
+ var i18n_select_textarea_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default = /* @__PURE__ */ defineComponent({
7
+ __name: "i18n-select-textarea",
8
+ props: {
9
+ attr: {},
10
+ inputExtraProps: {},
11
+ i18nConfig: {},
12
+ i18nText: {},
13
+ placeholderText: {},
14
+ rows: {},
15
+ style: {}
16
+ },
17
+ emits: [
18
+ "update:i18nText",
19
+ "update:i18nConfig",
20
+ "on-i18n-select",
21
+ "clickOutside",
22
+ "focus"
23
+ ],
24
+ setup(__props, { emit: __emit }) {
25
+ const props = __props;
26
+ const emit = __emit;
27
+ const inputValue = computed({
28
+ get() {
29
+ return props.i18nText ?? "";
30
+ },
31
+ set(value) {
32
+ emit("update:i18nText", value);
33
+ }
34
+ });
35
+ const i18nConfigState = computed(() => {
36
+ if (isEmpty(props.i18nConfig)) return {};
37
+ if (typeof props.i18nConfig === "string") return JSON.parse(props.i18nConfig) ?? {};
38
+ return props.i18nConfig ?? {};
39
+ });
40
+ const i18nValue = computed(() => {
41
+ return i18nConfigState.value?.[props.attr];
42
+ });
43
+ const handleSelectI18n = (params) => {
44
+ if (params) {
45
+ if (isEmpty(inputValue.value)) emit("update:i18nText", params.i18nTitle);
46
+ emit("update:i18nConfig", JSON.stringify(isEmpty(params) ? omit(i18nConfigState.value, props.attr) : {
47
+ ...i18nConfigState.value,
48
+ [props.attr]: params.i18nKey
49
+ }));
50
+ emit("on-i18n-select", params);
51
+ }
52
+ };
53
+ const inputRef = ref();
54
+ const handleFocus = () => {
55
+ emit("focus", inputRef.value);
56
+ };
57
+ return (_ctx, _cache) => {
58
+ const _component_a_textarea = resolveComponent("a-textarea");
59
+ return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_a_textarea, mergeProps({
60
+ ref_key: "inputRef",
61
+ ref: inputRef,
62
+ value: inputValue.value,
63
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
64
+ placeholder: __props.placeholderText
65
+ }, __props.inputExtraProps, {
66
+ style: {
67
+ resize: "none",
68
+ ...__props.style
69
+ },
70
+ onFocus: handleFocus
71
+ }), null, 16, [
72
+ "value",
73
+ "placeholder",
74
+ "style"
75
+ ]), createVNode(i18n_select_btn_default, {
76
+ "i18n-value": i18nValue.value,
77
+ "simple-btn": true,
78
+ type: "text",
79
+ onOnSelectI18n: handleSelectI18n,
80
+ onClosed: _cache[1] || (_cache[1] = ($event) => emit("clickOutside"))
81
+ }, null, 8, ["i18n-value"])]);
82
+ };
83
+ }
84
+ });
85
+ //#endregion
86
+ export { i18n_select_textarea_vue_vue_type_script_setup_true_name_i18n_select_input_lang_default as default };
@@ -1,51 +1,46 @@
1
- import { ref, unref, createApp } from 'vue';
2
- import { has } from 'lodash-es';
3
- import _sfc_main from './i18n-select-modal.vue.mjs';
4
-
1
+ import i18n_select_modal_default from "./i18n-select-modal.vue.mjs";
2
+ import { createApp, ref, unref } from "vue";
3
+ import { has } from "lodash-es";
4
+ //#region src/components/I18nSelect/src/useI18nSelect.ts
5
5
  function useI18nSelect() {
6
- let app = null;
7
- let instance = null;
8
- const i18nModalKey = ref("");
9
- function open(params) {
10
- let props;
11
- let target = document.body;
12
- if (has(params, "target") || has(params, "props")) {
13
- const options = params;
14
- props = options.props || {};
15
- target = options.target || document.body;
16
- } else {
17
- props = params;
18
- }
19
- i18nModalKey.value = props.i18nModalKey || `i18n-select-modal-${Math.random().toString(16).substring(8)}`;
20
- const propsData = {
21
- ...props,
22
- destroyCallback: () => close(props?.destroyCallback),
23
- i18nModalKey: unref(i18nModalKey)
24
- };
25
- if (!app) {
26
- const container = document.createElement("div");
27
- container.id = unref(i18nModalKey);
28
- const t = unref(target);
29
- t?.appendChild(container);
30
- app = createApp(_sfc_main, propsData);
31
- instance = app.mount(container);
32
- }
33
- instance?.open();
34
- }
35
- function close(callback) {
36
- if (typeof callback === "function") {
37
- callback();
38
- }
39
- document.querySelector(`#${unref(i18nModalKey)}`).remove();
40
- if (app) {
41
- app.unmount();
42
- app = null;
43
- }
44
- }
45
- return {
46
- open,
47
- close
48
- };
6
+ let app = null;
7
+ let instance = null;
8
+ const i18nModalKey = ref("");
9
+ function open(params) {
10
+ let props;
11
+ let target = document.body;
12
+ if (has(params, "target") || has(params, "props")) {
13
+ const options = params;
14
+ props = options.props || {};
15
+ target = options.target || document.body;
16
+ } else props = params;
17
+ i18nModalKey.value = props.i18nModalKey || `i18n-select-modal-${Math.random().toString(16).substring(8)}`;
18
+ const propsData = {
19
+ ...props,
20
+ destroyCallback: () => close(props?.destroyCallback),
21
+ i18nModalKey: unref(i18nModalKey)
22
+ };
23
+ if (!app) {
24
+ const container = document.createElement("div");
25
+ container.id = unref(i18nModalKey);
26
+ unref(target)?.appendChild(container);
27
+ app = createApp(i18n_select_modal_default, propsData);
28
+ instance = app.mount(container);
29
+ }
30
+ instance?.open();
31
+ }
32
+ function close(callback) {
33
+ if (typeof callback === "function") callback();
34
+ document.querySelector(`#${unref(i18nModalKey)}`).remove();
35
+ if (app) {
36
+ app.unmount();
37
+ app = null;
38
+ }
39
+ }
40
+ return {
41
+ open,
42
+ close
43
+ };
49
44
  }
50
-
45
+ //#endregion
51
46
  export { useI18nSelect };
@@ -0,0 +1,8 @@
1
+ import "./I18nSelect/src/i18n-modal.vue.mjs";
2
+ import "./I18nSelect/src/useI18nSelect.mjs";
3
+ import "./I18nSelect/src/i18n-select-btn.vue.mjs";
4
+ import "./I18nSelect/src/i18n-select-input.vue.mjs";
5
+ import "./I18nSelect/src/i18n-select-input-form.vue.mjs";
6
+ import "./I18nSelect/src/i18n-select-textarea.vue.mjs";
7
+ import "./I18nSelect/src/i18n-select-textarea-form.vue.mjs";
8
+ import "./I18nSelect/index.mjs";