Skip to content

Commit

Permalink
chore: 格式化 src 的 axml
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondYuan committed Sep 25, 2023
1 parent 4150924 commit 2aaecc1
Show file tree
Hide file tree
Showing 67 changed files with 1,673 additions and 1,053 deletions.
69 changes: 41 additions & 28 deletions src/ActionSheet/index.axml
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
<import-sjs from="./index.sjs" name="helper" />
<import-sjs
from="./index.sjs"
name="helper" />
<popup
className="ant-actionsheet-popup"
visible="{{visible}}"
maskClosable="{{true}}"
position="bottom"
onClose="onClose"
>
<view style="{{style}}" class="ant-actionsheet {{className ? className : ''}} {{helper.isIconMode(actions) ? 'ant-actionsheet-icon' : ''}}">
<slot name="title">
<view class="ant-actionsheet-title-wrap" a:if="{{title}}">
<view class="ant-actionsheet-title-content">{{title}}</view>
</view>
</slot>
<view class="ant-actionsheet-list">
onClose="onClose">
<view
style="{{style}}"
class="ant-actionsheet {{className ? className : ''}} {{helper.isIconMode(actions) ? 'ant-actionsheet-icon' : ''}}">
<slot name="title">
<view
class="ant-actionsheet-title-wrap"
a:if="{{title}}">
<view class="ant-actionsheet-title-content">{{title}}</view>
</view>
</slot>
<view class="ant-actionsheet-list">
<view
a:for="{{actions}}"
class="ant-actionsheet-list-item {{ item.disabled ? 'ant-actionsheet-list-item-disabled' : ''}}"
hover-class="{{ item.disabled ? '': 'ant-actionsheet-list-item-active' }} "
onTap="onAction"
data-index="{{index}}"
data-item="{{item}}">
<view
a:for="{{actions}}"
class="ant-actionsheet-list-item {{ item.disabled ? 'ant-actionsheet-list-item-disabled' : ''}}"
hover-class="{{ item.disabled ? '': 'ant-actionsheet-list-item-active' }} "
onTap="onAction"
data-index="{{index}}"
data-item="{{item}}"
>
class="ant-actionsheet-list-item-icon"
a:if="{{helper.isIconMode(actions)}}"
style="background-image: url('{{item.icon}}')"></view>
<view class="ant-actionsheet-list-item-content">
<view
class="ant-actionsheet-list-item-icon"
a:if="{{helper.isIconMode(actions)}}"
style="background-image: url('{{item.icon}}')"
>
class="ant-actionsheet-list-item-title {{ item.danger ? 'ant-actionsheet-list-item-title-danger' : ''}}">
{{item.text}}
</view>
<view class='ant-actionsheet-list-item-content'>
<view class="ant-actionsheet-list-item-title {{ item.danger ? 'ant-actionsheet-list-item-title-danger' : ''}}">{{item.text}}</view>
<view a:if="{{item.description}}" class='ant-actionsheet-list-item-description'>{{item.description}}</view>
<view
a:if="{{item.description}}"
class="ant-actionsheet-list-item-description">
{{item.description}}
</view>
</view>
</view>
<view class="ant-actionsheet-cancel-gap"/>
<slot name="cancelText">
<view class="ant-actionsheet-cancel" onTap="onClose">{{cancelText}}</view>
</slot>
</view>
<view class="ant-actionsheet-cancel-gap" />
<slot name="cancelText">
<view
class="ant-actionsheet-cancel"
onTap="onClose">
{{cancelText}}
</view>
</slot>
</view>
</popup>
11 changes: 7 additions & 4 deletions src/Avatar/index.axml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<import-sjs from="./index.sjs" name="utils" />
<import-sjs
from="./index.sjs"
name="utils" />

<view class="ant-avatar {{className ? className : ''}}" style="{{style}}">
<view
class="ant-avatar {{className ? className : ''}}"
style="{{style}}">
<image
class="ant-avatar-image {{utils.getClass(size)}}"
src="{{src}}"
a:if="{{src}}"
/>
a:if="{{src}}" />
</view>
31 changes: 17 additions & 14 deletions src/Badge/index.axml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<import-sjs from="./index.sjs" name="_sjs" />
<import-sjs
from="./index.sjs"
name="_sjs" />

