Skip to content

Commit

Permalink
fix: resolved series of problems in skyline (#2791)
Browse files Browse the repository at this point in the history
* fix: resolved series of problems in skyline

* fix: resolved series of problems in skyline

---------

Co-authored-by: jarmywang <[email protected]>
  • Loading branch information
anlyyao and jarmywang authored May 23, 2024
1 parent 90e6e97 commit e9f5a18
Show file tree
Hide file tree
Showing 31 changed files with 74 additions and 282 deletions.
2 changes: 1 addition & 1 deletion src/button/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
font-family: PingFang SC, Microsoft YaHei, Arial Regular;
font-weight: @button-font-weight;
vertical-align: top;
box-sizing: border-box;

.cursor-pointer();

Expand Down Expand Up @@ -572,7 +573,6 @@

&--block {
display: flex;
box-sizing: border-box;
width: 100%;
}

Expand Down
8 changes: 5 additions & 3 deletions src/checkbox/checkbox.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@
class="{{_.cls(classPrefix + '__title', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-label"
style="-webkit-line-clamp:{{maxLabelRow}}"
>
{{label}}
<block wx:if="{{label}}">{{label}}</block>
<slot />
<slot name="label" />
</view>
<view
class="{{_.cls(classPrefix + '__description', [['disabled', _disabled]])}} {{prefix}}-class-content "
style="-webkit-line-clamp:{{maxContentRow}}"
>{{content}}<slot name="content"
/></view>
>
<block wx:if="{{content}}">{{content}}</block>
<slot name="content" />
</view>
</view>
<view
wx:if="{{theme == 'default' && !borderless}}"
Expand Down
72 changes: 18 additions & 54 deletions src/dropdown-menu/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项一
选项一
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -216,16 +212,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项二
选项二
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -282,16 +274,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-radio__title--checked t-class-label"
style="-webkit-line-clamp:3"
>
选项三
选项三
</wx-view>
<wx-view
class="t-radio__description t-radio__description--checked t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -335,16 +323,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项四
选项四
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -388,16 +372,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项五
选项五
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -441,16 +421,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项六
选项六
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -494,16 +470,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项七
选项七
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -547,16 +519,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-class-label"
style="-webkit-line-clamp:3"
>
选项八
选项八
</wx-view>
<wx-view
class="t-radio__description t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down Expand Up @@ -600,16 +568,12 @@ exports[`dropdown-menu :base 1`] = `
class="t-radio__title t-radio__title--disabled t-class-label"
style="-webkit-line-clamp:3"
>
禁用选项
禁用选项
</wx-view>
<wx-view
class="t-radio__description t-radio__description--disabled t-class-content "
style="-webkit-line-clamp:5"
>
</wx-view>
/>
</wx-view>
<wx-view
class="t-radio__border t-radio__border--left t-class-border"
Expand Down
1 change: 1 addition & 0 deletions src/navbar/navbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
background: @navbar-bg-color;
display: flex;
align-items: center;
box-sizing: content-box;
}

