Skip to content

Commit

Permalink
Merge pull request #34 from Tencent/develop
Browse files Browse the repository at this point in the history
release: 0.8.0
  • Loading branch information
josonyang authored Mar 17, 2022
2 parents 2798aa2 + f30ac7e commit b8367e4
Show file tree
Hide file tree
Showing 77 changed files with 6,192 additions and 655 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ toc: false
spline: explain
---

## 0.8.0 `(2022-03-17)`


### Bug Fixes
* **dropdown-menu:** 移除冗余的dom结构 ecba97f
* **search:** 修复样式丢失问题, close #29 ac1dd2a, closes #29
* **input** 修复输入框样式丢失问题
* **grid** 修复grid-item样式丢失问题


### Features
* 新增pull-down-refresh组件 6f1c8a7


## 0.7.0 `(2022-03-14)`

### BREAKING CHANGES
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-mobile-vue",
"purename": "tdesign",
"version": "0.7.0",
"version": "0.8.0",
"description": "tdesign-mobile-vue",
"author": "TDesign Group",
"homepage": "https://tdesign.tencent.com/mobile-vue/",
Expand All @@ -17,7 +17,7 @@
"dev": "cd site && cross-env NODE_ENV=development vite",
"dev:debug": "cd site && cross-env NODE_ENV=development vite --debug",
"prebuild": "rimraf dist/* lib/* es/* esm/* typings/*",
"build": "cross-env NODE_ENV=production rollup -c scripts/rollup.config.js && npm run build:tsc",
"build": "npm run prebuild && cross-env NODE_ENV=production rollup -c scripts/rollup.config.js && npm run build:tsc",
"build:tsc": "concurrently \"npm:build:tsc-*\"",
"build:tsc-es": "vue-tsc --declaration --emitDeclarationOnly --outDir es/ -p tsconfig.build.json",
"build:tsc-esm": "vue-tsc --declaration --emitDeclarationOnly --outDir esm/ -p tsconfig.build.json",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/generate-coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fs.readFile(resolveCwd('test/unit/coverage/index.html'), 'utf8', (err, html) =>
});

const finalRes = `module.exports = ${JSON.stringify(result, null, 2)}`;
fs.writeFileSync(resolveCwd('site/sites/test-coverage.js'), finalRes);
fs.writeFileSync(resolveCwd('site/web/test-coverage.js'), finalRes);
console.log('successful re-generate coverage');
}
});
3 changes: 2 additions & 1 deletion scripts/test/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import { config } from '@vue/test-utils';
import { createApp } from 'vue';
import { renderToString } from '@vue/server-renderer';
import TDesign from '@/index';
import DemoBlock from '../../site/mobile/components/demo-block.vue';

config.global.plugins = [TDesign];

