Skip to content

Commit bb80dec

Browse files
chore: merge develop
2 parents 35b889c + 3a90714 commit bb80dec

File tree

11 files changed

+158
-146
lines changed

11 files changed

+158
-146
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"lodash": "^4.17.21",
9595
"mitt": "^3.0.1",
9696
"sortablejs": "^1.15.0",
97-
"tdesign-icons-vue-next": "^0.2.4",
97+
"tdesign-icons-vue-next": "^0.3.4",
9898
"tinycolor2": "^1.6.0",
9999
"validator": "^13.9.0"
100100
},
@@ -176,7 +176,7 @@
176176
"rollup-plugin-terser": "^7.0.2",
177177
"rollup-plugin-vue": "^6.0.0",
178178
"semver": "^7.5.4",
179-
"tdesign-icons-view": "^0.3.0",
179+
"tdesign-icons-view": "^0.3.4",
180180
"tdesign-publish-cli": "^0.0.12",
181181
"tdesign-site-components": "^0.15.3",
182182
"tdesign-theme-generator": "^1.0.11",

src/auto-complete/__tests__/index.test.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('Anchor', () => {
1212
});
1313
await wrapper.setProps({ popupProps: { visible: true } });
1414
expect(wrapper.find('.t-auto-complete').exists()).toBeTruthy();
15-
const panelNode = document.querySelector('.t-autocomplete__panel');
15+
const panelNode = document.querySelector('.t-auto-complete__panel');
1616
expect(document.querySelectorAll('.t-select-option').length).toBe(3);
17-
expect(document.querySelector('.t-autocomplete__panel')).toBeTruthy();
17+
expect(document.querySelector('.t-auto-complete__panel')).toBeTruthy();
1818
panelNode.parentNode.removeChild(panelNode);
1919
});
2020
});

