From 8cb025affd1792f2ee59ca4fc433b638ada45c7f Mon Sep 17 00:00:00 2001
From: ZhouWei <1244620067@qq.com>
Date: Wed, 9 Aug 2023 19:32:30 +0800
Subject: [PATCH 1/2] feat: add border less
---
components/auto-complete/demo/border-less.vue | 53 +++++++++++++++++++
components/auto-complete/demo/index.vue | 3 ++
components/auto-complete/index.en-US.md | 1 +
components/auto-complete/index.zh-CN.md | 1 +
4 files changed, 58 insertions(+)
create mode 100644 components/auto-complete/demo/border-less.vue
diff --git a/components/auto-complete/demo/border-less.vue b/components/auto-complete/demo/border-less.vue
new file mode 100644
index 0000000000..44715e89d8
--- /dev/null
+++ b/components/auto-complete/demo/border-less.vue
@@ -0,0 +1,53 @@
+
+---
+order: 7
+title:
+ zh-CN: 无边框
+ en-US: Border less
+---
+
+## zh-CN
+
+没有边框。
+
+## en-US
+
+border less.
+
+
+
+
+
+
+
diff --git a/components/auto-complete/demo/index.vue b/components/auto-complete/demo/index.vue
index a788b90fb5..a51728fc2e 100644
--- a/components/auto-complete/demo/index.vue
+++ b/components/auto-complete/demo/index.vue
@@ -7,6 +7,7 @@
+
@@ -18,6 +19,7 @@ import NonCaseSensitive from './non-case-sensitive.vue';
import CertainCategory from './certain-category.vue';
import UncertainCategory from './uncertain-category.vue';
import statusVue from './status.vue';
+import BorderLess from './border-less.vue';
import CN from '../index.zh-CN.md';
import US from '../index.en-US.md';
@@ -34,6 +36,7 @@ export default defineComponent({
NonCaseSensitive,
CertainCategory,
UncertainCategory,
+ BorderLess,
},
setup() {
return {};
diff --git a/components/auto-complete/index.en-US.md b/components/auto-complete/index.en-US.md
index 3493b9f90d..ba28faf5c9 100644
--- a/components/auto-complete/index.en-US.md
+++ b/components/auto-complete/index.en-US.md
@@ -30,6 +30,7 @@ The differences with Select are:
| allowClear | Show clear button, effective in multiple mode only. | boolean | false | |
| autofocus | get focus when component mounted | boolean | false | |
| backfill | backfill selected item the input when using keyboard | boolean | false | |
+| bordered | Whether has border style | boolean | true | 4.0 |
| default (for customize input element) | customize input element | slot | `` | |
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
| defaultOpen | Initial open state of dropdown | boolean | - | |
diff --git a/components/auto-complete/index.zh-CN.md b/components/auto-complete/index.zh-CN.md
index f6b67c506f..3e656950ae 100644
--- a/components/auto-complete/index.zh-CN.md
+++ b/components/auto-complete/index.zh-CN.md
@@ -31,6 +31,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*WERTQ6qvgEYAAA
| allowClear | 支持清除, 单选模式有效 | boolean | false | |
| autofocus | 自动获取焦点 | boolean | false | |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false | |
+| bordered | 是否有边框 | boolean | true | 4.0 |
| default (自定义输入框) | 自定义输入框 | slot | `` | |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | |
From eb4f9f81f92ab8f34c0f99fa7837c94237169241 Mon Sep 17 00:00:00 2001
From: ZhouWei <1244620067@qq.com>
Date: Thu, 10 Aug 2023 00:36:32 +0800
Subject: [PATCH 2/2] feat: add customize clear button
---
.../__tests__/__snapshots__/demo.test.js.snap | 35 ++++++++++
components/auto-complete/demo/allow-clear.vue | 69 +++++++++++++++++++
components/auto-complete/demo/index.vue | 3 +
components/auto-complete/index.en-US.md | 1 +
components/auto-complete/index.tsx | 1 +
components/auto-complete/index.zh-CN.md | 1 +
6 files changed, 110 insertions(+)
create mode 100644 components/auto-complete/demo/allow-clear.vue
diff --git a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
index 97a47020f7..2d2c7da70e 100644
--- a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
+++ b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap
@@ -1,5 +1,28 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`renders ./components/auto-complete/demo/allow-clear.vue correctly 1`] = `
+
+
+
+ Clearable
+
+
+
+
+
+
+
+
+
+
+ Customized clear icon
+
+
+
+
+
+`;
+
exports[`renders ./components/auto-complete/demo/basic.vue correctly 1`] = `
@@ -12,6 +35,18 @@ exports[`renders ./components/auto-complete/demo/basic.vue correctly 1`] = `
`;
+exports[`renders ./components/auto-complete/demo/border-less.vue correctly 1`] = `
+
+
+
+ border less
+
+
+
+
+
+`;
+
exports[`renders ./components/auto-complete/demo/certain-category.vue correctly 1`] = `
diff --git a/components/auto-complete/demo/allow-clear.vue b/components/auto-complete/demo/allow-clear.vue
new file mode 100644
index 0000000000..121c96b1e9
--- /dev/null
+++ b/components/auto-complete/demo/allow-clear.vue
@@ -0,0 +1,69 @@
+
+---
+order: 8
+title:
+ zh-CN: 自定义清除按钮
+ en-US: Customize clear button
+---
+
+## zh-CN
+
+自定义清除按钮。
+
+## en-US
+
+Customize clear button.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/auto-complete/demo/index.vue b/components/auto-complete/demo/index.vue
index a51728fc2e..70cb70d8ab 100644
--- a/components/auto-complete/demo/index.vue
+++ b/components/auto-complete/demo/index.vue
@@ -8,6 +8,7 @@
+
@@ -20,6 +21,7 @@ import CertainCategory from './certain-category.vue';
import UncertainCategory from './uncertain-category.vue';
import statusVue from './status.vue';
import BorderLess from './border-less.vue';
+import AllowClear from './allow-clear.vue';
import CN from '../index.zh-CN.md';
import US from '../index.en-US.md';
@@ -37,6 +39,7 @@ export default defineComponent({
CertainCategory,
UncertainCategory,
BorderLess,
+ AllowClear,
},
setup() {
return {};
diff --git a/components/auto-complete/index.en-US.md b/components/auto-complete/index.en-US.md
index ba28faf5c9..8b9c215075 100644
--- a/components/auto-complete/index.en-US.md
+++ b/components/auto-complete/index.en-US.md
@@ -31,6 +31,7 @@ The differences with Select are:
| autofocus | get focus when component mounted | boolean | false | |
| backfill | backfill selected item the input when using keyboard | boolean | false | |
| bordered | Whether has border style | boolean | true | 4.0 |
+| clearIcon | Use slot custom clear icon | slot | `
` | 4.0 |
| default (for customize input element) | customize input element | slot | `
` | |
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
| defaultOpen | Initial open state of dropdown | boolean | - | |
diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx
index a6b8fb8ad6..3e2b7a63f7 100644
--- a/components/auto-complete/index.tsx
+++ b/components/auto-complete/index.tsx
@@ -54,6 +54,7 @@ const AutoComplete = defineComponent({
default: any;
notFoundContent: any;
dataSource: any;
+ clearIcon: any;
}>,
setup(props, { slots, attrs, expose }) {
warning(
diff --git a/components/auto-complete/index.zh-CN.md b/components/auto-complete/index.zh-CN.md
index 3e656950ae..44b21e63d2 100644
--- a/components/auto-complete/index.zh-CN.md
+++ b/components/auto-complete/index.zh-CN.md
@@ -32,6 +32,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*WERTQ6qvgEYAAA
| autofocus | 自动获取焦点 | boolean | false | |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false | |
| bordered | 是否有边框 | boolean | true | 4.0 |
+| clearIcon | 使用插槽自定义清除按钮 | slot | `
` | 4.0 |
| default (自定义输入框) | 自定义输入框 | slot | `
` | |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | |