diff --git a/packages/opendesign/src/_components/in-box/style/index.scss b/packages/opendesign/src/_components/in-box/style/index.scss index 6c43b4f60ecc08d603d01dcbdf0f8f4ae251fb1e..38241341183a577cbd07f9d6804a32a2dd1d7583 100644 --- a/packages/opendesign/src/_components/in-box/style/index.scss +++ b/packages/opendesign/src/_components/in-box/style/index.scss @@ -20,7 +20,6 @@ background-color: var(--_box-bg-color); transition: all var(--o-duration-s) var(--o-easing-standard); - cursor: pointer; @include hover { border-color: var(--_box-bd-color-hover); background-color: var(--_box-bg-color-hover); diff --git a/packages/opendesign/src/_components/in-input/InInput.vue b/packages/opendesign/src/_components/in-input/InInput.vue index 61ccfc544dfa3348ede76c5a1ca162a9f998d4b7..2eed7048df085ef75587abb88fccfe9dcc1400ee 100644 --- a/packages/opendesign/src/_components/in-input/InInput.vue +++ b/packages/opendesign/src/_components/in-input/InInput.vue @@ -5,6 +5,7 @@ import { IconClose, IconEyeOn, IconEyeOff } from '../../_utils/icons'; import { useInput, type UseInputEmitsT } from '../../_headless/use-input'; import { useInputPassword } from '../../_headless/use-input-password'; import { useI18n } from '../../locale'; +import { isUndefined } from '../../_utils/is'; const props = defineProps(inInputProps); const slots = defineSlots<{ @@ -61,7 +62,15 @@ const { showPassword, onEyeMouseDown, onEyeMouseUp, onEyeClick } = useInputPassw const inputType = ref(props.type); const togglePassword = (visible?: boolean) => { - inputType.value = visible ? 'text' : 'password'; + if (isUndefined(visible)) { + if (inputType.value === 'text') { + inputType.value = 'password'; + } else { + inputType.value = 'text'; + } + } else { + inputType.value = visible ? 'text' : 'password'; + } }; watchEffect(() => { @@ -75,6 +84,10 @@ const focus = () => { inputEl.value?.focus(); }; +const blur = () => { + inputEl.value?.blur(); +}; + /** * 自适应宽度 */ @@ -89,6 +102,7 @@ const mirrorValue = computed(() => { defineExpose({ inputEl, focus, + blur, clear, togglePassword, }); diff --git a/packages/opendesign/src/input-number/style/index.scss b/packages/opendesign/src/input-number/style/index.scss index e3ca6d42bcec1b6ba58e3e25f71b4a08bcc31e7c..6005a6f7f40a8e9d1881c4a57aab80ef7fadd08e 100644 --- a/packages/opendesign/src/input-number/style/index.scss +++ b/packages/opendesign/src/input-number/style/index.scss @@ -7,13 +7,12 @@ justify-content: center; display: flex; cursor: pointer; - min-width: var(--box-height); + min-width: var(--_box-height); font-size: 16px; flex-wrap: wrap; color: var(--input-number-btn-color); } - .o-input-number-btn { width: 100%; height: 50%; diff --git a/packages/opendesign/src/input/OInput.vue b/packages/opendesign/src/input/OInput.vue index b08396f58ca4caf78b433702ac3f7fe47ed0d8a0..45d263ae1f8fd5bb188f7121f26a79543a618936 100644 --- a/packages/opendesign/src/input/OInput.vue +++ b/packages/opendesign/src/input/OInput.vue @@ -85,6 +85,14 @@ onMounted(() => { inputId.value = uniqueId(); } }); + +defineExpose({ + focus: () => inInputRef.value?.focus(), + blur: () => inInputRef.value?.blur(), + clear: () => inInputRef.value?.clear(), + inputEl: () => inInputRef.value?.inputEl, + togglePassword: () => inInputRef.value?.togglePassword(), +});