Skip to content

Commit

Permalink
1.0.0 (#1681)
Browse files Browse the repository at this point in the history
* fix(SwipeCell): fix docs (#1634)

* fix(Dialog): fix button style (#1633)

* fix(loading): update loading color (#1627)

* Refactor/loading remove (#1626)

* fix(loading): remove bar and error theme

* test(loading): update

* test(image-viewer): update snapshot

* chore(Cell): adjust className for hover-class (#1635)

* chore(Cell): adjust className for hover-class

* test: update snapshots

* chore(Picker&&DateTimePicker): remove footer slot (#1631)

* chore(Radio): align attribute is renamed to placement (#1630)

* chore(Checkbox): align attribute is renamed to placement (#1629)

* chore(Search): remove the right-icon and add the clearable attribute (#1628)

* feat(button): support suffix slot (#1624)

* feat(button): support suffix slot

* test(button): update snapshot

* chore(Avatar): remove bordered attribute (#1632)

* chore(Avatar): remove bordered attribute

* fix: fix cr

* chore(Message): remove action and add the link attribute (#1637)

* chore(Message): remove action and add the link attribute

* fix: fix cr

* fix(navbar): resolve capsule event currectly (#1641)

* chore(Footer): copyright attribute is renamed to text (#1642)

* chore(Footer): copyright attribute is renamed to text

* chore(CountDown): remove theme attribute

* fix(dialog): resolve word misspelling (#1644)

* chore(CountDown): remove hightlight theme (#1645)

* fix(slider): 规范无障碍语义. (#1388)

* fix(slider): 规范无障碍语义

* fix(slider): 无障碍滑块valuetext规范.(#1402)

* fix(slider): 无用动态百分比播报问题.(#1402)

* fix(slider): 隐藏数值读取.(#1402)

* fix(slider): 隐藏数值读取.(#1402)

* fix(slider): 变量规范.(#1402)

* docs(steps): update api

* fix(toast): replace fail theme with error (#1647)

* docs: update api & changelog

* fix: fix overview.md errors (#1651)

* fix: update pages

* fix(collapse): resolve disabled color (#1648)

* fix(collapse): resolve disabled color

* test: update snapshot

* chore(Link): remove status and add disabled and hover (#1652)

* chore(Link): remove status and add disabled and hover

* feat(Link): support external-classes

* feat(Drawer): add hover style (#1673)

* fix(Tag): use catch to bind events (#1669)

* fix(rate): remove variant property and update tips disapper logic (#1674)

* fix(rate): remove variant property and update tips disapper logic

* test(rate): update snapshot

* fix(BackTop): fix icon (#1660)

* fix(Picker): update demo (#1661)

* fix: update sidebar of the site (#1659)

* docs(common): update design docs (#1658)

* fix(SideBar): fix inaccurate positioning when the page was init (#1675)

* fix(slider): remove colors and disabledColor property (#1676)

* feat(AvatarGroup): add border style (#1678)

* fix(dialog): resolve action tsd error and support buttonLayout (#1654) (#1655)

* chore(NoticeBar): extra attribute is renamed to operation (#1638)

* fix(Cell): resolve demo problems (#1679)

* chore: publish v1.0.0 (#1680)

* chore: publish v1.0.0

* chore: changelog's changes

---------

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

* docs: update changelog

---------

Co-authored-by: Y <anly_yaw@163.com>
Co-authored-by: Wang <awangjianjun9@gmail.com>
Co-authored-by: byqbai <byq1213@qq.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Feb 28, 2023
1 parent a4e3c2f commit 7e24936
Show file tree
Hide file tree
Showing 215 changed files with 1,048 additions and 1,182 deletions.
80 changes: 55 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,55 @@ spline: explain
toc: false
docClass: timeline
---
## 🌈 1.0.0 `2023-02-27`
### ❗ Breaking Changes
- `Cell`: 调整 hover 状态对应的类名 @anlyyao ([#1635](https://github.com/Tencent/tdesign-miniprogram/pull/1635))
- `Checkbox`: 属性 align 更名为 placement @anlyyao ([#1629](https://github.com/Tencent/tdesign-miniprogram/pull/1629))
- `Toast`: 属性 theme 的枚举值 fail 替换成 error @LeeJim ([#1647](https://github.com/Tencent/tdesign-miniprogram/pull/1647))
- `Slider`: 移除 colors 和 disabledColor,建议使用 CSS Variables 修改 @LeeJim ([#1676](https://github.com/Tencent/tdesign-miniprogram/pull/1676))
- `Loading`: 移除 theme = error 以及 theme = bar,以及调整 DOM @LeeJim ([#1626](https://github.com/Tencent/tdesign-miniprogram/pull/1626))
- `Picker`: 移除 `footer` 插槽 @anlyyao ([#1631](https://github.com/Tencent/tdesign-miniprogram/pull/1631))
- `DateTimePicker`: 移除 `footer` 插槽 @anlyyao ([#1631](https://github.com/Tencent/tdesign-miniprogram/pull/1631))
- `Radio`: 属性 align 更名为 placement @anlyyao ([#1630](https://github.com/Tencent/tdesign-miniprogram/pull/1630))
- `RadioGroup`: 属性 align 更名为 placement @anlyyao ([#1630](https://github.com/Tencent/tdesign-miniprogram/pull/1630))
- `Search`: 移除 `right-icon` 属性相关 @anlyyao ([#1628](https://github.com/Tencent/tdesign-miniprogram/pull/1628))
- `Avatar`: 移除 `bordered` 属性 @anlyyao ([#1632](https://github.com/Tencent/tdesign-miniprogram/pull/1632))
- `AvatarGroup`: `cascading` 属性默认值变更为 `left-up` @anlyyao ([#1632](https://github.com/Tencent/tdesign-miniprogram/pull/1632))
- `Message`: 移除 `action` 属性相关,使用 `link` 代替 @anlyyao ([#1637](https://github.com/Tencent/tdesign-miniprogram/pull/1637))
- `Footer`: `copyright` 更名为 `text` @anlyyao ([#1642](https://github.com/Tencent/tdesign-miniprogram/pull/1642))
- `Footer`: `textLinkList` 更名为 `links` @anlyyao ([#1642](https://github.com/Tencent/tdesign-miniprogram/pull/1642))
- `Footer`: 移除 `theme` 属性 @anlyyao ([#1642](https://github.com/Tencent/tdesign-miniprogram/pull/1642))
- `CountDown`: `theme` 属性移除 `hightlight` @anlyyao ([#1645](https://github.com/Tencent/tdesign-miniprogram/pull/1645))
- `Link`: 移除 `status` 属性 @anlyyao ([#1652](https://github.com/Tencent/tdesign-miniprogram/pull/1652))
- `Rate`: 移除 variant 属性,完全依赖 icon 属性来控制图标 @LeeJim ([#1674](https://github.com/Tencent/tdesign-miniprogram/pull/1674))
- `NoticeBar`: `extra` 属性更名为 `operation` @anlyyao ([#1638](https://github.com/Tencent/tdesign-miniprogram/pull/1638))

### 🚀 Features
- `Search`: 新增 `clearable`,用于启用清除控件 @anlyyao ([#1628](https://github.com/Tencent/tdesign-miniprogram/pull/1628))
- `Button`: 新增支持 suffix 插槽 @LeeJim ([#1624](https://github.com/Tencent/tdesign-miniprogram/pull/1624))
- `Message`: 新增 `link` 属性 @anlyyao ([#1637](https://github.com/Tencent/tdesign-miniprogram/pull/1637))
- `Link`: 新增 `disabled` 属性 @anlyyao ([#1652](https://github.com/Tencent/tdesign-miniprogram/pull/1652))
- `Link`: 新增 `hover` 属性 @anlyyao ([#1652](https://github.com/Tencent/tdesign-miniprogram/pull/1652))
- `Link`: 新增 `externalClasses` 属性 @anlyyao ([#1652](https://github.com/Tencent/tdesign-miniprogram/pull/1652))
- `Drawer`: 补充 `hover` 态样式 @anlyyao ([#1673](https://github.com/Tencent/tdesign-miniprogram/pull/1673))
- `AvatarGroup`: 头像组中默认带边框 @anlyyao ([#1678](https://github.com/Tencent/tdesign-miniprogram/pull/1678))
### 🐞 Bug Fixes
- `Fab`: 修复丢失style 默认值的问题 @LeeJim ([#1625](https://github.com/Tencent/tdesign-miniprogram/pull/1625))
- `Dialog`: 修复文字按钮`hover`态圆角不正确 @anlyyao ([#1633](https://github.com/Tencent/tdesign-miniprogram/pull/1633))
- `Switch`: 优化禁用态下 loading 的颜色 @LeeJim ([#1627](https://github.com/Tencent/tdesign-miniprogram/pull/1627))
- `Message`: 修复主题图标不正确 @anlyyao ([#1637](https://github.com/Tencent/tdesign-miniprogram/pull/1637))
- `NavBar`: 修复胶囊内部点击事件没反应的问题 @LeeJim ([#1641](https://github.com/Tencent/tdesign-miniprogram/pull/1641))
- `Dialog`: 修复 confirm 的拼写错误 @zzzimooo ([#1644](https://github.com/Tencent/tdesign-miniprogram/pull/1644))
- `CountDown`: 修复默认风格下时间单位分割的问题 @anlyyao ([#1645](https://github.com/Tencent/tdesign-miniprogram/pull/1645))
- `Slider`: 优化无障碍访问支持 @byq1213 ([#1388](https://github.com/Tencent/tdesign-miniprogram/pull/1388))
- `Collapse`: 修复 disabled 状态下标题颜色错误的问题 @LeeJim ([#1648](https://github.com/Tencent/tdesign-miniprogram/pull/1648))
- `Cell`: 修复外部样式类 t-class-title 放置位置错误的问题 @LeeJim ([#1648](https://github.com/Tencent/tdesign-miniprogram/pull/1648))
- `Tag`: 修复 `close``click` 事件一并触发的问题 @anlyyao ([#1669](https://github.com/Tencent/tdesign-miniprogram/pull/1669))
- `Rate`: 修复 tips 偶尔会不消失的问题 @LeeJim ([#1674](https://github.com/Tencent/tdesign-miniprogram/pull/1674))
- `BackTop`: 修复 `icon` 不显示问题 @anlyyao ([#1660](https://github.com/Tencent/tdesign-miniprogram/pull/1660))
- `NoticeBar`: 修复主题图标不正确 @anlyyao ([#1638](https://github.com/Tencent/tdesign-miniprogram/pull/1638))
- `Badge`: 调整 display 使用 block 替换 inline-block @anlyyao ([#1679](https://github.com/Tencent/tdesign-miniprogram/pull/1679))
- `Dialog`: 修复命令行方式没法调整按钮布局的问题 @zzzimooo ([#1655](https://github.com/Tencent/tdesign-miniprogram/pull/1655))
## 🌈 1.0.0-rc.3 `2023-02-20`
### ❗ Breaking Changes
- `Image`: 插槽的渲染需要传入对应 slot 的字符串 @LeeJim ([#1609](https://github.com/Tencent/tdesign-miniprogram/pull/1609))
Expand All @@ -14,7 +63,7 @@ docClass: timeline
- `Input`: 支持 `tips` 文本方向与 `align` 属性值一致 @anlyyao ([#1585](https://github.com/Tencent/tdesign-miniprogram/pull/1585))
- `CellGroup`: 默认最后一项 `cell` 无底部边框线 @anlyyao ([#1607](https://github.com/Tencent/tdesign-miniprogram/pull/1607))
- `Image`: 补充外部样式类名 `class` @anlyyao ([#1611](https://github.com/Tencent/tdesign-miniprogram/pull/1611))
- `DropdownMenu`: 新增 reset 事件 @LeeJim ([#1617](https://github.com/Tencent/tdesign-miniprogram/pull/1617))
- `DropdownMenu`: 新增 `reset` 事件 @LeeJim ([#1617](https://github.com/Tencent/tdesign-miniprogram/pull/1617))
- `Drawer`: 支持无障碍访问 @zhangpaopao0609 ([#1552](https://github.com/Tencent/tdesign-miniprogram/pull/1552))

### 🐞 Bug Fixes
Expand All @@ -29,17 +78,16 @@ docClass: timeline
- `Tabs`: 修复属性不支持响应式变化的问题 @LeeJim ([#1616](https://github.com/Tencent/tdesign-miniprogram/pull/1616))
- `DropdownMenu`: 修复下拉菜单遮罩层无法点击 @RoseyW ([#1615](https://github.com/Tencent/tdesign-miniprogram/pull/1615))
- `Message`: 修复事件名称,以符合文档 @LeeJim ([#1618](https://github.com/Tencent/tdesign-miniprogram/pull/1618))
- `Dialog`: 修复事件名,从 overlayClick 改成 overlay-click @LeeJim ([#1619](https://github.com/Tencent/tdesign-miniprogram/pull/1619))
- `SwiperNav`: 修复事件名,从 navBtnChange 改成 nav-btn-change @LeeJim ([#1619](https://github.com/Tencent/tdesign-miniprogram/pull/1619))
- `TextArea`: 修复事件名,从 lineChange改成 line-change @LeeJim ([#1619](https://github.com/Tencent/tdesign-miniprogram/pull/1619))
- `DropdownMenu`: 修复下拉菜单遮罩层无法点击 @RoseyW ([#1615](https://github.com/Tencent/tdesign-miniprogram/pull/1615))
- `Dialog`: 修复事件名,从 `overlayClick` 改成 `overlay-click` @LeeJim ([#1619](https://github.com/Tencent/tdesign-miniprogram/pull/1619))
- `SwiperNav`: 修复事件名,从 `navBtnChange` 改成 `nav-btn-change` @LeeJim ([#1619](https://github.com/Tencent/tdesign-miniprogram/pull/1619))
- `TextArea`: 修复事件名,从 `lineChange` 改成 `line-change` @LeeJim ([#1619](https://github.com/Tencent/tdesign-miniprogram/pull/1619))

## 🌈 1.0.0-rc.2 `2023-02-13`
### ❗ Breaking Changes
- `Icon`: `size``color` 属性默认值变更为 `''` @anlyyao ([#1553](https://github.com/Tencent/tdesign-miniprogram/pull/1553))
### 🚀 Features
- 所有组件同时支持 `style``customStyle` 属性 @LeeJim ([#1532](https://github.com/Tencent/tdesign-miniprogram/pull/1532))
- `Button`: 支持点击态边框颜色 css variable @anlyyao ([#1530](https://github.com/Tencent/tdesign-miniprogram/pull/1530))
- `Button`: 支持点击态边框颜色 CSS Variable @anlyyao ([#1530](https://github.com/Tencent/tdesign-miniprogram/pull/1530))
- `Result`: 属性 icon 支持对象类型,透传至图标组件 @LeeJim ([#1539](https://github.com/Tencent/tdesign-miniprogram/pull/1539))
- `TabBar`: 属性 icon 支持对象类型,透传至图标组件 @LeeJim ([#1539](https://github.com/Tencent/tdesign-miniprogram/pull/1539))
- `Toast`: 属性 icon 支持对象类型,透传至图标组件 @LeeJim ([#1539](https://github.com/Tencent/tdesign-miniprogram/pull/1539))
Expand Down Expand Up @@ -91,23 +139,6 @@ docClass: timeline
- `Picker`: 修复样式、优化布局以及交互体验 @LeeJim ([#1513](https://github.com/Tencent/tdesign-miniprogram/pull/1513))
- `Swiper`: 修复 `autoplay` 状态下,`swiper` 偶现左右抖动问题 @anlyyao ([#1494](https://github.com/Tencent/tdesign-miniprogram/pull/1494))

## 🌈 1.0.0-rc.1 `2023-01-18`
### ❗ BREAKING CHANGES
- `Dialog`: 移除内置的 input 样式 @LeeJim ([#1516](https://github.com/Tencent/tdesign-miniprogram/pull/1516))
- `Input`: 优化 DOM,移除外置的 wapper 元素 @LeeJim ([#1516](https://github.com/Tencent/tdesign-miniprogram/pull/1516))

### 🚀 Features
- `Cell`: 新增底边框左右边距 CSS Variables @anlyyao ([#1515](https://github.com/Tencent/tdesign-miniprogram/pull/1515))
- `Cell`: 补充 CSS Variables @anlyyao ([#1517](https://github.com/Tencent/tdesign-miniprogram/pull/1517))
- `SideBar`: 支持传入 Icon @LeeJim ([#1520](https://github.com/Tencent/tdesign-miniprogram/pull/1520))
- `Tabs`: 支持传入 icon @LeeJim ([#1519](https://github.com/Tencent/tdesign-miniprogram/pull/1519))
### 🐞 Bug Fixes
- `Upload`: 修复 add-content 不生效的问题 @LeeJim ([#1507](https://github.com/Tencent/tdesign-miniprogram/pull/1507))
- `Upload`: 优化插槽渲染,不再需要传入 add-content = 'slot' @LeeJim ([#1507](https://github.com/Tencent/tdesign-miniprogram/pull/1507))
- `Cascader`: 修复 slot 无法使用的问题 @LeeJim ([#1508](https://github.com/Tencent/tdesign-miniprogram/pull/1508))
- `Picker`: 修复样式、优化布局以及交互体验 @LeeJim ([#1513](https://github.com/Tencent/tdesign-miniprogram/pull/1513))
- `Swiper`: 修复 `autoplay` 状态下,`swiper` 偶现左右抖动问题 @anlyyao ([#1494](https://github.com/Tencent/tdesign-miniprogram/pull/1494))

## 🌈 1.0.0-rc `2023-01-12`
### ❗ Breaking Changes
- 全部组件开启 vritualHost,当基础库版本低于 2.19.2 自动关闭 @LeeJim ([#1495](https://github.com/Tencent/tdesign-miniprogram/pull/1495))
Expand Down Expand Up @@ -158,7 +189,7 @@ docClass: timeline
- `PullDownRefresh`: 新增 scroll 事件 @LeeJim ([#1424](https://github.com/Tencent/tdesign-miniprogram/pull/1424))
- `BackTop`: 放置 pull-down-refresh 内部时,将会滚动该容器到顶部 @LeeJim ([#1424](https://github.com/Tencent/tdesign-miniprogram/pull/1424))
- `Swiper`: 增加 click 事件 @LeeJim ([#1435](https://github.com/Tencent/tdesign-miniprogram/pull/1435))
- `Collapse`: 新增 placmen 属性,支持内容面板在上方 @LeeJim ([#1446](https://github.com/Tencent/tdesign-miniprogram/pull/1446))
- `Collapse`: 新增 placment 属性,支持内容面板在上方 @LeeJim ([#1446](https://github.com/Tencent/tdesign-miniprogram/pull/1446))
- `Calendar`: 新增 auto-close 属性,以及 close 事件 @LeeJim ([#1448](https://github.com/Tencent/tdesign-miniprogram/pull/1448))
- `Textarea`: 补充 cursor、disableDefaultPadding、showConfirmBar、 selection-Start、 selectionEnd、holdKeyboard 等属性 @anlyyao ([#1463](https://github.com/Tencent/tdesign-miniprogram/pull/1463))
- `Textarea`: 补充 keyboardheightchange 事件 @anlyyao ([#1463](https://github.com/Tencent/tdesign-miniprogram/pull/1463))
Expand Down Expand Up @@ -304,7 +335,6 @@ docClass: timeline
- `Fab`: 支持无障碍访问 @zhangpaopao0609 ([#1231](https://github.com/Tencent/tdesign-miniprogram/pull/1231))
- `Tabs`: 支持无障碍访问 @zhangpaopao0609 ([#1227](https://github.com/Tencent/tdesign-miniprogram/pull/1227))
- `Overlay`: 支持无障碍访问 @szu-bee ([#1205](https://github.com/Tencent/tdesign-miniprogram/pull/1205))
- `Collapse`: 支持无障碍访问 @gzzhanghao ([#1224](https://github.com/Tencent/tdesign-miniprogram/pull/1224))
- `Toast`: 支持无障碍访问 @huaiyinfeilong ([#1210](https://github.com/Tencent/tdesign-miniprogram/pull/1210))

### 🐞 Bug Fixes
Expand Down
1 change: 0 additions & 1 deletion example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"pages/tabs/tabs",
"pages/icon/icon",
"pages/loading/loading",
"pages/loading/loadingProgress/index",
"pages/progress/progress",
"pages/cascader/cascader",
"pages/cell/cell",
Expand Down
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.0.0-rc.3",
"version": "1.0.0",
"description": "tdesign-miniprogram",
"title": "tdesign-ßminiprogram",
"main": "miniprogram_dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions site/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ spline: explain
</a>
</div>
<div class="image-wrapper">
<a class="item" href="/miniprogram/components/sidebar">
<a class="item" href="/miniprogram/components/side-bar">
<img class="__light__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-sidebar.png" />
<img class="__dark__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-sidebar-dark.png" />
<p class="name">SideBar 侧边导航栏</p>
Expand Down Expand Up @@ -203,7 +203,7 @@ spline: explain
</div>

<div class="image-wrapper">
<a class="item" href="/miniprogram/components/textarea">
<a class="item" href="/miniprogram/components/tree-select">
<img class="__light__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-treeselect.png" />
<img class="__dark__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-treeselect-dark.png" />
<p class="name">TreeSelect 树形选择</p>
Expand Down Expand Up @@ -401,7 +401,7 @@ spline: explain
</div>

<div class="image-wrapper">
<a class="item" href="/miniprogram/components/popup">
<a class="item" href="/miniprogram/components/overlay">
<img class="__light__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-overlay.png" />
<img class="__dark__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-overlay-dark.png" />
<p class="name">Overlay 遮罩层</p>
Expand Down
12 changes: 9 additions & 3 deletions site/plugin-tdoc/md-to-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function customRender({ source, file, md }: any) {
};

// md filename
const reg = file.match(/src\/(\w+-?\w+)\/(\w+-?\w+)\.md/);
const reg = file.match(/src\/(\S*)(?=\/\S*.md)/);
const componentName = reg && reg[1];

// split md
Expand All @@ -79,9 +79,15 @@ function customRender({ source, file, md }: any) {

if (pageData.isComponent) {
mdSegment.demoMd = md.render.call(md, `${demoMd.replace(/<!--[\s\S]+?-->/g, '')}`).html;
mdSegment.apiMd = md.render.call(md, `${pageData.toc ? '[toc]\n' : ''}${apiMd.replace(/<!--[\s\S]+?-->/g, '')}`).html;
mdSegment.apiMd = md.render.call(
md,
`${pageData.toc ? '[toc]\n' : ''}${apiMd.replace(/<!--[\s\S]+?-->/g, '')}`,
).html;
} else {
mdSegment.docMd = md.render.call(md, `${pageData.toc ? '[toc]\n' : ''}${content.replace(/<!--[\s\S]+?-->/g, '')}`).html;
mdSegment.docMd = md.render.call(
md,
`${pageData.toc ? '[toc]\n' : ''}${content.replace(/<!--[\s\S]+?-->/g, '')}`,
).html;
}

// 设计指南内容 不展示 design Tab 则不解析
Expand Down
21 changes: 11 additions & 10 deletions site/plugin-tdoc/transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ import mdToVue from './md-to-vue';

let demoCodesImports: Record<string, string> = {};


export default {
before({ source, file, md }: any) {
const resouceDir = path.dirname(file);
const reg = file.match(/src\/(\w+-?\w+)\/\w+-?\w+\.md/);
const reg = file.match(/src\/(\S*)(?=\/\S*.md)/);
const name = reg && reg[1];
demoCodesImports = {};

// 增加渲染规则
md.renderer.rules.html_block = function (tokens: string, idx: number) {
const { content } = tokens[idx];
if (content.startsWith('<img') && content.indexOf('qrcode') === -1) {
return '';
return '';
}

return content;
Expand All @@ -29,10 +28,10 @@ export default {
console.log('\x1B[36m%s\x1B[0m', `${name} 组件需要实现 _example/${demoDirName} 示例!`);
return '\n<h3>DEMO (🚧建设中)...</h3>';
}
const wxml = fs.readFileSync(path.resolve(demoPath, 'index.wxml'), { encoding: 'utf-8'});
const js = fs.readFileSync(path.resolve(demoPath, 'index.js'), { encoding: 'utf-8'});
const css = fs.readFileSync(path.resolve(demoPath, 'index.wxss'), { encoding: 'utf-8'});
const json = fs.readFileSync(path.resolve(demoPath, 'index.json'), { encoding: 'utf-8'});
const wxml = fs.readFileSync(path.resolve(demoPath, 'index.wxml'), { encoding: 'utf-8' });
const js = fs.readFileSync(path.resolve(demoPath, 'index.js'), { encoding: 'utf-8' });
const css = fs.readFileSync(path.resolve(demoPath, 'index.wxss'), { encoding: 'utf-8' });
const json = fs.readFileSync(path.resolve(demoPath, 'index.json'), { encoding: 'utf-8' });

return `
<td-code-block panel="WXML">
Expand All @@ -43,13 +42,15 @@ export default {
<pre slot="CSS" lang="css">${encodeURIComponent(css)}</pre>
<pre slot="JSON" lang="javascript">${encodeURIComponent(json)}</pre>
</td-code-block>`
</td-code-block>`;
});

return source;
},
render({ source, file, md }: { source: string, file: string, md: any }) {
const demoCodesDefsStr = Object.keys(demoCodesImports).map((key) => demoCodesImports[key]).join(';\n');
render({ source, file, md }: { source: string; file: string; md: any }) {
const demoCodesDefsStr = Object.keys(demoCodesImports)
.map((key) => demoCodesImports[key])
.join(';\n');
const demoCodesInstallStr = Object.keys(demoCodesImports).join(',');

const sfc = mdToVue({
Expand Down
8 changes: 4 additions & 4 deletions site/site.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
component: () => import('@/navbar/README.md'),
},
{
title: 'SideBar 侧边导航',
title: 'SideBar 侧边栏',
name: 'sidebar',
meta: { docType: 'navigation' },
path: '/miniprogram/components/side-bar',
Expand Down Expand Up @@ -177,7 +177,7 @@ export default {
component: () => import('@/cascader/README.md'),
},
{
title: 'CheckBox 复选框',
title: 'CheckBox 多选框',
name: 'checkbox',
meta: { docType: 'form' },
path: '/miniprogram/components/checkbox',
Expand Down Expand Up @@ -365,7 +365,7 @@ export default {
component: () => import('@/skeleton/README.md'),
},
{
title: 'Sticky 吸顶容器',
title: 'Sticky 吸顶',
name: 'sticky',
meta: { docType: 'navigation' },
path: '/miniprogram/components/sticky',
Expand Down Expand Up @@ -399,7 +399,7 @@ export default {
component: () => import('@/action-sheet/README.md'),
},
{
title: 'Dialog 弹出框',
title: 'Dialog 对话框',
name: 'dialog',
meta: { docType: 'message' },
path: '/miniprogram/components/dialog',
Expand Down
2 changes: 1 addition & 1 deletion src/_common
Submodule _common updated 60 files
+4 −0 .gitignore
+75 −0 docs/miniprogram/_design/ActionSheet.md
+86 −0 docs/miniprogram/_design/Button.md
+59 −0 docs/miniprogram/_design/Checkbox.md
+69 −0 docs/miniprogram/_design/Dialog.md
+55 −0 docs/miniprogram/_design/Divider.md
+61 −0 docs/miniprogram/_design/Drawer.md
+88 −0 docs/miniprogram/_design/Fab.md
+61 −0 docs/miniprogram/_design/Image.md
+45 −0 docs/miniprogram/_design/ImageViewer.md
+59 −0 docs/miniprogram/_design/PullDownRefresh.md
+64 −0 docs/miniprogram/_design/Radio.md
+62 −0 docs/miniprogram/_design/Slider.md
+83 −0 docs/miniprogram/_design/TabBar.md
+114 −0 docs/miniprogram/_design/Tabs.md
+38 −0 docs/miniprogram/_design/gen-design-docs.js
+73 −0 docs/miniprogram/design/action-sheet.md
+84 −0 docs/miniprogram/design/button.md
+57 −0 docs/miniprogram/design/checkbox.md
+67 −0 docs/miniprogram/design/dialog.md
+53 −0 docs/miniprogram/design/divider.md
+59 −0 docs/miniprogram/design/drawer.md
+86 −0 docs/miniprogram/design/fab.md
+43 −0 docs/miniprogram/design/image-viewer.md
+59 −0 docs/miniprogram/design/image.md
+57 −0 docs/miniprogram/design/pull-down-refresh.md
+62 −0 docs/miniprogram/design/radio.md
+60 −0 docs/miniprogram/design/slider.md
+81 −0 docs/miniprogram/design/tab-bar.md
+112 −0 docs/miniprogram/design/tabs.md
+420 −0 docs/miniprogram/overview.md
+80 −0 docs/mobile/_design/按钮Button.md
+2 −0 docs/mobile/design/button.md
+9 −3 docs/web/api/select.md
+5 −3 js/color-picker/gradient.ts
+3 −2 js/date-picker/format.ts
+8 −7 js/date-picker/utils.ts
+144 −143 js/global-config/locale/ar_KW.ts
+145 −144 js/global-config/locale/en_US.ts
+147 −146 js/global-config/locale/ja_JP.ts
+146 −145 js/global-config/locale/ko_KR.ts
+147 −146 js/global-config/locale/zh_CN.ts
+4 −2 js/input-number/large-number.ts
+8 −6 js/input-number/number.ts
+1 −1 js/loading/circle-adapter.ts
+4 −3 js/table/tree-store.ts
+5 −3 js/tree/tree-node-model.ts
+10 −7 js/tree/tree-node.ts
+12 −8 js/tree/tree-store.ts
+7 −5 js/upload/main.ts
+2 −1 js/upload/xhr.ts
+3 −2 js/utils/calcTextareaHeight.ts
+12 −2 js/utils/getScrollbarWidth.ts
+21 −6 js/utils/helper.ts
+1 −0 js/utils/observe.ts
+1 −1 js/watermark/generateBase64Url.ts
+3 −3 package.json
+5 −5 style/web/components/button/_index.less
+0 −1 style/web/components/dialog/_index.less
+4 −4 style/web/components/tabs/_index.less
1 change: 1 addition & 0 deletions src/avatar-group/avatar-group.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import '../common/style/index.less';
@import '../avatar/avatar.less';

//组合头像偏移量
@avatar-group-offset-small: var(--td-avatar-group-margin-left-small, -4px);
Expand Down
Loading

0 comments on commit 7e24936

Please sign in to comment.