From 46d7dfafff6ed3e92401eead75ce0c215347547f Mon Sep 17 00:00:00 2001 From: lijun Date: Wed, 16 Aug 2023 16:58:48 +0800 Subject: [PATCH] 1.2.0 (#2294) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 * 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 * 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 * 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 <1183048003@qq.com> * chore: publish v1.1.2 (#1910) * chore: publish v1.1.2 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * 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] * 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] * 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] * 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 * 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 * 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 * 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] * 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] * 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 * 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] * 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] * 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] * 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] * test: remove snapshot for virtual-host (#2161) * test: remove snapshot for virtual-host * test: update config * test: update config * fix(*): resolve console warn (#2164) * fix: 修复rate组件选中没有生效 (#2158) * fix: 修复rate组件选中没有生效 修复rate组件选中没有生效 * fix: 导致父组件tap失效 * fix(rate): uncatch event (#2168) * feat(pull-down-refresh): 增加show-scrollbar参数 (#2163) * docs(pulldown-refresh): add show-scrollbar property * fix(picker): observe value (#2169) * fix(tabs): enable scroll smoothly (#2170) * fix(tree-select): enable value with empty array (#2173) * chore: publish v1.1.12 (#2175) * chore: publish v1.1.12 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * chore: add css variables content for api docs (#2182) * fix: resolved some spelling mistake * chore: add css variables content for api docs * docs: add external-class content (#2186) * docs(Button): add external-class contnet * docs(Grid): add external-class contnet * docs(Divider): add external-class content * feat(action-sheet): support the show-overlay property (#2194) * fix(toast): fix type error in the close method of toast (#2191) * fix: action ci script security * fix: resolved some spelling mistake (#2197) * fix: resolved some spelling mistake * fix(StepItem): remove useless css * Fix/20230715 wrong label (#2195) * fix(slider, message): 修复message nowrap classPrefix 失效 & slider 组件标签大括号异常 message nowrap 属性中的 classPrefix 被当做字符串处理,导致无法正常使用。slider 组件中多出来了一对闭合大括号,导致无法正常匹配 * fix(message 组件): marquee 还原 变量还原 * fix(message): 多余中括号移除 多余中括号移除 --------- Co-authored-by: gao.ghf * docs(action-sheet): enable show-overlay (#2196) * fix(picker): column index is always zero (#2188) * docs: add external-class content (#2200) * chore: publish v1.1.13 (#2205) * chore: publish v1.1.13 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * fix(popup): resolve auto focus (#2209) * fix(popup): resolve auto focus * test: update snapshot * feat(action-sheet): support suffix icon for list type (#2210) * fix: resolve slider render (#2211) * feat(TreeSelect): support label super long ellipsis (#2208) * chore: publish v1.1.13-beta * fix: enable remove scroller when component detached (#2215) * fix: enable remove scroller when component detached * fix: update variable name * fix: resolve grammar problem (#2217) * fix: resolve grammar problem * fix: recover unexpected changed * feat(overlay): enable duration (#2179) * feat(overlay): enable duration * test: snap-update * test: update snapshot --------- Co-authored-by: lijun * chore: publish v1.1.14 (#2219) * chore: publish v1.1.14 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * docs(link): 补充使用说明,修复文档中句号导致的链接跳转错误 (#2227) * fix: update script for testing demo (#2235) * fix: update script for testing demo * fix: resolve eslint errors * fix(action-sheet): enable item color for grid type (#2231) * chore: remove getphonenumber on demo (#2225) * chore: remove getphonenumber on demo * test: update snapshot * fix(swipe-cell): enable dynaimc props (#2239) * feat(dropdown-menu): support custom icon for arrow (#2240) * chore: publish v1.1.15 (#2241) * chore: publish v1.1.15 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * fix(Swiper): resolved loading style (#2246) * feat(search): support property for input (#2229) * feat(search): support maxcharacter and maxlength property * feat(search): example that support maxcharacter and maxlength property * test(search): support maxcharacter and maxlength property * feat(search): support property for input * test(search): support property for input * perf(search): support property for input * perf(search): support property for input * docs(swiper): add external class (#2256) * fix(TabBar): resolved demo code error (#2257) * feat(Icon): update icon form 0.1.4 to 0.2.0 (#2254) * fix(Input): resolved t-class-label invalid (#2259) * fix(Input): resolved t-class-label invalid * feat(Input): enrich css variables * fix(grid-item): invalid less variables (#2253) * fix(grid-item): invalid less variables * fix(grid-item): initialize default values * chore: upgrade icon-view component (#2269) * fix(radio): avoid unnecessary render (#2271) * fix(radio): avoid unnecessaryrender * test: update snapshot * fix(swipe-cell): prevent default scroll (#2281) * fix(collapse): enable expand all (#2280) * fix(collapse): enable expand all * test: update snapshot * docs(radio): update api * fix(swipe-cell): enable hidden on the beginning (#2283) * fix(checkbox): enable icon using slot (#2285) * feat(loading): add css variable for text color (#2273) * feat(loading): add css variable for text color BREAKING CHANGE: q * fix(loading): update text color * docs(loading): update css variables * fix(popup): resolve scroll over throught (#2290) * fix(popup): resolve scroll over throught * test: update snapshot * fix(popup): prevent scroll throught * chore: publish v1.2.0 (#2293) * chore: publish v1.2.0 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] --------- Co-authored-by: Cyrus Co-authored-by: favouredddd <40692560+favouredddd@users.noreply.github.com> Co-authored-by: 孜孜 <1183048003@qq.com> Co-authored-by: zjianzzhang Co-authored-by: tomcat-hz <59186135+tomcat-hz@users.noreply.github.com> Co-authored-by: 龙风 <455947455@qq.com> Co-authored-by: zhangpaopao Co-authored-by: Guan9 Co-authored-by: Y Co-authored-by: github-actions[bot] Co-authored-by: byqbai Co-authored-by: betavs <34408516+betavs@users.noreply.github.com> Co-authored-by: jarmywang Co-authored-by: jurrychen <534747442@qq.com> Co-authored-by: pingwu <58472278+wuping97@users.noreply.github.com> Co-authored-by: pingwu Co-authored-by: yuchumian <26185330+yuchumian@users.noreply.github.com> Co-authored-by: yuchumian Co-authored-by: ElanYoung <39727435+ElanYoung@users.noreply.github.com> Co-authored-by: betavs <392368711@qq.com> Co-authored-by: Antzy Co-authored-by: xiaosansiji Co-authored-by: Hwaphon <969489625@qq.com> Co-authored-by: gao.ghf Co-authored-by: ccccpj Co-authored-by: qianxu Co-authored-by: wū yāng --- CHANGELOG.md | 24 + package.json | 4 +- .../__test__/__snapshots__/index.test.js.snap | 3 + src/checkbox/checkbox.wxml | 3 +- src/collapse-panel/collapse-panel.ts | 26 +- .../__test__/__snapshots__/index.test.js.snap | 8 +- src/collapse/collapse.ts | 3 - src/common/wechat.ts | 9 + .../__test__/__snapshots__/index.test.js.snap | 3 + .../__test__/__snapshots__/index.test.js.snap | 3 + .../__test__/__snapshots__/index.test.js.snap | 57 +- src/grid-item/grid-item.less | 10 +- .../__test__/__snapshots__/demo.test.js.snap | 15821 +++++++++++++++- src/icon/_example/data.js | 967 +- src/icon/icon.less | 4334 ++++- src/input/README.en-US.md | 2 + src/input/README.md | 2 + .../__test__/__snapshots__/index.test.js.snap | 10 +- src/input/input.less | 6 +- src/input/input.wxml | 4 +- src/loading/README.en-US.md | 1 + src/loading/README.md | 1 + src/loading/loading.less | 2 + .../__test__/__snapshots__/index.test.js.snap | 3 + src/popup/popup.ts | 2 - src/popup/popup.wxml | 12 +- src/popup/popup.wxs | 7 + src/radio/README.md | 2 +- src/radio/radio.ts | 10 +- src/search/README.md | 12 + .../__test__/__snapshots__/index.test.js.snap | 11 +- src/search/_example/maxlength/index.js | 1 + src/search/_example/maxlength/index.json | 5 + src/search/_example/maxlength/index.wxml | 6 + src/search/_example/maxlength/index.wxss | 4 + src/search/_example/search.json | 1 + src/search/_example/search.wxml | 3 + src/search/props.ts | 58 + src/search/search.ts | 21 +- src/search/search.wxml | 17 +- src/search/type.ts | 94 + src/swipe-cell/_example/swipe-cell.ts | 32 +- src/swipe-cell/swipe-cell.ts | 7 + src/swipe-cell/swipe-cell.wxs | 1 + src/swiper/README.md | 15 + .../__test__/__snapshots__/demo.test.js.snap | 14 +- src/swiper/_example/vertical/index.wxml | 6 +- src/swiper/_example/vertical/index.wxss | 10 +- src/swiper/swiper.less | 1 - src/tab-bar/README.md | 2 +- 50 files changed, 20536 insertions(+), 1124 deletions(-) create mode 100644 src/common/wechat.ts create mode 100644 src/search/_example/maxlength/index.js create mode 100644 src/search/_example/maxlength/index.json create mode 100644 src/search/_example/maxlength/index.wxml create mode 100644 src/search/_example/maxlength/index.wxss diff --git a/CHANGELOG.md b/CHANGELOG.md index fb7e27611..a1e718e7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,30 @@ toc: false docClass: timeline --- + ## 🌈 1.2.0 `2023-08-16` +### 🚀 Features +- `Search`: 支持透传更多 Input 的属性 @betavs ([#2229](https://github.com/Tencent/tdesign-miniprogram/pull/2229)) +- `Icon`: 图标更新,新增 `960` 个图标 @anlyyao ([#2254](https://github.com/Tencent/tdesign-miniprogram/pull/2254)) +- `Input`: 新增 `--td-input-label-max-width` 和 `--td-input-label-min-width` 两个样式变量 @anlyyao ([#2259](https://github.com/Tencent/tdesign-miniprogram/pull/2259)) +- `Loading`: 新增 CSS Variable 用于调整加载提示文案颜色 @ElanYoung ([#2273](https://github.com/Tencent/tdesign-miniprogram/pull/2273)) + +### 🐞 Bug Fixes +- `Swiper`: 修复图片加载中/加载错误占位符未居中的问题 @anlyyao ([#2246](https://github.com/Tencent/tdesign-miniprogram/pull/2246)) +- `TabBar`: 修复示例代码展示错误 @anlyyao ([#2257](https://github.com/Tencent/tdesign-miniprogram/pull/2257)) +- `Input`: 修复 `t-class-label` 外部样式类无法修改 `label` 宽度 @anlyyao ([#2259](https://github.com/Tencent/tdesign-miniprogram/pull/2259)) +- `GridItem`: 修复无效的css变量 @betavs ([#2253](https://github.com/Tencent/tdesign-miniprogram/pull/2253)) +- `Radio`: 修复调整 placement 之后的渲染抖动的问题 @LeeJim ([#2271](https://github.com/Tencent/tdesign-miniprogram/pull/2271)) +- `SwipeCell`: 阻止默认的垂直滚动,优化交互体验 @LeeJim ([#2281](https://github.com/Tencent/tdesign-miniprogram/pull/2281)) +- `Collapse`: 修复默认展开全部时,无法正常收起的问题 @LeeJim ([#2280](https://github.com/Tencent/tdesign-miniprogram/pull/2280)) +- `SwipeCell`: 使用 hidden 隐藏后显示仍能够正常使用 @LeeJim ([#2283](https://github.com/Tencent/tdesign-miniprogram/pull/2283)) +- `Checkbox`: 修复 icon 无法使用插槽的问题 @LeeJim ([#2285](https://github.com/Tencent/tdesign-miniprogram/pull/2285)) +- `Popup`: 修复滚动穿透的问题 @LeeJim ([#2290](https://github.com/Tencent/tdesign-miniprogram/pull/2290)) + +### 🚧 Others +- `Swiper`: 修复示例错误 @anlyyao ([#2246](https://github.com/Tencent/tdesign-miniprogram/pull/2246)) +- `Swiper`: 补充外部样式类信息 @LeeJim ([#2256](https://github.com/Tencent/tdesign-miniprogram/pull/2256)) +- `Icon`: 更新图标展示UI组件至 0.2.0 版本 @uyarn ([#2269](https://github.com/Tencent/tdesign-miniprogram/pull/2269)) + ## 🌈 1.1.15 `2023-08-01` ### 🚀 Features - `DropdownMenu`: 支持自定义箭头图标 @LeeJim ([#2240](https://github.com/Tencent/tdesign-miniprogram/pull/2240)) diff --git a/package.json b/package.json index 3558a89e4..914c26425 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tdesign-miniprogram", "purename": "tdesign", - "version": "1.1.15", + "version": "1.2.0", "description": "tdesign-miniprogram", "title": "tdesign-ßminiprogram", "main": "miniprogram_dist/index.js", @@ -100,7 +100,7 @@ "prismjs": "^1.24.1", "standard-changelog": "^2.0.27", "stylelint": "^13.13.1", - "tdesign-icons-view": "^0.1.0", + "tdesign-icons-view": "^0.2.1", "tdesign-publish-cli": "^0.0.12", "tdesign-site-components": "^0.12.2", "typescript": "~4.7.2", diff --git a/src/calendar/__test__/__snapshots__/index.test.js.snap b/src/calendar/__test__/__snapshots__/index.test.js.snap index 62d1bde0e..f56032e0c 100644 --- a/src/calendar/__test__/__snapshots__/index.test.js.snap +++ b/src/calendar/__test__/__snapshots__/index.test.js.snap @@ -13,7 +13,10 @@ exports[`calendar :base 1`] = ` bind:transitionend="onTransitionEnd" > - + + ) { - this.setData(data); - - return new Promise((resolve) => wx.nextTick(resolve)); - }, - - updateExpanded(activeValues) { - if (!this.parent) { + updateExpanded(activeValues = []) { + if (!this.$parent || this.data.ultimateDisabled) { return; } const { value } = this.properties; - const expanded = activeValues.includes(value); + const { defaultExpandAll } = this.$parent.data; + const expanded = defaultExpandAll ? !this.data.expanded : activeValues.includes(value); if (expanded === this.properties.expanded) return; @@ -90,7 +84,11 @@ export default class CollapsePanel extends SuperComponent { if (ultimateDisabled) return; - this.parent.switch(value); + if (this.$parent.data.defaultExpandAll) { + this.updateExpanded(); + } else { + this.$parent.switch(value); + } }, }; } diff --git a/src/collapse/__test__/__snapshots__/index.test.js.snap b/src/collapse/__test__/__snapshots__/index.test.js.snap index 3c2af13a0..b111a347c 100644 --- a/src/collapse/__test__/__snapshots__/index.test.js.snap +++ b/src/collapse/__test__/__snapshots__/index.test.js.snap @@ -15,13 +15,13 @@ exports[`collapse :defaultExpandAll 1`] = ` > @@ -79,7 +79,7 @@ exports[`collapse :defaultExpandAll 1`] = ` { + return new Promise((resolve, reject) => { + wx.createIntersectionObserver(context) + .relativeToViewport() + .observe(selector, (res) => { + resolve(res); + }); + }); +}; diff --git a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap index 85ae4c782..3cdd66378 100644 --- a/src/date-time-picker/__test__/__snapshots__/index.test.js.snap +++ b/src/date-time-picker/__test__/__snapshots__/index.test.js.snap @@ -21,7 +21,10 @@ exports[`date-time-picker :base 1`] = ` bind:transitionend="onTransitionEnd" > @@ -183,14 +186,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项二" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -236,14 +239,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项三" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -302,14 +305,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项四" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -355,14 +358,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项五" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -408,14 +411,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项六" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -461,14 +464,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项七" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -514,14 +517,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{false}}" ariaLabel="选项八" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{false}}" style="" tabindex="" bind:tap="handleTap" > @@ -567,14 +570,14 @@ exports[`dropdown-menu :base 1`] = ` ariaDisabled="{{true}}" ariaLabel="禁用选项" ariaRole="radio" - class="t-radio t-radio--block class t-class" + class="t-radio t-radio--left t-radio--block class t-class" disabled="{{true}}" style="" tabindex="" bind:tap="handleTap" > diff --git a/src/grid-item/grid-item.less b/src/grid-item/grid-item.less index 4a98d5d82..cdf6d338f 100644 --- a/src/grid-item/grid-item.less +++ b/src/grid-item/grid-item.less @@ -18,10 +18,10 @@ @grid-item-description-font-size: var(--td-grid-item-description-font-size, 24rpx); @grid-item-description-line-height: var(--td-grid-item-description-line-height, 40rpx); @grid-item-description-color: var(--td-grid-item-description-color, @font-gray-3); -@grid-item-description-padding-top: var(--td-grid-item-description-padding-top, 8rpx); +@grid-item-description-padding-top: var(--td-grid-item-description-padding-top, 0); @grid-item-hover-bg-color: var(--td-grid-item-hover-bg-color, @bg-color-secondarycontainer); -@grid-item-horizontal-text-padding-left: var(--td-grid-item-horizontal-text-padding-left, 24rpx); -@grid-item-horizontal-text-description-top: var(--td-grid-item-horizontal-text-description-top, 4rpx); +@grid-item-horizontal-text-padding-left: var(--td-grid-item-horizontal-text-padding-left, 0); +@grid-item-horizontal-text-description-top: var(--td-grid-item-horizontal-text-description-top, 0); .@{item} { box-sizing: border-box; @@ -48,6 +48,7 @@ overflow: hidden; position: relative; padding: @grid-item-padding 0 24rpx; + background-color: @grid-item-bg-color; &--horizontal { flex-direction: row; @@ -135,12 +136,15 @@ } &__description { + padding-top: @grid-item-description-padding-top; width: inherit; color: @grid-item-description-color; font-size: @grid-item-description-font-size; line-height: @grid-item-description-line-height; &--horizontal { + margin-top: @grid-item-horizontal-text-description-top; + padding-left: @grid-item-horizontal-text-padding-left; text-align-last: left; } } diff --git a/src/icon/__test__/__snapshots__/demo.test.js.snap b/src/icon/__test__/__snapshots__/demo.test.js.snap index 427bfa0e6..3c108b947 100644 --- a/src/icon/__test__/__snapshots__/demo.test.js.snap +++ b/src/icon/__test__/__snapshots__/demo.test.js.snap @@ -5,6 +5,36 @@ exports[`Icon Icon base demo works fine 1`] = ` + + + + activity + + + + + + add-and-subtract + + @@ -54,3585 +84,17940 @@ exports[`Icon Icon base demo works fine 1`] = ` class="demo__card" > - app + address-book - arrow-down-rectangle + adjustment - arrow-down + airplay-wave - arrow-left + alarm-add - arrow-right + alarm-off - arrow-triangle-down-filled + alarm - arrow-triangle-down + align-top - arrow-triangle-up-filled + align-vertical - arrow-triangle-up + alpha - arrow-up + analytics - attach + anchor - backtop-rectangle + angry - backtop + animation-1 - backward + animation - barcode + anticlockwise - books + api + + app + + + + + + apple + + + + + + application + + + + + + architecture-hui-style + + + + + + archway-1 + + + + + + archway + + + + + + arrow-down-circle + + + + + + arrow-down-rectangle + + + + + + arrow-down + + + + + + arrow-left-circle + + + + + + arrow-left-down-circle + + + + + + arrow-left-down + + + + + + arrow-left-right-1 + + + + + + arrow-left-right-2 + + + + + + arrow-left-right-3 + + + + + + arrow-left-right-circle + + + + + + arrow-left-up-circle + + + + + + arrow-left-up + + + + + + arrow-left + + + + + + arrow-right-circle + + + + + + arrow-right-down-circle + + + + + + arrow-right-down + + + + + + arrow-right-up-circle + + + + + + arrow-right-up + + + + + + arrow-right + + + + + + arrow-triangle-down-filled + + + + + + arrow-triangle-down + + + + + + arrow-triangle-up-filled + + + + + + arrow-triangle-up + + + + + + arrow-up-circle + + + + + + arrow-up-down-1 + + + + + + arrow-up-down-2 + + + + + + arrow-up-down-3 + + + + + + arrow-up-down-circle + + + + + + arrow-up + + + + + + artboard + + + + + + article + + + + + + assignment-checked + + + + + + assignment-code + + + + + + assignment-error + + + + + + assignment-user + + + + + + assignment + + + + + + attach + + + + + + attic-1 + + + + + + attic + + + + + + audio + + + + + + awkward + + + + + + backtop-rectangle + + + + + + backtop + + + + + + backup + + + + + + backward + + + + + + bad-laugh + + + + + + bamboo-shoot + + + + + + banana + + + + + + barbecue + + + + + + barcode-1 + + + + + + barcode + + + + + + base-station + + + + + + battery-add + + + + + + battery-charging + + + + + + battery-low + + + + + + battery + + + + + + bean + + + + + + beer + + + + + + beta + + + + + + bifurcate + + + + + + bill + + + + + + blockchain + + + + + + bluetooth + + + + + + bone + + + + + + book-open + + + + + + book + + + + + + bookmark-add + + + + + + bookmark-checked + + + + + + bookmark-double + + + + + + bookmark-minus + + + + + + bookmark + + + + + + braces + + + + + + brackets + + + + + + bread + + + + + + bridge-1 + + + + + + bridge-2 + + + + + + bridge-3 + + + + + + bridge-4 + + + + + + bridge-5 + + + + + + bridge-6 + + + + + + bridge + + + + + + brightness-1 + + + + + + brightness + + + + + + broccoli + + + + + + browse-gallery + + + + + + browse-off + + + + + + browse + + + + + + brush + + + + + + bug-report + + + + + + bug + + + + + + building-1 + + + + + + building-2 + + + + + + building-3 + + + + + + building-4 + + + + + + building-5 + + + + + + building + + + + + + bulletpoint + + + + + + button + + + + + + cabbage + + + + + + cake + + + + + + calculation-1 + + + + + + calculation + + + + + + calculator-1 + + + + + + calculator + + + + + + calendar-1 + + + + + + calendar-2 + + + + + + calendar-edit + + + + + + calendar-event + + + + + + calendar + + + + + + call-1 + + + + + + call-cancel + + + + + + call-forwarded + + + + + + call-incoming + + + + + + call-off + + + + + + call + + + + + + calm-1 + + + + + + calm + + + + + + camera-1 + + + + + + camera-2 + + + + + + camera-off + + + + + + camera + + + + + + candy + + + + + + card + + + + + + cardmembership + + + + + + caret-down-small + + + + + + caret-down + + + + + + caret-left-small + + + + + + caret-left + + + + + + caret-right-small + + + + + + caret-right + + + + + + caret-up-small + + + + + + caret-up + + + + + + cart-add + + + + + + cart + + + + + + cast + + + + + + castle-1 + + + + + + castle-2 + + + + + + castle-3 + + + + + + castle-4 + + + + + + castle-5 + + + + + + castle-6 + + + + + + castle-7 + + + + + + castle + + + + + + cat + + + + + + catalog + + + + + + cd + + + + + + celsius + + + + + + center-focus-strong + + + + + + centimeter + + + + + + certificate-1 + + + + + + certificate + + + + + + chart-3d + + + + + + chart-add + + + + + + chart-analytics + + + + + + chart-area-multi + + + + + + chart-area + + + + + + chart-bar + + + + + + chart-bubble + + + + + + chart-colum + + + + + + chart-combo + + + + + + chart-line-data-1 + + + + + + chart-line-data + + + + + + chart-line-multi + + + + + + chart-line + + + + + + chart-maximum + + + + + + chart-median + + + + + + chart-minimum + + + + + + chart-pie + + + + + + chart-radar + + + + + + chart-radial + + + + + + chart-ring-1 + + + + + + chart-ring + + + + + + chart-scatter + + + + + + chart-stacked + + + + + + chart + + + + + + chat-add + + + + + + chat-bubble-1 + + + + + + chat-bubble-add + + + + + + chat-bubble-error + + + + + + chat-bubble-help + + + + + + chat-bubble-history + + + + + + chat-bubble-locked + + + + + + chat-bubble-smile + + + + + + chat-bubble + + + + + + chat-checked + + + + + + chat-clear + + + + + + chat-double + + + + + + chat-error + + + + + + chat-heart + + + + + + chat-message + + + + + + chat-off + + + + + + chat-poll + + + + + + chat-setting + + + + + + chat + + + + + + check-circle-filled + + + + + + check-circle + + + + + + check-double + + + + + + check-rectangle-filled + + + + + + check-rectangle + + + + + + check + + + + + + cheese + + + + + + cherry + + + + + + chevron-down-circle + + + + + + chevron-down-double-s + + + + + + chevron-down-double + + + + + + chevron-down-rectangle + + + + + + chevron-down-s + + + + + + chevron-down + + + + + + chevron-left-circle + + + + + + chevron-left-double-s + + + + + + chevron-left-double + + + + + + chevron-left-rectangle + + + + + + chevron-left-s + + + + + + chevron-left + + + + + + chevron-right-circle + + + + + + chevron-right-double-s + + + + + + chevron-right-double + + + + + + chevron-right-rectangle + + + + + + chevron-right-s + + + + + + chevron-right + + + + + + chevron-up-circle + + + + + + chevron-up-double-s + + + + + + chevron-up-double + + + + + + chevron-up-rectangle + + + + + + chevron-up-s + + + + + + chevron-up + + + + + + chicken + + + + + + chili + + + + + + chimney-1 + + + + + + chimney-2 + + + + + + chimney + + + + + + chinese-cabbage + + + + + + church + + + + + + circle + + + + + + city-1 + + + + + + city-10 + + + + + + city-11 + + + + + + city-12 + + + + + + city-13 + + + + + + city-14 + + + + + + city-15 + + + + + + city-2 + + + + + + city-3 + + + + + + city-4 + + + + + + city-5 + + + + + + city-6 + + + + + + city-7 + + + + + + city-8 + + + + + + city-9 + + + + + + city-ancient-1 + + + + + + city-ancient-2 + + + + + + city-ancient + + + + + + city + + + + + + clear-formatting-1 + + + + + + clear-formatting + + + + + + clear + + + + + + close-circle-filled + + + + + + close-circle + + + + + + close-octagon + + + + + + close-rectangle + + + + + + close + + + + + + cloud-download + + + + + + cloud-upload + + + + + + cloud + + + + + + cloudy-day + + + + + + cloudy-night-rain + + + + + + cloudy-night + + + + + + cloudy-rain + + + + + + cloudy-sunny + + + + + + code-1 + + + + + + code-off + + + + + + code + + + + + + cola + + + + + + collage + + + + + + collection + + + + + + color-invert + + + + + + combination + + + + + + command + + + + + + compass-1 + + + + + + compass + + + + + + component-breadcrumb + + + + + + component-checkbox + + + + + + component-divider-horizontal + + + + + + component-divider-vertical + + + + + + component-dropdown + + + + + + component-grid + + + + + + component-input + + + + + + component-layout + + + + + + component-radio + + + + + + component-space + + + + + + component-steps + + + + + + component-switch + + + + + + constraint + + + + + + contrast-1 + + + + + + contrast + + + + + + control-platform + + + + + + cooperate + + + + + + coordinate-system + + + + + + copy + + + + + + copyright + + + + + + corn + + + + + + coupon + + + + + + course + + + + + + cpu + + + + + + crack + + + + + + creditcard-add + + + + + + creditcard-off + + + + + + creditcard + + + + + + crooked-smile + + + + + + cry-and-laugh + + + + + + cry-loudly + + + + + + css3 + + + + + + cucumber + + + + + + currency-exchange + + + + + + cursor + + + + + + curtain + + + + + + curve + + + + + + cut-1 + + + + + + cut + + + + + + dam-1 + + + + + + dam-2 + + + + + + dam-3 + + + + + + dam-4 + + + + + + dam-5 + + + + + + dam-6 + + + + + + dam-7 + + + + + + dam + + + + + + dart-board + + + + + + dashboard-1 + + + + + + dashboard + + + + + + data-base + + + + + + data-checked + + + + + + data-display + + + + + + data-error + + + + + + data-search + + + + + + data + + + + + + delete-1 + + + + + + delete-time + + + + + + delete + + + + + + delta + + + + + + depressed + + + + + + desktop-1 + + + + + + desktop + + + + + + despise + + + + + + device + + + + + + discount-filled + + + + + + discount + + + + + + dissatisfaction + + + + + + divide + + + + + + dividers-1 + + + + + + dividers + + + + + + doge + + + + + + double-storey + + + + + + download-1 + + + + + + download + + + + + + downscale + + + + + + drag-drop + + + + + + drag-move + + + + + + drink + + + + + + drumstick + + + + + + dv + + + + + + dvd + + + + + + earphone + + + + + + earth + + + + + + edit-1 + + + + + + edit-2 + + + + + + edit-off + + + + + + edit + + + + + + education + + + + + + eggplant + + + + + + ellipsis + + + + + + emo-emotional + + + + + + enter + + + + + + equal + + + + + + error-circle-filled + + + + + + error-circle + + + + + + error-triangle + + + + + + error + + + + + + excited-1 + + + + + + excited + + + + + + expand-horizontal + + + + + + expand-vertical + + + + + + explore-off + + + + + + explore + + + + + + exposure + + + + + + extension-off + + + + + + extension + + + + + + face-retouching + + + + + + fact-check + + + + + + fahrenheit-scale + + + + + + feel-at-ease + + + + + + ferocious + + + + + + ferris-wheel + + + + + + file-1 + + + + + + file-add-1 + + + + + + file-add + + + + + + file-attachment + + + + + + file-blocked + + + + + + file-code-1 + + + + + + file-code + + + + + + file-copy + + + + + + file-download + + + + + + file-excel + + + + + + file-export + + + + + + file-icon + + + + + + file-image + + + + + + file-import + + + + + + file-locked + + + + + + file-minus + + + + + + file-music + + + + + + file-onenote + + + + + + file-outlook + + + + + + file-paste + + + + + + file-pdf + + + + + + file-powerpoint + + + + + + file-restore + + + + + + file-safety + + + + + + file-search + + + + + + file-setting + + + + + + file-teams + + + + + + file-unknown + + + + + + file-unlocked + + + + + + file-word + + + + + + file-zip + + + + + + file + + + + + + fill-color-1 + + + + + + fill-color + + + + + + film-1 + + + + + + film + + + + + + filter-1 + + + + + + filter-2 + + + + + + filter-3 + + + + + + filter-clear + + + + + + filter-off + + + + + + filter + + + + + + fingerprint-1 + + + + + + fingerprint-2 + + + + + + fingerprint-3 + + + + + + fingerprint + + + + + + fish + + + + + + flag-1 + + + + + + flag-2 + + + + + + flag-3 + + + + + + flag-4 + + + + + + flag + + + + + + flashlight + + + + + + flight-landing + + + + + + flight-takeoff + + + + + + flip-smiling-face + + + + + + flip-to-back + + + + + + flip-to-front + + + + + + focus + + + + + + fog-night + + + + + + fog-sunny + + + + + + fog + + + + + + folder-1 + + + + + + folder-add-1 + + + + + + folder-add + + + + + + folder-blocked + + + + + + folder-details + + + + + + folder-export + + + + + + folder-import + + + + + + folder-locked + + + + + + folder-minus + + + + + + folder-move + + + + + + folder-off + + + + + + folder-open-1 + + + + + + folder-open + + + + + + folder-search + + + + + + folder-setting + + + + + + folder-shared + + + + + + folder-unlocked + + + + + + folder-zip + + + + + + folder + + + + + + forest + + + + + + fork + + + + + + form + + + + + + format-horizontal-align-bottom + + + + + + format-horizontal-align-center + + + + + + format-horizontal-align-top + + + + + + format-vertical-align-center + + + + + + format-vertical-align-left + + + + + + format-vertical-align-right + + + + + + forward + + + + + + frame-1 + + + + + + frame + + + + + + fries + + + + + + fullscreen-1 + + + + + + fullscreen-2 + + + + + + fullscreen-exit-1 + + + + + + fullscreen-exit + + + + + + fullscreen + + + + + + function-curve + + + + + + functions-1 + + + + + + functions + + + + + + gamepad-1 + + + + + + gamepad + + + + + + gamma + + + + + + garlic + + + + + + gender-female + + + + + + gender-male + + + + + + gesture-applause + + + + + + gesture-click + + + + + + gesture-down + + + + + + gesture-expansion + + + + + + gesture-left-slip + + + + + + gesture-left + + + + + + gesture-pray-1 + + + + + + gesture-pray + + + + + + gesture-press + + + + + + gesture-ranslation-1 + + + + + + gesture-ranslation + + + + + + gesture-right-slip + + + + + + gesture-right + + + + + + gesture-slide-up + + + + + + gesture-up-1 + + + + + + gesture-up-2 + + + + + + gesture-up-and-down + + + + + + gesture-up + + + + + + gesture-wipe-down + + + + + + gift + + + + + + giggle + + + + + + git-branch + + + + + + git-commit + + + + + + git-merge + + + + + + git-pull-request + + + + + + git-repository-commits + + + + + + git-repository-private + + + + + + git-repository + + + + + + gps + + + + + + grape + + + + + + greater-than-or-equal + + + + + + greater-than + + + + + + green-onion + + + + + + grid-add + + + + + + grid-view + + + + + + guitar + + + + + + hamburger + + + + + + happy + + + + + + hard-disk-storage + + + + + + hard-drive + + + + + + hashtag + + + + + + hd + + + + + + heart-filled + + + + + + heart + + + + + + help-circle-filled + + + + + + help-circle + + + + + + help-rectangle + + + + + + help + + + + + + highlight-1 + + + + + + highlight + + + + + + history-setting + + + + + + history + + + + + + home + + + + + + hospital-1 + + + + + + hospital + + + + + + hotspot-wave + + + + + + hourglass + + + + + + houses-1 + + + + + + houses-2 + + + + + + houses + + + + + + html5 + + + + + + https + + + + + + ice-cream + + + + + + icon + + + + + + image-1 + + + + + + image-add + + + + + + image-edit + + + + + + image-error + + + + + + image-off + + + + + + image-search + + + + + + image + + + + + + indent-left + + + + + + indent-right + + + + + + indicator + + + + + + info-circle-filled + + + + + + info-circle + + + + + + ink + + + + + + install-desktop + + + + + + install-mobile + + + + + + install + + + + + + institution-checked + + + + + + institution + + + + + + internet + + + + + + ipod + + + + + + joyful + + + + + + jump-off + + + + + + jump + + + + + + keyboard + + + + + + laptop + + + + + + layers + + + + + + layout + + + + + + leaderboard + + + + + + lemon-slice + + + + + + lemon + + + + + + less-than-or-equal + + + + + + less-than + + + + + + letters-a + + + + + + letters-b + + + + + + letters-c + + + + + + letters-d + + + + + + letters-e + + + + + + letters-f + + + + + + letters-g + + + + + + letters-h + + + + + + letters-i + + + + + + letters-j + + + + + + letters-k + + + + + + letters-l + + + + + + letters-m + + + + + + letters-n + + + + + + letters-o + + + + + + letters-p + + + + + + letters-q + + + + + + letters-r + + + + + + letters-s + + + + + + letters-t + + + + + + letters-u + + + + + + letters-v + + + + + + letters-w + + + + + + letters-x + + + + + + letters-y + + + + + + letters-z + + + + + + lightbulb-circle + + + + + + lightbulb + + + + + + lighthouse-1 + + + + + + lighthouse-2 + + + + + + lighthouse + + + + + + lighting-circle + + + + + + line-height + + + + + + link-1 + + + + + + link-unlink + + + + + + link + + + + + + liquor + + + + + + list + + + + + + load + + + + + + loading + + + + + + location-1 + + + + + + location-enlargement + + + + + + location-error + + + + + + location-parking-place + + + + + + location-reduction + + + + + + location-setting + + + + + + location + + + + + + lock-off + + + + + + lock-on + + + + + + lock-time + + + + + + login + + + + + + logo-adobe-illustrate + + + + + + logo-adobe-photoshop-1 + + + + + + logo-adobe-photoshop + + + + + + logo-android + + + + + + logo-apple-filled + + + + + + logo-apple + + + + + + logo-behance + + + + + + logo-chrome-filled + + + + + + logo-chrome + + + + + + logo-cinema4d + + + + + + logo-codepen + + + + + + logo-codesandbox + + + + + + logo-dribbble + + + + + + logo-facebook + + + + + + logo-figma + + + + + + logo-framer + + + + + + logo-github-filled + + + + + + logo-github + + + + + + logo-gitlab + + + + + + logo-ie-filled + + + + + + logo-ie + + + + + + logo-instagram + + + + + + logo-qq + + + + + + logo-twitter + + + + + + logo-wechat-stroke + + + + + + logo-wechat + + + + + + logo-wecom + + + + + + logo-windows-filled + + + + + + logo-windows + + + + + + logo-youtube + + + + + + logout + + + + + + look-around + + + + + + loudspeaker + + + + + + mail + + + + + + map-3d + + + + + + map-add + + + + + + map-aiming + + + + + + map-blocked + + + + + + map-bubble + + + + + + map-cancel + + + + + + map-chat + + + + + + map-checked + + + + + + map-collection + + + + + + map-connection + + + + + + map-distance + + + + + + map-double + + + + + + map-edit + + + + + + map-grid + + + + + + map-information-1 + + + + + + map-information-2 + + + + + + map-information + + + + + + map-location + + + + + + map-locked + + + + + + map-marked + + + + + + map-navigation + + + + + + map-outline + + + + + + map-route-planning + + + + + + map-ruler + + + + + + map-safety + + + + + + map-search-1 + + + + + + map-search + + + + + + map-setting + + + + + + map-unlocked + + + + + + map + + + + + + mark-as-unread + + + + + + markup + + + + + + mathematics + + + + + + measurement-1 + + + + + + measurement-2 + + + + + + measurement + + + + + + meat-pepper + + + + + + media-library + + + + + + member + + + + + + menu-application + + + + + + menu-fold + + + + + + menu-unfold + + + + + + menu + + + + + + merge-cells + + + + + + microphone-1 + + + + + + microphone-2 + + + + + + microphone + + + + + + milk + + + + + + minus-circle-filled + + + + + + minus-circle + + + + + + minus-rectangle-filled + + + + + + minus-rectangle + + + + + + minus + + + + + + mirror + + + + + + mobile-blocked + + + + + + mobile-list + + + + + + mobile-navigation + + + + + + mobile-shortcut + + + + + + mobile-vibrate + + + + + + mobile + + + + + + mode-dark + + + + + + mode-light + + + + + + module + + + + + + money + + + + + + monument + + + + + + moon-fall + + + + + + moon-rising + + + + + + moon + + + + + + more + + + + + + mosque-1 + + + + + + mosque + + + + + + mouse + + + + + + move-1 + + + + + + move + + + + + + movie-clapper + + + + + + multiply + + + + + + museum-1 + + + + + + museum-2 + + + + + + museum + + + + + + mushroom-1 + + + + + + mushroom + + + + + + music-1 + + + + + + music-2 + + + + + + music-rectangle-add + + + + + + music + + + + + + navigation-arrow + + + + + + next + + + + + + no-expression + + + + + + noodle + + + + + + notification-add + + + + + + notification-circle + + + + + + notification-error + + + + + + notification-filled + + + + + + notification + + + + + + numbers-0-1 + + + + + + numbers-0 + + + + + + numbers-1-1 + + + + + + numbers-1 + + + + + + numbers-2-1 + + + + + + numbers-2 + + + + + + numbers-3-1 + + + + + + numbers-3 + + + + + + numbers-4-1 + + + + + + numbers-4 + + + + + + numbers-5-1 + + + + + + numbers-5 + + + + + + numbers-6-1 + + + + + + numbers-6 + + + + + + numbers-7-1 + + + + + + numbers-7 + + + + + + numbers-8-1 + + + + + + numbers-8 + + + + + + numbers-9-1 + + + + + + numbers-9 + + + + + + nut + + + + + + object-storage + + + + + + open-mouth + + + + + + opera + + + + + + order-adjustment-column + + + + + + order-ascending + + + + + + order-descending + + + + + + outbox + + + + + + page-first + + + + + + page-head + + + + + + page-last + + + + + + palace-1 + + + + + + palace-2 + + + + + + palace-3 + + + + + + palace-4 + + + + + + palace + + + + + + palette-1 + + + + + + palette + + + + + + panorama-horizontal + + + + + + panorama-vertical + + + + + + pantone + + + + + + parabola + + + + + + parentheses + + + + + + paste + + + + + + patio + + + + + + pause-circle-filled + + + + + + pause-circle-stroke + + + + + + pause-circle + + + + + + pause + + + + + + pea + + + + + + peach + + + + + + pear + + + + + + pearl-of-the-orient + + + + + + pen-ball + + + + + + pen-brush + + + + + + pen-mark + + + + + + pen-quill + + + + + + pen + + + + + + pending + + + + + + percent + + + + + + personal-information + + + + + + phone-locked + + + + + + phone-search + + + + + + pi + + + + + + piano + + + + + + pin-filled + + + + + + pin + + + + + + play-circle-filled + + + + + + play-circle-stroke-add + + + + + + play-circle-stroke + + + + + + play-circle + + + + + + play-demo + + + + + + play-rectangle + + + + + + play + + + + + + plus + + + + + + popsicle + + + + + + portrait + + + + + + pout + + + + + + poweroff + + + + + + precise-monitor + + + + + + previous + + + + + + print + + + + + + pumpkin + + + + + + pyramid-maya + + + + + + pyramid + + + + + + qrcode + + + + + + quadratic + + + + + + questionnaire + + + + + + queue + + + + + + radar + + + + + + radio-1 + + + + + + radio-2 + + + + + + radish + + + + + + rain-heavy + + + + + + rain-light + + + + + + rain-medium + + + + + + rainbow + + + + + + rectangle + + + + + + refresh + + + + + + relation + + + + + + relativity + + + + + + remote-wave + + + + + + remove + + + + + + replay + + + + + + rice-ball + + + + + + rice + + + + + + roast + + + + + + rocket + + + + + + rollback + + + + + + rollfront + + + + + + root-list + + + + + + rotate-locked + + + + + + rotate + + + + + + rotation + + + + + + round + + + + + + router-wave + + + + + + rss + + + + + + ruler + + + + + + sailing-hotel + + + + + + sandwich + + + + + + saturation + + + + + + sausage + + + + + + save + + + + + + saving-pot + + + + + + scan + + + + + + screen-4k + + + + + + screencast + + + + + + screenshot + + + + + + scroll-bar + + + + + + sd-card-1 + + + + + + sd-card + + + + + + search-error + + + + + + search + + + + + + secured + + + + + + send-cancel + + + + + + send + + + + + + sensors-1 + + + + + + sensors-2 + + + + + + sensors-off + + + + + + sensors + + + + + + serenity + + + + + + server + + + + + + service + + + + + + setting-1 + + + + + + setting + + + + + + share-1 + + + + + + share + + + + + + sharpness + + + + + + shield-error + + + + + + shimen + + + + + + shop-1 + + + + + + shop-2 + + + + + + shop-3 + + + + + + shop-4 + + + + + + shop-5 + + + + + + shop + + + + + + shrimp + + + + + + shrink-horizontal + + + + + + shrink-vertical + + + + + + shutter + + + + + + shutup + + + + + + sim-card-1 + + + + + + sim-card-2 + + + + + + sim-card + + + + + + sinister-smile + + + + + + sip + + + + + + slash + + + + + + sleep + + + + + + slice + + + + + + slideshow + + + + + + smile + + + + + + sneer + + + + + + snowflake + + + + + + sonic + + + + + + sound-down + + + + - browse-off + sound-high - browse + sound-low - bulletpoint + sound-mute-1 - calendar + sound-mute - call + sound-up - caret-down-small + sound - caret-down + space - caret-left-small + speechless-1 - caret-left + star-filled - caret-right-small + star - caret-right + statue-of-jesus - caret-up-small + sticky-note - caret-up + stop-circle-filled - cart + stop-circle-stroke - chart-bar + stop-circle - chart-bubble + stop - chart-pie + store - chart + street-road-1 - chat + street-road - check-circle-filled + subtitle - check-circle + subway-line - check-rectangle-filled + sum - check-rectangle + sun-fall - check + sun-rising - chevron-down-circle + sunny - chevron-down-rectangle + support - chevron-down + surprised-1 - chevron-left-circle + surprised - chevron-left-double + swap-left - chevron-left-rectangle + swap-right - chevron-left + swap - chevron-right-circle + swear-1 - chevron-right-double + swear-2 - chevron-right-rectangle + system-2 - chevron-right + system-3 - chevron-up-circle + system-application - chevron-up-rectangle + system-blocked - chevron-up + system-code - circle + system-components - clear + system-coordinate - close-circle-filled + system-device - close-circle + system-interface - close-rectangle + system-location - close + system-locked - cloud-download + system-log - cloud-upload + system-marked - cloud + system-messages - code + system-regulation - control-platform + system-search - creditcard + system-setting - dashboard + system-storage - delete + system-sum - desktop + system-unlocked - discount-filled + tab - discount + table-1 - download + table-2 - edit-1 + table-add - edit + table-split - ellipsis + table - enter + tag - error-circle-filled + tangerinr - error-circle + tape - error + task-1 - file-add + task-add-1 - file-copy + task-add - file-excel + task-checked - file-icon + task-error - file-image + task-location - file-paste + task-marked - file-pdf + task-setting - file-powerpoint + task-visible - file-unknown + task - file-word + tea - file + teahouse - filter-clear + template - filter + temple - - flag + terminal-rectangle-1 - folder-add + terminal-rectangle - folder-open + terminal-window - folder + terminal - fork + textbox - format-horizontal-align-bottom + textformat-bold - format-horizontal-align-center + textformat-color - format-horizontal-align-top + textformat-italic - format-vertical-align-center + textformat-strikethrough - format-vertical-align-left + textformat-underline - format-vertical-align-right + textformat-wrap - forward + theaters - fullscreen-exit + thumb-down-1 - fullscreen + thumb-down-2 - gender-female + thumb-down - gender-male + thumb-up-1 - gift + thumb-up-2 - heart-filled + thumb-up - heart + thunder - help-circle-filled + thunderstorm-night - help-circle + thunderstorm-sunny - help + thunderstorm - history + ticket - home + time-filled - hourglass + time - image-error + tips-double - image + tips - info-circle-filled + tomato - info-circle + tools-circle - internet + tools - jump + tornado - laptop + tower-1 - layers + tower-2 - link-unlink + tower-3 - link + tower-clock - loading + tower - location + town - lock-off + traffic-events - lock-on + traffic - login + transform-1 - logo-android + transform-2 - logo-apple-filled + transform-3 - logo-apple + transform - logo-chrome-filled + translate-1 - logo-chrome + translate - logo-codepen + tree-list - logo-github-filled + tree-round-dot-vertical - logo-github + tree-round-dot - logo-ie-filled + tree-square-dot-vertical - logo-ie + tree-square-dot - logo-qq + trending-down - logo-wechat + trending-up - logo-wecom + tv-1 - logo-windows-filled + tv-2 - logo-windows + tv - logout + typography - mail + uncomfortable-1 - menu-fold + uncomfortable-2 - menu-unfold + uncomfortable - minus-circle-filled + undertake-delivery - minus-circle + undertake-environment-protection - minus-rectangle-filled + undertake-hold-up - minus-rectangle + undertake-transaction - mirror + undertake - mobile-vibrate + unfold-less - mobile + unfold-more - money-circle + unhappy-1 - more + unhappy - move + uninstall - next + upload-1 - notification-filled + upload - notification + upscale - order-adjustment-column + usb - order-ascending + user-1 - order-descending + user-add - page-first + user-arrow-down - page-last + user-arrow-left - pause-circle-filled + user-arrow-right - photo + user-arrow-up - pin-filled + user-avatar - pin + user-blocked - play-circle-filled + user-business - play-circle-stroke + user-checked-1 - play-circle + user-checked - play + user-circle - poweroff + user-clear - precise-monitor + user-error-1 - previous + user-invisible - print + user-list - qrcode + user-locked - queue + user-marked - rectangle + user-password - refresh + user-safety - relativity + user-search - remove + user-setting - rollback + user-talk-1 - rollfront + user-talk-off-1 - root-list + user-talk - rotation + user-time - round + user-transmit - save + user-unknown - scan + user-unlocked - search + user-vip - secured + user-visible - server + user - service + usergroup-add - setting + usergroup-clear - share + usergroup - shop + vehicle - slash + verified - sound + verify - star-filled + video-camera-1 - star + video-camera-2 - stop-circle-1 + video-camera-dollar - stop-circle-filled + video-camera-minus - stop-circle + video-camera-music - stop + video-camera-off - swap-left + video-camera - swap-right + video-library - swap + video - thumb-down + view-agenda - thumb-up + view-column - time-filled + view-in-ar - time + view-list - tips + view-module - tools + visual-recognition - translate-1 + wallet - translate + watch - unfold-less + watermelon - unfold-more + wave-left - upload + wave-right - usb + wealth-1 - user-add + wealth - user-avatar + widget - user-circle + wifi-1 - user-clear + wifi-off-1 - user-talk + wifi-off - user + wifi - usergroup-add + window-1 - usergroup-clear + window - usergroup + windy-rain - video + windy - view-column + wink - view-list + work-history - view-module + work-off - wallet + work - wifi + wry-smile - - tdesign - + tdesign - + - {{label}} + {{label}} diff --git a/src/loading/README.en-US.md b/src/loading/README.en-US.md index 1af7609f7..c2414ba34 100644 --- a/src/loading/README.en-US.md +++ b/src/loading/README.en-US.md @@ -25,5 +25,6 @@ The component provides the following CSS variables, which can be used to customi Name | Default Value | Description -- | -- | -- --td-loading-color | @brand-color | - +--td-loading-text-color | inherit | - --td-loading-text-font-size | 24rpx | - --td-loading-text-line-height | 40rpx | - diff --git a/src/loading/README.md b/src/loading/README.md index 037b52166..18ee4c87a 100644 --- a/src/loading/README.md +++ b/src/loading/README.md @@ -80,5 +80,6 @@ t-class-indicator | 指示符样式类 名称 | 默认值 | 描述 -- | -- | -- --td-loading-color | @brand-color | - +--td-loading-text-color | inherit | - --td-loading-text-font-size | 24rpx | - --td-loading-text-line-height | 40rpx | - diff --git a/src/loading/loading.less b/src/loading/loading.less index eeb5429c7..3ca6f0809 100644 --- a/src/loading/loading.less +++ b/src/loading/loading.less @@ -3,6 +3,7 @@ @loading: ~'@{prefix}-loading'; @loading-color: var(--td-loading-color, @brand-color); +@loading-text-color: var(--td-loading-text-color, inherit); @loading-text-font-size: var(--td-loading-text-font-size, 24rpx); @loading-text-line-height: var(--td-loading-text-line-height, 40rpx); @@ -89,6 +90,7 @@ } &__text { + color: @loading-text-color; font-size: @loading-text-font-size; line-height: @loading-text-line-height; diff --git a/src/picker/__test__/__snapshots__/index.test.js.snap b/src/picker/__test__/__snapshots__/index.test.js.snap index 3db69f84a..efa7530be 100644 --- a/src/picker/__test__/__snapshots__/index.test.js.snap +++ b/src/picker/__test__/__snapshots__/index.test.js.snap @@ -18,7 +18,10 @@ exports[`picker :base 1`] = ` bind:transitionend="onTransitionEnd" > + - + @@ -23,7 +27,7 @@ wx:if="{{showOverlay}}" visible="{{visible}}" z-index="{{overlayProps && overlayProps.zIndex || 11000}}" - prevent-scroll-through="{{preventScrollThrough || overlayProps && overlayProps.preventScrollThrough}}" + prevent-scroll-through="{{preventScrollThrough || (overlayProps ? !!overlayProps.preventScrollThrough : false)}}" bind:tap="handleOverlayClick" custom-style="{{overlayProps && overlayProps.style || ''}}" /> diff --git a/src/popup/popup.wxs b/src/popup/popup.wxs index a2da0d0ae..20be1302b 100644 --- a/src/popup/popup.wxs +++ b/src/popup/popup.wxs @@ -3,6 +3,13 @@ function getPopupStyles(zIndex) { return zIndexStyle; } +function onContentTouchMove (e) { + if (e.target.dataset.prevention) { + return false; + }; +} + module.exports = { getPopupStyles: getPopupStyles, + onContentTouchMove: onContentTouchMove }; diff --git a/src/radio/README.md b/src/radio/README.md index 3a09efa80..000532f25 100644 --- a/src/radio/README.md +++ b/src/radio/README.md @@ -80,7 +80,7 @@ t-class | 根节点样式类 t-class-label | 标签样式类 t-class-icon | 图标样式类 t-class-content | 内容样式类 -t-class-border` | 边框样式类 +t-class-border | 边框样式类 ### RadioGroup Props diff --git a/src/radio/radio.ts b/src/radio/radio.ts index 08afaf4f3..799e23ee4 100644 --- a/src/radio/radio.ts +++ b/src/radio/radio.ts @@ -34,12 +34,7 @@ export default class Radio extends SuperComponent { lifetimes = { attached() { - this.initStatus(); - }, - ready() { - this.setData({ - _placement: this.data.placement ?? this.$parent?.data?.placement ?? 'left', - }); + this.init(); }, }; @@ -87,7 +82,7 @@ export default class Radio extends SuperComponent { this._trigger('change', { checked: checked && allowUncheck ? false : !checked }); } }, - initStatus() { + init() { const { icon } = this.data; const isIdArr = Array.isArray(this.$parent?.icon || icon); @@ -95,6 +90,7 @@ export default class Radio extends SuperComponent { customIcon: isIdArr, slotIcon: icon === 'slot', iconVal: isIdArr ? this.$parent?.icon || icon : [], + _placement: this.data.placement ?? this.$parent?.data?.placement ?? 'left', }); }, diff --git a/src/search/README.md b/src/search/README.md index eb7847a0e..2bdb4fa9a 100644 --- a/src/search/README.md +++ b/src/search/README.md @@ -51,6 +51,18 @@ disabled | Boolean | false | 是否禁用 | N cursor-spacing | Number | 0 | 搜索框聚焦时底部与键盘的距离 | N focus | Boolean | false | 是否聚焦 | N label | String | '' | 已废弃。左侧文本 | N +maxcharacter | Number | - | 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 | N +maxlength | Number | -1 | 用户最多可以输入的文本长度,一个中文等于一个计数长度。默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 | N +confirm-type | String | search | 设置键盘右下角按钮的文字,仅在type='text'时生效。
具体释义:
`send` 右下角按钮为“发送”;
`search` 右下角按钮为“搜索”;
`next` 右下角按钮为“下一个”;
`go` 右下角按钮为“前往”;
`done` 右下角按钮为“完成”。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)。可选项:send/search/next/go/done | N +always-embed | Boolean | false | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) | N +confirm-hold | Boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 | N +cursor | Number | - | 必需。指定 focus 时的光标位置 | Y +selection-start | Number | -1 | 光标起始位置,自动聚集时有效,需与 selection-end 搭配使用 | N +selection-end | Number | -1 | 光标结束位置,自动聚集时有效,需与 selection-start 搭配使用 | N +adjust-position | Boolean | true | 键盘弹起时,是否自动上推页面 | N +hold-keyboard | Boolean | false | focus时,点击页面的时候不收起键盘 | N +placeholder-style | String | - | 必需。指定 placeholder 的样式 | Y +placeholder-class | String | input-placeholder | 指定 placeholder 的样式类 | N left-icon | String / Slot | 'search' | 左侧图标 | N placeholder | String | '' | 占位符 | N right-icon | String / Slot | 'close-circle-filled' | 已废弃。右侧图标 | N diff --git a/src/search/__test__/__snapshots__/index.test.js.snap b/src/search/__test__/__snapshots__/index.test.js.snap index be26b67ba..01d0fd3cc 100644 --- a/src/search/__test__/__snapshots__/index.test.js.snap +++ b/src/search/__test__/__snapshots__/index.test.js.snap @@ -29,14 +29,23 @@ exports[`search Props :base 1`] = `
+ + + + + diff --git a/src/search/_example/maxlength/index.wxss b/src/search/_example/maxlength/index.wxss new file mode 100644 index 000000000..a5f17d78a --- /dev/null +++ b/src/search/_example/maxlength/index.wxss @@ -0,0 +1,4 @@ +.example-search { + background-color: #fff; + padding: 16rpx 32rpx; +} diff --git a/src/search/_example/search.json b/src/search/_example/search.json index 989a6056f..3d6aa7859 100644 --- a/src/search/_example/search.json +++ b/src/search/_example/search.json @@ -2,6 +2,7 @@ "navigationBarTitleText": "Search", "usingComponents": { "base": "./base", + "maxlength": "./maxlength", "action": "./action", "shape": "./shape", "other": "./other" diff --git a/src/search/_example/search.wxml b/src/search/_example/search.wxml index e1edc7ed4..9edb8768e 100644 --- a/src/search/_example/search.wxml +++ b/src/search/_example/search.wxml @@ -4,6 +4,9 @@ + + + diff --git a/src/search/props.ts b/src/search/props.ts index 68fde16df..436ba7e7c 100644 --- a/src/search/props.ts +++ b/src/search/props.ts @@ -40,6 +40,64 @@ const props: TdSearchProps = { type: String, value: '', }, + /** 用户最多可以输入的字符个数,一个中文汉字表示两个字符长度。`maxcharacter` 和 `maxlength` 二选一使用 */ + maxcharacter: { + type: Number, + }, + /** 用户最多可以输入的文本长度,一个中文等于一个计数长度,默认为 -1,不限制输入长度。`maxcharacter` 和 `maxlength` 二选一使用 */ + maxlength: { + type: Number, + value: -1, + }, + /** 设置键盘右下角按钮的文字,仅在type='text'时生效。
具体释义:
`send` 右下角按钮为“发送”;
`search` 右下角按钮为“搜索”;
`next` 右下角按钮为“下一个”;
`go` 右下角按钮为“前往”;
`done` 右下角按钮为“完成”。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html) */ + confirmType: { + type: String, + value: 'search', + }, + /** 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) */ + alwaysEmbed: { + type: Boolean, + value: false, + }, + /** 点击键盘右下角按钮时是否保持键盘不收起 */ + confirmHold: { + type: Boolean, + value: false, + }, + /** 指定focus时的光标位置 */ + cursor: { + type: Number, + }, + /** 光标起始位置,自动聚集时有效,需与selection-end搭配使用 */ + selectionStart: { + type: Number, + value: -1, + }, + /** 光标结束位置,自动聚集时有效,需与selection-start搭配使用 */ + selectionEnd: { + type: Number, + value: -1, + }, + /** 键盘弹起时,是否自动上推页面 */ + adjustPosition: { + type: Boolean, + value: true, + }, + /** focus时,点击页面的时候不收起键盘 */ + holdKeyboard: { + type: Boolean, + value: false, + }, + /** 指定 placeholder 的样式 */ + placeholderStyle: { + type: String, + value: '', + }, + /** 指定 placeholder 的样式类 */ + placeholderClass: { + type: String, + value: '', + }, /** 左侧图标 */ leftIcon: { type: String, diff --git a/src/search/search.ts b/src/search/search.ts index 9e6a820d2..87bebfb11 100644 --- a/src/search/search.ts +++ b/src/search/search.ts @@ -1,6 +1,7 @@ import { SuperComponent, wxComponent } from '../common/src/index'; import config from '../common/config'; import props from './props'; +import { getCharacterLength } from '../common/utils'; const { prefix } = config; const name = `${prefix}-search`; @@ -22,22 +23,22 @@ export default class Search extends SuperComponent { properties = props; - observers = { - focus(this: Search, nextValue: boolean) { - this.setData({ 'localValue.focus': nextValue }); - }, - }; + observers = {}; data = { classPrefix: name, prefix, - localValue: { - focus: false, - }, }; onInput(e) { - const { value } = e.detail; + let { value } = e.detail; + const { maxcharacter } = this.properties; + + if (maxcharacter && typeof maxcharacter === 'number' && maxcharacter > 0) { + const { characters } = getCharacterLength('maxcharacter', value, maxcharacter); + + value = characters; + } this.setData({ value }); this.triggerEvent('change', { value }); @@ -46,14 +47,12 @@ export default class Search extends SuperComponent { onFocus(e) { const { value } = e.detail; - this.setData({ 'localValue.focus': true }); this.triggerEvent('focus', { value }); } onBlur(e) { const { value } = e.detail; - this.setData({ 'localValue.focus': false }); this.triggerEvent('blur', { value }); } diff --git a/src/search/search.wxml b/src/search/search.wxml index 14a6a2280..667d0d771 100644 --- a/src/search/search.wxml +++ b/src/search/search.wxml @@ -2,7 +2,7 @@ @@ -17,14 +17,23 @@ 具体释义:
`send` 右下角按钮为“发送”;
`search` 右下角按钮为“搜索”;
`next` 右下角按钮为“下一个”;
`go` 右下角按钮为“前往”;
`done` 右下角按钮为“完成”。
[小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html) + * @default search + */ + confirmType?: { + type: StringConstructor; + value?: 'send' | 'search' | 'next' | 'go' | 'done'; + }; + /** + * 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) + * @default false + */ + alwaysEmbed?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 点击键盘右下角按钮时是否保持键盘不收起 + * @default false + */ + confirmHold?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 指定focus时的光标位置 + */ + cursor: { + type: NumberConstructor; + value?: number; + }; + /** + * 光标起始位置,自动聚集时有效,需与selection-end搭配使用 + * @default -1 + */ + selectionStart?: { + type: NumberConstructor; + value?: number; + }; + /** + * 光标结束位置,自动聚集时有效,需与selection-start搭配使用 + * @default -1 + */ + selectionEnd?: { + type: NumberConstructor; + value?: number; + }; + /** + * 键盘弹起时,是否自动上推页面 + * @default true + */ + adjustPosition?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * focus时,点击页面的时候不收起键盘 + * @default false + */ + holdKeyboard?: { + type: BooleanConstructor; + value?: boolean; + }; + /** + * 指定 placeholder 的样式 + * @default '' + */ + placeholderStyle: { + type: StringConstructor; + value?: string; + }; + /** + * 指定 placeholder 的样式类 + * @default '' + */ + placeholderClass?: { + type: StringConstructor; + value?: string; + }; /** * 左侧图标 * @default 'search' diff --git a/src/swipe-cell/_example/swipe-cell.ts b/src/swipe-cell/_example/swipe-cell.ts index 8002c41bd..560d44d43 100644 --- a/src/swipe-cell/_example/swipe-cell.ts +++ b/src/swipe-cell/_example/swipe-cell.ts @@ -1,31 +1 @@ -Page({ - data: { - right: [ - { - text: '编辑', - className: 't-swipe-cell-demo-btn edit-btn', - }, - { - text: '删除', - className: 't-swipe-cell-demo-btn delete-btn', - }, - ], - }, - - onActionClick({ detail }) { - wx.showToast({ title: `你点击了${detail.text}`, icon: 'none' }); - }, - - onDelete() { - wx.showToast({ title: '你点击了删除', icon: 'none' }); - }, - onEdit() { - wx.showToast({ title: '你点击了编辑', icon: 'none' }); - }, - onFavor() { - wx.showToast({ title: '你点击了收藏', icon: 'none' }); - }, - onChoice() { - wx.showToast({ title: '你点击了选择', icon: 'none' }); - }, -}); +Page({}); diff --git a/src/swipe-cell/swipe-cell.ts b/src/swipe-cell/swipe-cell.ts index 4a89b930c..2ad68297c 100644 --- a/src/swipe-cell/swipe-cell.ts +++ b/src/swipe-cell/swipe-cell.ts @@ -2,6 +2,7 @@ import { SuperComponent, wxComponent } from '../common/src/index'; import config from '../common/config'; import props from './props'; import { getRect } from '../common/utils'; +import { getObserver } from '../common/wechat'; let ARRAY: WechatMiniprogram.Component.TrivialInstance[] = []; @@ -49,6 +50,12 @@ export default class SwiperCell extends SuperComponent { setSwipeWidth() { Promise.all([getRect(this, `${ContainerClass}__left`), getRect(this, `${ContainerClass}__right`)]).then( ([leftRect, rightRect]) => { + if (leftRect.width === 0 && rightRect.width === 0 && !this._hasObserved) { + this._hasObserved = true; + getObserver(this, `.${name}`).then(() => { + this.setSwipeWidth(); + }); + } this.setData({ leftWidth: leftRect.width, rightWidth: rightRect.width, diff --git a/src/swipe-cell/swipe-cell.wxs b/src/swipe-cell/swipe-cell.wxs index 21779d7b9..16f01a2a3 100644 --- a/src/swipe-cell/swipe-cell.wxs +++ b/src/swipe-cell/swipe-cell.wxs @@ -133,6 +133,7 @@ var onDrag = function (event, ownerInstance) { } state.dragging = true; swipeMove(state.startOffset + state.deltaX); + return false }; var open = function (position) { diff --git a/src/swiper/README.md b/src/swiper/README.md index 35383f442..731ceaecb 100644 --- a/src/swiper/README.md +++ b/src/swiper/README.md @@ -85,6 +85,16 @@ change | `(current: number, source: SwiperChangeSource)` | 轮播切换时触发 click | `(index: number)` | `0.34.0`。点击轮播项时触发 image-load | `(index: number)` | `1.1.4`。图片加载时触发 +### Swiper 外部样式类 + +类名 | 说明 +-- | -- +t-class | 根节点样式类 +t-class-nav | 导航样式类 +t-class-image | 当前图片样式类 +t-class-prev-image | 上一图片样式类 +t-class-next-image | 下一图片样式类 + ### SwiperNav Props 名称 | 类型 | 默认值 | 说明 | 必传 @@ -97,6 +107,11 @@ show-controls | Boolean | false | `0.32.0`。是否显示两侧的控制按钮 | total | Number | 0 | `0.34.0`。总共的项数 | N type | String | dots | 导航器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等。TS 类型:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper-nav/type.ts) | N +### SwiperNav 外部样式类 + +类名 | 说明 +-- | -- +t-class | 根节点样式类 ### CSS 变量 组件提供了下列 CSS 变量,可用于自定义样式。 diff --git a/src/swiper/__test__/__snapshots__/demo.test.js.snap b/src/swiper/__test__/__snapshots__/demo.test.js.snap index fa7eeb923..5e2add506 100644 --- a/src/swiper/__test__/__snapshots__/demo.test.js.snap +++ b/src/swiper/__test__/__snapshots__/demo.test.js.snap @@ -279,7 +279,7 @@ exports[`Swiper Swiper vertical demo works fine 1`] = ` class="option" > - - 5000 -
- - 500 -
diff --git a/src/swiper/_example/vertical/index.wxml b/src/swiper/_example/vertical/index.wxml index 48171a6fc..6f010cfd9 100644 --- a/src/swiper/_example/vertical/index.wxml +++ b/src/swiper/_example/vertical/index.wxml @@ -29,11 +29,10 @@ value="{{interval}}" min="{{1000}}" max="{{5000}}" - label="" + label="{{true}}" step="{{500}}" bindchange="onIntervalChange" > - {{interval}} @@ -45,11 +44,10 @@ value="{{duration}}" min="{{200}}" max="{{2000}}" - label="" + label="{{true}}" step="{{100}}" bindchange="onDurationChange" > - {{duration}} diff --git a/src/swiper/_example/vertical/index.wxss b/src/swiper/_example/vertical/index.wxss index 9685e784a..cf9b7c2ed 100644 --- a/src/swiper/_example/vertical/index.wxss +++ b/src/swiper/_example/vertical/index.wxss @@ -33,20 +33,12 @@ margin-right: 20rpx; } -.cell .option { - display: flex; - flex-direction: row; - justify-content: start; - align-items: center; -} - .cell .option-desc { width: 68rpx; - padding-left: 32rpx; } .cell .swiper-slider { - flex: 1; + margin: 32rpx 0; } .swiper-box-vertical .item { diff --git a/src/swiper/swiper.less b/src/swiper/swiper.less index afbeb9f3e..9b28f0c28 100644 --- a/src/swiper/swiper.less +++ b/src/swiper/swiper.less @@ -24,7 +24,6 @@ transition: all 0.3s ease; &-host { - display: block; width: 100%; } } diff --git a/src/tab-bar/README.md b/src/tab-bar/README.md index 552b9afa0..8d9c3dde4 100644 --- a/src/tab-bar/README.md +++ b/src/tab-bar/README.md @@ -30,7 +30,7 @@ isComponent: true #### 纯图标标签栏 -{{ text-only }} +{{ icon-only }} #### 双层级纯文本标签栏