<view class="ant-badge
{{className ? className : ''}}" style="{{style}}">
<view
class="ant-badge
{{className ? className : ''}}"
style="{{style}}">
<view class="ant-badge-body">
<slot></slot>
</view>
<view
a:if="{{type=== 'dot'}}"
class="ant-badge-content"
style="{{_sjs.setPositionStyle(position, offsetX, offsetY)}}">
<view
class="ant-badge-dot {{stroke ? 'ant-badge-dot-stroke' : ''}}"
style="{{bgColor ? `background-color: ${bgColor};`: ''}}">
</view>
a:if="{{type=== 'dot'}}"
class="ant-badge-content"
style="{{_sjs.setPositionStyle(position, offsetX, offsetY)}}">
<view
class="ant-badge-dot {{stroke ? 'ant-badge-dot-stroke' : ''}}"
style="{{bgColor ? `background-color: ${bgColor};`: ''}}"></view>
</view>
<view
a:else
Expand All @@ -21,8 +24,7 @@
{{type==='bubble' ? `ant-badge-content-${position}-bubble` : ''}}
{{stroke ? 'ant-badge-content-stroke' : ''}}"
style="{{bgColor ? `background-color: ${bgColor};`: ''}} {{_sjs.setBubbleStyle(type, position)}};{{_sjs.setPositionStyle(position, offsetX, offsetY)}}">
<view class="ant-badge-icon-container">
</view>
<view class="ant-badge-icon-container"></view>

<view class="ant-badge-content-text">
<slot name="text">
Expand All @@ -36,8 +38,9 @@
class="ant-badge-text">
{{text}}
</view>
<view a:if="{{type==='bubble'}}"
class="ant-badge-bubble">
<view
a:if="{{type==='bubble'}}"
class="ant-badge-bubble">
{{text}}
</view>
</slot>
Expand Down
38 changes: 24 additions & 14 deletions src/Checkbox/CheckboxGroup/index.axml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<import-sjs from="../index.sjs" name="componentUtils" />
<import-sjs
from="../index.sjs"
name="componentUtils" />

