Skip to content

Commit

Permalink
feat(CheckboxGroup): add keys props
Browse files Browse the repository at this point in the history
  • Loading branch information
huxinhai committed Oct 9, 2024
1 parent 728a19f commit 8603fbe
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/checkbox/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,26 @@ default-value | Array | undefined | uncontrolled property。Typescript:`T` `ty
name | params | description
-- | -- | --
change | `(value: CheckboxGroupValue, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | \-

### CSS Variables

The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
-- | -- | --
--td-checkbox-bg-color | @bg-color-container | -
--td-checkbox-border-color | @component-stroke | -
--td-checkbox-description-color | @text-color-secondary | -
--td-checkbox-description-disabled-color | @text-color-disabled | -
--td-checkbox-description-line-height | 44rpx | -
--td-checkbox-font-size | 32rpx | -
--td-checkbox-icon-checked-color | @brand-color | -
--td-checkbox-icon-color | @component-border | -
--td-checkbox-icon-disabled-bg-color | @bg-color-component-disabled | -
--td-checkbox-icon-disabled-color | @brand-color-disabled | -
--td-checkbox-icon-size | 48rpx | -
--td-checkbox-tag-active-bg-color | @brand-color-light | -
--td-checkbox-tag-active-color | @brand-color | -
--td-checkbox-title-color | @text-color-primary | -
--td-checkbox-title-disabled-color | @text-color-disabled | -
--td-checkbox-title-line-height | 48rpx | -
--td-checkbox-vertical-padding | 32rpx | -
89 changes: 88 additions & 1 deletion src/checkbox/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,69 @@
:: BASE_DOC ::
---
title: Checkbox 多选框
description: 用于预设的一组选项中执行多项选择,并呈现选择结果。
spline: form
isComponent: true
---

<span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20lines-85%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20functions-87%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20statements-86%25-blue" /></span><span class="coverages-badge" style="margin-right: 10px"><img src="https://img.shields.io/badge/coverages%3A%20branches-76%25-red" /></span>
## 引入

全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。

```json
"usingComponents": {
"t-checkbox": "tdesign-miniprogram/checkbox/checkbox",
"t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group"
}
```

## 代码演示

<a href="https://developers.weixin.qq.com/s/2M5mxim27YSp" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> 在开发者工具中预览效果 </a>

<blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" >
<p>Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"</p>
</blockquote>

### 组件类型

纵向多选框

{{ base }}

横向多选框

{{ horizontal }}

带全选多选框

{{ all }}

### 组件状态

多选框状态

{{ status }}

### 组件样式

勾选样式

{{ type }}

勾选显示位置

{{ right }}

非通栏多选样式

{{ card }}

### 组件规格

多选框尺寸规格

{{ special }}

## API

Expand Down Expand Up @@ -63,3 +128,25 @@ default-value | Array | undefined | 选中值。非受控属性。TS 类型:`T
名称 | 参数 | 描述
-- | -- | --
change | `(value: CheckboxGroupValue, context: { value: boolean\|number\|string, label: boolean\|number\|string })` | 值变化时触发。`context` 表示当前点击项内容。
### CSS Variables

组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
--td-checkbox-bg-color | @bg-color-container | -
--td-checkbox-border-color | @component-stroke | -
--td-checkbox-description-color | @text-color-secondary | -
--td-checkbox-description-disabled-color | @text-color-disabled | -
--td-checkbox-description-line-height | 44rpx | -
--td-checkbox-font-size | 32rpx | -
--td-checkbox-icon-checked-color | @brand-color | -
--td-checkbox-icon-color | @component-border | -
--td-checkbox-icon-disabled-bg-color | @bg-color-component-disabled | -
--td-checkbox-icon-disabled-color | @brand-color-disabled | -
--td-checkbox-icon-size | 48rpx | -
--td-checkbox-tag-active-bg-color | @brand-color-light | -
--td-checkbox-tag-active-color | @brand-color | -
--td-checkbox-title-color | @text-color-primary | -
--td-checkbox-title-disabled-color | @text-color-disabled | -
--td-checkbox-title-line-height | 48rpx | -
--td-checkbox-vertical-padding | 32rpx | -

0 comments on commit 8603fbe

Please sign in to comment.