-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DiamondYuan
committed
Jan 10, 2024
1 parent
2568fa6
commit 409c084
Showing
22 changed files
with
208 additions
and
99 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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
function getClass(size) { | ||
const list = ['x-small', 'small', 'medium', 'large']; | ||
if (list.indexOf(size) >=0) { | ||
return `ant-skeleton-avatar-${size}`; | ||
var list = ['x-small', 'small', 'medium', 'large']; | ||
if (list.indexOf(size) >= 0) { | ||
return "ant-skeleton-avatar-".concat(size); | ||
} | ||
return 'ant-skeleton-avatar-medium'; | ||
} | ||
|
||
export default { getClass }; | ||
export default { | ||
getClass: getClass | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
function getClass(size) { | ||
const list = ['small', 'medium', 'large']; | ||
if (list.indexOf(size) >=0) { | ||
return `ant-skeleton-button-${size}`; | ||
var list = ['small', 'medium', 'large']; | ||
if (list.indexOf(size) >= 0) { | ||
return "ant-skeleton-button-".concat(size); | ||
} | ||
return 'ant-skeleton-button-medium'; | ||
} | ||
|
||
export default { getClass }; | ||
export default { | ||
getClass: getClass | ||
}; |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<view | ||
a:if="{{loading}}" | ||
class="ant-skeleton-input {{animate?'ant-skeleton-input-animate':''}} {{className||''}}" | ||
style="{{style}}"></view> | ||
a:if="{{ loading }}" | ||
class="ant-skeleton-input {{ animate ? 'ant-skeleton-input-animate' : '' }} {{ className || '' }}" | ||
style="{{ style }}" /> | ||
<slot a:else /> |
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
<view | ||
a:if="{{loading && rows > 0}}" | ||
class="ant-skeleton-paragraph {{animate?'ant-skeleton-paragraph-animate':''}} {{className||''}}" | ||
style="{{style}}"> | ||
<view | ||
class="ant-skeleton-paragraph-row" | ||
a:for="{{rows}}"></view> | ||
a:if="{{ loading && rows > 0 }}" | ||
class="ant-skeleton-paragraph {{ animate ? 'ant-skeleton-paragraph-animate' : '' }} {{ className || '' }}" | ||
style="{{ style }}"> | ||
<block | ||
a:for="{{ Array.from({ | ||
length: rows, | ||
}) }}" | ||
a:for-index="index" | ||
a:for-item="_" | ||
a:key="{{ index }}"> | ||
<view class="ant-skeleton-paragraph-row" /> | ||
</block> | ||
</view> | ||
<slot a:else /> |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<view | ||
a:if="{{loading}}" | ||
class="ant-skeleton-title {{animate?'ant-skeleton-title-animate':''}} {{className||''}}" | ||
style="{{style}}"></view> | ||
a:if="{{ loading }}" | ||
class="ant-skeleton-title {{ animate ? 'ant-skeleton-title-animate' : '' }} {{ className || '' }}" | ||
style="{{ style }}" /> | ||
<slot a:else /> |
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 was deleted.
Oops, something went wrong.
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,25 @@ | ||
import { View, Slot, TSXMLProps } from 'tsxml'; | ||
import { SkeletonAvatarProps } from './props'; | ||
import utils from './index.sjs'; | ||
|
||
export default ({ | ||
loading, | ||
style, | ||
shape, | ||
size, | ||
animate, | ||
className, | ||
}: TSXMLProps<SkeletonAvatarProps>) => ( | ||
<Component> | ||
{loading ? ( | ||
<View | ||
style={style} | ||
class={`ant-skeleton-avatar ant-skeleton-avatar-${shape} ${ | ||
animate ? 'ant-skeleton-avatar-animate' : '' | ||
} ${utils.getClass(size)} ${className || ''}`} | ||
/> | ||
) : ( | ||
<Slot /> | ||
)} | ||
</Component> | ||
); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
import { View, Slot, TSXMLProps } from 'tsxml'; | ||
import utils from './index.sjs'; | ||
import { SkeletonButtonProps } from './props'; | ||
|
||
export default ({ | ||
loading, | ||
animate, | ||
size, | ||
className, | ||
style, | ||
}: TSXMLProps<SkeletonButtonProps>) => ( | ||
<Component> | ||
{loading ? ( | ||
<View | ||
class={`ant-skeleton-button ${ | ||
animate ? 'ant-skeleton-button-animate' : '' | ||
} ${utils.getClass(size)} ${className || ''}`} | ||
style={style} | ||
/> | ||
) : ( | ||
<Slot /> | ||
)} | ||
</Component> | ||
); |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import { View, TSXMLProps, Slot } from 'tsxml'; | ||
import { SkeletonInputProps } from './props'; | ||
|
||
export default ({ | ||
loading, | ||
animate, | ||
className, | ||
style, | ||
}: TSXMLProps<SkeletonInputProps>) => ( | ||
<Component> | ||
{loading ? ( | ||
<View | ||
class={`ant-skeleton-input ${ | ||
animate ? 'ant-skeleton-input-animate' : '' | ||
} ${className || ''}`} | ||
style={style} | ||
></View> | ||
) : ( | ||
<Slot /> | ||
)} | ||
</Component> | ||
); |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
import { View, Slot, TSXMLProps } from 'tsxml'; | ||
import { SkeletonParagraphProps } from './props'; | ||
|
||
export default ({ | ||
loading, | ||
rows, | ||
animate, | ||
className, | ||
style, | ||
}: TSXMLProps<SkeletonParagraphProps>) => ( | ||
<Component> | ||
{loading && rows > 0 ? ( | ||
<View | ||
class={`ant-skeleton-paragraph ${ | ||
animate ? 'ant-skeleton-paragraph-animate' : '' | ||
} ${className || ''}`} | ||
style={style} | ||
> | ||
{Array.from({ length: rows }).map((_, index) => ( | ||
<View key={index} class="ant-skeleton-paragraph-row"></View> | ||
))} | ||
</View> | ||
) : ( | ||
<Slot></Slot> | ||
)} | ||
</Component> | ||
); |
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import { View, Slot, TSXMLProps, Component } from 'tsxml'; | ||
import { SkeletonTitleProps, SkeletonTitleDefaultProps } from './props'; | ||
|
||
export default ({ | ||
loading, | ||
animate, | ||
className, | ||
style, | ||
}: TSXMLProps<SkeletonTitleProps> = SkeletonTitleDefaultProps) => ( | ||
<Component> | ||
{loading ? ( | ||
<View | ||
class={`ant-skeleton-title ${ | ||
animate ? 'ant-skeleton-title-animate' : '' | ||
} ${className || ''}`} | ||
style={style} | ||
></View> | ||
) : ( | ||
<Slot /> | ||
)} | ||
</Component> | ||
); |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
import { Component, Slot, View } from 'tsxml'; | ||
import { ISkeletonProps } from './props'; | ||
import Avatar from './Avatar/index.axml'; | ||
import Paragraph from './Paragraph/index.axml'; | ||
import Title from './Title/index.axml'; | ||
|
||
export default ({ | ||
loading, | ||
className, | ||
animate, | ||
avatar, | ||
title, | ||
paragraph, | ||
}: ISkeletonProps) => ( | ||
<Component> | ||
{loading ? ( | ||
<View class={`ant-skeleton ${className || ''}`}> | ||
{avatar && ( | ||
<View class="ant-skeleton-avatar-wrapper"> | ||
<Avatar | ||
animate={animate} | ||
loading | ||
size={typeof avatar === 'boolean' ? undefined : avatar.size} | ||
/> | ||
</View> | ||
)} | ||
<View class="ant-skeleton-content-wrapper"> | ||
{title && <Title animate={animate} loading />} | ||
{paragraph && ( | ||
<Paragraph | ||
animate={animate} | ||
rows={typeof paragraph === 'boolean' ? undefined : paragraph.rows} | ||
loading | ||
/> | ||
)} | ||
</View> | ||
</View> | ||
) : ( | ||
<Slot /> | ||
)} | ||
</Component> | ||
); |