This commit is contained in:
Ling53666
2025-08-18 09:11:51 +08:00
commit 02554225da
2516 changed files with 133155 additions and 0 deletions

View File

@ -0,0 +1 @@
.ant-steps{display:flex;overflow:hidden}.ant-steps-horizontal{flex-direction:row;justify-content:space-around}.ant-steps-vertical{display:block;padding:32px}.ant-steps-item:last-child .ant-steps-item-indicator-vertical::after{display:none}.ant-steps-item-vertical:last-child{padding-bottom:0}.ant-steps-item{position:relative;z-index:5;display:flex;margin:8px 0 8px 0}.ant-steps-item-vertical{padding-bottom:24px;margin:0}.ant-steps-item-vertical .ant-steps-item-title{margin-bottom:4px;font-size:13px;color:#333}.ant-steps-item-vertical .ant-steps-item-desc{font-size:12px;color:#999}.ant-steps-item-vertical::after{position:absolute;height:100%;width:1px;content:'';top:13.5px;z-index:-1;transform:translateX(-50%)}.ant-steps-item-vertical .ant-steps-item-text{display:flex;flex-direction:column;flex:1}.ant-steps-item-horizontal{flex-direction:column;margin-top:8px;padding:0 8px}.ant-steps-item-horizontal::after{position:absolute;width:100%;height:1px;content:'';top:17px;left:0;transform:translate(50%,-50%);z-index:-1}.ant-steps-item-horizontal .ant-steps-item-desc,.ant-steps-item-horizontal .ant-steps-item-title{text-align:center}.ant-steps-item-horizontal .ant-steps-item-desc{margin-bottom:0}.ant-steps-item:last-child::after{display:none}.ant-steps-item-indicator-vertical{transform:translateX(-50%)}.ant-steps-item-indicator-horizontal{display:flex;justify-content:center;margin:8px 0 8px 0}.ant-steps-item-indicator-icon{width:9px;height:9px;border-radius:50%}.ant-steps-item .ant-steps-item-active-icon-image{transform:translateX(0)}.ant-steps-item-horizontal{flex:1;display:flex}.ant-steps-item-horizontal .ant-steps-item-title{margin-bottom:2px;font-size:13px}.ant-steps-item-horizontal .ant-steps-item-title:empty{display:none}.ant-steps-item-horizontal .ant-steps-item-desc{margin:2px 0 2px 0;color:#999;font-size:12px}.ant-steps-item-horizontal .ant-steps-item-desc:empty{display:none}.ant-steps-item-active::after{background-color:#e5e5e5}.ant-steps-item-active-icon{display:flex;justify-content:center;align-items:center;background:0 0;color:#1677ff}.ant-steps-item-active-icon,.ant-steps-item-active-icon .a-image{height:18px;width:18px}.ant-steps-item-active-icon-default{height:10px;width:10px;border-radius:50%;background-color:#1677ff}.ant-steps-item-active .ant-steps-item-title{color:#1677ff}.ant-steps-item-non-active::after{background-color:#e5e5e5}.ant-steps-item-non-active-icon{display:flex;justify-content:center;align-items:center;background:0 0;color:#e5e5e5}.ant-steps-item-non-active-icon,.ant-steps-item-non-active-icon .a-image{height:18px;width:18px}.ant-steps-item-non-active-icon-default{height:8px;width:8px;border-radius:50%;background-color:#e5e5e5}.ant-steps-item-non-active .ant-steps-item-title{color:#999}.ant-steps-item-finish::after{background-color:#1677ff}.ant-steps-item-finish-icon{display:flex;justify-content:center;align-items:center;background:0 0;color:#1677ff}.ant-steps-item-finish-icon,.ant-steps-item-finish-icon .a-image{height:18px;width:18px}.ant-steps-item-finish-icon-default{height:8px;width:8px;border-radius:50%;background-color:#1677ff}.ant-steps-item-finish .ant-steps-item-title{color:#333}.ant-steps-item-error-icon{display:flex;justify-content:center;align-items:center;background:0 0;color:#ff3141}.ant-steps-item-error-icon,.ant-steps-item-error-icon .a-image{height:18px;width:18px}.ant-steps-item-error-icon-default{height:10px;width:10px;border-radius:50%;background-color:#ff3141}.ant-steps-item .ant-steps-item-title-error{color:#ff3141}

View File

@ -0,0 +1,50 @@
<import-sjs
from="./index.sjs"
name="utils"
></import-sjs>
<view
class="ant-steps ant-steps-{{direction}} {{className || ''}}"
style="{{style}}"
>
<block
a:for="{{items}}"
a:for-index="index"
a:for-item="item"
>
<view class="ant-steps-item ant-steps-item-{{direction}} {{index < current ? 'ant-steps-item-finish' : ''}} {{index === current ? 'ant-steps-item-active' : ''}} {{index > current ? 'ant-steps-item-non-active' : ''}}">
<view class="ant-steps-item-indicator ant-steps-item-indicator-{{direction}}">
<view class="ant-steps-item-indicator-icon ant-steps-item-{{utils.getClassName(current, index, status)}}-icon">
<slot
name="icon"
value="{{item}}"
index="{{index}}"
current="{{current}}"
status="{{status}}"
>
<view class="ant-steps-item-{{utils.getClassName(current, index, status)}}-icon-default"></view>
</slot>
</view>
</view>
<view class="ant-steps-item-text">
<view class="ant-steps-item-title ant-steps-item-title-{{utils.getClassName(current, index, status)}}">
<slot
name="title"
value="{{item}}"
index="{{index}}"
>
{{item.title}}
</slot>
</view>
<view class="ant-steps-item-desc">
<slot
name="description"
value="{{item}}"
index="{{index}}"
>
{{item.description}}
</slot>
</view>
</view>
</view>
</block>
</view>

View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1,3 @@
import { Component } from '../_util/simply';
import { StepsFunctionalProps } from './props';
Component(StepsFunctionalProps);

View File

@ -0,0 +1,3 @@
{
"component": true
}

View File

@ -0,0 +1,16 @@
function getClassName(current, index, status) {
current = current || 0;
if (index < current) {
return 'finish';
}
if (index === current) {
if (status === 'error') {
return 'error';
}
return 'active';
}
return 'non-active';
}
export default {
getClassName: getClassName
};

View File

@ -0,0 +1,24 @@
import { IBaseProps } from '../_util/base';
/**
* @description 步骤条,分步展示当前进展
*/
export interface IStepsProps extends IBaseProps {
/**
* @description 当前步骤
*/
current: number;
/**
* @description 方向
*/
direction: 'horizontal' | 'vertical';
/**
* @description 状态
*/
status: 'finish' | 'error';
items?: {
title: string;
description: string;
}[];
}
export declare const StepsDefaultProps: Partial<IStepsProps>;
export declare const StepsFunctionalProps: Partial<IStepsProps>;

View File

@ -0,0 +1,11 @@
export var StepsDefaultProps = {
current: 0,
direction: 'horizontal',
status: 'finish',
};
export var StepsFunctionalProps = {
current: 0,
direction: 'horizontal',
status: 'finish',
items: [],
};