-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #827 from GaviXi/master
back-top 1.0.3 and improve back-top in site
- Loading branch information
Showing
10 changed files
with
403 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { OmiProps, WeElement, h, tag, classNames, render, createRef } from 'omi' | ||
|
||
import '../index' | ||
|
||
import '../../space' | ||
|
||
@tag('back-top-custom') | ||
export default class backTopCustom extends WeElement { | ||
height = 300 | ||
|
||
// scrollCss = | ||
// `.t-list{ | ||
// height: ` + | ||
// this.height + | ||
// `px !important; | ||
// overflow: auto, | ||
// }` | ||
|
||
// sizeStyle = { | ||
// position: 'relative', | ||
// insetInlineEnd: 0, | ||
// insetBlockEnd: 0, | ||
// } | ||
|
||
withStyle = ` | ||
.t-back-top{ | ||
position: relative !important; | ||
right: 0 !important; | ||
bottom: 0 !important; | ||
} | ||
` | ||
render() { | ||
return ( | ||
<h.f> | ||
<div style="position: relative; "> | ||
<t-space direction="vertical"> | ||
<t-space> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
default={<span>TOP</span>} | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
content={<span>UP</span>} | ||
container={() => document} | ||
/> | ||
</t-space> | ||
</t-space> | ||
</div> | ||
</h.f> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { OmiProps, WeElement, h, tag, classNames, render, createRef } from 'omi' | ||
|
||
import '../index' | ||
|
||
import '../../space' | ||
|
||
@tag('back-top-shape') | ||
export default class backTopShape extends WeElement { | ||
height = 300 | ||
|
||
// scrollCss = | ||
// `.t-list{ | ||
// height: ` + | ||
// this.height + | ||
// `px !important; | ||
// overflow: auto, | ||
// }` | ||
|
||
// sizeStyle = { | ||
// position: 'relative', | ||
// insetInlineEnd: 0, | ||
// insetBlockEnd: 0, | ||
// } | ||
|
||
withStyle = ` | ||
.t-back-top{ | ||
position: relative !important; | ||
right: 0 !important; | ||
bottom: 0 !important; | ||
} | ||
` | ||
render() { | ||
return ( | ||
<h.f> | ||
<div style="position: relative;"> | ||
<t-space direction="vertical"> | ||
<t-space size={24}> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
shape="circle" | ||
size="medium" | ||
// offset={['400px', '316px']} | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
// offset={['300px', '300px']} | ||
container={() => document} | ||
/> | ||
</t-space> | ||
<t-space size={24}> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
shape="circle" | ||
theme="primary" | ||
// offset={['400px', '316px']} | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
theme="primary" | ||
// offset={['300px', '300px']} | ||
container={() => document} | ||
/> | ||
</t-space> | ||
<t-space size={24}> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
shape="circle" | ||
theme="dark" | ||
// offset={['400px', '316px']} | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
theme="dark" | ||
// offset={['300px', '300px']} | ||
container={() => document} | ||
/> | ||
</t-space> | ||
</t-space> | ||
</div> | ||
</h.f> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
tdesign/desktop/src/back-top/_example/back-top-theme.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
import { OmiProps, WeElement, h, tag, classNames, render, createRef } from 'omi' | ||
|
||
import '../index' | ||
|
||
import '../../space' | ||
|
||
@tag('back-top-theme') | ||
export default class backTopTheme extends WeElement { | ||
height = 300 | ||
|
||
// scrollCss = | ||
// `.t-list{ | ||
// height: ` + | ||
// this.height + | ||
// `px !important; | ||
// overflow: auto, | ||
// }` | ||
|
||
// sizeStyle = { | ||
// position: 'relative', | ||
// insetInlineEnd: 0, | ||
// insetBlockEnd: 0, | ||
// } | ||
|
||
withStyle = ` | ||
.t-back-top{ | ||
position: relative !important; | ||
right: 0 !important; | ||
bottom: 0 !important; | ||
} | ||
` | ||
render() { | ||
return ( | ||
<h.f> | ||
<div style="position: relative; "> | ||
<t-space direction="vertical"> | ||
<t-space> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
theme='primary' | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
theme='dark' | ||
container={() => document} | ||
/> | ||
</t-space> | ||
<t-space> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
shape="circle" | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
shape="circle" | ||
theme='primary' | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="medium" | ||
shape="circle" | ||
theme='dark' | ||
container={() => document} | ||
/> | ||
</t-space> | ||
<t-space> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="small" | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="small" | ||
theme="primary" | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="small" | ||
theme="dark" | ||
container={() => document} | ||
/> | ||
</t-space> | ||
<t-space> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="small" | ||
shape="circle" | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="small" | ||
theme="primary" | ||
shape="circle" | ||
container={() => document} | ||
/> | ||
<t-back-top | ||
css={this.withStyle} | ||
visibleHeight={0} | ||
size="small" | ||
theme="dark" | ||
shape="circle" | ||
container={() => document} | ||
/> | ||
</t-space> | ||
</t-space> | ||
</div> | ||
</h.f> | ||
) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.