From 5979d3370da098440207b32b658788364ed57471 Mon Sep 17 00:00:00 2001 From: anlyyao Date: Sun, 27 Apr 2025 15:09:09 +0800 Subject: [PATCH 1/3] feat(Cascader): support header slot --- src/cascader/README.en-US.md | 1 + src/cascader/README.md | 1 + src/cascader/cascader.wxml | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/cascader/README.en-US.md b/src/cascader/README.en-US.md index c18f6d4f8..42a0bb131 100644 --- a/src/cascader/README.en-US.md +++ b/src/cascader/README.en-US.md @@ -10,6 +10,7 @@ style | Object | - | CSS(Cascading Style Sheets) | N custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N check-strictly | Boolean | false | \- | N close-btn | Boolean / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N +header | Slot | - | `1.9.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N options | Array | [] | Typescript:`Array` | N placeholder | String | 选择选项 | \- | N diff --git a/src/cascader/README.md b/src/cascader/README.md index a81ff13f9..a94f7161e 100644 --- a/src/cascader/README.md +++ b/src/cascader/README.md @@ -62,6 +62,7 @@ style | Object | - | 样式 | N custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N check-strictly | Boolean | false | 父子节点选中状态不再关联,可各自选中或取消 | N close-btn | Boolean / Slot | true | 关闭按钮。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N +header | Slot | - | `1.9.1`。头部。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N options | Array | [] | 可选项数据源。TS 类型:`Array` | N placeholder | String | 选择选项 | 未选中时的提示文案 | N diff --git a/src/cascader/cascader.wxml b/src/cascader/cascader.wxml index cab98bcdd..01dae08fe 100644 --- a/src/cascader/cascader.wxml +++ b/src/cascader/cascader.wxml @@ -10,6 +10,9 @@ + + + From 4f81f4bc99b45b11e79901db8fcd2bc40c565c8c Mon Sep 17 00:00:00 2001 From: anlyyao Date: Sun, 27 Apr 2025 15:18:30 +0800 Subject: [PATCH 2/3] docs(Input): generate api docs --- src/input/README.en-US.md | 7 ++++--- src/input/README.md | 5 +++-- src/input/_example/suffix/index.wxml | 6 +----- src/input/_example/suffix/index.wxss | 3 +++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/input/README.en-US.md b/src/input/README.en-US.md index 83d7f8f03..66d3e62b7 100644 --- a/src/input/README.en-US.md +++ b/src/input/README.en-US.md @@ -10,7 +10,7 @@ style | Object | - | CSS(Cascading Style Sheets) | N custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N adjust-position | Boolean | true | \- | N align | String | left | text align type。options: left/center/right | N -allow-input-over-max | Boolean | false | `1.8.6`. allow to continue input on value length is over `maxlength` or `maxcharacter` | N +allow-input-over-max | Boolean | false | `1.8.6`。allow to continue input on value length is over `maxlength` or `maxcharacter` | N always-embed | Boolean | false | \- | N auto-focus | Boolean | false | \- | N borderless | Boolean | false | input without border | N @@ -23,6 +23,7 @@ cursor-color | String | #0052d9 | \- | N cursor-spacing | Number | 0 | \- | N disabled | Boolean | undefined | make input to be disabled | N error-message | String | - | `deprecated` | N +extra | Slot | - | `1.9.1`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N focus | Boolean | false | \- | N format | Function | - | input value formatter, `type=number` does not work. if you need to format number, `InputNumber` Component might be better。Typescript:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N hold-keyboard | Boolean | false | \- | N @@ -35,7 +36,7 @@ placeholder | String | undefined | \- | N placeholder-class | String | input-placeholder | \- | N placeholder-style | String | - | required | Y prefix-icon | String / Object / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -readonly | Boolean | undefined | \- | N +readonly | Boolean | undefined | `1.8.6` | N safe-password-cert-path | String | - | \- | N safe-password-custom-hash | String | - | \- | N safe-password-length | Number | - | \- | N @@ -108,4 +109,4 @@ Name | Default Value | Description --td-input-suffix-text-color | @text-color-primary | - --td-input-vertical-padding | 32rpx | - --td-input-warning-text-color | @warning-color | - ---td-input-warning-tips-color | @warning-color | - +--td-input-warning-tips-color | @warning-color | - \ No newline at end of file diff --git a/src/input/README.md b/src/input/README.md index 518544848..43fe3ece6 100644 --- a/src/input/README.md +++ b/src/input/README.md @@ -102,6 +102,7 @@ cursor-color | String | #0052d9 | 光标颜色。iOS 下的格式为十六进制 cursor-spacing | Number | 0 | 指定光标与键盘的距离,取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 | N disabled | Boolean | undefined | 是否禁用输入框 | N error-message | String | - | 已废弃。错误提示文本,值为空不显示(废弃属性,如果需要,请更为使用 status 和 tips) | N +extra | Slot | - | `1.9.1`。右侧额外内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N focus | Boolean | false | 获取焦点 | N format | Function | - | 指定输入框展示值的格式。TS 类型:`InputFormatType` `type InputFormatType = (value: InputValue) => string`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/input/type.ts) | N hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N @@ -114,7 +115,7 @@ placeholder | String | undefined | 占位符 | N placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 | N placeholder-style | String | - | 必需。指定 placeholder 的样式 | Y prefix-icon | String / Object / Slot | - | 组件前置图标。值为字符串表示图标名称,值为 `Object` 类型,表示透传至 `icon`。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N -readonly | Boolean | undefined | 只读状态 | N +readonly | Boolean | undefined | `1.8.6`。只读状态 | N safe-password-cert-path | String | - | 安全键盘加密公钥的路径,只支持包内路径 | N safe-password-custom-hash | String | - | 安全键盘计算 hash 的算法表达式,如 `md5(sha1('foo' + sha256(sm3(password + 'bar'))))` | N safe-password-length | Number | - | 安全键盘输入密码长度 | N @@ -187,4 +188,4 @@ t-class-tips | 提示样式类 --td-input-suffix-text-color | @text-color-primary | - --td-input-vertical-padding | 32rpx | - --td-input-warning-text-color | @warning-color | - ---td-input-warning-tips-color | @warning-color | - +--td-input-warning-tips-color | @warning-color | - \ No newline at end of file diff --git a/src/input/_example/suffix/index.wxml b/src/input/_example/suffix/index.wxml index eb2863d5f..890532d3a 100644 --- a/src/input/_example/suffix/index.wxml +++ b/src/input/_example/suffix/index.wxml @@ -5,11 +5,7 @@ bind:click="click" /> - - 操作按钮 - - - + 操作按钮 diff --git a/src/input/_example/suffix/index.wxss b/src/input/_example/suffix/index.wxss index e69de29bb..8debd9a21 100644 --- a/src/input/_example/suffix/index.wxss +++ b/src/input/_example/suffix/index.wxss @@ -0,0 +1,3 @@ +.extra { + --td-input-align-items: start; +} From 9cb7e499be1dafc8670594183752e4ceb241cbed Mon Sep 17 00:00:00 2001 From: anlyyao Date: Sun, 27 Apr 2025 15:21:16 +0800 Subject: [PATCH 3/3] test: update snapshots --- src/input/__test__/__snapshots__/demo.test.js.snap | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/input/__test__/__snapshots__/demo.test.js.snap b/src/input/__test__/__snapshots__/demo.test.js.snap index 07a1bbd87..5b2b9e0bd 100644 --- a/src/input/__test__/__snapshots__/demo.test.js.snap +++ b/src/input/__test__/__snapshots__/demo.test.js.snap @@ -273,18 +273,7 @@ exports[`Input Input suffix demo works fine 1`] = ` bind:click="click" /> - - 操作按钮 - - -