&__left {
Expand Down
8 changes: 5 additions & 3 deletions src/radio/radio.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@
class="{{_.cls(classPrefix + '__title', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-label"
style="-webkit-line-clamp:{{maxLabelRow}}"
>
{{label}}
<block wx:if="{{label}}">{{label}}</block>
<slot />
<slot name="label" />
</view>

<view
class="{{_.cls(classPrefix + '__description', [['disabled', _disabled], ['checked', checked]])}} {{prefix}}-class-content "
style="-webkit-line-clamp:{{maxContentRow}}"
>{{content}}<slot name="content"
/></view>
>
<block wx:if="{{content}}">{{content}}</block>
<slot name="content" />
</view>
</view>

<view wx:if="{{!borderless}}" class="{{_.cls(classPrefix + '__border', [_placement])}} {{prefix}}-class-border" />
Expand Down
10 changes: 0 additions & 10 deletions src/textarea/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ exports[`Textarea Textarea autosize demo works fine 1`] = `
disableDefaultPadding="{{true}}"
label="标签文字"
placeholder="请输入文字"
tClassLabel=""
bind:line-change="onLineChange"
/>
</autosize>
Expand Down Expand Up @@ -41,8 +40,6 @@ exports[`Textarea Textarea card demo works fine 1`] = `
placeholder="请输入文字"
style="border-radius: 18rpx;"
tClass="external-class"
tClassIndicator=""
tClassLabel=""
/>
</wx-view>
</card>
Expand All @@ -66,7 +63,6 @@ exports[`Textarea Textarea custom demo works fine 1`] = `
placeholder="请输入文字"
style="height: 248rpx"
tClass="external-class"
tClassIndicator=""
/>
</wx-view>
</custom>
Expand All @@ -80,7 +76,6 @@ exports[`Textarea Textarea disabled demo works fine 1`] = `
label="标签文字"
placeholder="请输入文字"
tClass="external-class"
tClassLabel=""
value="不可编辑文字"
/>
</disabled>
Expand All @@ -93,7 +88,6 @@ exports[`Textarea Textarea label demo works fine 1`] = `
label="标签文字"
placeholder="请输入文字"
tClass="external-class"
tClassLabel=""
/>
</wx-label>
`;
Expand All @@ -107,8 +101,6 @@ exports[`Textarea Textarea maxcharacter demo works fine 1`] = `
maxcharacter="200"
placeholder="设置最大字符个数,一个汉字表示两个字符"
tClass="external-class"
tClassIndicator=""
tClassLabel=""
/>
</maxcharacter>
`;
Expand All @@ -122,8 +114,6 @@ exports[`Textarea Textarea maxlength demo works fine 1`] = `
maxlength="200"
placeholder="设置最大字符个数"
tClass="external-class"
tClassIndicator=""
tClassLabel=""
/>
</maxlength>
`;
3 changes: 0 additions & 3 deletions src/textarea/_example/autosize/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import SkylineBehavior from '@behaviors/skyline.js';

Component({
behaviors: [SkylineBehavior],
data: {
autosize: {
maxHeight: 120,
Expand Down
1 change: 0 additions & 1 deletion src/textarea/_example/autosize/index.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<t-textarea
label="标签文字"
t-class-label="{{skylineRender?'skyline-label':''}}"
placeholder="请输入文字"
disableDefaultPadding="{{true}}"
autosize="{{autosize}}"
Expand Down
10 changes: 0 additions & 10 deletions src/textarea/_example/autosize/index.wxss
Original file line number Diff line number Diff line change
@@ -1,10 +0,0 @@
.skyline-label {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.9);
flex-shrink: 0;
line-height: 44rpx;
padding-bottom: 16rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
3 changes: 0 additions & 3 deletions src/textarea/_example/card/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import SkylineBehavior from '@behaviors/skyline.js';

Component({
behaviors: [SkylineBehavior],
data: {
style: 'border-radius: 18rpx;',
},
Expand Down
2 changes: 0 additions & 2 deletions src/textarea/_example/card/index.wxml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<view class="textarea-example">
<t-textarea
t-class="external-class"
t-class-label="{{skylineRender?'skyline-label':''}}"
t-class-indicator="{{skylineRender?'skyline-indicator':''}}"
label="标签文字"
placeholder="请输入文字"
maxlength="500"
Expand Down
20 changes: 0 additions & 20 deletions src/textarea/_example/card/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,3 @@
.external-class {
height: 312rpx;
}

.skyline-label {
font-size: 28rpx;
color: rgba(0, 0, 0, 0.9);
flex-shrink: 0;
line-height: 44rpx;
padding-bottom: 16rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.skyline-indicator {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
text-align: right;
/*line-height: 40rpx;*/
padding-top: 16rpx;
min-height: 56rpx;
}
3 changes: 0 additions & 3 deletions src/textarea/_example/custom/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import SkylineBehavior from '@behaviors/skyline.js';

Component({
behaviors: [SkylineBehavior],
data: {
style: 'height: 248rpx',
},
Expand Down
1 change: 0 additions & 1 deletion src/textarea/_example/custom/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<text class="textarea-example__label">标签文字</text>
<t-textarea
t-class="external-class"
t-class-indicator="{{skylineRender?'skyline-indicator':''}}"
placeholder="请输入文字"
bordered
maxlength="100"
Expand Down
9 changes: 0 additions & 9 deletions src/textarea/_example/custom/index.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,3 @@
line-height: 40rpx;
padding-bottom: 16rpx;
}

.skyline-indicator {
color: rgba(0, 0, 0, 0.4);
font-size: 24rpx;
text-align: right;
/*line-height: 40rpx;*/
padding-top: 16rpx;
min-height: 56rpx;
}
4 changes: 1 addition & 3 deletions src/textarea/_example/disabled/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
import SkylineBehavior from '@behaviors/skyline.js';

Component({ behaviors: [SkylineBehavior] });
Component({});
Loading

0 comments on commit e9f5a18

Please sign in to comment.