Skip to content

Commit

Permalink
feat: remove discard api (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccccpj authored Jun 30, 2023
1 parent 2e3b8b8 commit b0f9906
Show file tree
Hide file tree
Showing 32 changed files with 95 additions and 228 deletions.
80 changes: 40 additions & 40 deletions src/cascader/__test__/__snapshots__/demo.test.jsx.snap

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/cascader/__test__/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exports[`cascader > events > : pick 1`] = `
>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -107,7 +107,7 @@ exports[`cascader > events > : pick 1`] = `
value="110000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand All @@ -132,7 +132,7 @@ exports[`cascader > events > : pick 1`] = `
<!--v-if-->
</div>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -141,7 +141,7 @@ exports[`cascader > events > : pick 1`] = `
value="120000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand Down
5 changes: 0 additions & 5 deletions src/dropdown-menu/dropdown-item-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ export default {
type: [String, Number] as PropType<TdDropdownItemProps['optionsColumns']>,
default: 1,
},
/** 已废弃。选项排列;不再支持 tree 布局,可与 treeSelect 配合使用 */
optionsLayout: {
type: String,
default: 'columns',
},
/** 选中值 */
value: {
type: [String, Number] as PropType<TdDropdownItemProps['value']>,
Expand Down
1 change: 0 additions & 1 deletion src/dropdown-menu/dropdown-menu.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ label | String | - | \- | N
multiple | Boolean | false | \- | N
options | Array | [] | Typescript:`Array<DropdownOption>` `interface DropdownOption { label: string; disabled: boolean; value: DropdownValue; }`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/dropdown-menu/type.ts) | N
optionsColumns | String / Number | 1 | \- | N
optionsLayout | String | columns | `deprecated` | N
value | String / Number | undefined | `v-model` and `v-model:value` is supported。Typescript:`DropdownValue ` `type DropdownValue = string \| number;`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/dropdown-menu/type.ts) | N
defaultValue | String / Number | undefined | uncontrolled property。Typescript:`DropdownValue ` `type DropdownValue = string \| number;`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/dropdown-menu/type.ts) | N
onChange | Function | | Typescript:`(value: DropdownValue) => void`<br/> | N
Expand Down
1 change: 0 additions & 1 deletion src/dropdown-menu/dropdown-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ label | String | - | 标题 | N
multiple | Boolean | false | 是否多选 | N
options | Array | [] | 选项数据。TS 类型:`Array<DropdownOption>` `interface DropdownOption { label: string; disabled: boolean; value: DropdownValue; }`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/dropdown-menu/type.ts) | N
optionsColumns | String / Number | 1 | 选项分栏(1-3) | N
optionsLayout | String | columns | 已废弃。选项排列;不再支持 tree 布局,可与 treeSelect 配合使用 | N
value | String / Number | undefined | 选中值。支持语法糖 `v-model``v-model:value`。TS 类型:`DropdownValue ` `type DropdownValue = string \| number;`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/dropdown-menu/type.ts) | N
defaultValue | String / Number | undefined | 选中值。非受控属性。TS 类型:`DropdownValue ` `type DropdownValue = string \| number;`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/dropdown-menu/type.ts) | N
onChange | Function | | TS 类型:`(value: DropdownValue) => void`<br/>值改变时触发 | N
Expand Down
6 changes: 0 additions & 6 deletions src/dropdown-menu/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ export interface TdDropdownItemProps {
* @default 1
*/
optionsColumns?: string | number;
/**
* 选项排列;不再支持 tree 布局,可与 treeSelect 配合使用
* @default columns
* @deprecated
*/
optionsLayout?: string;
/**
* 选中值
*/
Expand Down
24 changes: 12 additions & 12 deletions src/form/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ exports[`Form > Form horizontalVue demo works fine 1`] = `
>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -933,7 +933,7 @@ exports[`Form > Form horizontalVue demo works fine 1`] = `
value="110000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand All @@ -958,7 +958,7 @@ exports[`Form > Form horizontalVue demo works fine 1`] = `
<!--v-if-->
</div>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -967,7 +967,7 @@ exports[`Form > Form horizontalVue demo works fine 1`] = `
value="120000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand Down Expand Up @@ -2675,7 +2675,7 @@ exports[`Form > Form mobileVue demo works fine 1`] = `
>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -2684,7 +2684,7 @@ exports[`Form > Form mobileVue demo works fine 1`] = `
value="110000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand All @@ -2709,7 +2709,7 @@ exports[`Form > Form mobileVue demo works fine 1`] = `
<!--v-if-->
</div>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -2718,7 +2718,7 @@ exports[`Form > Form mobileVue demo works fine 1`] = `
value="120000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand Down Expand Up @@ -4286,7 +4286,7 @@ exports[`Form > Form verticalVue demo works fine 1`] = `
>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -4295,7 +4295,7 @@ exports[`Form > Form verticalVue demo works fine 1`] = `
value="110000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand All @@ -4320,7 +4320,7 @@ exports[`Form > Form verticalVue demo works fine 1`] = `
<!--v-if-->
</div>
<div
class="t-radio t-radio--right t-radio--block"
class="t-radio t-radio--left t-radio--block"
>
<input
class="t-radio__original"
Expand All @@ -4329,7 +4329,7 @@ exports[`Form > Form verticalVue demo works fine 1`] = `
value="120000"
/>
<div
class="t-radio__icon t-radio__icon--right"
class="t-radio__icon t-radio__icon--left"
>
<!--v-if-->
<!--v-if-->
Expand Down
5 changes: 3 additions & 2 deletions src/input/input.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ align | String | left | options:left/center/right | N
allowInputOverMax | Boolean | false | \- | N
autocomplete | String | undefined | \- | N
autofocus | Boolean | false | \- | N
borderless | Boolean | false | \- | N
clearable | Boolean | false | \- | N
disabled | Boolean | - | \- | N
errorMessage | String | - | `deprecated` | N
format | Function | - | Typescript:`InputFormatType` `type InputFormatType = (value: InputValue) => string`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/input/type.ts) | N
label | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
layout | String | horizontal | options:vertical/horizontal | N
borderless | Boolean | false | \- | N
maxcharacter | Number | - | \- | N
maxlength | Number | - | \- | N
name | String | - | \- | N
Expand All @@ -35,6 +34,7 @@ onBlur | Function | | Typescript:`(value: InputValue, context: { e: FocusEven
onChange | Function | | Typescript:`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' }) => void`<br/> | N
onClear | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
onFocus | Function | | Typescript:`(value: InputValue, context: { e: FocusEvent }) => void`<br/> | N
onValidate | Function | | Typescript:`(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`<br/>trigger on text length being over max length or max character | N

### Input Events

Expand All @@ -44,3 +44,4 @@ blur | `(value: InputValue, context: { e: FocusEvent })` | \-
change | `(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' })` | \-
clear | `(context: { e: MouseEvent })` | \-
focus | `(value: InputValue, context: { e: FocusEvent })` | \-
validate | `(context: { error?: 'exceed-maximum' \| 'below-minimum' })` | trigger on text length being over max length or max character
5 changes: 3 additions & 2 deletions src/input/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ align | String | left | 文本内容位置,居左/居中/居右。可选项:
allowInputOverMax | Boolean | false | 超出 `maxlength``maxcharacter` 之后是否允许继续输入 | N
autocomplete | String | undefined | 是否开启自动填充功能,HTML5 原生属性,[点击查看详情](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) | N
autofocus | Boolean | false | 自动聚焦 | N
borderless | Boolean | false | 是否开启无边框模式 | N
clearable | Boolean | false | 是否可清空 | N
disabled | Boolean | - | 是否禁用输入框 | N
errorMessage | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N
format | Function | - | 指定输入框展示值的格式。TS 类型:`InputFormatType` `type InputFormatType = (value: InputValue) => string`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/input/type.ts) | N
label | String / Slot / Function | - | 左侧文本。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
layout | String | horizontal | 标题输入框布局方式。可选项:vertical/horizontal | N
borderless | Boolean | false | 是否开启无边框模式 | N
maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter``maxlength` 二选一使用 | N
maxlength | Number | - | 用户最多可以输入的文本长度,一个中文等于一个计数长度。值为空,则表示不限制输入长度。`maxcharacter``maxlength` 二选一使用 | N
name | String | - | 名称 | N
Expand All @@ -34,6 +33,7 @@ onBlur | Function | | TS 类型:`(value: InputValue, context: { e: FocusEvent
onChange | Function | | TS 类型:`(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' }) => void`<br/>输入框值发生变化时触发。`trigger=initial` 表示传入的数据不符合预期,组件自动处理后触发 change 告知父组件。如:初始值长度超过 `maxlength` 限制 | N
onClear | Function | | TS 类型:`(context: { e: MouseEvent }) => void`<br/>清空按钮点击时触发 | N
onFocus | Function | | TS 类型:`(value: InputValue, context: { e: FocusEvent }) => void`<br/>获得焦点时触发 | N
onValidate | Function | | TS 类型:`(context: { error?: 'exceed-maximum' \| 'below-minimum' }) => void`<br/>字数超出限制时触发 | N

### Input Events

Expand All @@ -43,3 +43,4 @@ blur | `(value: InputValue, context: { e: FocusEvent })` | 失去焦点时触发
change | `(value: InputValue, context?: { e?: InputEvent \| MouseEvent \| CompositionEvent; trigger: 'input' \| 'initial' \| 'clear' })` | 输入框值发生变化时触发。`trigger=initial` 表示传入的数据不符合预期,组件自动处理后触发 change 告知父组件。如:初始值长度超过 `maxlength` 限制
clear | `(context: { e: MouseEvent })` | 清空按钮点击时触发
focus | `(value: InputValue, context: { e: FocusEvent })` | 获得焦点时触发
validate | `(context: { error?: 'exceed-maximum' \| 'below-minimum' })` | 字数超出限制时触发
12 changes: 2 additions & 10 deletions src/input/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ export default {
},
/** 自动聚焦 */
autofocus: Boolean,
/** 是否开启无边框模式 */
borderless: Boolean,
/** 是否可清空 */
clearable: Boolean,
/** 是否禁用输入框 */
disabled: Boolean,
/** 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) */
errorMessage: {
type: String,
default: '',
},
/** 指定输入框展示值的格式 */
format: {
type: Function as PropType<TdInputProps['format']>,
Expand All @@ -52,11 +49,6 @@ export default {
return ['vertical', 'horizontal'].includes(val);
},
},
/** 是否开启无边框模式 */
borderless: {
type: Boolean,
value: false,
},
/** 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 */
maxcharacter: {
type: Number,
Expand Down
16 changes: 5 additions & 11 deletions src/input/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export interface TdInputProps {
* @default false
*/
autofocus?: boolean;
/**
* 是否开启无边框模式
* @default false
*/
borderless?: boolean;
/**
* 是否可清空
* @default false
Expand All @@ -35,12 +40,6 @@ export interface TdInputProps {
* 是否禁用输入框
*/
disabled?: boolean;
/**
* 错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips)
* @default ''
* @deprecated
*/
errorMessage?: string;
/**
* 指定输入框展示值的格式
*/
Expand All @@ -54,11 +53,6 @@ export interface TdInputProps {
* @default horizontal
*/
layout?: 'vertical' | 'horizontal';
/**
* 是否开启无边框模式
* @default true
*/
borderless?: boolean;
/**
* 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用
*/
Expand Down
14 changes: 2 additions & 12 deletions src/message/message.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,14 @@ theme | String | info | options:info/success/warning/error。Typescript:`Mes
visible | Boolean | false | `v-model` and `v-model:visible` is supported | N
defaultVisible | Boolean | false | uncontrolled property | N
zIndex | Number | - | \- | N
onChange | Function | | Typescript:`(visible: boolean) => void`<br/>`deprecated` | N
onClose | Function | | Typescript:`(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent }) => void`<br/>`deprecated`。close message event。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
onCloseBtnClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
onClosed | Function | | Typescript:`() => void`<br/>`deprecated` | N
onDurationEnd | Function | | Typescript:`() => void`<br/> | N
onLinkClick | Function | | 【developing】Typescript:`(context: { e: MouseEvent }) => void`<br/> | N
onOpen | Function | | Typescript:`() => void`<br/>`deprecated` | N
onOpened | Function | | Typescript:`() => void`<br/>`deprecated` | N
onLinkClick | Function | | Typescript:`(context: { e: MouseEvent }) => void`<br/> | N

### Message Events

name | params | description
-- | -- | --
change | `(visible: boolean)` | `deprecated`
close | `(context: { trigger: 'close-click' \| 'duration-end', e?: MouseEvent })` | `deprecated`。close message event。Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts)
close-btn-click | `(context: { e: MouseEvent })` | \-
closed | \- | `deprecated`
duration-end | \- | \-
link-click | 【developing】`(context: { e: MouseEvent })` | \-
open | \- | `deprecated`
opened | \- | `deprecated`
link-click | `(context: { e: MouseEvent })` | \-
Loading

0 comments on commit b0f9906

Please sign in to comment.