hzzt-plus 2.0.0 → 2.0.1
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/attributes.json +1 -1
- package/dist/index.full.js +20 -14
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +8 -8
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +20 -14
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/input-range/index.mjs +2 -2
- package/es/components/input-range/src/input-range.mjs +76 -26
- package/es/components/input-range/src/input-range.mjs.map +1 -1
- package/es/components/input-range/src/input-range2.mjs +26 -76
- package/es/components/input-range/src/input-range2.mjs.map +1 -1
- package/es/components/scroll/index.mjs +2 -2
- package/es/components/scroll/src/scroll.mjs +86 -0
- package/es/components/scroll/src/scroll.mjs.map +1 -1
- package/es/components/scroll/src/scroll2.mjs +0 -86
- package/es/components/scroll/src/scroll2.mjs.map +1 -1
- package/es/components/select-input/index.d.ts +4 -4
- package/es/components/select-input/src/select-input.d.ts +1 -1
- package/es/components/select-input/src/select-input.mjs +1 -1
- package/es/components/select-input/src/select-input.mjs.map +1 -1
- package/es/components/select-input/src/select-input.vue.d.ts +4 -4
- package/es/components/select-input/src/select-input2.mjs +2 -2
- package/es/components/select-input/src/select-input2.mjs.map +1 -1
- package/es/components/select-textarea/index.mjs +2 -2
- package/es/components/select-textarea/src/select-textarea.d.ts +2 -1
- package/es/components/select-textarea/src/select-textarea.mjs +31 -100
- package/es/components/select-textarea/src/select-textarea.mjs.map +1 -1
- package/es/components/select-textarea/src/select-textarea.vue.d.ts +14 -4
- package/es/components/select-textarea/src/select-textarea2.mjs +105 -30
- package/es/components/select-textarea/src/select-textarea2.mjs.map +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/input-range/index.js +2 -2
- package/lib/components/input-range/src/input-range.js +76 -27
- package/lib/components/input-range/src/input-range.js.map +1 -1
- package/lib/components/input-range/src/input-range2.js +27 -76
- package/lib/components/input-range/src/input-range2.js.map +1 -1
- package/lib/components/scroll/index.js +2 -2
- package/lib/components/scroll/src/scroll.js +89 -0
- package/lib/components/scroll/src/scroll.js.map +1 -1
- package/lib/components/scroll/src/scroll2.js +0 -89
- package/lib/components/scroll/src/scroll2.js.map +1 -1
- package/lib/components/select-input/index.d.ts +4 -4
- package/lib/components/select-input/src/select-input.d.ts +1 -1
- package/lib/components/select-input/src/select-input.js +1 -1
- package/lib/components/select-input/src/select-input.js.map +1 -1
- package/lib/components/select-input/src/select-input.vue.d.ts +4 -4
- package/lib/components/select-input/src/select-input2.js +2 -2
- package/lib/components/select-input/src/select-input2.js.map +1 -1
- package/lib/components/select-textarea/index.js +2 -2
- package/lib/components/select-textarea/src/select-textarea.d.ts +2 -1
- package/lib/components/select-textarea/src/select-textarea.js +32 -100
- package/lib/components/select-textarea/src/select-textarea.js.map +1 -1
- package/lib/components/select-textarea/src/select-textarea.vue.d.ts +14 -4
- package/lib/components/select-textarea/src/select-textarea2.js +105 -31
- package/lib/components/select-textarea/src/select-textarea2.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"scroll2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -4,7 +4,7 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
|
|
|
4
4
|
disabled: BooleanConstructor;
|
|
5
5
|
replace: BooleanConstructor;
|
|
6
6
|
label: StringConstructor;
|
|
7
|
-
|
|
7
|
+
options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
8
8
|
inputProps: ObjectConstructor;
|
|
9
9
|
customProps: ObjectConstructor;
|
|
10
10
|
position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -28,7 +28,7 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
|
|
|
28
28
|
disabled: BooleanConstructor;
|
|
29
29
|
replace: BooleanConstructor;
|
|
30
30
|
label: StringConstructor;
|
|
31
|
-
|
|
31
|
+
options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
32
32
|
inputProps: ObjectConstructor;
|
|
33
33
|
customProps: ObjectConstructor;
|
|
34
34
|
position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -831,7 +831,7 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
|
|
|
831
831
|
disabled: BooleanConstructor;
|
|
832
832
|
replace: BooleanConstructor;
|
|
833
833
|
label: StringConstructor;
|
|
834
|
-
|
|
834
|
+
options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]) | ((new (...args: any[]) => import("..").OptionType[]) | (() => import("..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
835
835
|
inputProps: ObjectConstructor;
|
|
836
836
|
customProps: ObjectConstructor;
|
|
837
837
|
position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -854,10 +854,10 @@ export declare const HzztSelectInput: import("hzzt-plus/es/utils").SFCWithInstal
|
|
|
854
854
|
onInput?: ((value: string | undefined) => any) | undefined;
|
|
855
855
|
}, {
|
|
856
856
|
disabled: boolean;
|
|
857
|
+
options: import("..").OptionType[];
|
|
857
858
|
modelValue: import("hzzt-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
858
859
|
replace: boolean;
|
|
859
860
|
split: string;
|
|
860
|
-
data: import("..").OptionType[];
|
|
861
861
|
position: string;
|
|
862
862
|
indexType: string;
|
|
863
863
|
}>> & Record<string, any>;
|
|
@@ -7,7 +7,7 @@ export declare const selectInputProps: {
|
|
|
7
7
|
disabled: BooleanConstructor;
|
|
8
8
|
replace: BooleanConstructor;
|
|
9
9
|
label: StringConstructor;
|
|
10
|
-
|
|
10
|
+
options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
11
11
|
inputProps: ObjectConstructor;
|
|
12
12
|
customProps: ObjectConstructor;
|
|
13
13
|
position: import("hzzt-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-input.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.ts"],"sourcesContent":["import {buildProps, definePropType, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectInput from './select-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\nimport {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\nexport const selectInputProps = buildProps({\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n indexType: {\n type: String,\n default: 'number',\n },\n disabled: Boolean,\n replace: Boolean,\n label: String,\n
|
|
1
|
+
{"version":3,"file":"select-input.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.ts"],"sourcesContent":["import {buildProps, definePropType, isString} from '@hzzt-plus/utils'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectInput from './select-input.vue'\nimport {UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\nimport {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\nexport const selectInputProps = buildProps({\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n indexType: {\n type: String,\n default: 'number',\n },\n disabled: Boolean,\n replace: Boolean,\n label: String,\n options: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n customProps: Object,\n position: {\n type: String,\n default: 'left',\n },\n formatLabel: {\n type: Function,\n },\n split: {\n type: String,\n default: '',\n },\n size: useSizeProp,\n})\n\nexport type SelectInputProps = ExtractPropTypes<typeof selectInputProps>\n\nexport const selectInputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string | undefined) => isString(value),\n input: (value: string | undefined) => isString(value),\n change: (value: string | undefined) => isString(value),\n}\nexport type SelectInputEmits = typeof selectInputEmits\n\nexport type SelectInputInstance = InstanceType<typeof SelectInput>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,gBAAgB,GAAG,UAAU,CAAC;AAC3C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,QAAQ;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE,WAAW;AACnB,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG;AAChC,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACnC,EAAE,MAAM,EAAE,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AACpC;;;;"}
|
|
@@ -5,7 +5,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5
5
|
disabled: BooleanConstructor;
|
|
6
6
|
replace: BooleanConstructor;
|
|
7
7
|
label: StringConstructor;
|
|
8
|
-
|
|
8
|
+
options: import("../../../utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
9
9
|
inputProps: ObjectConstructor;
|
|
10
10
|
customProps: ObjectConstructor;
|
|
11
11
|
position: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -29,7 +29,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
29
|
disabled: BooleanConstructor;
|
|
30
30
|
replace: BooleanConstructor;
|
|
31
31
|
label: StringConstructor;
|
|
32
|
-
|
|
32
|
+
options: import("../../../utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
33
33
|
inputProps: ObjectConstructor;
|
|
34
34
|
customProps: ObjectConstructor;
|
|
35
35
|
position: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -832,7 +832,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
832
832
|
disabled: BooleanConstructor;
|
|
833
833
|
replace: BooleanConstructor;
|
|
834
834
|
label: StringConstructor;
|
|
835
|
-
|
|
835
|
+
options: import("../../../utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
836
836
|
inputProps: ObjectConstructor;
|
|
837
837
|
customProps: ObjectConstructor;
|
|
838
838
|
position: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, string, boolean>;
|
|
@@ -855,10 +855,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
855
855
|
onInput?: ((value: string | undefined) => any) | undefined;
|
|
856
856
|
}, {
|
|
857
857
|
disabled: boolean;
|
|
858
|
+
options: OptionType[];
|
|
858
859
|
modelValue: import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
859
860
|
replace: boolean;
|
|
860
861
|
split: string;
|
|
861
|
-
data: OptionType[];
|
|
862
862
|
position: string;
|
|
863
863
|
indexType: string;
|
|
864
864
|
}>;
|
|
@@ -104,8 +104,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
104
104
|
_: 3
|
|
105
105
|
}, 16, ["class", "modelValue"])
|
|
106
106
|
], 2),
|
|
107
|
-
_ctx.
|
|
108
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.
|
|
107
|
+
_ctx.options.length && !unref(trueDisabled) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
108
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
|
|
109
109
|
return openBlock(), createBlock(unref(ElLink), mergeProps({
|
|
110
110
|
key: index,
|
|
111
111
|
class: "margin-r-4"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-input2.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div :class=\"inputContainerCls\">\n <slot name=\"title\">\n <hzzt-title :label=\"label\"></hzzt-title>\n </slot>\n <el-input ref=\"inputRef\"\n :class=\"inputCls\"\n v-model=\"inputVal\"\n v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"\n >\n <template slot=\"append\">\n <slot name=\"append\"></slot>\n </template>\n </el-input>\n </div>\n <div v-if=\"
|
|
1
|
+
{"version":3,"file":"select-input2.mjs","sources":["../../../../../../packages/components/select-input/src/select-input.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div :class=\"inputContainerCls\">\n <slot name=\"title\">\n <hzzt-title :label=\"label\"></hzzt-title>\n </slot>\n <el-input ref=\"inputRef\"\n :class=\"inputCls\"\n v-model=\"inputVal\"\n v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"\n >\n <template slot=\"append\">\n <slot name=\"append\"></slot>\n </template>\n </el-input>\n </div>\n <div v-if=\"options.length&&!trueDisabled\">\n <el-link v-for=\"(item, index) in options\" :key=\"index\" class=\"margin-r-4\" v-bind=\"customProps\" @click=\"select(item)\">\n {{ getLinkName(item, index) }}\n </el-link>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {computed, ref, watch} from 'vue'\n import {selectInputEmits, selectInputProps} from './select-input'\n import {useGlobalSize, useNamespace, numberToLetter} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import HzztTitle from \"@hzzt-plus/components/title/src/title.vue\";\n import {ElInput, ElLink} from 'element-plus'\n import {OptionType} from \"@hzzt-plus/components/select/src/select\";\n\n defineOptions({\n name: 'HzztSelectInput',\n })\n\n const props = defineProps(selectInputProps)\n const emit = defineEmits(selectInputEmits)\n\n const inputVal = ref(props.modelValue);\n\n const nsInput = useNamespace('select-input')\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n const inputContainerCls = computed(() => [\n 'flex',\n props.position === 'top' ? 'column' : 'row align-items-center'\n ])\n\n const inputCls = computed(() => [\n 'flex-1',\n props.label ? props.position === 'top' ? 'margin-b-1' : 'margin-l-1' : ''\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n })\n\n function input(val: string) {\n emit('update:modelValue', val);\n emit('input', val);\n }\n\n function change(val: string) {\n emit('change', val);\n }\n\n function getLinkName(item: OptionType, index: number) {\n let prefix = '';\n if (props.indexType == 'number') {\n prefix = `(${index + 1})`\n } else if (props.indexType == 'letter') {\n prefix = `(${numberToLetter(index)})`\n }\n return prefix + (item.label || item.value);\n }\n\n function select(item: OptionType) {\n const value = item.value||item.label;\n let content = '';\n if (!inputVal.value) inputVal.value = '';\n if (props.formatLabel) {\n content = props.formatLabel(value);\n } else if (props.replace) {\n content = value;\n } else {\n content = inputVal.value ? `${inputVal.value}${props.split}${value}` : value;\n }\n inputVal.value = content;\n input(content);\n change(content);\n }\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import SelectTextarea from './src/select-
|
|
3
|
-
export { selectTextareaEmits, selectTextareaProps } from './src/select-
|
|
2
|
+
import SelectTextarea from './src/select-textarea2.mjs';
|
|
3
|
+
export { selectTextareaEmits, selectTextareaProps } from './src/select-textarea.mjs';
|
|
4
4
|
import { withInstall } from '../../utils/vue/install.mjs';
|
|
5
5
|
|
|
6
6
|
const HzztSelectTextarea = withInstall(SelectTextarea);
|
|
@@ -10,8 +10,9 @@ export declare const selectTextareaProps: {
|
|
|
10
10
|
};
|
|
11
11
|
disabled: BooleanConstructor;
|
|
12
12
|
label: StringConstructor;
|
|
13
|
-
|
|
13
|
+
options: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => OptionType[]) | (() => OptionType[]) | ((new (...args: any[]) => OptionType[]) | (() => OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
14
14
|
inputProps: ObjectConstructor;
|
|
15
|
+
selectProps: ObjectConstructor;
|
|
15
16
|
replace: BooleanConstructor;
|
|
16
17
|
modelValue: import("hzzt-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, string, boolean>;
|
|
17
18
|
};
|
|
@@ -1,106 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { selectTextareaProps, selectTextareaEmits } from './select-textarea2.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
3
2
|
import '../../../hooks/index.mjs';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import '../../../constants/index.mjs';
|
|
4
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
5
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
|
6
|
+
import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
|
7
|
+
import { isString } from '@vue/shared';
|
|
8
|
+
import { isNumber, isBoolean } from '../../../utils/types.mjs';
|
|
10
9
|
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
29
|
-
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
30
|
-
const containerCls = computed(() => [
|
|
31
|
-
nsInput.b(),
|
|
32
|
-
nsInput.m(trueSize.value)
|
|
33
|
-
]);
|
|
34
|
-
const _inputProps = computed(() => ({
|
|
35
|
-
disabled: trueDisabled.value,
|
|
36
|
-
clearable: true,
|
|
37
|
-
...props.inputProps,
|
|
38
|
-
type: "textarea"
|
|
39
|
-
}));
|
|
40
|
-
watch(() => props.modelValue, (v) => {
|
|
41
|
-
inputVal.value = v;
|
|
42
|
-
});
|
|
43
|
-
function input(val) {
|
|
44
|
-
emit("update:modelValue", val);
|
|
45
|
-
emit("input", val);
|
|
46
|
-
}
|
|
47
|
-
function change(val) {
|
|
48
|
-
emit("change", val);
|
|
49
|
-
}
|
|
50
|
-
function selectChange(val) {
|
|
51
|
-
if (!inputVal.value && inputVal.value !== 0)
|
|
52
|
-
inputVal.value = "";
|
|
53
|
-
selectValue.value = "";
|
|
54
|
-
let content = val;
|
|
55
|
-
if (!props.replace) {
|
|
56
|
-
const inputEl = inputRef.value.$el.getElementsByTagName("textarea")[0];
|
|
57
|
-
content = insertCursorPosition(inputEl, val);
|
|
58
|
-
}
|
|
59
|
-
input(content);
|
|
60
|
-
change(content);
|
|
61
|
-
emit("select", val);
|
|
62
|
-
}
|
|
63
|
-
return (_ctx, _cache) => {
|
|
64
|
-
return openBlock(), createElementBlock("div", {
|
|
65
|
-
class: normalizeClass(unref(containerCls))
|
|
66
|
-
}, [
|
|
67
|
-
createElementVNode("div", _hoisted_1, [
|
|
68
|
-
createElementVNode("div", _hoisted_2, [
|
|
69
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
70
|
-
createVNode(HzztTitle, {
|
|
71
|
-
class: "margin-l-1",
|
|
72
|
-
label: _ctx.label
|
|
73
|
-
}, null, 8, ["label"])
|
|
74
|
-
]),
|
|
75
|
-
!unref(trueDisabled) ? (openBlock(), createBlock(unref(ElSelectV2), {
|
|
76
|
-
key: 0,
|
|
77
|
-
class: "flex-1",
|
|
78
|
-
modelValue: selectValue.value,
|
|
79
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
|
|
80
|
-
"allow-create": "",
|
|
81
|
-
filterable: "",
|
|
82
|
-
clearable: "",
|
|
83
|
-
onChange: selectChange,
|
|
84
|
-
options: _ctx.data
|
|
85
|
-
}, null, 8, ["modelValue", "options"])) : createCommentVNode("v-if", true),
|
|
86
|
-
renderSlot(_ctx.$slots, "right")
|
|
87
|
-
]),
|
|
88
|
-
createVNode(unref(ElInput), mergeProps({
|
|
89
|
-
ref_key: "inputRef",
|
|
90
|
-
ref: inputRef,
|
|
91
|
-
class: "flex-1 margin-t-1",
|
|
92
|
-
modelValue: inputVal.value,
|
|
93
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
|
|
94
|
-
}, unref(_inputProps), {
|
|
95
|
-
onInput: input,
|
|
96
|
-
onChange: change
|
|
97
|
-
}), null, 16, ["modelValue"])
|
|
98
|
-
])
|
|
99
|
-
], 2);
|
|
100
|
-
};
|
|
10
|
+
const selectTextareaProps = buildProps({
|
|
11
|
+
size: useSizeProp,
|
|
12
|
+
disabled: Boolean,
|
|
13
|
+
label: String,
|
|
14
|
+
options: {
|
|
15
|
+
type: definePropType(Array),
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
inputProps: Object,
|
|
19
|
+
selectProps: Object,
|
|
20
|
+
replace: Boolean,
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: definePropType([
|
|
23
|
+
String,
|
|
24
|
+
Number
|
|
25
|
+
]),
|
|
26
|
+
default: ""
|
|
101
27
|
}
|
|
102
28
|
});
|
|
103
|
-
|
|
29
|
+
const selectTextareaEmits = {
|
|
30
|
+
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
31
|
+
[CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
32
|
+
[INPUT_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
33
|
+
select: (val) => isString(val) || isNumber(val) || isBoolean(val)
|
|
34
|
+
};
|
|
104
35
|
|
|
105
|
-
export {
|
|
36
|
+
export { selectTextareaEmits, selectTextareaProps };
|
|
106
37
|
//# sourceMappingURL=select-textarea.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-textarea.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.
|
|
1
|
+
{"version":3,"file":"select-textarea.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.ts"],"sourcesContent":["import {buildProps, definePropType, isString, isNumber, isBoolean} from '@hzzt-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type SelectTextarea from './select-textarea.vue'\nimport {useSizeProp} from \"@hzzt-plus/hooks\";\nimport {OptionType} from \"@hzzt-plus/components\";\nimport {CHANGE_EVENT, INPUT_EVENT, UPDATE_MODEL_EVENT} from \"@hzzt-plus/constants\";\n\nexport const selectTextareaProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n label: String,\n options: {\n type: definePropType<OptionType[]>(Array),\n default: () => [],\n },\n inputProps: Object,\n selectProps: Object,\n replace: Boolean,\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n ]),\n default: '',\n },\n})\n\nexport type SelectTextareaProps = ExtractPropTypes<typeof selectTextareaProps>\n\nexport const selectTextareaEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [INPUT_EVENT]: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n select: (val: string | number | boolean | undefined) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\nexport type SelectTextareaEmits = typeof selectTextareaEmits\n\nexport type SelectTextareaInstance = InstanceType<typeof SelectTextarea>\n"],"names":[],"mappings":";;;;;;;;;AAGY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,UAAU,EAAE,MAAM;AACpB,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC;AACzB,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,KAAK,CAAC;AACN,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,mBAAmB,GAAG;AACnC,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AAC1E,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACnE;;;;"}
|
|
@@ -7,8 +7,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
};
|
|
8
8
|
disabled: BooleanConstructor;
|
|
9
9
|
label: StringConstructor;
|
|
10
|
-
|
|
10
|
+
options: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("../..").OptionType[]) | (() => import("../..").OptionType[]) | ((new (...args: any[]) => import("../..").OptionType[]) | (() => import("../..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
11
11
|
inputProps: ObjectConstructor;
|
|
12
|
+
selectProps: ObjectConstructor;
|
|
12
13
|
replace: BooleanConstructor;
|
|
13
14
|
modelValue: import("../../../utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, string, boolean>;
|
|
14
15
|
}, {
|
|
@@ -21,8 +22,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
21
22
|
};
|
|
22
23
|
disabled: BooleanConstructor;
|
|
23
24
|
label: StringConstructor;
|
|
24
|
-
|
|
25
|
+
options: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("../..").OptionType[]) | (() => import("../..").OptionType[]) | ((new (...args: any[]) => import("../..").OptionType[]) | (() => import("../..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
25
26
|
inputProps: ObjectConstructor;
|
|
27
|
+
selectProps: ObjectConstructor;
|
|
26
28
|
replace: BooleanConstructor;
|
|
27
29
|
modelValue: import("../../../utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, string, boolean>;
|
|
28
30
|
}>> & {
|
|
@@ -63,6 +65,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
63
65
|
disabled: boolean;
|
|
64
66
|
clearable: boolean;
|
|
65
67
|
}>;
|
|
68
|
+
_selectProps: import("vue").ComputedRef<{
|
|
69
|
+
options: import("../..").OptionType[];
|
|
70
|
+
size: "" | "default" | "small" | "large";
|
|
71
|
+
filterable: boolean;
|
|
72
|
+
clearable: boolean;
|
|
73
|
+
allowCreate: boolean;
|
|
74
|
+
}>;
|
|
66
75
|
input: (val: string) => void;
|
|
67
76
|
change: (val: string) => void;
|
|
68
77
|
selectChange: (val: string) => void;
|
|
@@ -13096,8 +13105,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13096
13105
|
};
|
|
13097
13106
|
disabled: BooleanConstructor;
|
|
13098
13107
|
label: StringConstructor;
|
|
13099
|
-
|
|
13108
|
+
options: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("../..").OptionType[]) | (() => import("../..").OptionType[]) | ((new (...args: any[]) => import("../..").OptionType[]) | (() => import("../..").OptionType[]))[], unknown, unknown, () => never[], boolean>;
|
|
13100
13109
|
inputProps: ObjectConstructor;
|
|
13110
|
+
selectProps: ObjectConstructor;
|
|
13101
13111
|
replace: BooleanConstructor;
|
|
13102
13112
|
modelValue: import("../../../utils").EpPropFinalized<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown, string, boolean>;
|
|
13103
13113
|
}>> & {
|
|
@@ -13107,8 +13117,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13107
13117
|
onSelect?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
13108
13118
|
}, {
|
|
13109
13119
|
disabled: boolean;
|
|
13120
|
+
options: import("../..").OptionType[];
|
|
13110
13121
|
modelValue: import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined) | ((new (...args: any[]) => (string | number | null | undefined) & {}) | (() => string | number | null | undefined))[], unknown, unknown>;
|
|
13111
13122
|
replace: boolean;
|
|
13112
|
-
data: import("../..").OptionType[];
|
|
13113
13123
|
}>;
|
|
13114
13124
|
export default _default;
|
|
@@ -1,36 +1,111 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createVNode, createBlock, mergeProps, createCommentVNode } from 'vue';
|
|
2
|
+
import { selectTextareaProps, selectTextareaEmits } from './select-textarea.mjs';
|
|
2
3
|
import '../../../hooks/index.mjs';
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { useFormSize, useFormDisabled, ElSelectV2, ElInput } from 'element-plus';
|
|
5
|
+
import HzztTitle from '../../title/src/title2.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
+
import { useGlobalSize } from '../../../hooks/use-size/index.mjs';
|
|
9
|
+
import { insertCursorPosition } from '../../../hooks/use-cursor/index.mjs';
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
const _hoisted_1 = { class: "flex column" };
|
|
12
|
+
const _hoisted_2 = { class: "flex align-items-center" };
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: "HzztSelectTextarea"
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: selectTextareaProps,
|
|
19
|
+
emits: selectTextareaEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const inputVal = ref(props.modelValue);
|
|
23
|
+
const selectValue = ref("");
|
|
24
|
+
const inputRef = ref();
|
|
25
|
+
const nsInput = useNamespace("select-textarea");
|
|
26
|
+
const formSize = useFormSize();
|
|
27
|
+
const formDisabled = useFormDisabled();
|
|
28
|
+
const trueSize = computed(() => props.size || formSize.value || useGlobalSize().value);
|
|
29
|
+
const trueDisabled = computed(() => props.disabled || formDisabled.value);
|
|
30
|
+
const containerCls = computed(() => [
|
|
31
|
+
nsInput.b(),
|
|
32
|
+
nsInput.m(trueSize.value)
|
|
33
|
+
]);
|
|
34
|
+
const _inputProps = computed(() => ({
|
|
35
|
+
disabled: trueDisabled.value,
|
|
36
|
+
clearable: true,
|
|
37
|
+
...props.inputProps,
|
|
38
|
+
type: "textarea"
|
|
39
|
+
}));
|
|
40
|
+
const _selectProps = computed(() => ({
|
|
41
|
+
options: props.options,
|
|
42
|
+
size: trueSize.value,
|
|
43
|
+
filterable: true,
|
|
44
|
+
clearable: true,
|
|
45
|
+
allowCreate: true,
|
|
46
|
+
...props.selectProps
|
|
47
|
+
}));
|
|
48
|
+
watch(() => props.modelValue, (v) => {
|
|
49
|
+
inputVal.value = v;
|
|
50
|
+
});
|
|
51
|
+
function input(val) {
|
|
52
|
+
emit("update:modelValue", val);
|
|
53
|
+
emit("input", val);
|
|
54
|
+
}
|
|
55
|
+
function change(val) {
|
|
56
|
+
emit("change", val);
|
|
57
|
+
}
|
|
58
|
+
function selectChange(val) {
|
|
59
|
+
if (!inputVal.value && inputVal.value !== 0)
|
|
60
|
+
inputVal.value = "";
|
|
61
|
+
selectValue.value = "";
|
|
62
|
+
let content = val;
|
|
63
|
+
if (!props.replace) {
|
|
64
|
+
const inputEl = inputRef.value.$el.getElementsByTagName("textarea")[0];
|
|
65
|
+
content = insertCursorPosition(inputEl, val);
|
|
66
|
+
}
|
|
67
|
+
input(content);
|
|
68
|
+
change(content);
|
|
69
|
+
emit("select", val);
|
|
70
|
+
}
|
|
71
|
+
return (_ctx, _cache) => {
|
|
72
|
+
return openBlock(), createElementBlock("div", {
|
|
73
|
+
class: normalizeClass(unref(containerCls))
|
|
74
|
+
}, [
|
|
75
|
+
createElementVNode("div", _hoisted_1, [
|
|
76
|
+
createElementVNode("div", _hoisted_2, [
|
|
77
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
78
|
+
createVNode(HzztTitle, {
|
|
79
|
+
size: unref(trueSize),
|
|
80
|
+
class: "margin-l-1",
|
|
81
|
+
label: _ctx.label
|
|
82
|
+
}, null, 8, ["size", "label"])
|
|
83
|
+
]),
|
|
84
|
+
!unref(trueDisabled) ? (openBlock(), createBlock(unref(ElSelectV2), mergeProps({
|
|
85
|
+
key: 0,
|
|
86
|
+
class: "flex-1",
|
|
87
|
+
modelValue: selectValue.value,
|
|
88
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectValue.value = $event),
|
|
89
|
+
onChange: selectChange
|
|
90
|
+
}, unref(_selectProps)), null, 16, ["modelValue"])) : createCommentVNode("v-if", true),
|
|
91
|
+
renderSlot(_ctx.$slots, "right")
|
|
92
|
+
]),
|
|
93
|
+
createVNode(unref(ElInput), mergeProps({
|
|
94
|
+
ref_key: "inputRef",
|
|
95
|
+
ref: inputRef,
|
|
96
|
+
class: "flex-1 margin-t-1",
|
|
97
|
+
modelValue: inputVal.value,
|
|
98
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputVal.value = $event)
|
|
99
|
+
}, unref(_inputProps), {
|
|
100
|
+
onInput: input,
|
|
101
|
+
onChange: change
|
|
102
|
+
}), null, 16, ["modelValue"])
|
|
103
|
+
])
|
|
104
|
+
], 2);
|
|
105
|
+
};
|
|
26
106
|
}
|
|
27
107
|
});
|
|
28
|
-
|
|
29
|
-
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
30
|
-
[CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
31
|
-
[INPUT_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
32
|
-
select: (val) => isString(val) || isNumber(val) || isBoolean(val)
|
|
33
|
-
};
|
|
108
|
+
var SelectTextarea = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "select-textarea.vue"]]);
|
|
34
109
|
|
|
35
|
-
export {
|
|
110
|
+
export { SelectTextarea as default };
|
|
36
111
|
//# sourceMappingURL=select-textarea2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-textarea2.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.
|
|
1
|
+
{"version":3,"file":"select-textarea2.mjs","sources":["../../../../../../packages/components/select-textarea/src/select-textarea.vue"],"sourcesContent":["<template>\n <div :class=\"containerCls\">\n <div class=\"flex column\">\n <div class=\"flex align-items-center\">\n <slot name=\"title\">\n <hzzt-title :size=\"trueSize\" class=\"margin-l-1\" :label=\"label\"></hzzt-title>\n </slot>\n <el-select-v2 class=\"flex-1\" v-model=\"selectValue\" @change=\"selectChange\"\n v-if=\"!trueDisabled\" v-bind=\"_selectProps\"></el-select-v2>\n <slot name=\"right\"></slot>\n </div>\n <el-input ref=\"inputRef\" class=\"flex-1 margin-t-1\" v-model=\"inputVal\" v-bind=\"_inputProps\"\n @input=\"input\"\n @change=\"change\"></el-input>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import {selectTextareaProps, selectTextareaEmits} from './select-textarea'\n import {computed, ref, watch} from \"vue\";\n import {useGlobalSize, useNamespace, insertCursorPosition} from \"@hzzt-plus/hooks\";\n import {useFormDisabled, useFormSize} from \"element-plus\";\n import HzztTitle from \"@hzzt-plus/components/title/src/title.vue\";\n import {ElInput, ElSelectV2} from 'element-plus'\n\n defineOptions({\n name: 'HzztSelectTextarea',\n })\n\n const props = defineProps(selectTextareaProps)\n const emit = defineEmits(selectTextareaEmits)\n\n const inputVal = ref(props.modelValue);\n const selectValue = ref('');\n const inputRef = ref();\n\n const nsInput = useNamespace('select-textarea')\n const formSize = useFormSize()\n const formDisabled = useFormDisabled()\n\n const trueSize = computed(\n () => props.size || formSize.value || useGlobalSize().value\n )\n\n const trueDisabled = computed(() => props.disabled || formDisabled.value)\n\n const containerCls = computed(() => [\n nsInput.b(),\n nsInput.m(trueSize.value),\n ])\n\n const _inputProps = computed(() => ({\n disabled: trueDisabled.value,\n clearable: true,\n ...props.inputProps,\n type: 'textarea',\n }))\n\n const _selectProps = computed(() => ({\n options: props.options,\n size: trueSize.value,\n filterable: true,\n clearable: true,\n allowCreate: true,\n ...props.selectProps,\n }))\n\n watch(() => props.modelValue, (v) => {\n inputVal.value = v;\n })\n\n function input(val: string) {\n emit('update:modelValue', val);\n emit('input', val);\n }\n\n function change(val: string) {\n emit('change', val);\n }\n\n function selectChange(val: string) {\n if (!inputVal.value && inputVal.value !== 0) inputVal.value = '';\n selectValue.value = '';\n let content = val;\n if (!props.replace) {\n const inputEl = inputRef.value.$el.getElementsByTagName('textarea')[0];\n content = insertCursorPosition(inputEl, val);\n }\n input(content);\n change(content);\n emit('select', val);\n }\n\n\n</script>\n"],"names":["_openBlock","_createElementBlock"],"mappings":"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"}
|