Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mobile-borderless): support borderless props #548

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { TdCheckboxGroupProps } from './type';
const props: TdCheckboxGroupProps = {
/** 是否开启无边框模式 */
/** 是否开启无边框模式。优先级低于 Checkbox.borderless */
borderless: {
type: Boolean,
value: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { KeysType } from '../common/common';

export interface TdCheckboxGroupProps<T = CheckboxGroupValue> {
/**
* 是否开启无边框模式
* 是否开启无边框模式。优先级低于 Checkbox.borderless
* @default false
*/
borderless?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name | type | default | description | required
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
block | Boolean | true | \- | N
borderless | Boolean | false | \- | N
borderless | Boolean | undefined | \- | N
check-all | Boolean | false | \- | N
checked | Boolean | false | \- | N
default-checked | Boolean | undefined | uncontrolled property | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
block | Boolean | true | 是否为块级元素 | N
borderless | Boolean | false | 是否开启无边框模式 | N
borderless | Boolean | undefined | 是否开启无边框模式 | N
check-all | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
checked | Boolean | false | 是否选中 | N
default-checked | Boolean | undefined | 是否选中。非受控属性 | N
Expand Down Expand Up @@ -49,7 +49,7 @@ t-class-label | 标签样式类
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
borderless | Boolean | false | 是否开启无边框模式 | N
borderless | Boolean | false | 是否开启无边框模式。优先级低于 Checkbox.borderless | N
disabled | Boolean | undefined | 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled | N
keys | Object | - | 用来定义 value / label / disabled 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
max | Number | undefined | 支持最多选中的数量 | N
Expand Down
4 changes: 2 additions & 2 deletions packages/products/tdesign-miniprogram/src/checkbox/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const props: TdCheckboxProps = {
},
/** 是否开启无边框模式 */
borderless: {
type: Boolean,
value: false,
type: null,
value: undefined,
},
/** 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 */
checkAll: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface TdCheckboxProps {
};
/**
* 是否开启无边框模式
* @default false
*/
borderless?: {
type: BooleanConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name | type | default | description | required
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
block | Boolean | true | \- | N
borderless | Boolean | false | \- | N
borderless | Boolean | undefined | \- | N
checkAll | Boolean | false | \- | N
checked | Boolean | false | \- | N
defaultChecked | Boolean | false | uncontrolled property | N
Expand All @@ -35,6 +35,7 @@ name | type | default | description | required
-- | -- | -- | -- | --
className | String | - | className of component | N
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N
borderless | Boolean | false | \- | N
disabled | Boolean | undefined | \- | N
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
max | Number | undefined | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
block | Boolean | true | 是否为块级元素 | N
borderless | Boolean | false | 是否开启无边框模式 | N
borderless | Boolean | undefined | 是否开启无边框模式 | N
checkAll | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
checked | Boolean | false | 是否选中 | N
defaultChecked | Boolean | false | 是否选中。非受控属性 | N
Expand All @@ -35,6 +35,7 @@ onChange | Function | | TS 类型:`(checked: boolean, context: { e: ChangeEve
-- | -- | -- | -- | --
className | String | - | 类名 | N
style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
borderless | Boolean | false | 是否开启无边框模式。优先级低于 Checkbox.borderless | N
disabled | Boolean | undefined | 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled | N
keys | Object | - | 用来定义 value / label / disabled 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
max | Number | undefined | 支持最多选中的数量 | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TdCheckboxProps, TdCheckboxGroupProps } from './type';

export const checkboxDefaultProps: TdCheckboxProps = {
block: true,
borderless: false,
borderless: undefined,
checkAll: false,
defaultChecked: false,
disabled: undefined,
Expand All @@ -19,6 +19,7 @@ export const checkboxDefaultProps: TdCheckboxProps = {
};

export const checkboxGroupDefaultProps: TdCheckboxGroupProps = {
borderless: false,
disabled: undefined,
max: undefined,
readonly: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export interface TdCheckboxProps {
block?: boolean;
/**
* 是否开启无边框模式
* @default false
*/
borderless?: boolean;
/**
Expand Down Expand Up @@ -98,6 +97,11 @@ export interface TdCheckboxProps {
}

export interface TdCheckboxGroupProps<T = CheckboxGroupValue> {
/**
* 是否开启无边框模式。优先级低于 Checkbox.borderless
* @default false
*/
borderless?: boolean;
/**
* 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled
*/
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { TdCheckboxGroupProps } from '../checkbox/type';
import { PropType } from 'vue';

export default {
/** 是否开启无边框模式。优先级低于 Checkbox.borderless */
borderless: Boolean,
/** 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled */
disabled: {
type: Boolean,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
name | type | default | description | required
-- | -- | -- | -- | --
block | Boolean | true | \- | N
borderless | Boolean | undefined | \- | N
checkAll | Boolean | false | \- | N
checked | Boolean | false | `v-model` and `v-model:checked` is supported | N
defaultChecked | Boolean | false | uncontrolled property | N
Expand Down Expand Up @@ -36,6 +37,7 @@ change | `(checked: boolean, context: { e: Event })` | \-

name | type | default | description | required
-- | -- | -- | -- | --
borderless | Boolean | false | \- | N
disabled | Boolean | undefined | \- | N
keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
max | Number | undefined | \- | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
block | Boolean | true | 是否为块级元素 | N
borderless | Boolean | undefined | 是否开启无边框模式 | N
checkAll | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
checked | Boolean | false | 是否选中。支持语法糖 `v-model` 或 `v-model:checked` | N
defaultChecked | Boolean | false | 是否选中。非受控属性 | N
Expand Down Expand Up @@ -36,6 +37,7 @@ change | `(checked: boolean, context: { e: Event })` | 值变化时触发

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
borderless | Boolean | false | 是否开启无边框模式。优先级低于 Checkbox.borderless | N
disabled | Boolean | undefined | 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled | N
keys | Object | - | 用来定义 value / label / disabled 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
max | Number | undefined | 支持最多选中的数量 | N
Expand Down
5 changes: 5 additions & 0 deletions packages/products/tdesign-mobile-vue/src/checkbox/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export default {
type: Boolean,
default: true,
},
/** 是否开启无边框模式 */
borderless: {
type: Boolean,
default: undefined,
},
/** 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 */
checkAll: Boolean,
/** 是否选中 */
Expand Down
9 changes: 9 additions & 0 deletions packages/products/tdesign-mobile-vue/src/checkbox/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export interface TdCheckboxProps {
* @default true
*/
block?: boolean;
/**
* 是否开启无边框模式
*/
borderless?: boolean;
/**
* 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用
* @default false
Expand Down Expand Up @@ -97,6 +101,11 @@ export interface TdCheckboxProps {
}

export interface TdCheckboxGroupProps<T = CheckboxGroupValue> {
/**
* 是否开启无边框模式。优先级低于 Checkbox.borderless
* @default false
*/
borderless?: boolean;
/**
* 是否禁用组件。优先级:Form.disabled < CheckboxGroup.disabled < Checkbox.disabled
*/
Expand Down
10 changes: 8 additions & 2 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -25147,6 +25147,7 @@
{
"id": 3522,
"platform_framework": [
"8",
"16",
"32",
"64"
Expand All @@ -25157,7 +25158,7 @@
"field_type": [
"4"
],
"field_default_value": "false",
"field_default_value": "undefined",
"field_enum": "",
"field_desc_zh": "是否开启无边框模式",
"field_desc_en": null,
Expand All @@ -25177,6 +25178,7 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
Expand Down Expand Up @@ -26356,6 +26358,8 @@
{
"id": 3521,
"platform_framework": [
"8",
"16",
"32",
"64"
],
Expand All @@ -26367,7 +26371,7 @@
],
"field_default_value": "false",
"field_enum": "",
"field_desc_zh": "是否开启无边框模式",
"field_desc_zh": "是否开启无边框模式。优先级低于 Checkbox.borderless",
"field_desc_en": null,
"field_required": 0,
"event_input": "",
Expand All @@ -26385,6 +26389,8 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
Expand Down