config.global.createSSRApp = (comp) => {
const app = createApp(comp);
app.config.globalProperties.$route = {};
app.use(TDesign);
app.use(TDesign).component('tdesign-demo-block', DemoBlock);
const html = renderToString(app);
return html;
};
8 changes: 7 additions & 1 deletion site/docs.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,15 @@ export default {
title: 'BackTop 返回顶部',
name: 'back-top',
meta: { docType: 'base' },
path: '/vue-mobile/components/back-top',
path: '/mobile-vue/components/back-top',
component: () => import('@/back-top/back-top.md'),
},
{
title: 'PullDownRefresh 下拉刷新',
name: 'pull-down-refresh',
path: '/mobile-vue/components/pull-down-refresh',
component: () => import('@/pull-down-refresh/pull-down-refresh.md'),
},
// {
// title: 'ActionSheet 动作面板',
// name: 'action-sheet',
Expand Down
135 changes: 85 additions & 50 deletions site/web/test-coverage.js
Original file line number Diff line number Diff line change
@@ -1,118 +1,153 @@
module.exports = {
"": "93.1%",
"actionSheet": "84.61%",
"": "93.84%",
"actionSheet": "24.48%",
"actionSheet/demos": "0%",
"actionSheet/style": "0%",
"badge": "100%",
"avatar": "91.17%",
"avatarGroup": "35.89%",
"avatarGroup/style": "0%",
"avatar/demos": "0%",
"avatar/style": "0%",
"backTop": "93.93%",
"backTop/demos": "0%",
"backTop/style": "0%",
"badge": "88.57%",
"badge/demos": "0%",
"badge/style": "0%",
"button": "100%",
"buttonGroup": "100%",
"button": "91.17%",
"buttonGroup": "83.33%",
"buttonGroup/style": "0%",
"button/demos": "0%",
"button/style": "0%",
"cell": "100%",
"cellGroup": "100%",
"cellGroup": "92.85%",
"cellGroup/style": "0%",
"cell/demos": "0%",
"cell/style": "0%",
"checkGroup": "100%",
"checkGroup": "13.97%",
"checkGroup/style": "0%",
"checkbox": "61.4%",
"checkbox": "35.41%",
"checkbox/demos": "0%",
"checkbox/style": "0%",
"collapse": "41.02%",
"collapse": "27.1%",
"collapse/demos": "0%",
"collapse/style": "0%",
"countDown": "100%",
"countDown": "73.68%",
"countDown/demos": "0%",
"countDown/style": "0%",
"dialog": "34.78%",
"dateTimePicker": "12.3%",
"dateTimePicker/demos": "0%",
"dateTimePicker/style": "0%",
"dialog": "24.13%",
"dialog/demos": "0%",
"dialog/style": "0%",
"divider": "80%",
"divider": "70%",
"divider/style": "0%",
"drawer": "100%",
"drawer": "42.85%",
"drawer/demos": "0%",
"drawer/style": "0%",
"dropdownMenu": "34.37%",
"dropdownMenu": "0%",
"dropdownMenu/demos": "0%",
"dropdownMenu/style": "0%",
"fab": "100%",
"fab": "57.14%",
"fab/style": "0%",
"icon/demos": "0%",
"indexes": "100%",
"grid": "41.07%",
"grid/demos": "0%",
"grid/style": "0%",
"image": "31.37%",
"imageViewer": "8.62%",
"imageViewer/demos": "0%",
"imageViewer/style": "0%",
"image/demos": "0%",
"image/style": "0%",
"indexes": "23.89%",
"indexes/demos": "0%",
"indexes/style": "0%",
"input": "80%",
"input": "29.82%",
"input/demos": "0%",
"input/style": "0%",
"mask": "100%",
"list": "26.49%",
"list/demos": "0%",
"list/style": "0%",
"loading": "39.13%",
"loading/demos": "0%",
"loading/icon": "57.14%",
"loading/style": "0%",
"mask": "76.92%",
"mask/demos": "0%",
"mask/style": "0%",
"message": "41.93%",
"message": "32.75%",
"message/demos": "0%",
"message/style": "0%",
"navbar": "100%",
"navbar": "50%",
"navbar/demos": "0%",
"navbar/style": "0%",
"noticeBar": "88.88%",
"noticeBar": "0%",
"noticeBar/demos": "0%",
"noticeBar/style": "0%",
"picker": "11.04%",
"picker": "12.65%",
"picker/demos": "0%",
"picker/style": "0%",
"popup": "77.77%",
"popup": "34.88%",
"popup/demos": "0%",
"popup/style": "0%",
"preview": "100%",
"preview/demos": "0%",
"preview/style": "0%",
"progress": "72.72%",
"progress/demos": "0%",
"progress": "54.54%",
"progress/style": "0%",
"radio": "90.9%",
"radioGroup": "100%",
"radio": "32.72%",
"radioGroup": "48%",
"radioGroup/style": "0%",
"radio/demos": "0%",
"radio/style": "0%",
"rate": "100%",
"rate": "30%",
"rate/demos": "0%",
"rate/style": "0%",
"searchField": "100%",
"searchField/demos": "0%",
"searchField/style": "0%",
"segmentedControl": "100%",
"segmentedControl/demos": "0%",
"segmentedControl/style": "0%",
"shared": "55.26%",
"shared/useCountDown": "16.66%",
"shared/useToggle": "63.63%",
"slider": "8.57%",
"search": "28.94%",
"search/demos": "0%",
"search/style": "0%",
"shared": "66.66%",
"shared/useChildSlots": "10.52%",
"shared/useCountDown": "21.05%",
"shared/useDefault": "7.89%",
"shared/useEmitEvent": "33.33%",
"shared/useInterval": "0%",
"shared/useToggle": "14.28%",
"skeleton": "31.25%",
"skeleton/demos": "0%",
"skeleton/style": "0%",
"slider": "10.28%",
"slider/demos": "0%",
"slider/style": "0%",
"stepper": "90.9%",
"stepper": "35.55%",
"stepper/demos": "0%",
"stepper/style": "0%",
"steps": "80%",
"steps": "32.46%",
"steps/demos": "0%",
"steps/style": "0%",
"sticky": "29.78%",
"sticky/demos": "0%",
"sticky/style": "0%",
"style": "0%",
"swiper": "80%",
"swipeCell": "15.38%",
"swipeCell/demos": "0%",
"swipeCell/style": "0%",
"swiper": "14.28%",
"swiper/demos": "0%",
"swiper/style": "0%",
"switch": "100%",
"switch": "51.72%",
"switch/demos": "0%",
"switch/style": "0%",
"tabBar": "70%",
"tabBar": "40.9%",
"tabBar/demos": "0%",
"tabBar/style": "0%",
"tabs": "85.71%",
"tabs": "29%",
"tabs/demos": "0%",
"tabs/style": "0%",
"tag": "24.59%",
"tag": "39.7%",
"tag/demos": "0%",
"tag/style": "0%",
"toast": "35%",
"textarea": "23.07%",
"textarea/style": "0%",
"toast": "34.32%",
"toast/demos": "0%",
"toast/style": "0%"
}
3 changes: 2 additions & 1 deletion src/avatar/avatar-group-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default {
type: String as PropType<TdAvatarGroupProps['cascading']>,
default: 'right-up' as TdAvatarGroupProps['cascading'],
validator(val: TdAvatarGroupProps['cascading']): boolean {
return ['left-up', 'right-up'].includes(val!);
if (!val) return true;
return ['left-up', 'right-up'].includes(val);
},
},
/** 头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5`,`...`, `更多` */
Expand Down
4 changes: 2 additions & 2 deletions src/avatar/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
alt | String | - | 头像替换文本,仅当图片存在时有效 | N
badgeProps | Object | - | 头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字。TS 类型:`TdBadgeProps` `import { TdBadgeProps } from '@Badge'`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/avatar/type.ts) | N
alt | String | - | 头像替换文本,仅当图片加载失败时有效 | N
badgeProps | Object | - | 头像右上角提示信息,继承 Badge 组件的全部特性。如:小红点,或者数字。TS 类型:`TdBadgeProps`[Badge API Documents](./badge?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/avatar/type.ts) | N
hideOnLoadFailed | Boolean | false | 加载失败时隐藏图片 | N
icon | Slot / Function | - | 图标。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
image | String | - | 图片地址 | N
Expand Down
5 changes: 3 additions & 2 deletions src/avatar/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TdAvatarProps } from './type';
import { PropType } from 'vue';