src/auto-complete/auto-complete.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default defineComponent({
149149
const topContent = renderTNodeJSX('panelTopContent');
150150
const bottomContent = renderTNodeJSX('panelBottomContent');
151151
const panelContent = Boolean(topContent || props.options?.length || bottomContent) ? (
152-
<div class={`${classPrefix.value}-autocomplete__panel`}>
152+
<div class={`${classPrefix.value}-auto-complete__panel`}>
153153
{topContent}
154154
{listContent}
155155
{bottomContent}

src/auto-complete/option-list.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import HighlightOption from './highlight-option';
44
import { CommonClassNameType } from '../hooks/useCommonClassName';
55
import { AutoCompleteOptionObj, TdAutoCompleteProps } from './type';
66
import log from '../_common/js/log';
7-
import { usePrefixClass } from '../hooks/useConfig';
7+
import { useConfig, usePrefixClass } from '../hooks/useConfig';
88
import { on, off } from '../utils/dom';
99
import isString from 'lodash/isString';
1010
import escapeRegExp from 'lodash/escapeRegExp';
@@ -30,6 +30,8 @@ export default defineComponent({
3030
const active = ref('');
3131
const classPrefix = usePrefixClass();
3232

33+
const { globalConfig } = useConfig('autoComplete');
34+
3335
const classes = computed(() => `${classPrefix.value}-select__list`);
3436
const optionClasses = computed(() => [
3537
`${classPrefix.value}-select-option`,
@@ -138,7 +140,8 @@ export default defineComponent({
138140
});
139141

140142
return () => {
141-
if (!tOptions.value.length) return null;
143+
if (!tOptions.value.length)
144+
return <div className={`${classPrefix.value}-auto-complete__panel--empty`}>{globalConfig.value.empty}</div>;
142145
return (
143146
<ul class={classes.value}>
144147
{tOptions.value.map((item) => {

src/breadcrumb/breadcrumb-item.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ export default defineComponent({
6868
const { proxy } = getCurrentInstance();
6969

7070
const handleClick = () => {
71-
if (props.href) {
72-
window.location.href = props.href;
73-
}
7471
const router = props.router || proxy.$router;
72+
7573
if (props.to && router) {
7674
props.replace ? router.replace(props.to) : router.push(props.to);
75+
} else {
76+
window.location.href = props.href;
7777
}
7878
};
7979
const bindEvent = (e: MouseEvent) => {

src/breadcrumb/breadcrumb.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ theme | String | light | 组件风格。可选项:light | N
2323
content | String / Slot / Function | - | 子元素。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
2424
default | String / Slot / Function | - | 子元素,同 content。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
2525
disabled | Boolean | - | 是否禁用当前项点击 | N
26-
href | String | - | 跳转链接 | N
26+
href | String | - | 跳转链接,不能与 to 共用 | N
2727
icon | Slot / Function | - | 面板屑项内的前置图标。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
2828
maxWidth | String | undefined | 最大宽度,超出后会以省略号形式呈现。优先级高于 Breadcrumb 中的 maxItemWidth | N
2929
replace | Boolean | false | 路由跳转是否采用覆盖的方式(覆盖后将没有浏览器历史记录) | N
3030
router | Object | - | 路由对象。如果项目存在 Router,则默认使用 Router。TS 类型:`any` | N
3131
target | String | _self | 链接或路由跳转方式。可选项:_blank/_self/_parent/_top | N
32-
to | String / Object | - | 路由跳转目标,当且仅当 Router 存在时,该 API 有效。TS 类型:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/breadcrumb/type.ts) | N
32+
to | String / Object | - | 路由跳转目标,当且仅当 Router 存在时,该 API 有效。不能与 href 共用。TS 类型:`string \| Route` `interface Route { path?: string; name?: string; hash?: string; query?: RouteData; params?: RouteData }` `type RouteData = { [key: string]: string \| string[] }`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/breadcrumb/type.ts) | N
3333
onClick | Function | | TS 类型:`(e: MouseEvent) => void`<br/>点击时触发 | N
3434

3535
### BreadcrumbItem Events

src/config-provider/type.ts

+12
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import { ImageProps } from '../image';
1313
import { TNode, SizeEnum } from '../common';
1414

1515
export interface GlobalConfigProvider {
16+
/**
17+
* 自动填充全局配置
18+
*/
19+
autoComplete?: AutoCompleteConfig;
1620
/**
1721
* 警告全局配置
1822
*/
@@ -148,6 +152,14 @@ export interface GlobalConfigProvider {
148152
upload?: UploadConfig;
149153
}
150154

155+
export interface AutoCompleteConfig {
156+
/**
157+
* 语言配置,“暂无数据”描述文本
158+
* @default ''
159+
*/
160+
empty?: string;
161+
}
162+
151163
export interface InputConfig {
152164
/**
153165
* 是否开启自动填充功能

src/progress/progress.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default defineComponent({
3434
});
3535

3636
const statusStyle = computed(() => {
37-
if (props.percentage >= 100) {
37+
if (!props.status && props.percentage >= 100) {
3838
return 'success';
3939
}
4040
return props.status || 'default';

src/select/select-panel.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,9 @@ export default defineComponent({
128128
defaultNode: <div class={`${COMPONENT_NAME.value}__loading-tips`}>{t(globalConfig.value.loadingText)}</div>,
129129
})}
130130
{/* 空状态 */}
131-
{!props.loading &&
132-
isEmpty.value &&
133-
!showCreateOption.value &&
134-
renderDefaultTNode('empty', {
135-
defaultNode: <div class={`${COMPONENT_NAME.value}__empty`}>{t(globalConfig.value.empty)}</div>,
136-
})}
131+
{!props.loading && isEmpty.value && !showCreateOption.value && (
132+
<div class={`${COMPONENT_NAME.value}__empty`}>{renderTNodeJSX('empty') || t(globalConfig.value.empty)}</div>
133+
)}
137134
{!isEmpty.value && renderOptionsContent(options)}
138135
</div>
139136
);

0 commit comments

Comments
 (0)