Skip to content

Commit

Permalink
1.1.11 (#2154)
Browse files Browse the repository at this point in the history
* fix(loading): resolve style error (#1873)

* fix(loading): resolve style error

* test: update unit test

* feat: empty的文案添加换行 (#1870)

* fix(button): 修复[button] type="submit"时,disabled未生效 (#1878)

* fix(button): 修复[button] type="submit"时,disabled未生效

修复[button] type="submit"时,disabled未生效

* fix(button): 修复[button] type="submit"时,disabled未生效

修复[button] type="submit"时,disabled未生效

* test: update snap

---------

Co-authored-by: zjianzzhang <[email protected]>

* style(row): row垂直居中样式 (#1866)

添加row的flex布局,垂直居中

* fix(progress): 安卓机朗读异常 & 动态朗读 (#1354)

* fix: 安卓机朗读异常

* fix: fix code

* fix: 安卓不发音

* fix: fix code

* fix: wip 优化中

* fix: 优化

* chore: update snap

* fix: fix code

* fix: fix code

* fix: 错误使用iOS变量

* fix(补充注释): 补充注释

* fix: 优化

* test: update snap

* fix: 补充注释

* fix: 优化部分注释, remove code

* fix: 优化注释

---------

Co-authored-by: leejimqiu <[email protected]>

* feature/swiper aria v2 (#1598)

* feat(swiper): support aria

* feat(swiper): support custom ariaLabel

* feat(swiper): image name

* chore(swiper): update snap

---------

Co-authored-by: leejimqiu <[email protected]>

* docs: update custom theme

* fix(radio): resolve style (#1889)

* feat: 支持分割线组件的线条使用变量控制属性 (#1890)

* fix(action-sheet): resolve ts error of show method (#1907)

* fix(grid): 修复column>=4个时,--td-grid-item-image-width和--td-grid-item-text-font-size是无效的 (#1903)

* chore: update _common (#1902)

* feat: 支持radio的内容字体大小使用变量。 (#1895)

* feat: 支持radio的内容字体大小使用变量。

* style: 修改css变量名称

* Bitjian fix/radio icon size (#1909)

* fix: 修复--td-radio-icon-size对未选中的图标未生效

* fix: fix radio 未选择的图标未生效

* fix(radio): support css variables to change circle icon size

---------

Co-authored-by: bitjian <[email protected]>

* chore: publish v1.1.2 (#1910)

* chore: publish v1.1.2

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(rate): 评分组件支持无障碍滑动 (#1574)

* fix(rate): 评分组件支持滑动无障碍操作(#1050)

* fix(rate): 评分组件样式问题修复.(#1050)

* fix(rate): 评分组件单测问题.(#1050)

* fix(rate): 抽象样式, 冗余代码.(#1050)

* fix(rate): 删除冗余节点.(#1050)

* fix(rate): 优化读取.(#1050)

* fix(rate): 新增额外的读取.(#1050)

* fix(rate): 修复警告旁白导致的滑动卡顿.(#1050)

* fix(rate): sr-only注释(#1050)

* fix(rate): update test snapshots. (#1050)

* build: remove preview workflow tentatively

* fix(upload): resolve max (#1914)

* fix(navbar): resolve capsule zindex (#1920)

* chore: update site

* fix(button): 修复variant=outline等状态下loading不展示 (#1922)

* fix(button): 修复variant=outline等状态下loading不展示

* fix(button): loading inheritColor 字段错误

* fix(navbar): resolve vertical align (#1926)

* fix(navbar): resolve vertical align

* test(navbar): update snapshot

* fix(dropdown-menu): support multiple column radio (#1927)

* fix(Link): resolve disabled problem (#1928)

* fix(calendar): resolve error (#1930)

* fix(calendar): resolve error

* fix(calendar): make observer robust

* fix(tabs): resolve content overflow (#1931)

* fix(tabs): resolve content overflow

* test(tabs): update snapshot

* chore: update issue template

* fix(Input): resolve vertical layout style error (#1934)

* feat(collapse): add header-left-icon property (#1933)

* feat(tabs): add middle slot (#1936)

* chore: publish v1.1.3 (#1937)

* chore: publish v1.1.3

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(slider): enable dragstart and dragend event (#1940)

* fix(image-viewer): add using-custom-navation property (#1944)

* feat(Swiper): update api docs (#1945)

* feat(Swiper): update api docs

* Update CHANGELOG.md

* fix(picker): enable to using falsy value (#1948)

* fix(toast): auto hide when page is hide (#1947)

* feat(swiper): add image-load event (#1949)

* feat(swiper): add image-load event

* fix: resolve fallback value

* test: update snapshot

* chore: publish v1.1.4 (#1950)

* chore: publish v1.1.4

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs(picker): enrich api detail (#1956)

* fix(tabs): resolve track position (#1958)

* feat(pulldown-refresh): add some properties from scroll-view (#1959)

* feat(pulldown-refresh): add some properties from scroll-view

* refactor(pulldown-refresh): using px to calculate

* feat(loading): support indicator slot

* test: update snapshot

* fix(pulldown-refresh): resolve value (#1960)

* feat(datetime-picker): support steps property (#1961)

* feat(steps): add sequence property (#1962)

* feat(dropdown-menu): add css variable for border width (#1967)

* feat(Stepper): allow input to be empty (#1971)

* fix(calendar): enable scroll into view when use-popup is false (#1969)

* chore(image-viewer): update demo (#1968)

* chore(image-viewer): update demo

* chore(image-viewer): update demo

* fix(action-sheet): enable close when click cancel

* chore: recover demo

* chore: publish v1.1.5 (#1975)

* chore: publish v1.1.5

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs(badge): update api

* fix(navbar): Fix invalid fixed attribute of Navbar component (#1982)

* feat(Icon): update icon from 0.1.2 to 0.1.4 (#1979)

* feat(Icon): update iconform 0.1.2 to 0.1.4

* test: update snapshots

* chore: update _common

* Feat/picker-zindex (#1985)

* feat: picker添加层级控制

* refactor: 修改popupProps的处理逻辑

* refactor: fix template error

* fix: picker compile error

* fix(DropdownMenu): auto scroll to current (#1788) (#1981)

* fix(DropdownMenu): auto scroll to current (#1788)

* fix(DropdownMenu): resolve auto scroll wrong height (#1788)

* fix(DropdownMenu): auto multi scroll to current (#1788)

* feat: 添加支持date-picker的蒙层属性透 (#1991)

* feat(Slider): the step attribute supports decimals (#1990)

* feat(Slider): the step attribute supports decimals

* fix(slider): resolve emit same value

---------

Co-authored-by: leejimqiu <[email protected]>

* chore: publish v1.1.5-beta

* fix(pulldown-refresh): resolve refresh event

* fix: 修复variant动态修改无效

* feat(Grid): enrich demo (#1993)

* feat(Input): resolve label content wraps (#1994)

* docs(Steps): remove invalid attributes (#1995)

* fix(pulldown-refresh): resolve refresh event (#1998)

* fix(pulldown-refresh): resolve refresh event

* fix(pulldown-refresh): resolve change event

* fix: fix [下拉菜单] 单选选项行高不一致 #1980 (#1992)

* feat: action-sheet支持层级 (#2002)

* fix: 修复多余 row 的样式导致 col 不换行问题 (#1996)

* fix: 修复row样式问题

fix #1964, fix #1851

* fix: 修复多余 row 的样式导致 col 不换行问题

"fix #1964", "fix #1851"

---------

Co-authored-by: pingwu <[email protected]>

* fix(dialog): display of cancel and confirm button when calling a command. (#1986)

* fix(dialog): Display problem of cancel and confirm button when calling a command.

* revert(dialog): Revert changes to ` dialog.wxml`

* fix(dialog): Button issue when invoking commands.

---------

Co-authored-by: yuchumian <[email protected]>

* fix(calendar): enable calendar type (#2003)

* chore: publish v1.1.6 (#2004)

* chore: publish v1.1.6

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore(ActionSheet): prohibit exporting components at index (#2008)

* feat: action-sheet支持cancel的颜色变量 (#2007)

* fix(sticky): resolve width (#2012)

* fix(side-bar-item): fix prefix and suffix style anomalies (#2011)

* fix(tabbar): resolve width when virtual-host not available (#2013)

* chore: publish v1.1.6-beta

* build: update npm publish

* fix(action-sheet): resolve invalid syntax

* fix(Icon): rename some icons (#2020)

* fix(Icon): rename some icons

* test: update snapshots

* chore: publish v1.1.7 (#2031)

* chore: publish v1.1.7

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat(Textarea): support max/min height (#2035)

* feat(Textarea): support max/min height

* test: update snapshots

* fix: rename proposal to transform and display installation dependencies (#2046)

* fix(DropdownMenu): resolved the basic library cannot be used under version 2.19.2 (#2043)

* fix(DropdownMenu): resolved the basic library cannot be used under version 2.19.2

* test: update snapshots

* fix(Sticky): resolved width problem (#2047)

* fix(Sticky): resolved width problem

* fix(sticky): recover classname

---------

Co-authored-by: leejimqiu <[email protected]>

* fix(navbar): polish bg support (#2049)

* fix(drawer): resolve word misspelling (#2039)

* fix(drawer): item-click parameter error

* fix(drawer): item-click parameter error

* fix(drawer): item-click parameter error

* fix(image): enable dynamic dimension (#2050)

* chore: publish v1.1.8 (#2051)

* chore: publish v1.1.8

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(indexes): 索引导航无法选中问题 (#2036)

* fix(indexes): 异步数据未重新计算高度

* docs(indexes): 增加async文档说明

* fix(indexes): 通过indexList null判断是否异步数据

* fix(indexes): 修改indexList type类型

* feat(switch): prevent click when the switch component props loading is true (#2061)

* feat(checkbox): 自定义图标增加半选中态 (#2056)

* feat(Search): support cursor-spacing attr (#2065)

* feat(Search): support cursor-spacing attr

* test: update snapshots

* fix(Switch): resolved loading state style (#2074)

* fix(Icon): resolved icon naming error (#2076)

* fix(tree-select): enable keys property (#2085)

* fix(radio-group): fix abnormal display of radio group selection status (#2082)

* fix(radio-group): fix abnormal display of radio group selection status

* fix(radio-group): fix abnormal display of radio group selection status

* docs(slider): add faq part

* fix(CellGroup): resolved borderen invalid (#2089)

* chore: publish v1.1.9 (#2091)

* chore: publish v1.1.9

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat(notice-bar): add interval property when direction='vertical'

* test(notice-bar): add interval property when direction='vertical'

* fix(Grid): resolved align='laft' valid (#2110)

* fix(Fab): resolved hover-class invalid (#2093)

* fix(upload): fix abnormal image display (#2098)

* feat(tabs): add split property (#2113)

* fix(slider): fix abnormal calculation of slider mark (#2114)

* fix(Input): resolve value=0 is valid when type is number (#2108)

* fix(slider): enable async render (#2115)

* fix: add type check before call pagescroll (#2116)

* build: remove issue assign logic

* fix(action-sheet): do not trigger close event when disabled (#2117)

* fix(stepper): trigger change when value changed (#2118)

* chore: publish v1.1.10 (#2119)

* chore: publish v1.1.10

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix(tabs): fix style anomalies caused by too many tabs items (#2123)

* fix(picker): fix default value is invalid (#2126)

* feat(checkbox-group): add borderless property (#2124)

* feat(checkbox-group): add borderless property

* test(checkbox-group): add borderless property

* fix(Stepper): resolved precision problem (#2130)

* fix(radio): fix vertical align (#2135)

* fix(checkbox): resolve align when icon size changed (#2136)

* docs(checkbox): update (#2137)

* docs(checkbox): update

* fix(checkbox): resolve priority of disabled property

* fix(search): catch tap event when trigger clear (#2139)

* fix(search): catch tap event when triiger clear

* test(search): update snapshot

* docs: update used page

* fix(divider): replace external class (#2140)

* fix(divider): replace external class

* test: update snapshot

* feat(radio): enable allow-uncheck (#2141)

* feat(radio): enable allow-uncheck

* feat(radio-group): add allowUncheck for RadioOption

* test(radio-group): add allowUncheck for RadioOption

* feat(radio-group): update change value

* fix(toast): resolve repeated event triggering (#2146)

* feat(dropdown-item): add close event (#2147)

* fix: resolve console warnings (#2149)

* Update README.md (#2150)

* fix(popup): update width when placement is bottom (#2152)

* chore: publish v1.1.11 (#2153)

* chore: publish v1.1.11

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: Cyrus <[email protected]>
Co-authored-by: favouredddd <[email protected]>
Co-authored-by: 孜孜 <[email protected]>
Co-authored-by: zjianzzhang <[email protected]>
Co-authored-by: tomcat-hz <[email protected]>
Co-authored-by: 龙风 <[email protected]>
Co-authored-by: zhangpaopao <[email protected]>
Co-authored-by: Guan9 <[email protected]>
Co-authored-by: Y <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: byqbai <[email protected]>
Co-authored-by: betavs <[email protected]>
Co-authored-by: jarmywang <[email protected]>
Co-authored-by: jurrychen <[email protected]>
Co-authored-by: pingwu <[email protected]>
Co-authored-by: pingwu <[email protected]>
Co-authored-by: yuchumian <[email protected]>
Co-authored-by: yuchumian <[email protected]>
Co-authored-by: ElanYoung <[email protected]>
Co-authored-by: betavs <[email protected]>
  • Loading branch information
21 people authored Jul 4, 2023
1 parent e680444 commit aa0d3fd
Show file tree
Hide file tree
Showing 40 changed files with 195 additions and 125 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ toc: false
docClass: timeline
---

## 🌈 1.1.11 `2023-07-04`
### 🚀 Features
- `CheckboxGroup`: 新增 borderless 属性 @betavs ([#2124](https://github.com/Tencent/tdesign-miniprogram/pull/2124))
- `Radio`: 允许取消选中 @betavs ([#2141](https://github.com/Tencent/tdesign-miniprogram/pull/2141))
- `DropdownItem`: 新增 close 事件 @LeeJim ([#2147](https://github.com/Tencent/tdesign-miniprogram/pull/2147))
### 🐞 Bug Fixes
- `Tabs`: 解决选项过多时样式错误的问题 @betavs ([#2123](https://github.com/Tencent/tdesign-miniprogram/pull/2123))
- `Picker`: 修复默认值无效 @betavs ([#2126](https://github.com/Tencent/tdesign-miniprogram/pull/2126))
- `Stepper`: 修复精度缺失问题 @anlyyao ([#2130](https://github.com/Tencent/tdesign-miniprogram/pull/2130))
- `Radio`: 修复自定义图标大小之后的垂直对齐问题 @betavs ([#2135](https://github.com/Tencent/tdesign-miniprogram/pull/2135))
- `Checkbox`: 修复自定义图标尺寸后的垂直对齐问题 @LeeJim ([#2136](https://github.com/Tencent/tdesign-miniprogram/pull/2136))
- `CheckboxGroup`: 修复使用 options 时,disabled 不生效的问题 @LeeJim ([#2137](https://github.com/Tencent/tdesign-miniprogram/pull/2137))
- `Checkbox`: 修复 disabled 优先级的问题 @LeeJim ([#2137](https://github.com/Tencent/tdesign-miniprogram/pull/2137))
- `Search`: 截获点击 clear 触发的 tap 事件 @LeeJim ([#2139](https://github.com/Tencent/tdesign-miniprogram/pull/2139))
- `Divider`: 修复外部样式类的位置 @LeeJim ([#2140](https://github.com/Tencent/tdesign-miniprogram/pull/2140))
- `Toast`: 解决 close 事件重复触发 @LeeJim ([#2146](https://github.com/Tencent/tdesign-miniprogram/pull/2146))
- `Popup`: 修复底部弹出时的宽度问题 @LeeJim ([#2152](https://github.com/Tencent/tdesign-miniprogram/pull/2152))

### 🚧 Others

- 解决控制台报警的问题 @LeeJim ([#2149](https://github.com/Tencent/tdesign-miniprogram/pull/2149))

## 🌈 1.1.10 `2023-06-20`
### 🚀 Features
- `Tabs`: 新增 split 属性 @LeeJim ([#2113](https://github.com/Tencent/tdesign-miniprogram/pull/2113))
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ npm run dev

最低基础库版本`^2.6.5`

## 团队成员

<a href="https://github.com/tencent/tdesign-miniprogram/graphs/contributors">
<img src="https://contrib.rocks/image?repo=tencent/tdesign-miniprogram" />
</a>

## 开源协议

TDesign 遵循 [MIT 协议](https://github.com/Tencent/tdesign-miniprogram/LICENSE)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-miniprogram",
"purename": "tdesign",
"version": "1.1.10",
"version": "1.1.11",
"description": "tdesign-miniprogram",
"title": "tdesign-ßminiprogram",
"main": "miniprogram_dist/index.js",
Expand Down
12 changes: 12 additions & 0 deletions site/data/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,16 @@ export default [
preview: ['https://tdesign.gtimg.com/miniprogram/case/haoyongqrcode.png'],
qrcode: 'https://tdesign.gtimg.com/miniprogram/case/haoyongqrcode-code.png',
},
{
name: '去野户外club',
tags: ['效率工具'],
preview: ['https://tdesign.gtimg.com/miniprogram/case/intowild.png'],
qrcode: 'https://tdesign.gtimg.com/miniprogram/case/intowild-code.jpeg',
},
{
name: '库壁啦',
tags: ['效率工具'],
preview: ['https://tdesign.gtimg.com/miniprogram/case/bikula.png'],
qrcode: 'https://tdesign.gtimg.com/miniprogram/case/bikula-code.jpeg',
},
];
12 changes: 6 additions & 6 deletions src/avatar/avatar.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
wx:if="{{image}}"
t-class="{{prefix}}-image {{classPrefix}}__image"
t-class-load="{{prefix}}-class-alt"
style="{{imageProps.style || ''}}"
style="{{imageProps && imageProps.style || ''}}"
src="{{image}}"
mode="{{imageProps.mode || 'aspectFill'}}"
lazy="{{imageProps.lazy || false}}"
loading="{{imageProps.loading || 'default'}}"
shape="{{imageProps.shape || 'round'}}"
webp="{{imageProps.webp || false}}"
mode="{{imageProps && imageProps.mode || 'aspectFill'}}"
lazy="{{imageProps && imageProps.lazy || false}}"
loading="{{imageProps && imageProps.loading || 'default'}}"
shape="{{imageProps && imageProps.shape || 'round'}}"
webp="{{imageProps && imageProps.webp || false}}"
error="{{alt || 'default'}}"
bind:error="onLoadError"
/>
Expand Down
8 changes: 1 addition & 7 deletions src/checkbox-group/checkbox-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ export default class CheckBoxGroup extends SuperComponent {
checkboxOptions: [],
};

properties = {
...props,
borderless: {
type: Boolean,
value: false,
},
};
properties = props;

observers = {
value() {
Expand Down
3 changes: 2 additions & 1 deletion src/checkbox-group/checkbox-group.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
content-disabled="{{item.contentDisabled || false}}"
icon="{{item.icon || 'circle'}}"
indeterminate="{{item.indeterminate || false}}"
disabled="{{item.disabled}}"
disabled="{{ item.disabled == null ? disabled : item.disabled }}"
max-content-row="{{item.maxContentRow || 5}}"
max-label-row="{{item.maxLabelRow || 3}}"
name="{{item.name || ''}}"
borderless="{{borderless}}"
readonly="{{item.readonly || false}}"
bind:change="handleInnerChildChange"
placement="{{item.placement || 'left'}}"
Expand Down
11 changes: 5 additions & 6 deletions src/checkbox-group/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

import { TdCheckboxGroupProps } from './type';
const props: TdCheckboxGroupProps = {
/** 自定义组件样式 */
style: {
type: String,
value: '',
/** 是否开启无边框模式 */
borderless: {
type: Boolean,
value: false,
},
/** 是否禁用组件 */
/** 是否禁用组件,默认为 false。 CheckboxGroup.disabled < Checkbox.disabled ,后续新增 Form 组件后,Form.disabled 优先级最低 */
disabled: {
type: Boolean,
value: false,
},
/** 支持最多选中的数量 */
max: {
Expand Down
21 changes: 10 additions & 11 deletions src/checkbox-group/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

export interface TdCheckboxGroupProps {
export interface TdCheckboxGroupProps<T = CheckboxGroupValue> {
/**
* 自定义组件样式
* @default ''
* 是否开启无边框模式
* @default false
*/
style?: {
type: StringConstructor;
value?: string;
borderless?: {
type: BooleanConstructor;
value?: boolean;
};
/**
* 是否禁用组件
* @default false
* 是否禁用组件,默认为 false。 CheckboxGroup.disabled < Checkbox.disabled ,后续新增 Form 组件后,Form.disabled 优先级最低
*/
disabled?: {
type: BooleanConstructor;
Expand Down Expand Up @@ -50,15 +49,15 @@ export interface TdCheckboxGroupProps {
*/
value?: {
type: ArrayConstructor;
value?: CheckboxGroupValue;
value?: T;
};
/**
* 选中值,非受控属性
* @default []
*/
defaultValue?: {
type: ArrayConstructor;
value?: CheckboxGroupValue;
value?: T;
};
}

Expand All @@ -71,4 +70,4 @@ export interface CheckboxOptionObj {
checkAll?: true;
}

export type CheckboxGroupValue = Array<string | number>;
export type CheckboxGroupValue = Array<string | number | boolean>;
18 changes: 10 additions & 8 deletions src/checkbox/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@

name | type | default | description | required
-- | -- | -- | -- | --
placement | String | left | options:left/right | N
block | Boolean | true | \- | N
borderless | Boolean | false | \- | N
check-all | Boolean | false | \- | N
checked | Boolean | false | \- | N
default-checked | Boolean | undefined | uncontrolled property | N
content | String / Slot | - | \- | N
content | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
content-disabled | Boolean | - | \- | N
disabled | Boolean | undefined | \- | N
external-classes | Array | - | `['t-class', 't-class-icon', 't-class-label', 't-class-content', 't-class-border']` | N
icon | String / Array | 'circle' | Typescript:`'circle' \| 'line' \| 'rectangle' \| string[]` | N
indeterminate | Boolean | false | \- | N
label | String / Slot | - | \- | N
label | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
max-content-row | Number | 5 | \- | N
max-label-row | Number | 3 | \- | N
name | String | - | \- | N
placement | String | left | options:left/right | N
readonly | Boolean | false | \- | N
value | String / Number | - | Typescript:`string \| number \| boolean` | N
value | String / Number / Boolean | - | value of checkbox。Typescript:`string \| number \| boolean` | N

### Checkbox Events

Expand All @@ -33,15 +34,16 @@ change | `(checked: boolean)` | \-

name | type | default | description | required
-- | -- | -- | -- | --
disabled | Boolean | false | \- | N
borderless | Boolean | false | \- | N
disabled | Boolean | - | \- | N
max | Number | undefined | \- | N
name | String | - | \- | N
options | Array | [] | Typescript:`Array<CheckboxOption>` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
value | Array | [] | Typescript:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
default-value | Array | undefined | uncontrolled property。Typescript:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
value | Array | [] | Typescript:`T` `type CheckboxGroupValue = Array<string \| number \| boolean>`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
default-value | Array | undefined | uncontrolled property。Typescript:`T` `type CheckboxGroupValue = Array<string \| number \| boolean>`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N

### CheckboxGroup Events

name | params | description
-- | -- | --
change | `(value: CheckboxGroupValue, context: CheckboxGroupChangeContext)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: Event; current: string \| number; option: CheckboxOption \| TdCheckboxProps; type: 'check' \| 'uncheck' }`<br/>
change | `(value: CheckboxGroupValue)` | \-
20 changes: 11 additions & 9 deletions src/checkbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,24 @@ isComponent: true

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
placement | String | left | 多选框和内容相对位置。可选项:left/right | N
block | Boolean | true | 是否为块级元素 | N
borderless | Boolean | false | 是否开启无边框模式 | N
check-all | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
checked | Boolean | false | 是否选中 | N
default-checked | Boolean | undefined | 是否选中。非受控属性 | N
content | String / Slot | - | 多选框内容 | N
content | String / Slot | - | 多选框内容[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
content-disabled | Boolean | - | 是否禁用组件内容(content)触发选中 | N
disabled | Boolean | undefined | 是否禁用组件 | N
disabled | Boolean | undefined | 是否禁用组件。如果父组件存在 CheckboxGroup,默认值由 CheckboxGroup.disabled 控制。优先级:Checkbox.disabled > CheckboxGroup.disabled > Form.disabled | N
external-classes | Array | - | 组件类名,分别用于设置 组件外层、多选框图标、主文案、内容 等元素类名。`['t-class', 't-class-icon', 't-class-label', 't-class-content', 't-class-border']` | N
icon | String / Array | 'circle' | 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标,半选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标。TS 类型:`'circle' \| 'line' \| 'rectangle' \| string[]` | N
indeterminate | Boolean | false | 是否为半选 | N
label | String / Slot | - | 主文案 | N
label | String / Slot | - | 主文案[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
max-content-row | Number | 5 | 内容最大行数限制 | N
max-label-row | Number | 3 | 主文案最大行数限制 | N
name | String | - | HTML 元素原生属性 | N
placement | String | left | 多选框和内容相对位置。可选项:left/right | N
readonly | Boolean | false | 只读状态 | N
value | String / Number | - | 多选框的值。TS 类型:`string \| number` | N
value | String / Number / Boolean | - | 多选框的值。TS 类型:`string \| number \| boolean` | N

### Checkbox Events

Expand All @@ -92,15 +93,16 @@ change | `(checked: boolean)` | 值变化时触发

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
disabled | Boolean | false | 是否禁用组件 | N
borderless | Boolean | false | 是否开启无边框模式 | N
disabled | Boolean | - | 是否禁用组件,默认为 false。 CheckboxGroup.disabled < Checkbox.disabled ,后续新增 Form 组件后,Form.disabled 优先级最低 | N
max | Number | undefined | 支持最多选中的数量 | N
name | String | - | 统一设置内部复选框 HTML 属性 | N
options | Array | [] | 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」。TS 类型:`Array<CheckboxOption>` `type CheckboxOption = string \| number \| CheckboxOptionObj` `interface CheckboxOptionObj { label?: string; value?: string \| number; disabled?: boolean; checkAll?: true }`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
value | Array | [] | 选中值。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
default-value | Array | undefined | 选中值。非受控属性。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string \| number>`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
value | Array | [] | 选中值。TS 类型:`T` `type CheckboxGroupValue = Array<string \| number \| boolean>`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N
default-value | Array | undefined | 选中值。非受控属性。TS 类型:`T` `type CheckboxGroupValue = Array<string \| number \| boolean>`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts) | N

### CheckboxGroup Events

名称 | 参数 | 描述
-- | -- | --
change | `(value: CheckboxGroupValue, context: CheckboxGroupChangeContext)` | 值变化时触发`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中,`context.option` 表示当前变化的数据项。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/checkbox-group/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: Event; current: string \| number; option: CheckboxOption \| TdCheckboxProps; type: 'check' \| 'uncheck' }`<br/>
change | `(value: CheckboxGroupValue)` | 值变化时触发
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ exports[`Checkbox Checkbox all demo works fine 1`] = `
exports[`Checkbox Checkbox base demo works fine 1`] = `
<base>
<t-checkbox-group
borderless="{{true}}"
options="{{
Array [
Object {
Expand Down
1 change: 1 addition & 0 deletions src/checkbox/checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
height: @checkbox-icon-size;
color: @checkbox-icon-color;
font-size: @checkbox-icon-size;
margin-top: calc((@checkbox-title-line-height - @checkbox-icon-size) / 2);

&:empty {
display: none;
Expand Down
6 changes: 1 addition & 5 deletions src/checkbox/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class CheckBox extends SuperComponent {
const { value, disabled, borderless } = parent.data;
const valueSet = new Set(value);
const data: any = {
disabled: disabled || this.data.disabled,
disabled: this.data.disabled == null ? disabled : this.data.disabled,
};

if (borderless) {
Expand Down Expand Up @@ -53,10 +53,6 @@ export default class CheckBox extends SuperComponent {
type: String,
value: 'default',
},
borderless: {
type: Boolean,
value: false,
},
};

data = {
Expand Down
21 changes: 13 additions & 8 deletions src/checkbox/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

import { TdCheckboxProps } from './type';
const props: TdCheckboxProps = {
/** 多选框和内容相对位置 */
placement: {
type: String,
value: 'left',
},
/** 是否为块级元素 */
block: {
type: Boolean,
value: true,
},
/** 是否开启无边框模式 */
borderless: {
type: Boolean,
value: false,
},
/** 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 */
checkAll: {
type: Boolean,
Expand All @@ -39,16 +39,16 @@ const props: TdCheckboxProps = {
contentDisabled: {
type: Boolean,
},
/** 是否禁用组件 */
/** 是否禁用组件。如果父组件存在 CheckboxGroup,默认值由 CheckboxGroup.disabled 控制。优先级:Checkbox.disabled > CheckboxGroup.disabled > Form.disabled */
disabled: {
type: Boolean,
type: null,
value: undefined,
},
/** 组件类名,分别用于设置 组件外层、多选框图标、主文案、内容 等元素类名 */
externalClasses: {
type: Array,
},
/** 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标 */
/** 自定义选中图标和非选中图标。使用 Array 时表示:`[选中态图标,非选中态图标,半选中态图标]`。使用 String 时,值为 circle 表示填充圆形图标、值为 line 表示描边型图标、值为 rectangle 表示填充矩形图标 */
icon: {
type: null,
value: 'circle',
Expand Down Expand Up @@ -77,6 +77,11 @@ const props: TdCheckboxProps = {
type: String,
value: '',
},
/** 多选框和内容相对位置 */
placement: {
type: String,
value: 'left',
},
/** 只读状态 */
readonly: {
type: Boolean,
Expand Down
Loading

0 comments on commit aa0d3fd

Please sign in to comment.