export default {
/** 头像替换文本,仅当图片存在时有效 */
/** 头像替换文本,仅当图片加载失败时有效 */
alt: {
type: String,
default: '',
Expand All @@ -33,7 +33,8 @@ export default {
type: String as PropType<TdAvatarProps['shape']>,
default: 'circle' as TdAvatarProps['shape'],
validator(val: TdAvatarProps['shape']): boolean {
return ['circle', 'round'].includes(val!);
if (!val) return true;
return ['circle', 'round'].includes(val);
},
},
/** 尺寸,示例值:small/medium/large/24px/38px 等,默认为 large */
Expand Down
2 changes: 1 addition & 1 deletion src/avatar/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TNode } from '../common';

export interface TdAvatarProps {
/**
* 头像替换文本,仅当图片存在时有效
* 头像替换文本,仅当图片加载失败时有效
* @default ''
*/
alt?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/back-top/demos/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const name = `${prefix}-back-top`;
const backTopDemos = [
{ text: '顶部', theme: 'round' },
{ text: '顶部', theme: 'round-dark' },
{ text: '返回顶部', theme: 'half-round' },
{ text: '返回顶部', theme: 'half-round-dark' },
{ text: '返回', theme: 'half-round' },
{ text: '返回', theme: 'half-round-dark' },
{ text: '', theme: 'round' },
];
export default defineComponent({
Expand Down
6 changes: 4 additions & 2 deletions src/badge/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default {
type: String as PropType<TdBadgeProps['shape']>,
default: 'circle' as TdBadgeProps['shape'],
validator(val: TdBadgeProps['shape']): boolean {
return ['circle', 'round', 'ribbon'].includes(val!);
if (!val) return true;
return ['circle', 'round', 'ribbon'].includes(val);
},
},
/** 当数值为 0 时,是否展示徽标 */
Expand All @@ -48,7 +49,8 @@ export default {
type: String as PropType<TdBadgeProps['size']>,
default: 'medium' as TdBadgeProps['size'],
validator(val: TdBadgeProps['size']): boolean {
return ['small', 'medium'].includes(val!);
if (!val) return true;
return ['small', 'medium'].includes(val);
},
},
};
2 changes: 1 addition & 1 deletion src/button/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ disabled | Boolean | false | 是否禁用按钮 | N
ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
icon | Slot / Function | - | 按钮内部图标,可完全自定义。TS 类型:`TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
loading | Boolean | false | 是否显示为加载状态 | N
shape | String | square | 按钮形状,有二种:方形、圆角方形。可选项:square/round | N
shape | String | square | 按钮形状,有二种:方形、圆角方形 。可选项:square/round | N
size | String | medium | 组件尺寸。可选项:small/medium/large。TS 类型:`SizeEnum`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
theme | String | default | 组件风格,依次为品牌色、危险色。可选项:default/primary/danger | N
variant | String | base | 按钮形式,基础、线框、文字。可选项:base/outline/text | N
Expand Down
Loading

0 comments on commit b8367e4

Please sign in to comment.