<list
className="ant-checkbox-group {{className ? className : ''}} ant-checkbox-group-{{position}}" style="{{style}}">
<list
className="ant-checkbox-group {{className ? className : ''}} ant-checkbox-group-{{position}}"
style="{{style}}">
<checkbox-group
name="{{name}}"
value="{{ mixin.value }}"
>
value="{{ mixin.value }}">
<view class="ant-checkbox-group-body">
<block a:if="{{position === 'vertical'}}">
<list-item a:for="{{options}}">
Expand All @@ -15,11 +17,15 @@
data-index="{{index}}"
value="{{item.value}}"
disabled="{{disabled || item.disabled}}"
onChange="onChange"
>
<slot name="label" value="{{item}}" index="{{index}}">
<view class="ant-checkbox-group-item-label-default">{{item.label}}</view>
</slot>
onChange="onChange">
<slot
name="label"
value="{{item}}"
index="{{index}}">
<view class="ant-checkbox-group-item-label-default">
{{item.label}}
</view>
</slot>
</checkbox>
</list-item>
</block>
Expand All @@ -31,10 +37,14 @@
data-index="{{index}}"
value="{{item.value}}"
disabled="{{disabled || item.disabled}}"
onChange="onChange"
>
<slot name="label" value="{{item}}" index="{{index}}">
<view class="ant-checkbox-group-item-label-default">{{item.label}}</view>
onChange="onChange">
<slot
name="label"
value="{{item}}"
index="{{index}}">
<view class="ant-checkbox-group-item-label-default">
{{item.label}}
</view>
</slot>
</checkbox>
</block>
Expand Down
25 changes: 17 additions & 8 deletions src/Checkbox/index.axml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
<import-sjs from="./index.sjs" name="componentUtils" />
<label class="ant-checkbox-item {{className || ''}}" style="{{style || ''}}">
<import-sjs
from="./index.sjs"
name="componentUtils" />
<label
class="ant-checkbox-item {{className || ''}}"
style="{{style || ''}}">
<view class="ant-checkbox-item-container">
<view class="ant-checkbox-item-wrap">
<checkbox
<checkbox
class="ant-checkbox-item-base"
value="{{value}}"
onChange="onChange"
checked="{{mixin.value}}"
disabled="{{disabled}}"
/>
disabled="{{disabled}}" />
<view class="ant-checkbox-item-fake">
<view class="ant-checkbox-item-fake-{{componentUtils.getClassName(mixin.value, disabled)}}" style="{{mixin.value && !disabled && color ? 'background:' + color : ''}}">
<icon a:if="{{mixin.value}}" type="CheckOutline" class="ant-checkbox-item-fake-{{componentUtils.getClassName(mixin.value, disabled)}}-icon" />
<view
class="ant-checkbox-item-fake-{{componentUtils.getClassName(mixin.value, disabled)}}"
style="{{mixin.value && !disabled && color ? 'background:' + color : ''}}">
<icon
a:if="{{mixin.value}}"
type="CheckOutline"
class="ant-checkbox-item-fake-{{componentUtils.getClassName(mixin.value, disabled)}}-icon" />
</view>
</view>
</view>
<view class="ant-checkbox-item-content {{disabled ? 'ant-checkbox-item-disabled' : ''}}">
<view
class="ant-checkbox-item-content {{disabled ? 'ant-checkbox-item-disabled' : ''}}">
<slot />
</view>
</view>
Expand Down
20 changes: 10 additions & 10 deletions src/Checklist/ChecklistItem/index.axml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<view
<view
class="ant-checklist-item"
onTap="{{item.disabled || item.readonly ? '': 'onChecklistItemClick'}}"
hover-class="{{item.disabled || item.readonly ? '' : 'ant-checklist-item-hover'}}"
hover-start-time="{{20}}"
hover-stay-time="{{40}}"
>
<view class="ant-checklist-item-content {{item.disabled ? 'ant-checklist-item-content-disabled': ''}}">
hover-stay-time="{{40}}">
<view
class="ant-checklist-item-content {{item.disabled ? 'ant-checklist-item-content-disabled': ''}}">
<view class="ant-checklist-item-content-box">
<slot name="content" item="{{item}}"/>
<slot
name="content"
item="{{item}}" />
</view>
<view
a:if="{{checked}}"
class="ant-checklist-item-content-icon "
>
class="ant-checklist-item-content-icon">
<slot name="icon" />
</view>
</view>
<view class="ant-checklist-item-line">
</view>
</view>
<view class="ant-checklist-item-line"></view>
</view>
40 changes: 28 additions & 12 deletions src/Checklist/index.axml
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@
<import-sjs from="./index.sjs" name="{getChecked}" />
<view class="ant-checklist {{className ? className : ''}}" style="{{style || ''}}">
<import-sjs
from="./index.sjs"
name="{getChecked}" />
<view
class="ant-checklist {{className ? className : ''}}"
style="{{style || ''}}">
<view class="ant-checklist-body">
<checklist-item
a:for="{{options}}"
checked="{{getChecked(item.value,mixin.value,multiple)}}"
item="{{item}}"
onChange="onChange"
>
<view slot="content" class="ant-checklist-item-content-box-nut">
<slot name="content" item="{{item}}">
<image a:if="{{item.image}}" class="ant-checklist-item-image" src="{{item.image}}" />
<view class="ant-checklist-item-text {{item.image ? '': 'ant-checklist-item-text-no-image'}}">
<view class="ant-checklist-item-text-title {{item.disabled ? 'ant-checklist-item-text-disabled' : ''}}">
onChange="onChange">
<view
slot="content"
class="ant-checklist-item-content-box-nut">
<slot
name="content"
item="{{item}}">
<image
a:if="{{item.image}}"
class="ant-checklist-item-image"
src="{{item.image}}" />
<view
class="ant-checklist-item-text {{item.image ? '': 'ant-checklist-item-text-no-image'}}">
<view
class="ant-checklist-item-text-title {{item.disabled ? 'ant-checklist-item-text-disabled' : ''}}">
{{item.title}}
</view>
<view a:if="{{item.description}}" class="ant-checklist-item-text-description {{item.disabled ? 'ant-checklist-item-text-disabled' : ''}}">
<view
a:if="{{item.description}}"
class="ant-checklist-item-text-description {{item.disabled ? 'ant-checklist-item-text-disabled' : ''}}">
{{item.description}}
</view>
</view>
</slot>
</view>
<view slot="icon">
<slot name="icon">
<icon type="CheckOutline" class="ant-checklist-item-check-icon" />
<icon
type="CheckOutline"
class="ant-checklist-item-check-icon" />
</slot>
</view>
</checklist-item>
</view>
</view>
</view>
Loading

0 comments on commit 2aaecc1

Please sign in to comment.