Skip to content

Commit 9ba9384

Browse files
authored
feat(Table): support ellipsis and ellipsisTitle props (#4666)
* feat(Table): support ellipsis and ellipsisTitle props * chore(Table): change PopoverProps to PopupProps * feat(Table): support ellipsis and ellipsisTitle props for UniApp * fix(Table): fix popup content color error * fix: fix cr * fix: fix close-btn clor * fix: fix test
1 parent 92af3d4 commit 9ba9384

41 files changed

Lines changed: 1065 additions & 38 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/components/calendar/__test__/__snapshots__/index.test.js.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ exports[`calendar :base 1`] = `
816816
</wx-view>
817817
</wx-view>
818818
<wx-view
819-
class="t-popup__close"
819+
class="t-popup__close t-class-close"
820820
bind:tap="handleClose"
821821
/>
822822
</wx-view>

‎packages/components/date-time-picker/__test__/__snapshots__/index.test.js.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ exports[`date-time-picker :base 1`] = `
521521
</wx-view>
522522
</wx-view>
523523
<wx-view
524-
class="t-popup__close"
524+
class="t-popup__close t-class-close"
525525
bind:tap="handleClose"
526526
/>
527527
</wx-view>

‎packages/components/dialog/__test__/__snapshots__/index.test.js.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ exports[`dialog :base 1`] = `
4848
/>
4949
</wx-view>
5050
<wx-view
51-
class="t-popup__close"
51+
class="t-popup__close t-class-close"
5252
bind:tap="handleClose"
5353
/>
5454
</wx-view>

‎packages/components/dropdown-menu/__test__/__snapshots__/index.test.js.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ exports[`dropdown-menu :base 1`] = `
677677
class="t-dropdown-item__footer t-class-footer"
678678
/>
679679
<wx-view
680-
class="t-popup__close"
680+
class="t-popup__close t-class-close"
681681
bind:tap="handleClose"
682682
/>
683683
</wx-view>

‎packages/components/mixins/using-custom-navbar.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ const useCustomNavbarBehavior = Behavior({
1515
distanceTop: 0,
1616
},
1717

18-
lifetimes: {
19-
attached() {
20-
if (this.properties.usingCustomNavbar) {
18+
observers: {
19+
usingCustomNavbar(value) {
20+
if (value) {
2121
this.calculateCustomNavbarDistanceTop();
22+
} else {
23+
this.setData({ distanceTop: 0 });
2224
}
2325
},
2426
},

‎packages/components/picker/__test__/__snapshots__/index.test.js.snap‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ exports[`picker :base 1`] = `
200200
</wx-view>
201201
</wx-view>
202202
<wx-view
203-
class="t-popup__close"
203+
class="t-popup__close t-class-close"
204204
bind:tap="handleClose"
205205
/>
206206
</wx-view>

‎packages/components/popup/popup.less‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
padding: 20rpx;
3434
line-height: 1;
3535
color: @popup-close-btn-color;
36+
font-size: 48rpx;
3637
}
3738

3839
&--top {

‎packages/components/popup/popup.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const name = `${prefix}-popup`;
1414

1515
@wxComponent()
1616
export default class Popup extends SuperComponent {
17-
externalClasses = [`${prefix}-class`, `${prefix}-class-content`];
17+
externalClasses = [`${prefix}-class`, `${prefix}-class-content`, `${prefix}-class-close`];
1818

1919
behaviors = [transition(), useCustomNavbar];
2020

‎packages/components/popup/popup.wxml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
>
3030
<slot name="content" />
3131
<slot />
32-
<view class="{{classPrefix}}__close" bind:tap="handleClose">
33-
<t-icon name="close" wx:if="{{closeBtn}}" size="64rpx" />
32+
<view class="{{classPrefix}}__close {{prefix}}-class-close" bind:tap="handleClose">
33+
<t-icon name="close" wx:if="{{closeBtn}}" />
3434
<slot name="close-btn" class="{{classPrefix}}-slot" />
3535
</view>
3636
</view>

‎packages/components/table/README.en-US.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ align | String | left | align type。options: left/right/center | N
5959
cell | String / Function | - | use cell to render table cell。Typescript: `string \| ((params: BaseTableCellParams<T>) => string)` `interface BaseTableCellParams<T extends TableRowData = TableRowData> { row: T; rowIndex: number; col: BaseTableCol<T>; colIndex: number }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/table/type.ts) | N
6060
class-name | String / Object / Array / Function | - | cell classnames。Typescript: `TableColumnClassName<T> \| TableColumnClassName<T>[]` `type TableColumnClassName<T extends TableRowData = TableRowData> = ClassName \| ((context: CellData<T>) => ClassName)` `interface CellData<T extends TableRowData = TableRowData> extends BaseTableCellParams<T> { type: 'th' \| 'td' }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/table/type.ts) | N
6161
col-key | String | - | unique key for column | N
62+
ellipsis | Boolean / Object / Function | false | ellipsis cell content。Typescript: `boolean \| PopupProps \| { props: PopupProps; content: string }`,[Popup API Documents](./popup?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/table/type.ts) | N
63+
ellipsis-title | Boolean / Object / Function | undefinde | ellipsis title content。Typescript: `boolean \| PopupProps \| { props: PopupProps; content: string }` `interface BaseTableColParams<T> { col: BaseTableCol<T>; colIndex: number }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/table/type.ts) | N
6264
fixed | String | left | fixed current column to left or right。options: left/right | N
6365
min-width | String / Number | - | add CSS property `min-width` to HTML Element `<col>`,Browsers with [TablesNG](https://docs.google.com/document/d/16PFD1GtMI9Zgwu0jtPaKZJ75Q2wyZ9EZnVbBacOfiNA/preview) support `minWidth` | N
6466
width | String / Number | - | column width | N

0 commit comments

Comments
 (0)