@gct-paas/design-web 0.1.4-dev.1 → 0.1.4-dev.10
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.mjs +1606 -0
- package/dist/index.min.cjs +57 -1
- package/dist/index.min.css +1 -0
- package/dist/index.system.min.js +57 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
- package/es/components/I18nSelect/index.d.ts +7 -0
- package/es/components/I18nSelect/src/i18n-modal.vue.d.ts +21 -0
- package/es/components/I18nSelect/src/i18n-modal.vue.mjs +151 -0
- package/es/components/I18nSelect/src/i18n-modal.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-btn.css +58 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue.d.ts +18 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-btn.vue2.mjs +138 -0
- package/es/components/I18nSelect/src/i18n-select-container.css +6 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue.d.ts +10 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-container.vue2.mjs +250 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.d.ts +15 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue.mjs +57 -0
- package/es/components/I18nSelect/src/i18n-select-input-form.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-input.css +3 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue.d.ts +51 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-input.vue2.mjs +129 -0
- package/es/components/{test-com/test-com.d.ts → I18nSelect/src/i18n-select-modal.vue.d.ts} +3 -2
- package/es/components/I18nSelect/src/i18n-select-modal.vue.mjs +21 -0
- package/es/components/I18nSelect/src/i18n-select-modal.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.d.ts +15 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue.mjs +57 -0
- package/es/components/I18nSelect/src/i18n-select-textarea-form.vue2.mjs +5 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.css +17 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.d.ts +26 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue.mjs +7 -0
- package/es/components/I18nSelect/src/i18n-select-textarea.vue2.mjs +93 -0
- package/es/components/I18nSelect/src/useI18nSelect.d.ts +13 -0
- package/es/components/I18nSelect/src/useI18nSelect.mjs +51 -0
- package/es/components/index.d.ts +1 -3
- package/es/index.d.ts +1 -0
- package/es/index.mjs +9 -7
- package/es/types/index.d.ts +4 -2
- package/package.json +17 -12
- package/dist/design-web.css +0 -1
- package/es/components/index.mjs +0 -4
- package/es/components/test-com/test-com.mjs +0 -21
- package/es/components/test-com/test-com.scss +0 -3
- package/es/components/test-vue-com/test-vue-com.vue +0 -15
- package/es/components/test-vue-com/test-vue-com.vue.d.ts +0 -2
- package/es/vite-env.d.ts +0 -1
|
@@ -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
|
-
|
|
2
|
-
|
|
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,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,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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InputProps, TextAreaProps } from 'ant-design-vue';
|
|
2
|
+
interface Props {
|
|
3
|
+
attr: string;
|
|
4
|
+
inputExtraProps?: InputProps | TextAreaProps;
|
|
5
|
+
i18nConfig?: string | Record<string, string>;
|
|
6
|
+
i18nText?: string;
|
|
7
|
+
placeholderText?: string;
|
|
8
|
+
rows?: number;
|
|
9
|
+
style?: object;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
"update:i18nText": (...args: any[]) => void;
|
|
13
|
+
"update:i18nConfig": (...args: any[]) => void;
|
|
14
|
+
"on-i18n-select": (...args: any[]) => void;
|
|
15
|
+
clickOutside: (...args: any[]) => void;
|
|
16
|
+
focus: (...args: any[]) => void;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
18
|
+
"onUpdate:i18nText"?: ((...args: any[]) => any) | undefined;
|
|
19
|
+
"onUpdate:i18nConfig"?: ((...args: any[]) => any) | undefined;
|
|
20
|
+
"onOn-i18n-select"?: ((...args: any[]) => any) | undefined;
|
|
21
|
+
onClickOutside?: ((...args: any[]) => any) | undefined;
|
|
22
|
+
onFocus?: ((...args: any[]) => any) | undefined;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
24
|
+
inputRef: unknown;
|
|
25
|
+
}, HTMLDivElement>;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +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 };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, resolveComponent, openBlock, createElementBlock, createVNode, mergeProps } from 'vue';
|
|
2
|
+
import I18nSelectBtn from './i18n-select-btn.vue.mjs';
|
|
3
|
+
import { isEmpty, omit } from 'lodash-es';
|
|
4
|
+
|
|
5
|
+
const _hoisted_1 = { class: "inline-block w100% relative" };
|
|
6
|
+
const _sfc_main = /* @__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)) {
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
if (typeof props.i18nConfig === "string") {
|
|
40
|
+
return JSON.parse(props.i18nConfig) ?? {};
|
|
41
|
+
}
|
|
42
|
+
return props.i18nConfig ?? {};
|
|
43
|
+
});
|
|
44
|
+
const i18nValue = computed(() => {
|
|
45
|
+
return i18nConfigState.value?.[props.attr];
|
|
46
|
+
});
|
|
47
|
+
const handleSelectI18n = (params) => {
|
|
48
|
+
if (params) {
|
|
49
|
+
if (isEmpty(inputValue.value)) {
|
|
50
|
+
emit("update:i18nText", params.i18nTitle);
|
|
51
|
+
}
|
|
52
|
+
emit(
|
|
53
|
+
"update:i18nConfig",
|
|
54
|
+
JSON.stringify(
|
|
55
|
+
isEmpty(params) ? omit(i18nConfigState.value, props.attr) : { ...i18nConfigState.value, [props.attr]: params.i18nKey }
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
emit("on-i18n-select", params);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const inputRef = ref();
|
|
62
|
+
const handleFocus = () => {
|
|
63
|
+
emit("focus", inputRef.value);
|
|
64
|
+
};
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
const _component_a_textarea = resolveComponent("a-textarea");
|
|
67
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
68
|
+
createVNode(_component_a_textarea, mergeProps({
|
|
69
|
+
ref_key: "inputRef",
|
|
70
|
+
ref: inputRef,
|
|
71
|
+
value: inputValue.value,
|
|
72
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
73
|
+
placeholder: __props.placeholderText
|
|
74
|
+
}, __props.inputExtraProps, {
|
|
75
|
+
style: {
|
|
76
|
+
resize: "none",
|
|
77
|
+
...__props.style
|
|
78
|
+
},
|
|
79
|
+
onFocus: handleFocus
|
|
80
|
+
}), null, 16, ["value", "placeholder", "style"]),
|
|
81
|
+
createVNode(I18nSelectBtn, {
|
|
82
|
+
"i18n-value": i18nValue.value,
|
|
83
|
+
"simple-btn": true,
|
|
84
|
+
type: "text",
|
|
85
|
+
onOnSelectI18n: handleSelectI18n,
|
|
86
|
+
onClosed: _cache[1] || (_cache[1] = ($event) => emit("clickOutside"))
|
|
87
|
+
}, null, 8, ["i18n-value"])
|
|
88
|
+
]);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface I18nSelectProps {
|
|
2
|
+
i18nModalKey?: string;
|
|
3
|
+
saveCallback?: (params: IObject) => void;
|
|
4
|
+
destroyCallback?: (params: IObject) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface IUseI18nSelectOptions {
|
|
7
|
+
target?: HTMLElement;
|
|
8
|
+
props?: Partial<I18nSelectProps>;
|
|
9
|
+
}
|
|
10
|
+
export declare function useI18nSelect(): {
|
|
11
|
+
open: (params: Partial<I18nSelectProps> | Partial<IUseI18nSelectOptions>) => void;
|
|
12
|
+
close: (callback: unknown) => void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ref, unref, createApp } from 'vue';
|
|
2
|
+
import { has } from 'lodash-es';
|
|
3
|
+
import _sfc_main from './i18n-select-modal.vue.mjs';
|
|
4
|
+
|
|
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
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { useI18nSelect };
|
package/es/components/index.d.ts
CHANGED
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { useI18nSelect } from './components/I18nSelect/src/useI18nSelect.mjs';
|
|
2
|
+
export { default as I18Modal } from './components/I18nSelect/src/i18n-modal.vue.mjs';
|
|
3
|
+
export { default as I18nSelectBtn } from './components/I18nSelect/src/i18n-select-btn.vue.mjs';
|
|
4
|
+
export { default as I18nSelectInput } from './components/I18nSelect/src/i18n-select-input.vue.mjs';
|
|
5
|
+
export { default as I18nSelectInputForm } from './components/I18nSelect/src/i18n-select-input-form.vue.mjs';
|
|
6
|
+
export { default as I18nSelectTextarea } from './components/I18nSelect/src/i18n-select-textarea.vue.mjs';
|
|
7
|
+
export { default as I18nSelectTextareaForm } from './components/I18nSelect/src/i18n-select-textarea-form.vue.mjs';
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
var index = {
|
|
9
|
+
const index = {
|
|
7
10
|
install(app) {
|
|
8
|
-
|
|
9
|
-
app.component(TestVueCom.name, TestVueCom);
|
|
11
|
+
console.log("Design Web install", app);
|
|
10
12
|
}
|
|
11
13
|
};
|
|
12
14
|
|
package/es/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/design-web",
|
|
3
|
-
"version": "0.1.4-dev.
|
|
3
|
+
"version": "0.1.4-dev.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台设计界面移动端底包",
|
|
6
6
|
"main": "dist/index.min.cjs",
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"author": "gct",
|
|
33
33
|
"scripts": {
|
|
34
|
-
"dev": "
|
|
35
|
-
"build": "
|
|
34
|
+
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|
|
35
|
+
"es:build": "vite build --config vite.dev.config.ts",
|
|
36
|
+
"build": "npm run lint && vite build --config vite.dev.config.ts && vite build --config vite.config.ts",
|
|
36
37
|
"lint": "eslint src/",
|
|
37
38
|
"publish:next": "npm run build && npm publish --access public --tag=next --registry=https://registry.npmjs.org/",
|
|
38
39
|
"publish:dev": "npm run build && npm publish --access public --tag=dev --registry=https://registry.npmjs.org/",
|
|
@@ -41,16 +42,20 @@
|
|
|
41
42
|
"publish:npm": "npm run build && npm publish --access public --registry=https://registry.npmjs.org/"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@gct-paas/
|
|
46
|
-
"@gct-paas/core
|
|
47
|
-
"@gct-paas/
|
|
48
|
-
"@gct-paas/
|
|
49
|
-
"@gct-paas/
|
|
50
|
-
"
|
|
45
|
+
"@ant-design/icons-vue": "^6.1.0",
|
|
46
|
+
"@gct-paas/api": "0.1.0-dev.8",
|
|
47
|
+
"@gct-paas/core": "0.1.4-dev.10",
|
|
48
|
+
"@gct-paas/core-web": "0.1.4-dev.10",
|
|
49
|
+
"@gct-paas/design": "0.1.4-dev.10",
|
|
50
|
+
"@gct-paas/schema": "0.1.4-dev.10",
|
|
51
|
+
"@gct-paas/scss": "0.1.4-dev.10",
|
|
52
|
+
"@vueuse/core": "^14.1.0",
|
|
53
|
+
"ant-design-vue": "3.2.20",
|
|
54
|
+
"vue": "^3.5.29"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
53
|
-
"
|
|
57
|
+
"@gct-paas/build": "^0.1.5-dev.8",
|
|
58
|
+
"sass": "^1.97.3"
|
|
54
59
|
},
|
|
55
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "e707c6d6332e7e83a3d5df97b37f619065d8ea39"
|
|
56
61
|
}
|
package/dist/design-web.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.gct-test-com{background-color:#0ff}
|
package/es/components/index.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineComponent, createVNode, createTextVNode } from 'vue';
|
|
2
|
-
import { useNamespace } from '@gct-paas/core';
|
|
3
|
-
import './test-com.scss';
|
|
4
|
-
|
|
5
|
-
"use strict";
|
|
6
|
-
const TestCom = /* @__PURE__ */ defineComponent({
|
|
7
|
-
name: "TestCom",
|
|
8
|
-
setup() {
|
|
9
|
-
const ns = useNamespace("test-com");
|
|
10
|
-
return {
|
|
11
|
-
ns
|
|
12
|
-
};
|
|
13
|
-
},
|
|
14
|
-
render() {
|
|
15
|
-
return createVNode("div", {
|
|
16
|
-
"class": this.ns.b()
|
|
17
|
-
}, [createTextVNode("TestCom")]);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export { TestCom };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="ns.b()">
|
|
3
|
-
<div>{{ msg }}</div>
|
|
4
|
-
<div>{{ msg2 }}</div>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
<script setup lang="ts" name="test-vue-com">
|
|
8
|
-
import { useNamespace } from '@gct-paas/core';
|
|
9
|
-
import { ref } from 'vue';
|
|
10
|
-
|
|
11
|
-
const ns = useNamespace('test-vue-com');
|
|
12
|
-
|
|
13
|
-
const msg = ref('Hello World!');
|
|
14
|
-
const msg2 = ref('Hello World2!');
|
|
15
|
-
</script>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
-
export default _default;
|
package/es/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|