From e478c8ab41ac58870b5bb713c63bfb36c420244d Mon Sep 17 00:00:00 2001 From: anlyyao Date: Tue, 21 Jan 2025 20:33:35 +0800 Subject: [PATCH 1/3] fix(Dialog): use the correct border-radius --- src/dialog/README.en-US.md | 9 +++++---- src/dialog/README.md | 9 +++++---- src/dialog/dialog.less | 27 ++++++++++++++++++--------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/dialog/README.en-US.md b/src/dialog/README.en-US.md index 620da0a29..d886deeeb 100644 --- a/src/dialog/README.en-US.md +++ b/src/dialog/README.en-US.md @@ -47,11 +47,12 @@ The component provides the following CSS variables, which can be used to customi Name | Default Value | Description -- | -- | -- --td-dialog-body-max-height | 912rpx | - ---td-dialog-close-color | @font-gray-3 | - ---td-dialog-content-color | @font-gray-2 | - +--td-dialog-border-radius | @radius-extra-large | - +--td-dialog-close-color | @text-color-placeholder | - +--td-dialog-content-color | @text-color-secondary | - --td-dialog-content-font-size | 32rpx | - --td-dialog-content-line-height | 48rpx | - ---td-dialog-title-color | @font-gray-1 | - +--td-dialog-title-color | @text-color-primary | - --td-dialog-title-font-size | 36rpx | - --td-dialog-title-line-height | 52rpx | - ---td-dialog-width | 622rpx | - \ No newline at end of file +--td-dialog-width | 622rpx | - diff --git a/src/dialog/README.md b/src/dialog/README.md index 259bc8d35..6cc1feb06 100644 --- a/src/dialog/README.md +++ b/src/dialog/README.md @@ -108,11 +108,12 @@ t-class-content | 内容样式类 名称 | 默认值 | 描述 -- | -- | -- --td-dialog-body-max-height | 912rpx | - ---td-dialog-close-color | @font-gray-3 | - ---td-dialog-content-color | @font-gray-2 | - +--td-dialog-border-radius | @radius-extra-large | - +--td-dialog-close-color | @text-color-placeholder | - +--td-dialog-content-color | @text-color-secondary | - --td-dialog-content-font-size | 32rpx | - --td-dialog-content-line-height | 48rpx | - ---td-dialog-title-color | @font-gray-1 | - +--td-dialog-title-color | @text-color-primary | - --td-dialog-title-font-size | 36rpx | - --td-dialog-title-line-height | 52rpx | - ---td-dialog-width | 622rpx | - \ No newline at end of file +--td-dialog-width | 622rpx | - diff --git a/src/dialog/dialog.less b/src/dialog/dialog.less index 8ead8aa09..8b108f9b4 100644 --- a/src/dialog/dialog.less +++ b/src/dialog/dialog.less @@ -5,6 +5,7 @@ // size @dialog-width: var(--td-dialog-width, 622rpx); +@dialog-border-radius: var(--td-dialog-border-radius, @radius-extra-large); @dialog-body-max-height: var(--td-dialog-body-max-height, 912rpx); // color @@ -21,19 +22,23 @@ .@{dialog} { overflow: hidden; width: @dialog-width; - border-radius: @radius-default; + border-radius: @dialog-border-radius; background-color: @bg-color-container; + &__wrapper { + --td-popup-border-radius: @dialog-border-radius; + } + &__close-btn { position: absolute; - top: 16rpx; - right: 16rpx; + top: @spacer; + right: @spacer; color: @dialog-close-color; z-index: 1; /* skyline适配新增 */ } &__content { - padding-top: @spacer-4; + padding-top: @spacer-3; padding-right: @spacer-3; padding-bottom: 0; padding-left: @spacer-3; @@ -43,6 +48,10 @@ flex-direction: column; justify-content: center; font-size: @font-size-m; + + &:empty { + display: none; + } } &__header { @@ -54,7 +63,7 @@ } &__header + &__body { - margin-top: 16rpx; + margin-top: @spacer; } &__body { @@ -80,7 +89,7 @@ &__footer { display: flex; - padding: 48rpx; + padding: @spacer-3; &--column { flex-flow: column-reverse; @@ -91,7 +100,7 @@ } &--full { - padding: 64rpx 0 0; + padding: @spacer-4 0 0; } } @@ -103,11 +112,11 @@ white-space: nowrap; &--horizontal + &--horizontal { - margin-left: 24rpx; + margin-left: @spacer-1; } &--vertical + &--vertical { - margin-bottom: 24rpx; + margin-bottom: @spacer-1; } &--text { From 2bf3c1562209ea572ac12b329c6974b5cd23d88c Mon Sep 17 00:00:00 2001 From: anlyyao Date: Tue, 21 Jan 2025 20:34:02 +0800 Subject: [PATCH 2/3] feat: update demo --- src/dialog/_example/base/index.js | 1 + src/dialog/_example/base/index.wxml | 19 ++++- src/dialog/_example/base/index.wxss | 6 ++ src/dialog/_example/confirm/index.js | 8 +- src/dialog/_example/confirm/index.wxml | 20 +++++ src/dialog/_example/dialog.wxml | 2 +- src/dialog/_example/status/index.wxml | 6 +- src/dialog/_example/with-image/index.js | 6 ++ src/dialog/_example/with-image/index.wxml | 95 ++++++++++++++++++++++- 9 files changed, 147 insertions(+), 16 deletions(-) diff --git a/src/dialog/_example/base/index.js b/src/dialog/_example/base/index.js index b7cf02cb5..7ada76b8d 100644 --- a/src/dialog/_example/base/index.js +++ b/src/dialog/_example/base/index.js @@ -5,6 +5,7 @@ Component({ showText: false, showMultiText: false, showTextAndTitle: false, + showTitleOnly: false, showMultiTextAndTitle: false, }, methods: { diff --git a/src/dialog/_example/base/index.wxml b/src/dialog/_example/base/index.wxml index dc8bbb9e5..1a655a555 100644 --- a/src/dialog/_example/base/index.wxml +++ b/src/dialog/_example/base/index.wxml @@ -7,7 +7,7 @@ bind:tap="showDialog" block > - 反馈类-基础 + 反馈类-带标题 + + 反馈类-纯标题 + + + diff --git a/src/dialog/_example/base/index.wxss b/src/dialog/_example/base/index.wxss index 88ad6b8a0..54de8d650 100644 --- a/src/dialog/_example/base/index.wxss +++ b/src/dialog/_example/base/index.wxss @@ -12,3 +12,9 @@ .long-content .content-container { white-space: pre-line; } + +.long-content ::-webkit-scrollbar { + display: none; + width: 0; + height: 0; +} diff --git a/src/dialog/_example/confirm/index.js b/src/dialog/_example/confirm/index.js index a5a37d9ed..f8d2fdd5c 100644 --- a/src/dialog/_example/confirm/index.js +++ b/src/dialog/_example/confirm/index.js @@ -4,13 +4,7 @@ Component({ dialogKey: '', showConfirm: false, showWarnConfirm: false, - showTooLongBtnContent: false, - showMultiBtn: false, - multiBtnList: [ - { content: '次要按钮', theme: 'light' }, - { content: '次要按钮', theme: 'light' }, - { content: '主要按钮', theme: 'primary' }, - ], + showLightConfirm: false, }, methods: { showDialog(e) { diff --git a/src/dialog/_example/confirm/index.wxml b/src/dialog/_example/confirm/index.wxml index 80fb1db96..d451b8bf5 100644 --- a/src/dialog/_example/confirm/index.wxml +++ b/src/dialog/_example/confirm/index.wxml @@ -38,3 +38,23 @@ bind:confirm="closeDialog" bind:cancel="closeDialog" /> + + + 确认类-纯标题 + + diff --git a/src/dialog/_example/dialog.wxml b/src/dialog/_example/dialog.wxml index f772fa5ad..a665f76e7 100644 --- a/src/dialog/_example/dialog.wxml +++ b/src/dialog/_example/dialog.wxml @@ -21,7 +21,7 @@ - + diff --git a/src/dialog/_example/status/index.wxml b/src/dialog/_example/status/index.wxml index 20b586145..09fc9ab73 100644 --- a/src/dialog/_example/status/index.wxml +++ b/src/dialog/_example/status/index.wxml @@ -85,7 +85,7 @@ bind:action="closeDialog" /> -带关闭按钮 +带关闭按钮的对话框 - 带关闭按钮 + 带关闭按钮的对话框 - 图片置顶 + 图片置顶-带标题描述 + + 图片置顶-无标题 + + + + + + + 图片置顶-纯标题 + + + + + + + 图片置顶-纯图片 + + + + + - 图片居中 + 图片居中-带标题描述 + + + 图片居中-纯标题 + + + + From a83d3cd1e01b6627a70a15b75670c6abb91a216b Mon Sep 17 00:00:00 2001 From: anlyyao Date: Tue, 21 Jan 2025 20:35:44 +0800 Subject: [PATCH 3/3] test: update snapshots --- .../__test__/__snapshots__/demo.test.js.snap | 201 +++++++++++++++++- 1 file changed, 192 insertions(+), 9 deletions(-) diff --git a/src/dialog/__test__/__snapshots__/demo.test.js.snap b/src/dialog/__test__/__snapshots__/demo.test.js.snap index b86ffb3bc..512ebbcff 100644 --- a/src/dialog/__test__/__snapshots__/demo.test.js.snap +++ b/src/dialog/__test__/__snapshots__/demo.test.js.snap @@ -12,7 +12,7 @@ exports[`Dialog Dialog base demo works fine 1`] = ` bind:tap="showDialog" > - 反馈类-基础 + 反馈类-带标题 + + + 反馈类-纯标题 + + + @@ -190,6 +218,33 @@ exports[`Dialog Dialog confirm demo works fine 1`] = ` bind:cancel="closeDialog" bind:confirm="closeDialog" /> + + + 确认类-纯标题 + + + `; @@ -330,7 +385,7 @@ exports[`Dialog Dialog status demo works fine 1`] = ` - 带关闭按钮 + 带关闭按钮的对话框 - 带关闭按钮 + 带关闭按钮的对话框 - 图片置顶 + 图片置顶-带标题描述 + + + + + 图片置顶-无标题 + + + + + + + + 图片置顶-纯标题 + + + + + + + + 图片置顶-纯图片 + + + @@ -408,7 +559,7 @@ exports[`Dialog Dialog with-image demo works fine 1`] = ` bind:tap="showDialog" > - 图片居中 + 图片居中-带标题描述 + + + + + 图片居中-纯标题 + + +